/* Cis Labs. One typeface (Inter, OFL-1.1, self-hosted subsets), one grid, paper and ink. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+2248, U+2260, U+2264-2265, U+2016, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0300-0331, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-cyrillic-greek.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+0400-052F, U+1C80-1C8F, U+1F00-1FFF, U+2DE0-2DFF, U+A640-A69F; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-Italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+2248, U+2260, U+2264-2265, U+2016, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-Italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0300-0331, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("fonts/Inter-Italic-cyrillic-greek.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+0400-052F, U+1C80-1C8F, U+1F00-1FFF, U+2DE0-2DFF, U+A640-A69F; }

:root {
  --paper: #FAF9F6;
  --paper-2: #F3F1EC;
  --paper-3: #EFECE6;
  --ink: #0B0B0C;
  --ink-2: #34332F;
  --muted: #66625A;
  --rule: #D9D4C7;
  --rule-soft: #E6E2D9;
  --link: #173885;
  --accent: #3D63DD;
  --plate: transparent;

  /* Script fallbacks come after the Latin faces, so mixed text stays in Inter
     and each script falls through to a face designed for it. */
  --scripts: "Noto Sans Devanagari", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Bengali", "Kohinoor Bangla",
    "Noto Sans Tamil", "Tamil Sangam MN", "Noto Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Sans Hebrew",
    "Noto Sans Thai", "Thonburi", "Leelawadee UI", "Noto Sans Ethiopic", "Kefa",
    "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "Apple SD Gothic Neo", "Malgun Gothic";
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, "Noto Sans", var(--scripts), sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.8125rem;   /* 13 */
  --step-0: 0.875rem;     /* 14 */
  --body: 1.0625rem;      /* 17 */
  --step-1: 1.1875rem;    /* 19 */
  --step-2: clamp(1.25rem, 1.1rem + 0.5vw, 1.375rem);   /* 20-22 */
  --step-3: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);  /* 22-26 */
  --step-4: clamp(2rem, 1.4rem + 2.2vw, 2.875rem);      /* 32-46 */
  --step-5: clamp(2.125rem, 1.3rem + 3.4vw, 3.75rem);   /* 34-60 */

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 38rem;
  --rail: 13rem;
  --gap: 3rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B0B0C;
    --paper-2: #151514;
    --paper-3: #1C1B19;
    --ink: #EFECE6;
    --ink-2: #CFCBC1;
    --muted: #9C988E;
    --rule: #34322E;
    --rule-soft: #23221F;
    --link: #A9BCF5;
    --accent: #7F9BEF;
    --plate: #FAF9F6;
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Above 1440 px the whole composition scales (grid, measure and type are in rem):
   16 px at 1440, 20 px at 2560 and beyond, so the page keeps its proportions instead of
   floating as a small block in a wide window. Percentages keep the reader's own base size. */
@media (min-width: 90rem) { html { font-size: min(125%, calc(67.86% + 0.357vw)); } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.62;
  font-feature-settings: "kern", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-color .15s, color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--paper); padding: .5rem .75rem; z-index: 10; text-decoration: none; }
.skip:focus { top: .75rem; }

/* ------------------------------------------------------------------ grid */

/* Content boxes sit inside the gutters (margins, not padding), so section rules align with the text. */
.wrap, main > * { width: auto; margin-inline: max(var(--gutter), calc((100% - 80rem) / 2)); padding-inline: 0; }

.grid {
  display: grid;
  grid-template-columns: [rail-start text-start] minmax(0, 1fr) [rail-end text-end aside-start aside-end];
  column-gap: var(--gap);
}
.grid > * { grid-column: text; min-width: 0; }
.grid > .span-main { grid-column: text-start / aside-end; }
.grid > .span-full { grid-column: rail-start / aside-end; }
.rail-label { grid-column: rail; }

@media (min-width: 48rem) {
  .grid { grid-template-columns: [rail-start text-start] minmax(0, var(--measure)) [text-end aside-start] minmax(0, 1fr) [rail-end aside-end]; }
}
@media (min-width: 75rem) {
  .grid { grid-template-columns: [rail-start] var(--rail) [rail-end text-start] minmax(0, var(--measure)) [text-end aside-start] minmax(12rem, 1fr) [aside-end]; }
  .rail-label { grid-column: rail; }
}

/* ------------------------------------------------------------------ header / footer */

/* The header floats: it stays with the reader, but only the lockup and the links have a backing,
   each its own small plate in the page colour (invisible over plain paper, legible over content).
   No band, no rule, nothing that strips the viewport. */
