/* ICMI Proceedings — the site stylesheet, after the ICMI brand book (first edition, November 2026).
   Colours and faces follow pages 9–11. The reading sizes run a step above the book's desktop scale (page 12),
   for long papers on screen. The openings show the field (pages 15–16), drawn by field.js, the same code as the
   Institute's website, as a still tile of the finished woven cross.

   FONTS. Doves Type (roman, both cuts) is licensed from Typespec and is NOT in this repository: the repository is
   public and the font files must not be posted in it. The build copies the licensed files into
   _site/assets/fonts from DOVES_FONT_DIR (see scripts/build-site.sh and the deploy workflow). Without them the
   roman falls back to Georgia. Doves Italic, Ysabeau Office and Paper Mono are under the SIL Open Font License
   and ship here. */

@font-face { font-family: 'Doves Headline'; src: url(fonts/DovesType-Headline.otf) format('opentype'); font-display: swap; }
@font-face { font-family: 'Doves Headline'; src: url(fonts/DovesItalic-Headline.ttf) format('truetype'); font-style: italic; font-display: swap; }
@font-face { font-family: 'Doves Text'; src: url(fonts/DovesType-Text.otf) format('opentype'); font-display: swap; }
@font-face { font-family: 'Doves Text'; src: url(fonts/DovesItalic-Text.ttf) format('truetype'); font-style: italic; font-display: swap; }
@font-face { font-family: 'Ysabeau Office'; src: url(fonts/YsabeauOffice-Variable.ttf) format('truetype'); font-weight: 1 1000; font-display: swap; }
@font-face { font-family: 'Paper Mono'; src: url(fonts/PaperMono-Regular.otf) format('opentype'); font-display: swap; }

:root {
  --linen: #E8E8E2; --thread: #2E3236; --scarlet: #B0222D;          /* the ground, the ink, the thread */
  --unbleached: #D3D0C6; --rule: #C9C8C0; --muted: #5E6266;          /* second ground; hairlines only; captions */
  --f-head: 'Doves Headline', 'Doves Text', Georgia, serif;          /* titles, statements, the name */
  --f-text: 'Doves Text', Georgia, serif;                            /* reading, labels, navigation */
  --f-table: 'Ysabeau Office', sans-serif;                           /* tables and figures, weight 500 */
  --f-code: 'Paper Mono', ui-monospace, monospace;                   /* code and model output */
  --gutter: 40px;
  --wide: 1200px;                                                    /* the page's outer column */
  --measure: 700px;                                                  /* about 66 characters at 20px */
  --para: 20px;                                                      /* the space between paragraphs */
}

/* ---------- ground */
* { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--linen); color: var(--thread); font-family: var(--f-text);
  font-size: 18px; line-height: 28px; font-kerning: normal; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
p, h1, h2, h3, h4, h5, ul, ol, figure, blockquote, pre, dl, dd { margin: 0; }
em, i, cite { font-style: italic; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
::selection { background: var(--unbleached); }

/* Strong text is set bold. Doves Type has one weight, so the browser thickens it; the rest of the site
   keeps font-synthesis off so nothing else is faked. */
b, strong { font-weight: bold; font-synthesis: weight; }
.reading table strong, .reading table b { font-weight: 700; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- small capitals, run-in heads, the red marks (pages 13–14) */
.sc, .label { font-feature-settings: "c2sc", "smcp"; letter-spacing: .08em; }
.label { font-size: 17px; line-height: 20px; }
.runin { text-transform: uppercase; letter-spacing: .06em; background: none; padding: 0; margin: 0; }
.pilcrow { color: var(--scarlet); font-size: 103%; margin-right: .12em; }
.red { color: var(--scarlet); }
.muted { color: var(--muted); }

/* On screen, red marks the link under the pointer, the focused control and the current page:
   a 1px scarlet underline, offset 8px, under thread type (page 10). */
.nav a, .ui-link { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 8px; }
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"], .ui-link:hover, .ui-link:focus-visible { text-decoration-color: var(--scarlet); }
:focus-visible { outline: 1px solid var(--scarlet); outline-offset: 4px; }

/* ---------- the masthead: the paper-series lockup and the navigation */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; }
.series { display: inline-flex; align-items: center; color: var(--thread); }
.series img { display: block; width: 44px; height: 44px; margin-right: 15px; flex-shrink: 0; }   /* the pixel-fitted quarter mark, at 44 */
.series .nm { display: block; font-family: var(--f-head); font-size: 34px; line-height: 36px; }
.series .sub { display: block; font-family: var(--f-head); font-size: 19px; line-height: 24px; margin-top: 2px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 17px; line-height: 20px; font-feature-settings: "c2sc", "smcp"; letter-spacing: .08em; padding-bottom: 8px; }

/* ---------- openings: type on linen, and beside it a still tile of the field with the finished woven cross */
.head-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 80px; align-items: center; }
.tile { position: relative; overflow: hidden; background: var(--linen); aspect-ratio: 1 / 1; }
.tile > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.opening .head-grid { padding-top: 88px; padding-bottom: 88px; }
.opening .tile { width: 440px; }
.statement { font-family: var(--f-head); font-size: 60px; line-height: 64px; color: var(--scarlet); max-width: 640px; }
.lede { font-size: 26px; line-height: 36px; margin-top: 32px; max-width: 600px; }
.latest { margin-top: 36px; }
.latest .label { display: block; color: var(--muted); margin-bottom: 6px; }
.latest a { font-family: var(--f-head); font-size: 26px; line-height: 34px; }