html { scroll-padding-top: 5rem; }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; pointer-events: none; }
.site-header > * { pointer-events: auto; }
.brand, .site-nav { background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 999px; padding: .45rem .8rem; margin: -.45rem -.8rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.mark { width: 1.375rem; height: 1.375rem; fill: currentColor; flex: none; display: block; }
.brand-name { font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.005em; white-space: nowrap; }
.brand-desc { font-size: var(--step-0); color: var(--muted); white-space: nowrap; padding-left: .75rem; margin-left: .15rem; border-left: 1px solid var(--rule); line-height: 1.1; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; font-size: var(--step-0); }
.nav-teams { display: flex; gap: 1.4rem; padding-left: 1.4rem; border-left: 1px solid var(--rule); }
.site-nav a, .nav-drawer summary { text-decoration: none; color: var(--muted); padding-block: .2rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current], .nav-drawer summary:hover { color: var(--ink); }
.site-nav a[aria-current] { box-shadow: inset 0 -1px 0 currentColor; }
.nav-drawer { display: none; position: relative; }
.nav-drawer summary { cursor: pointer; list-style: none; }
.nav-drawer summary::-webkit-details-marker { display: none; }
.nav-drawer summary::after { content: ""; display: inline-block; width: .35em; height: .35em; margin-left: .45em; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-.2em) rotate(45deg); }
.nav-drawer[open] summary::after { transform: translateY(.05em) rotate(-135deg); }
.nav-drawer-panel { position: absolute; right: -.8rem; top: calc(100% + .9rem); display: grid; gap: .15rem; padding: .6rem .8rem; min-width: 11rem; background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: .75rem; box-shadow: 0 0 0 1px var(--rule-soft); }
.nav-drawer-panel a { padding-block: .35rem; }
/* Phones and narrow tablets: the descriptor goes, the teams fold into the drawer. */
@media (max-width: 63.99rem) {
  .nav-teams { display: none; }
  .nav-drawer { display: block; }
}
@media (max-width: 29.99rem) { .brand-desc { display: none; } .site-nav { gap: 1.1rem; } }

.site-footer { margin-top: clamp(6rem, 14vw, 11rem); padding-block: 0 2.75rem; font-size: var(--step-0); color: var(--muted); }
.colophon { border-top: 1px solid var(--rule); padding-top: 1.5rem; row-gap: 2rem; }
.col-brand { grid-column: rail; display: flex; gap: .6rem; align-items: flex-start; color: var(--ink); }
.col-brand .mark { width: 1.1rem; height: 1.1rem; margin-top: .15rem; }
.col-brand p { display: flex; flex-direction: column; }
.col-brand .brand-name { font-size: var(--step-0); }
.col-desc { color: var(--muted); }
.col-links { grid-column: text-start / aside-end; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1.25rem 1.5rem; margin: 0; }
.col-links dt { color: var(--muted); margin-bottom: .35rem; }
.col-links dd { margin: 0; }
.col-links a { text-decoration: none; color: var(--ink); }
.col-links a:hover { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------------------------------ home: the statement, flush left */

/* One left edge for the whole page: header lockup, hero, thesis, research, footer. The measure of
   text is set by max-width, never by centring; full-width rules carry the right edge. */
.statement { padding-top: clamp(3.5rem, 10vw, 8.5rem); row-gap: clamp(2.25rem, 4.5vw, 3.5rem); }
.hero-line { container-type: inline-size; font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; margin: 0; }
/* The lab's line spans most of the content width at every size: it carries the right side of the page. */
.hero-l { display: block; white-space: nowrap; font-size: min(9rem, calc(88cqi / (var(--chars) * 0.53))); }
.thesis { display: grid; gap: 1em; font-size: var(--step-2); line-height: 1.5; color: var(--ink-2); letter-spacing: -0.006em; max-width: 34em; }
.thesis-lead { color: var(--ink); }

/* the work: the latest piece given presence, more research, the public teams */
.work { padding-top: clamp(5rem, 11vw, 9rem); }
.lead-piece { max-width: 56rem; padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.lp-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: var(--step-0); color: var(--muted); margin-bottom: 1rem; }
.lp-meta a { color: var(--ink); text-decoration: none; }
.lp-meta a:hover { color: var(--accent); }
.lp-title { font-size: var(--step-4); line-height: 1.1; letter-spacing: -0.025em; font-weight: 500; max-width: 22em; }
.lp-title a { text-decoration: none; }
.lp-title a:hover { color: var(--accent); }
.lp-stand { margin-top: 1rem; font-size: var(--step-2); line-height: 1.45; color: var(--ink-2); max-width: 34em; }
.work .entries { margin-bottom: 0; }
.work .more { margin: 1.25rem 0 0; }
.teams { list-style: none; margin: clamp(3.5rem, 7vw, 5.5rem) 0 0; padding: 0; border-top: 1px solid var(--rule); }
.teams li { border-bottom: 1px solid var(--rule); }
.teams a { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: 1rem 0 1.1rem; text-decoration: none; }
.tr-line { grid-column: 1; }
.tr-name { font-size: var(--step-1); font-weight: 500; }
.tr-line { color: var(--muted); }
.teams a::after { content: "→"; grid-row: 1; grid-column: 2; color: var(--muted); }
.teams a:hover .tr-name, .teams a:hover::after { color: var(--accent); }
@media (min-width: 48rem) {
  .teams a { grid-template-columns: minmax(10rem, 13rem) 1fr auto; align-items: baseline; column-gap: var(--gap); }
  .tr-line { grid-column: 2; grid-row: 1; }
  .teams a::after { grid-column: 3; }
}
.e-team { color: var(--ink); text-decoration: none; }
a.e-team:hover { color: var(--accent); }

/* team pages: the team's own statement, smaller than the lab's */
.team-kicker { margin-bottom: 1.5rem; }
.hero-line--team .hero-l { font-size: min(5.5rem, calc(62cqi / (var(--chars) * 0.53))); }
.team-nav { display: flex; gap: 1.5rem; font-size: var(--step-0); margin-top: 1.5rem; }
.team-nav a { color: var(--muted); text-decoration: none; padding-block: .2rem; }
.team-nav a:hover, .team-nav a[aria-current] { color: var(--ink); }
.team-nav a[aria-current] { box-shadow: inset 0 -1px 0 currentColor; }
.ri-team { white-space: nowrap; }

/* ------------------------------------------------------------------ home, second movement: the world's languages */

/* A quiet texture under the statement, on the same column. Every name sits on one shared
   baseline at a fixed pitch (the names' own boxes add no height), so scripts with tall
   marks cannot open the lines up. Per-script factors even out optical size. */
.field { padding-top: clamp(3rem, 6vw, 5rem); }
.lf { list-style: none; margin: 0; padding: 0; font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.25rem); line-height: 2.1; font-weight: 400; color: var(--muted); text-wrap: pretty; }
.lf li { display: inline; }
.lf li:not(:last-child)::after { content: "\2002"; }
.lf .lf-name { line-height: 0; unicode-bidi: isolate; white-space: nowrap; letter-spacing: 0; }
.lf .s-Arab { font-size: 1.12em; }
.lf .s-Hebr, .lf .s-Nkoo { font-size: 1.04em; }
.lf :is(.s-Deva, .s-Beng, .s-Guru, .s-Gujr, .s-Orya) { font-size: .98em; }
.lf :is(.s-Taml, .s-Telu, .s-Knda, .s-Mlym, .s-Sinh) { font-size: .9em; }
.lf :is(.s-Hans, .s-Hant, .s-Jpan, .s-Kore) { font-size: .92em; }
.lf :is(.s-Mymr, .s-Khmr, .s-Tibt) { font-size: .92em; }
@media (max-width: 47.99rem) { .lf { line-height: 2; } }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ home, third movement: the research */


.more { margin-top: 1.5rem; font-size: var(--step-0); }
.more a { text-decoration: none; color: var(--ink); }
.more a::after { content: " →"; }
.more a:hover { color: var(--accent); }
.empty { font-size: var(--step-1); color: var(--ink-2); }

/* ------------------------------------------------------------------ research index */