.paper-head { border-bottom: 1px solid var(--rule); }
.paper-head .head-grid { padding-top: 72px; padding-bottom: 72px; }
.paper-head .tile { width: 240px; }
.paper-head .label { color: var(--muted); }
.paper-head .label .no { color: var(--scarlet); }
.paper-title { font-family: var(--f-head); font-weight: normal; font-size: 48px; line-height: 56px; margin-top: 16px; max-width: 800px; }
.paper-byline { font-size: 19px; line-height: 28px; color: var(--muted); margin-top: 20px; }
.paper-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; font-size: 17px; line-height: 20px; font-feature-settings: "c2sc", "smcp"; letter-spacing: .08em; }

/* ---------- section titles, in red capitals */
.section { font-family: var(--f-head); font-weight: normal; font-size: 36px; line-height: 44px; letter-spacing: .04em; text-transform: uppercase; color: var(--scarlet); }

/* ---------- the list of papers: number in red small capitals, title in thread, authors and dates muted */
.papers { padding-top: 72px; padding-bottom: 104px; }
.papers .section { margin-bottom: 24px; }
.papers .list + .section { margin-top: 88px; }
.list { list-style: none; padding: 0; margin: 0; max-width: 920px; border-bottom: 1px solid var(--rule); }
.list > li { display: grid; grid-template-columns: 104px 1fr; column-gap: 32px; padding: 24px 0; border-top: 1px solid var(--rule); }
.list .no { font-size: 22px; line-height: 34px; color: var(--scarlet); font-feature-settings: "c2sc", "smcp"; letter-spacing: .08em; white-space: nowrap; }
.list .entry { font-family: var(--f-head); font-size: 26px; line-height: 34px; }
.list .entry a:hover, .list .entry a:focus-visible { text-decoration: underline; text-decoration-color: var(--scarlet); text-decoration-thickness: 1px; text-underline-offset: 6px; }
.list .meta { font-size: 18px; line-height: 28px; color: var(--muted); margin-top: 6px; }
.list .meta a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.list .meta a:hover { text-decoration-color: var(--scarlet); color: var(--thread); }

/* ---------- reading pages */
.reading-wrap { padding-top: 64px; padding-bottom: 104px; }
.paper-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 260px; column-gap: 96px; align-items: start; }
.paper-layout > aside { position: sticky; top: 32px; }
.reading { max-width: var(--measure); font-size: 20px; line-height: 32px; }

/* paragraphs: a space between, no indent */
.reading > * + *, .reading .abstract > * + *, .reading blockquote > * + *, .reading li > * + * { margin-top: var(--para); }
.reading h1 { font-family: var(--f-head); font-weight: normal; font-size: 36px; line-height: 44px; letter-spacing: .04em; text-transform: uppercase; color: var(--scarlet); }
.reading h2 { font-family: var(--f-head); font-weight: normal; font-size: 28px; line-height: 36px; letter-spacing: .04em; text-transform: uppercase; color: var(--scarlet); }
.reading > h2 { margin-top: 64px; }
.reading h3 { font-weight: normal; font-size: 20px; line-height: 32px; letter-spacing: .06em; text-transform: uppercase; }
.reading > h3 { margin-top: 44px; }
.reading h4, .reading h5 { font-weight: normal; font-size: 20px; line-height: 32px; font-style: italic; }
.reading > h4, .reading > h5 { margin-top: 32px; }
.reading > h2 + *, .reading > h3 + *, .reading > h4 + *, .reading .abstract > h2 + * { margin-top: 12px; }
.reading a { text-decoration: underline; text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reading a:hover, .reading a:focus-visible { text-decoration-color: var(--scarlet); }
.reading ul, .reading ol { padding-left: 1.3em; }
.reading li + li { margin-top: 10px; }
.reading hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }
.reading blockquote { border-left: 2px solid var(--rule); padding-left: 28px; }

/* the abstract: set the same way in every paper, whatever the source's form */
.abstract + * { margin-top: 56px !important; }

/* editorial notices (a correction): on the second ground */
.paper-notice { background: var(--unbleached); padding: 20px 24px; font-size: 18px; line-height: 28px; }
.paper-notice + * { margin-top: 40px !important; }
.paper-notice strong { background: none; }