.table--ri { margin: 0; }
.grid .table--ri table { width: 100%; min-width: 38rem; }
.table--ri td, .table--ri th { padding-block: .95rem; }
.table--ri thead th { padding-block: .5rem; border-bottom-color: var(--rule); }
.ri-no, .ri-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
.table--ri .ri-title { font-weight: 500; font-size: var(--step-1); position: static; font-variant-numeric: normal; }
.table--ri .ri-title a { text-decoration: none; }
.table--ri .ri-title a:hover { color: var(--accent); }
.ri-stand { display: block; font-weight: 400; font-size: 0.9375rem; color: var(--muted); margin-top: .25rem; max-width: 40em; }
.ri-type { white-space: nowrap; color: var(--ink-2); }
.ri-type .tag { display: block; }
.ri-lang { color: var(--ink-2); }
.table--ri .ri-year th { position: static; font-weight: 500; color: var(--ink); padding-top: 2rem; border-bottom: 0; }
.table--ri .is-placeholder .ri-title { color: var(--muted); }
.lang-index { margin-top: clamp(4.5rem, 9vw, 7rem); row-gap: 1rem; }
.index-h { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.015em; }
.li-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0 1.5rem; border-top: 1px solid var(--rule); }
.li-grid li { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 0 1rem; border-bottom: 1px solid var(--rule-soft); scroll-margin-top: 2rem; }
.li-grid .li-name { font-size: var(--step-2); line-height: 1.5; align-self: flex-start; }
.li-en { font-size: var(--step-0); color: var(--muted); }
.li-refs { font-size: var(--step-0); display: flex; gap: .5rem; }
.li-refs a { text-decoration: none; color: var(--ink-2); }
.li-refs a:hover { color: var(--accent); }
.li-grid li:target { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ------------------------------------------------------------------ research list */

.page-head { padding-top: clamp(2.5rem, 7vw, 6rem); padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.page-head h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.025em; }

.year + .year { margin-top: clamp(2.5rem, 5vw, 4rem); }
.entries { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.entry { display: grid; grid-template-columns: 1fr; row-gap: .35rem; padding-block: 1.1rem 1.35rem; border-top: 1px solid var(--rule); }
.e-date { font-size: var(--step-0); color: var(--muted); font-variant-numeric: tabular-nums; grid-row: 1; }
.e-date-wide { display: none; }
.e-main { grid-row: 2; }
.e-title { font-size: var(--step-1); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.e-title a { text-decoration: none; }
.e-title a:hover { text-decoration: underline; text-decoration-color: var(--rule); color: var(--ink); }
.e-title a:hover { color: var(--accent); }
.e-stand { margin-top: .3rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; max-width: 40em; }
.e-meta { grid-row: 1; justify-self: end; font-size: var(--step-0); color: var(--muted); display: flex; flex-wrap: wrap; gap: .15rem .75rem; justify-content: flex-end; }
.e-langs { color: var(--muted); }
.entry--placeholder .e-title { color: var(--muted); }

@media (max-width: 47.99rem) {
  .entry { grid-template-columns: auto 1fr; column-gap: 1rem; }
  .e-date { grid-column: 1; }
  .e-meta { grid-column: 2; }
  .e-main { grid-column: 1 / -1; }
  .e-langs { display: none; }
}
@media (min-width: 48rem) {
  .entry { grid-template-columns: 6rem minmax(0, 1fr) 9.5rem; column-gap: 1.5rem; align-items: baseline; }
  .e-date, .e-main, .e-meta { grid-row: 1; }
  .e-date-wide { display: inline; }
  .e-date-narrow { display: none; }
  .e-meta { flex-direction: column; align-items: flex-end; text-align: right; gap: .1rem; }
  .home-latest .e-date-wide { display: none; }
  .home-latest .e-date-narrow { display: inline; }
}

.tag { font-size: var(--step--1); font-weight: 500; }
.e-no { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }
.tag--draft { color: var(--accent); }
.tag--placeholder { color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------ article */

.article { padding-top: clamp(2.5rem, 7vw, 6rem); }
.article-head { padding-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.kicker { display: flex; gap: .9rem; font-size: var(--step-0); color: var(--muted); margin-bottom: 1.25rem; font-weight: 500; }
.kicker .tag { font-size: inherit; }
.article-head h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.028em; max-width: 21em; }
.article-head .standfirst { margin-top: 1.25rem; font-size: var(--step-2); line-height: 1.45; color: var(--ink-2); max-width: 34em; letter-spacing: -0.005em; }
.meta { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; margin: 2.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: var(--step-0); }
.meta div { display: flex; flex-direction: column; gap: .1rem; }
@media (max-width: 47.99rem) { .meta { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.5rem; } }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-variant-numeric: tabular-nums; }

.toc-col { display: none; }
.toc-inline { grid-column: text; margin-bottom: 2.5rem; border-block: 1px solid var(--rule); font-size: var(--step-0); }
.toc-inline summary { padding-block: .8rem; cursor: pointer; color: var(--muted); list-style-position: inside; }
.toc-inline ol, .toc ol { list-style: none; margin: 0; padding: 0 0 .9rem; }
.toc-inline li, .toc li { padding-block: .2rem; }
.toc a, .toc-inline a { text-decoration: none; color: var(--ink-2); display: flex; gap: .6rem; }
.toc a:hover, .toc-inline a:hover { color: var(--accent); }
.toc .secnum, .toc-inline .secnum { color: var(--muted); min-width: 1ch; font-variant-numeric: tabular-nums; }

@media (min-width: 75rem) {
  .article-head { grid-row: 1; }
  .prose { grid-row: 2; }
  .toc-col { display: block; grid-column: rail; grid-row: 2; }
  .toc { position: sticky; top: 2rem; font-size: var(--step-0); padding-top: .2rem; }
  .toc-h { font-size: var(--step-0); font-weight: 500; color: var(--muted); margin-bottom: .6rem; }
  .toc-inline { display: none; }
}

.prose { grid-column: rail-start / aside-end; display: grid; grid-template-columns: subgrid; min-width: 0; }
@media (min-width: 75rem) {
  .prose { grid-column: text-start / aside-end; }
  .prose--back { grid-row: 3; grid-column: rail-start / aside-end; }
  .prose--back > .table--full { grid-column: rail-start / aside-end; }
}
.prose--back > :first-child { margin-top: 3.25rem; }
.prose > * { grid-column: text; min-width: 0; }

.prose p, .prose ul, .prose ol { margin-block: 0 1.1em; }
.prose h2 { font-size: var(--step-3); line-height: 1.25; letter-spacing: -0.018em; margin-block: 3.25rem 1.1rem; position: relative; }
.prose h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.35; margin-block: 2.25rem .6rem; letter-spacing: -0.008em; }
.prose h4 { font-size: var(--body); font-weight: 600; margin-block: 1.75rem .4rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 .secnum { color: var(--muted); margin-right: .55em; font-variant-numeric: tabular-nums; }
@media (min-width: 75rem) {
  .prose h2 .secnum { position: absolute; right: 100%; margin-right: 0; padding-right: 1.1rem; font-size: var(--step-0); top: .55em; font-weight: 500; }
}
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); color: var(--link); }
.prose a:hover { color: var(--accent); text-decoration-color: currentColor; }
.prose code { font-size: 0.86em; background: var(--paper-2); padding: .06em .22em; border-radius: 3px; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.4rem; }
.prose ul > li::before { content: ""; position: absolute; left: 0; top: .82em; width: .6rem; border-top: 1px solid var(--muted); }
.prose ol { padding-left: 1.4rem; }
.prose ol > li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.prose li + li { margin-top: .45em; }
@media (min-width: 48rem) {
  .prose ol { padding-left: 0; }
  .prose ul > li { padding-left: 0; }
  .prose ul > li::before { left: -1.25rem; }
}
.prose blockquote { margin: 1.75rem 0; padding-left: 1.25rem; border-left: 1px solid var(--ink); color: var(--ink-2); }

/* figures: full natural detail, wider than the text where the figure is landscape */
.figure { margin: 2.5rem 0 2.75rem; }
.figure--wide { grid-column: text-start / aside-end; }
.figure-media { display: block; width: fit-content; max-width: 100%; text-decoration: none; background: var(--plate); border-radius: 2px; }
.figure img { display: block; width: var(--w, 100%); max-width: 100%; height: auto; }
.figure figcaption { margin-top: .75rem; font-size: var(--step-0); color: var(--muted); line-height: 1.45; max-width: var(--measure); }
.figure .label, .table-caption .label { color: var(--ink); font-weight: 500; margin-right: .4em; }
@media (prefers-color-scheme: dark) {
  /* Figures are drawn on paper; in dark mode they sit on a paper plate instead of being inverted. */
  .figure-media { padding: clamp(.5rem, 1.5vw, 1.25rem); filter: brightness(.9); }
}
@media (max-width: 47.99rem) {
  /* Landscape figures keep a legible size and scroll inside their frame. */
  .figure--wide .figure-media { overflow-x: auto; }
  .figure--wide img { min-width: calc(var(--w, 54rem) * .66); }
  .figure { margin-inline: calc(-1 * var(--gutter)); }
  .figure figcaption { padding-inline: var(--gutter); }
}

/* tables */
.table { margin: 2rem 0 2.5rem; overflow-x: auto; font-size: var(--step-0); line-height: 1.45; -webkit-overflow-scrolling: touch; }
.table--wide, .table--full { grid-column: text-start / aside-end; }
.table table { border-collapse: collapse; width: auto; min-width: min(100%, var(--measure)); font-variant-numeric: tabular-nums lining-nums; }
.table--text table { width: 100%; }
.table--full { font-size: var(--step--1); }
.table--full table { min-width: 64rem; }
.table--wide table { min-width: min(36rem, 100%); }
@media (max-width: 47.99rem) { .table--wide table { min-width: 36rem; } .table--text table { min-width: 24rem; } }
.table th, .table td { text-align: left; vertical-align: top; padding: .55rem .9rem .55rem 0; border-bottom: 1px solid var(--rule-soft); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table thead th { font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--ink); vertical-align: bottom; }
.table tbody th { font-weight: 500; }
.table .num { text-align: right; white-space: nowrap; }
.table thead .num { white-space: normal; }
.table code { font-size: .92em; background: none; padding: 0; }
.table tbody th { position: sticky; left: 0; background: var(--paper); z-index: 1; }
@media (max-width: 47.99rem) {
  .table { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .table tbody th { max-width: 11rem; }
}

/* code */
pre.code { margin: 1.75rem 0 2rem; padding: 1rem 1.25rem; background: var(--paper-2); border-radius: 3px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; tab-size: 4; }
pre.code code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
pre.code--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 47.99rem) { pre.code { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; padding-inline: var(--gutter); } }

/* notes */
.fnref { font-size: .72em; line-height: 0; margin-left: .1em; font-variant-numeric: lining-nums; }
.fnref a { text-decoration: none; color: var(--link); padding: 0 .1em; }
.sidenote { display: none; }
@media (min-width: 75rem) {
  .sidenote { display: block; float: right; clear: right; width: min(16rem, calc(100vw - 64rem)); margin-right: calc(-1 * min(16rem, calc(100vw - 64rem)) - var(--gap)); margin-top: .3rem; font-size: var(--step--1); line-height: 1.5; color: var(--muted); }
  .sidenote-n { color: var(--ink); font-weight: 500; margin-right: .25em; }
}
.endnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: var(--step-0); color: var(--ink-2); }
.endnotes .label-h { font-size: var(--step-0); font-weight: 500; color: var(--muted); margin: 0 0 .75rem; }
.endnotes ol { padding-left: 1.25rem; margin: 0; }
.endnotes li + li { margin-top: .5rem; }
.backref { text-decoration: none; color: var(--muted); }