/* the outline of a paper */
.outline .label { display: block; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.outline ol { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.outline li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 17px; line-height: 24px; margin: 0; }
.outline li::before { content: counter(s); color: var(--muted); }
.outline a { text-decoration: none; }
.outline a:hover, .outline a:focus-visible { text-decoration: underline; text-decoration-color: var(--scarlet); text-underline-offset: 4px; }
.reading .outline { margin-top: 48px; }

/* figures and images: charts drawn on white take the linen ground */
.reading img { display: block; margin: 0 auto; mix-blend-mode: multiply; }
.reading figure { margin-top: 40px; }
.reading figure + * { margin-top: 40px; }
.reading figcaption, .reading .caption { font-size: 17px; line-height: 26px; color: var(--muted); margin-top: 12px; }

/* tables of figures: Ysabeau Office, figures right-aligned, a hairline under the header */
.reading .table-scroll { overflow-x: auto; margin-top: 32px; }
.reading .table-scroll + * { margin-top: 32px; }
.reading table { border-collapse: collapse; font-family: var(--f-table); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; font-size: 16px; line-height: 24px; width: 100%; border-bottom: 1px solid var(--rule); }
.reading th { font-weight: 500; color: var(--muted); text-align: left; vertical-align: bottom; border-bottom: 1px solid var(--rule); padding: 0 20px 8px 0; }
.reading td { vertical-align: top; padding: 8px 20px 0 0; }
.reading tbody tr:last-child td { padding-bottom: 8px; }
.reading th.num, .reading td.num { text-align: right; }
.reading th:last-child, .reading td:last-child { padding-right: 0; }

/* code and model output */
.reading code { font-family: var(--f-code); font-size: .78em; background: var(--unbleached); padding: .1em .3em; }
.reading pre { font-family: var(--f-code); background: var(--unbleached); padding: 20px 24px; font-size: 15px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reading pre code { background: none; padding: 0; font-size: inherit; }

.MathJax { font-size: 1em !important; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; }

/* ---------- standalone pages (About, Fundraising, the Primer) */
.page-wrap { padding-top: 56px; padding-bottom: 104px; }
.page-wrap .reading > h1:first-child, .page-head { margin-bottom: 32px; }
.page-head .tagline { font-size: 22px; line-height: 32px; margin-top: 12px; }
.page-wrap .reading > p:has(> img:only-child) img { width: 100%; height: 380px; object-fit: cover; object-position: center; }

/* ---------- the footer, on the second ground */
.colophon { background: var(--unbleached); }
.colophon .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding-top: 48px; padding-bottom: 48px; }
.colophon .lockup { display: inline-flex; align-items: center; }
.colophon .lockup img { width: 32px; height: 32px; margin-right: 11px; display: block; flex-shrink: 0; }
.colophon .lockup .nm { font-family: var(--f-head); font-size: 24px; line-height: 28px; }

/* ---------- narrower screens and phones (page 12) */
@media (max-width: 1099px) {
  .paper-layout { grid-template-columns: minmax(0, 1fr); }
  .paper-layout > aside { display: none; }
  .opening .tile { width: 340px; }
  .paper-head .tile { width: 200px; }
  .head-grid { column-gap: 56px; }
}
@media (max-width: 760px) {
  :root { --gutter: 20px; --para: 18px; }
  .masthead .wrap { padding-top: 20px; padding-bottom: 20px; }
  .series img { width: 40px; height: 40px; margin-right: 13px; }
  .series .nm { font-size: 28px; line-height: 32px; }
  .series .sub { font-size: 15px; line-height: 20px; }
  .nav { gap: 8px 22px; }
  .head-grid { grid-template-columns: minmax(0, 1fr); }
  .opening .head-grid { padding-top: 48px; padding-bottom: 56px; }
  .opening .tile { width: 100%; max-width: 360px; margin-top: 48px; }
  .paper-head .head-grid { padding-top: 40px; padding-bottom: 40px; }
  .paper-head .tile { display: none; }
  .statement { font-size: 40px; line-height: 48px; }
  .section { font-size: 28px; line-height: 36px; }
  .lede { font-size: 22px; line-height: 32px; }
  .latest a { font-size: 22px; line-height: 30px; }
  .paper-title { font-size: 32px; line-height: 40px; }
  .paper-byline { font-size: 18px; }
  .papers { padding-top: 48px; }
  .list > li { grid-template-columns: 76px 1fr; column-gap: 16px; padding: 20px 0; }
  .list .no { font-size: 19px; line-height: 30px; }
  .list .entry { font-size: 22px; line-height: 30px; }
  .list .meta { font-size: 17px; line-height: 26px; }
  .reading-wrap { padding-top: 40px; }
  .reading { font-size: 19px; line-height: 30px; }
  .reading h2 { font-size: 24px; line-height: 32px; }
  .reading > h2 { margin-top: 48px; }
  .page-wrap .reading > p:has(> img:only-child) img { height: 220px; }
  .colophon .lockup .nm { font-size: 18px; line-height: 24px; }
}

@media print {
  .nav, .colophon, .tile, aside { display: none; }
}