/* closing blocks: artifacts and citation */
.block-artifacts, .block-cite { grid-column: text-start / aside-end; display: grid; grid-template-columns: subgrid; margin-top: 3.5rem; padding-top: 1.1rem; border-top: 1px solid var(--ink); }
.block-artifacts > *, .block-cite > * { grid-column: text; }
.block-cite { margin-top: 2.5rem; border-top-color: var(--rule); }
.block-artifacts h2, .block-cite h2 { font-size: var(--step-0); font-weight: 500; color: var(--muted); margin: 0 0 1rem; letter-spacing: 0; }
.block-artifacts p { font-size: 0.9375rem; color: var(--ink-2); }
.block-artifacts ul { margin: .25rem 0 1.25rem; padding: 0; }
.block-artifacts ul > li { padding: .75rem 0; border-top: 1px solid var(--rule-soft); display: grid; grid-template-columns: 1fr; gap: .15rem; font-size: 0.9375rem; }
.block-artifacts ul > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.block-artifacts ul > li::before { display: none; }
.block-artifacts li + li { margin-top: 0; }
.artifact-name { font-weight: 500; }
.artifact-body { color: var(--ink-2); }
@media (min-width: 48rem) { .block-artifacts ul > li { grid-template-columns: 10rem 1fr; gap: 1.5rem; } }
.cite-plain { font-size: 0.9375rem; color: var(--ink-2); }
.block-cite pre.code { margin-top: 1rem; }

/* page template (typography, 404) */
.article--page .article-head { grid-column: text-start / aside-end; }
@media (min-width: 75rem) { .article--page .prose { grid-column: text-start / aside-end; } }

/* typography test page */
.udhr { display: grid; gap: 1.4rem; margin: 1rem 0 2rem; }
.udhr p { margin: 0; }
.udhr-label { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 500; margin-bottom: .2rem; }
[dir="rtl"] > .udhr-label { text-align: right; }

/* ------------------------------------------------------------------ article devices */

/* abstract: front-matter `abstract` + `findings`; set apart from the body */
.abstract { grid-column: text-start / aside-end; margin: 0 0 4rem; padding: 0; }
.prose .abs-label { font-size: var(--step-0); font-weight: 500; color: var(--muted); margin: 0 0 .9rem; letter-spacing: 0; line-height: 1.4; }
.prose .abs-lead { font-size: var(--step-2); line-height: 1.45; color: var(--ink); max-width: 34em; letter-spacing: -0.005em; margin-bottom: 1.5rem; }
.prose .findings { list-style: none; margin: 0; padding: 0; }
.prose .findings li { margin: 0; display: grid; grid-template-columns: 1fr; gap: .3rem; padding: 1rem 0 1.1rem; border-top: 1px solid var(--rule); }
.prose .f-label { font-size: var(--body); font-weight: 600; letter-spacing: -0.005em; margin: 0; line-height: 1.45; }
.f-label a { text-decoration: none; color: var(--ink); }
.f-label a::after { content: " ↓"; color: var(--muted); font-weight: 400; }
.f-label a:hover { color: var(--accent); }
.prose .f-text { margin: 0; color: var(--ink-2); max-width: 40em; font-size: 0.9875rem; line-height: 1.6; }
@media (min-width: 48rem) { .findings li { grid-template-columns: 12rem minmax(0, 1fr); column-gap: 1.5rem; align-items: baseline; } }

/* section opener: `:: one line` under an h2 */
.prose .section-summary { font-size: var(--step-2); line-height: 1.4; color: var(--ink); letter-spacing: -0.01em; margin: -.35rem 0 1.75rem; max-width: 30em; }
.prose h2 + .section-summary { color: var(--ink-2); }

/* pull-out numbers: ::: numbers  value | caption */
.block-numbers { grid-column: text-start / aside-end; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.25rem 2rem; margin: .5rem 0 2.5rem; padding: 0; }
.block-numbers div { display: flex; flex-direction: column; gap: .3rem; }
.block-numbers dt { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.block-numbers dd { margin: 0; font-size: var(--step-0); color: var(--muted); line-height: 1.45; max-width: 20em; }

/* estimates with an interval: {{61% | 43, 81}} (build.py). The interval is real text after the estimate:
   visually hidden by default, a popover on hover, focus or tap, inline when "Show all" is on, inline in print. */
.est { white-space: nowrap; text-decoration: underline dotted var(--muted); text-decoration-thickness: 1px; text-underline-offset: .2em; cursor: help; }
.est:hover, .est:focus { text-decoration-color: var(--ink); text-decoration-style: solid; outline: none; }
.est:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }
.est .ci { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the popover sits under the line, inside the paragraph's own width, so it cannot overflow the page */
:is(p, li, dt, dd):has(> .est, > * > .est) { position: relative; }
.article:not(:has(.ci-toggle:checked)) .est:is(:hover, :focus) .ci {
  width: max-content; max-width: 100%; height: auto; overflow: visible; clip-path: none; white-space: normal;
  left: 0; top: auto; margin: 1.75em 0 0; padding: .3rem .6rem .35rem; z-index: 5;
  font-size: var(--step--1); font-weight: 400; line-height: 1.4; letter-spacing: 0; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; box-shadow: 0 1px 3px rgb(0 0 0 / .08);
  font-variant-numeric: tabular-nums;
}
.article:not(:has(.ci-toggle:checked)) .est:is(:hover, :focus) .ci::before { content: attr(data-est) / ""; color: var(--ink); font-weight: 500; margin-right: .6em; }
.article:not(:has(.ci-toggle:checked)) .est:is(:hover, :focus) .ci-x { display: none; }
.article:not(:has(.ci-toggle:checked)) .block-numbers .est:is(:hover, :focus) .ci { margin-top: .4rem; top: 100%; }
/* where anchor positioning exists, the popover hangs from the number itself and flips left at the column's edge */
@position-try --ci-row { position-area: bottom span-all; justify-self: start; max-width: 100%; margin: .35rem 0 0; }
@supports (anchor-scope: all) and (position-try-fallbacks: flip-inline) {
  /* the text column is the containing block: tall enough to hang below any line, as wide as the column */
  .prose:has(.est) { position: relative; }
  :is(p, li, dt, dd):has(> .est, > * > .est) { position: static; }
  .est { anchor-name: --est; anchor-scope: --est; }
  .article:not(:has(.ci-toggle:checked)) .est:is(:hover, :focus) .ci {
    position-anchor: --est; left: auto; top: auto; margin: .35rem 0 0; max-width: none;
    position-area: bottom span-right; position-try-fallbacks: flip-inline, --ci-row;
  }
  .article:not(:has(.ci-toggle:checked)) .block-numbers .est:is(:hover, :focus) .ci { top: auto; margin-top: .4rem; }
  .article:not(:has(.ci-toggle:checked)) .est:is(:hover, :focus) .ci::before { content: none; }
}
/* "Show all": every interval inline, small and muted */
.article:has(.ci-toggle:checked) .est { text-decoration: none; cursor: auto; white-space: normal; }
.article:has(.ci-toggle:checked) .est .ci { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; font-size: .8em; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.article:has(.ci-toggle:checked) .block-numbers .est .ci { display: block; margin-top: .3rem; font-size: var(--step-0); line-height: 1.4; }
.meta .meta-ci dd { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .9rem; color: var(--ink-2); }
@media (max-width: 47.99rem) { .meta .meta-ci { grid-column: 1 / -1; } }
.ci-switch { display: inline-block; color: var(--ink); cursor: pointer; white-space: nowrap; }
.ci-switch input { margin: 0 .35rem 0 0; width: .85rem; height: .85rem; vertical-align: -.1em; accent-color: var(--ink); cursor: pointer; }

/* run-in labels: a paragraph that opens with a bold sentence */
.prose p.runin { margin-top: 1.6em; }
.prose .runin-label { display: block; font-weight: 600; font-size: var(--body); margin-bottom: .2rem; letter-spacing: -0.005em; }

/* figure-first sections: ![alt](src){.lead} */
.figure--lead { margin-top: .5rem; }

/* ------------------------------------------------------------------ scripts */

:lang(ar), :lang(fa), :lang(ur) { font-family: "Inter", "Noto Sans Arabic", "SF Arabic", "Geeza Pro", "Segoe UI", Tahoma, var(--sans); line-height: 1.85; }
:lang(he) { font-family: "Inter", "Noto Sans Hebrew", "Arial Hebrew", "Segoe UI", var(--sans); }
:lang(hi), :lang(mr), :lang(ne) { font-family: "Inter", "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", var(--sans); line-height: 1.8; }
:lang(bn) { font-family: "Inter", "Noto Sans Bengali", "Kohinoor Bangla", "Bangla Sangam MN", "Nirmala UI", var(--sans); line-height: 1.8; }
:lang(ta) { font-family: "Inter", "Noto Sans Tamil", "Tamil Sangam MN", "Nirmala UI", var(--sans); line-height: 1.8; }
:lang(th) { font-family: "Inter", "Noto Sans Thai", "Thonburi", "Leelawadee UI", Tahoma, var(--sans); line-height: 1.85; }
:lang(zh-Hans), :lang(zh) { font-family: "Inter", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "Hiragino Sans GB", var(--sans); line-height: 1.8; }
:lang(zh-Hant) { font-family: "Inter", "PingFang TC", "Noto Sans CJK TC", "Microsoft JhengHei", var(--sans); line-height: 1.8; }
:lang(ja) { font-family: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", var(--sans); line-height: 1.8; }
:lang(ko) { font-family: "Inter", "Apple SD Gothic Neo", "Noto Sans CJK KR", "Malgun Gothic", var(--sans); line-height: 1.75; word-break: keep-all; }
span:lang(ar), span:lang(hi), span:lang(th), span:lang(zh-Hans), span:lang(ja), span:lang(ko), span:lang(bn), span:lang(ta) { line-height: inherit; }
[dir="rtl"] { text-align: start; }

/* ------------------------------------------------------------------ print */

@media print {
  :root { --paper: #fff; --plate: transparent; }
  body { font-size: 10.5pt; line-height: 1.5; background: #fff; color: #000; }
  .site-header, .site-footer, .toc, .toc-inline, .skip, .sidenote { display: none !important; }
  .wrap, main > * { max-width: none; padding: 0; }
  .grid, .prose { display: block; }
  .article { padding-top: 0; }
  .article-head h1 { font-size: 22pt; }
  .prose a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; overflow-wrap: anywhere; }
  .figure, .table, pre.code { break-inside: avoid; }
  .figure-media { filter: none; padding: 0; }
  .table { overflow: visible; font-size: 7.5pt; }
  .table table { min-width: 0 !important; }
  .table tbody th { position: static; }
  h2, h3 { break-after: avoid; }
  .endnotes { display: block; }
  .est { text-decoration: none; }
  .est .ci { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; clip-path: none !important; white-space: normal !important; border: 0 !important; box-shadow: none !important; background: none !important; font-size: .85em; color: #444; }
  .est .ci::before { content: none !important; }
  .est .ci-x { display: inline !important; }
  .meta-ci { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* research register on phones: number, date and title only */
@media (max-width: 47.99rem) {
  .grid .table--ri table { min-width: 0; }
  .table--ri .ri-type, .table--ri .ri-lang, .table--ri thead th:nth-child(4), .table--ri thead th:nth-child(5) { display: none; }
  .table--ri .ri-year th { padding-top: 1.25rem; }
}

.is-team .e-meta .e-team { display: none; }

/* ------------------------------------------------------------------ team design statements */

.statement-art { padding-top: clamp(3rem, 6vw, 5rem); }

/* Interpretability: the thesis as tokens, each with its id */
.tokens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; row-gap: 1.1rem; max-width: 64rem; }
.tokens li { display: flex; flex-direction: column; gap: .2rem; padding: 0 .55em 0 .4em; border-left: 1px solid var(--rule); }
.tk-t { font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem); line-height: 1.3; color: var(--ink-2); white-space: pre; }
.tk-i { font-size: var(--step--1); line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tokens--line .tk-t { font-size: var(--step-3); }

/* Vision: the mark as a grid of values */
.raster { display: block; width: min(100%, 30rem); height: auto; font-family: var(--sans); font-size: 7.2px; font-variant-numeric: tabular-nums; text-anchor: middle; }
.raster .rv { fill: var(--ink-2); }
.raster :is(.rv-1, .rv-2, .rv-3) { fill: var(--muted); opacity: .75; }
.raster :is(.rv-4, .rv-5, .rv-6) { fill: var(--muted); }
.raster .rz { fill: var(--rule); }
.raster .rd { fill: var(--muted); }

/* Distributed Training: the perfect squared square */
.squares { display: block; width: min(100%, 36rem); height: auto; font-family: var(--sans); font-variant-numeric: tabular-nums; text-anchor: start; }
.squares rect { fill: none; stroke: color-mix(in srgb, var(--muted) 75%, transparent); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.squares text { fill: var(--muted); }
@media (prefers-color-scheme: dark) { .squares rect { stroke: var(--muted); } }
