/* ===========================================================
   Distillation Technologies site stylesheet
   Chart series colours are validated for both themes.
   Do NOT re-tint --s-student / --s-teacher per theme.
   =========================================================== */

:root {
  --ground: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --line: #E1E5E8;
  --hair: #ECEEF1;
  --text: #0E1216;
  --muted: #565F68;
  --dim: #8A939B;
  --brand: #2050C0;
  --on-brand: #FFFFFF;

  --s-student: #2D6BE4;
  --s-teacher: #C2703D;
  --chart-grid: #E1E5E8;
  --st-good: #3D6B55;
  --st-warn: #B0740E;

  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0B0C0E; --surface: #121417; --surface-2: #171A1E;
    --line: #23272C; --hair: #1A1E22; --text: #E8EBEE;
    --muted: #99A2AA; --dim: #6B747C; --brand: #6FA0FF; --on-brand: #0B0C0E;
    --chart-grid: #23272C; --st-good: #74A88C; --st-warn: #D9A03F;
  }
}
:root[data-theme="dark"] {
  --ground: #0B0C0E; --surface: #121417; --surface-2: #171A1E;
  --line: #23272C; --hair: #1A1E22; --text: #E8EBEE;
  --muted: #99A2AA; --dim: #6B747C; --brand: #6FA0FF; --on-brand: #0B0C0E;
  --chart-grid: #23272C; --st-good: #74A88C; --st-warn: #D9A03F;
}
:root[data-theme="light"] {
  --ground: #FAFAFA; --surface: #FFFFFF; --surface-2: #F3F4F6;
  --line: #E1E5E8; --hair: #ECEEF1; --text: #0E1216;
  --muted: #565F68; --dim: #8A939B; --brand: #2050C0; --on-brand: #FFFFFF;
  --chart-grid: #E1E5E8; --st-good: #3D6B55; --st-warn: #B0740E;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--ground); color: var(--text);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 1px; }
img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: .625rem 1rem; font-size: 13.5px; text-decoration: none;
}
.skip:focus { left: .5rem; top: .5rem; }

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

.lbl {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin: 0;
}

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

.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; gap: 2rem; height: 62px;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease;
}
.hdr.stuck {
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.hdr:not(.stuck) { color: #EDF1F4; }
.hdr:not(.stuck) .hdr-nav a { color: rgba(237,241,244,.72); }
.hdr:not(.stuck) .hdr-nav a:hover,
.hdr:not(.stuck) .hdr-nav a[aria-current],
.hdr:not(.stuck) .hdr-nav a.cur { color: #fff; }
.hdr:not(.stuck) .ghost { border-color: rgba(237,241,244,.32); color: #EDF1F4; }
.hdr:not(.stuck) .ghost:hover { border-color: #fff; }

.hdr-brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; }
.hdr-mark { width: 17px; height: 17px; display: block; }
.hdr-name { font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; }
.hdr-name i { font-style: normal; opacity: .55; font-weight: 400; }

.hdr-nav { display: flex; align-items: center; gap: 1.75rem; margin-inline: auto; }
.hdr-nav a { font-size: 13.5px; text-decoration: none; color: var(--muted); transition: color .18s; }
.hdr-nav a:hover, .hdr-nav a[aria-current], .hdr-nav a.cur { color: var(--text); }

/* About dropdown. CSS-only: hover for the mouse, :focus-within for the
   keyboard. .hdr-drop is full header height so the menu can sit flush below
   the bar, and the ::before bridge keeps the hover alive across the gap. */
.hdr-drop { position: relative; display: flex; align-items: center; height: 62px; }
.hdr-drop > a { display: inline-flex; align-items: center; gap: .35rem; }
.hdr-drop > a::after {
  content: ""; width: 5px; height: 5px; flex: none;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .55;
}
.hdr-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 8.5rem; padding: .375rem; display: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
}
.hdr-menu::before { content: ""; position: absolute; inset: -1rem 0 auto; height: 1rem; }
.hdr-drop:hover .hdr-menu, .hdr-drop:focus-within .hdr-menu { display: block; }
.hdr-menu a { display: block; padding: .5rem .75rem; white-space: nowrap; color: var(--muted); }
.hdr-menu a:hover { color: var(--brand); }
.hdr-menu a[aria-current] { color: var(--text); }
/* The over-hero header paints every nav link near-white, which is invisible on
   the menu's own opaque surface. Menu links always use theme ink colours. */
.hdr:not(.stuck) .hdr-menu a { color: var(--muted); }
.hdr:not(.stuck) .hdr-menu a:hover { color: var(--brand); }
.hdr:not(.stuck) .hdr-menu a[aria-current] { color: var(--text); }

/* Mobile panel flattens dropdown children in as indented sub-links. */
.hdr-panel a.sub { padding-left: 1.25rem; font-size: .9375rem; color: var(--muted); }

/* ---------- mobile menu ---------- */

.hdr-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-left: auto;
  background: transparent; border: 1px solid var(--line); border-radius: 2px;
  color: inherit; cursor: pointer; padding: 0;
  transition: border-color .18s;
}
.hdr-toggle:hover { border-color: var(--muted); }
.hdr:not(.stuck) .hdr-toggle { border-color: rgba(237,241,244,.32); }
.hdr-toggle svg { display: block; width: 18px; height: 18px; }
.hdr-toggle .ic-close { display: none; }
.hdr-toggle[aria-expanded="true"] .ic-open { display: none; }
.hdr-toggle[aria-expanded="true"] .ic-close { display: block; }

.hdr-panel {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  padding: .5rem clamp(1.25rem, 4vw, 3rem) 1.25rem;
  display: none;
}
.hdr-panel.open { display: block; }
.hdr-panel a {
  display: block; padding: .9375rem .25rem;
  font-size: 1rem; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--hair);
}
.hdr-panel a[aria-current] { color: var(--brand); }
.hdr-panel a:last-of-type { border-bottom: none; }
.hdr-panel .btn { display: flex; justify-content: center; margin-top: 1rem; padding-block: .8125rem; font-size: 14.5px; }

/* Specificity matters more than order here. `.btn { display: inline-flex }` is
   declared later in this file with equal specificity, and a media query adds
   none, so a bare `.hdr-cta { display: none }` loses and the desktop button
   stays visible on phones, pushing the toggle off-screen. Scoping to .hdr
   raises these to 0,2,0 so they win regardless of where they sit. */
@media (max-width: 1000px) {
  .hdr .hdr-nav { display: none; }
  .hdr .hdr-cta { display: none; }
  .hdr .hdr-toggle { display: inline-flex; }
  /* the panel needs a readable ground even over the dark hero */
  .hdr.menu-open,
  .hdr:has(.hdr-panel.open) {
    background: color-mix(in srgb, var(--ground) 96%, transparent);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
    color: var(--text);
  }
  .hdr.menu-open .hdr-toggle,
  .hdr:has(.hdr-panel.open) .hdr-toggle { border-color: var(--line); }
}
@media (min-width: 1001px) { .hdr-panel { display: none !important; } }

/* `background: transparent` is load-bearing, not tidiness. Nearly every .btn on
   the site is an <a>, which has no default background, but a <button class="btn">
   inherits the UA ButtonFace grey (#F0F0F0). In dark mode .ghost's near-white
   text then lands on a near-white button and the label disappears entirely. */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; background: transparent;
  font-size: 13.5px; font-weight: 550; text-decoration: none;
  padding: .5625rem 1.0625rem; border-radius: 2px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.solid { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.solid:hover { filter: brightness(1.08); }
.ghost { border-color: var(--line); color: var(--text); }
.ghost:hover { border-color: var(--muted); }

/* The hero is dark in both themes, so buttons inside it cannot use the theme
   ink tokens. In light mode `.ghost` resolves to near-black text on a near-black
   ground and the button reads as empty. */
.hero .solid { background: #fff; color: #0B0C0E; border-color: #fff; }
.hero .solid:hover { filter: none; background: #E4EAF0; }
.hero .ghost { border-color: rgba(237,241,244,.32); color: #EDF1F4; }
.hero .ghost:hover { border-color: #fff; color: #fff; }

/* ---------- hero ---------- */

.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  background: #06070A; color: #EDF1F4; overflow: hidden; isolation: isolate;
}
.hero.short { min-height: 54svh; }
#graph { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 65% at 74% 28%, rgba(45,107,228,.16), transparent 62%),
    linear-gradient(to bottom, rgba(6,7,10,.52) 0%, rgba(6,7,10,.1) 38%, rgba(6,7,10,.9) 88%, var(--ground) 100%);
  pointer-events: none;
}
.hero-in { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 7rem var(--gutter) clamp(3rem, 7vh, 5rem); }

/* ---------- frontier lab marks ----------
   Lives inside the hero rather than in a band of its own: the hero's ::after
   fades to var(--ground) at its bottom edge, so any dark strip placed after it
   would meet that fade as a hard line. */

/* The hero's ::after fades to var(--ground) over its last ~12%, which in light
   mode is near-white. Marks left at the default bottom padding sit inside that
   fade and wash out, so a hero carrying a strip gets extra bottom padding to
   lift the whole content block clear of it. */
.hero:has(.labs) .hero-in { padding-bottom: clamp(6.5rem, 15vh, 10rem); }

.labs { margin-top: clamp(2rem, 4vh, 3rem); }
.labs-lbl {
  margin: 0 0 1.25rem;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(237,241,244,.44);
}
.labs-row {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: clamp(1.5rem, 4.5vw, 3.5rem);
}
.labs-row li { display: flex; align-items: center; }
.labs-mark {
  display: block; width: auto; color: #EDF1F4; opacity: .38;
  transition: opacity .3s ease;
}
.labs-row li:hover .labs-mark { opacity: .8; }
@media (max-width: 640px) {
  .labs-row { gap: 1.5rem 2rem; }
  .labs-mark { transform: scale(.82); transform-origin: left center; }
}
@media (prefers-reduced-motion: reduce) { .labs-mark { transition: none; } }
.hero .lbl { color: rgba(237,241,244,.5); }

.crumb { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(237,241,244,.5); margin: 0; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: #fff; }

.hero-title {
  font-size: clamp(2.4rem, 6.4vw, 5.15rem);
  font-weight: 620; letter-spacing: -.042em; line-height: .98;
  margin: 1.25rem 0 0; max-width: 17ch; text-wrap: balance;
}
.hero.short .hero-title { font-size: clamp(2.2rem, 5.2vw, 3.9rem); max-width: 20ch; }

.hero-sub {
  font-size: clamp(1.0625rem, 1.9vw, 1.375rem); font-weight: 400;
  line-height: 1.45; letter-spacing: -.012em;
  color: rgba(237,241,244,.8); margin: 1.5rem 0 0; max-width: 52ch;
}
.hero-sub b { font-weight: 400; color: #fff; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 2.25rem; }

.hero-meta {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: start;
  gap: .5rem 2.75rem; margin-top: 2.75rem; padding-top: 1.375rem;
  border-top: 1px solid rgba(237,241,244,.14);
}
@media (max-width: 720px) { .hero-meta { grid-template-columns: repeat(2, auto); gap: 1.125rem 2.5rem; } }
.hm-v { font-size: 1.5rem; font-weight: 620; letter-spacing: -.035em; line-height: 1; color: #fff; }
.hm-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: rgba(237,241,244,.5); margin-top: .4375rem; }

/* ---------- sections ---------- */

.sec { padding-block: clamp(3.75rem, 8.5vw, 6.5rem); }
.sec + .sec { border-top: 1px solid var(--hair); }

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.35rem); font-weight: 620;
  letter-spacing: -.032em; line-height: 1.12; margin: .875rem 0 0;
  max-width: 24ch; text-wrap: balance;
}
.sec-lede { color: var(--muted); max-width: 60ch; margin: 1rem 0 0; }

.prose { max-width: 62ch; }
.prose p { color: var(--muted); margin: 1rem 0 0; }
.prose p b { color: var(--text); font-weight: 600; }

/* ---------- stats + tables ---------- */

.dep-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-top: 2.5rem; background: var(--line);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
@media (max-width: 720px) { .dep-stats { grid-template-columns: 1fr; } }
.dep-s { background: var(--surface); padding: 1.5rem 1.375rem; }
.dep-s-v { font-size: 2rem; font-weight: 620; letter-spacing: -.04em; line-height: 1; }
.dep-s-k { font-size: .875rem; color: var(--muted); margin-top: .625rem; line-height: 1.5; }

.tblbox {
  margin-top: 1.75rem; border: 1px solid var(--line);
  border-radius: 3px; overflow-x: auto; background: var(--surface);
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--hair); font-size: 13px; }
thead th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim);
  background: var(--surface-2); border-bottom-color: var(--line); white-space: nowrap;
}
tbody th { font-weight: 400; color: var(--text); }
tbody td { color: var(--muted); white-space: nowrap; }
tbody tr:hover th, tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono-c { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.undis { color: var(--dim); }

td.def, td.unres {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .13em; text-transform: uppercase; white-space: nowrap;
}
td.def { color: var(--st-good); }
td.unres { color: var(--st-warn); }

.roster table, .prog table, .matrix table { min-width: 700px; }

.rd {
  display: inline-block; height: .8125em; border-radius: 1px;
  background: currentColor; opacity: .82; vertical-align: -.03em; margin-right: .375rem;
}

.dep-note { margin-top: 1.5rem; font-size: .9375rem; color: var(--muted); max-width: 60ch; }
.dep-note b { color: var(--text); font-weight: 600; }

/* ---------- staged lists ---------- */

.steps { margin-top: 2.5rem; }
.step {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.25rem);
  padding-block: 1.625rem; border-top: 1px solid var(--hair);
}
@media (max-width: 640px) { .step { grid-template-columns: 1fr; gap: .5rem; } }
.step-n { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--brand); padding-top: .3125rem; }
.step h3 { font-size: 1.0625rem; font-weight: 620; letter-spacing: -.018em; margin: 0; }
.step p { color: var(--muted); margin: .4375rem 0 0; font-size: .9375rem; max-width: 62ch; overflow-wrap: anywhere; }

.note { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; color: var(--dim); margin-top: 1.5rem; line-height: 1.8; max-width: 66ch; }
.note a { color: var(--brand); }

/* ---------- technology entries ---------- */

.tech {
  border-top: 1px solid var(--hair); padding-block: 1.75rem;
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.25rem);
}
@media (max-width: 680px) { .tech { grid-template-columns: 1fr; gap: .625rem; } }
.tech-id { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--brand); padding-top: .375rem; }
.tech h3 { font-size: 1.125rem; font-weight: 620; letter-spacing: -.02em; margin: 0; }
.tech .role { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); margin: .3125rem 0 0; }
.spec { margin: .9375rem 0 0; display: flex; flex-direction: column; gap: .5rem; max-width: 64ch; }
.spec > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: .875rem; font-size: .90625rem; }
@media (max-width: 520px) { .spec > div { grid-template-columns: 1fr; gap: .125rem; } }
.spec .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding-top: .3125rem; }
.spec .v { color: var(--muted); }
.spec .v b { color: var(--text); font-weight: 600; }

/* ---------- reference implementation / charts ---------- */

.refbox { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); overflow: hidden; }
.ref-hd { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--hair); }
.ref-t { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.ref-s { font-size: 12.5px; color: var(--dim); }
.legend { display: flex; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: .4375rem; font-size: 12px; color: var(--muted); }
.lg i { width: 10px; height: 10px; border-radius: 2px; display: block; flex: none; }
.toggle {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: .375rem .625rem; border-radius: 2px; cursor: pointer;
  transition: border-color .18s, color .18s;
}
.toggle:hover { border-color: var(--muted); color: var(--text); }

.glance { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--hair); }
@media (max-width: 820px) { .glance { grid-template-columns: repeat(2, 1fr); } }
.gl { padding: 1.25rem 1.375rem; border-right: 1px solid var(--hair); }
.gl:last-child { border-right: none; }
@media (max-width: 820px) {
  .gl:nth-child(2n) { border-right: none; }
  .gl:nth-child(-n+2) { border-bottom: 1px solid var(--hair); }
}
.gl-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); }
.gl-v { font-size: 1.4375rem; font-weight: 620; letter-spacing: -.035em; margin-top: .4375rem; line-height: 1.1; }
.gl-v.soft { color: var(--dim); font-weight: 500; }
.gl-n { font-size: .8125rem; color: var(--muted); margin-top: .1875rem; }

.ref-bd { padding: 1.5rem 1.375rem 1.75rem; position: relative; }
.radar-wrap { position: relative; max-width: 540px; margin: 0 auto; }
.radar-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis-label { font-family: var(--sans); font-size: 11.5px; fill: var(--muted); }
.axis-hit { fill: transparent; cursor: pointer; }
.axis-hit:hover + .axis-ring, .axis-hit:focus-visible + .axis-ring { opacity: 1; }
.axis-ring { opacity: 0; transition: opacity .15s; }
.radar-wrap.off { display: none; }
.tblview { display: none; overflow-x: auto; }
.tblview.on { display: block; }
.tblview table { min-width: 440px; }

#bars { display: block; width: 100%; height: auto; overflow: visible; }
.bar-lbl { font-size: 12.5px; fill: var(--muted); }
.bar-val { font-size: 12.5px; fill: var(--text); font-weight: 600; }
.bar-hit { fill: transparent; cursor: pointer; }
.barview.off { display: none; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13); padding: .625rem .75rem;
  font-size: 12.5px; min-width: 152px; opacity: 0; transform: translateY(3px);
  transition: opacity .14s, transform .14s;
}
.tip.on { opacity: 1; transform: none; }
.tip-t { font-weight: 600; margin-bottom: .375rem; font-size: 12px; }
.tip-r { display: flex; align-items: center; gap: .4375rem; color: var(--muted); }
.tip-r i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip-r b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.fn { font-size: 12px; color: var(--dim); margin: 1rem 0 0; max-width: 66ch; }

/* ---------- programs ---------- */

.tiers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden; margin-top: 2.5rem;
}
@media (max-width: 880px) { .tiers { grid-template-columns: 1fr; } }
.tier { background: var(--surface); padding: 1.75rem 1.5rem; display: flex; flex-direction: column; }
.tier-n { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.tier h3 { font-size: 1.3125rem; font-weight: 620; letter-spacing: -.028em; margin: .625rem 0 0; }
.tier-p { font-size: 1.5rem; font-weight: 620; letter-spacing: -.035em; margin-top: .875rem; }
.tier-p.soft { color: var(--dim); font-size: 1.125rem; }
.tier-d { font-size: .90625rem; color: var(--muted); margin: .875rem 0 0; }
.tier ul { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.tier li { font-size: .875rem; color: var(--muted); padding-left: 1rem; position: relative; }
.tier li::before { content: "\2014"; position: absolute; left: 0; color: var(--dim); }

/* ---------- newsroom / careers / definitions ---------- */

.listing { margin-top: 2.5rem; border-top: 1px solid var(--hair); }
.item {
  display: grid; grid-template-columns: 116px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem); padding-block: 1.5rem; border-bottom: 1px solid var(--hair);
}
@media (max-width: 640px) { .item { grid-template-columns: 1fr; gap: .375rem; } }
.item-d { font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); padding-top: .375rem; }
.item h3 { font-size: 1.0625rem; font-weight: 620; letter-spacing: -.018em; margin: 0; }
.item p { color: var(--muted); margin: .5rem 0 0; font-size: .9375rem; max-width: 64ch; }
.item .meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); margin-top: .625rem; }

.src { margin: .625rem 0 0; font-size: .8125rem; }
.src a { color: var(--brand); text-decoration: none; }
.src a:hover { text-decoration: underline; }
.src .outlet { color: var(--dim); }

.realnote {
  margin-top: 1.25rem; padding: 1rem 1.125rem;
  border: 1px solid var(--line); border-left: 2px solid var(--brand);
  border-radius: 3px; background: var(--surface);
  font-size: .875rem; color: var(--muted); max-width: 68ch;
}
.realnote b { color: var(--text); font-weight: 600; }

/* article footer blocks */

.sources { margin: 2.5rem 0 0; padding: 1.25rem 1.375rem; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 3px; }
.sources h2 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); margin: 0 0 .875rem; font-weight: 400; max-width: none; }
.sources ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; font-family: var(--sans); font-size: .875rem; }
.sources a { color: var(--brand); text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources .outlet { color: var(--dim); }

.related { margin-top: 2.5rem; }
.related h2 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); margin: 0 0 .875rem; font-weight: 400; max-width: none; }
.related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.related li { border-bottom: 1px solid var(--hair); }
.related a { display: block; padding: .8125rem .25rem; text-decoration: none; font-size: .9375rem; transition: padding-left .2s; }
.related a:hover { padding-left: .625rem; color: var(--brand); }
.related .rd-date { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); display: block; margin-bottom: .1875rem; }

.factual-badge, .fiction-badge {
  display: inline-flex; align-items: center; gap: .4375rem;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  padding: .25rem .5rem; border: 1px solid currentColor; border-radius: 2px; margin-bottom: 1.25rem;
}
.factual-badge { color: var(--st-good); }
.fiction-badge { color: var(--st-warn); }

.item h3 a { text-decoration: none; }
.item h3 a:hover { color: var(--brand); }

/* Traditional Chinese. System CJK faces, Hong Kong first. */
[lang^="zh"] {
  font-family: "PingFang HK", "PingFang TC", "Noto Sans HK", "Noto Sans TC",
               "Microsoft JhengHei", "Heiti TC", "Hiragino Sans CNS", var(--sans);
  line-height: 1.85;
}
[lang^="zh"] .hero-title { letter-spacing: -.01em; line-height: 1.18; max-width: 22ch; }
[lang^="zh"] h2 { letter-spacing: -.005em; line-height: 1.35; max-width: 28ch; }
[lang^="zh"] .article > p { line-height: 1.9; }
[lang^="zh"] .lbl, [lang^="zh"] .crumb { letter-spacing: .1em; }

/* technical diagrams */

.diagram {
  margin: 2.25rem 0 0;
  padding: 1.25rem 1.25rem .875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; min-width: 460px; height: auto; }
.diagram figcaption {
  margin-top: .875rem; padding-top: .75rem;
  border-top: 1px solid var(--hair);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}
.diagram .d-hd   { font-family: var(--sans); font-size: 13px; font-weight: 620; fill: var(--text); }
.diagram .d-sub  { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.diagram .d-nm   { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--text); }
.diagram .d-val  { font-family: var(--sans); font-size: 11.5px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.diagram .d-tick { font-family: var(--sans); font-size: 10.5px; fill: var(--muted); }
.diagram .d-note { font-family: var(--sans); font-size: 10.5px; fill: var(--dim); }
.diagram .d-warn { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--st-warn); }
.diagram .d-ok   { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--st-good); }
.diagram .d-onbar{ font-family: var(--sans); font-size: 10.5px; font-weight: 600; fill: var(--on-brand); }

/* full-bleed page figure */

.pagefig { border-bottom: 1px solid var(--hair); background: var(--surface-2); }
.pagefig img {
  display: block; width: 100%; height: auto;
  max-height: 420px; object-fit: cover; object-position: center;
}
.pagefig figcaption {
  max-width: var(--maxw); margin: 0 auto;
  padding: .875rem var(--gutter);
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}
@media (max-width: 640px) { .pagefig img { max-height: 240px; } }

/* consent bar */

.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0,0,0,.14);
}
.consent.show { display: flex; }
.consent p {
  margin: 0; flex: 1 1 22rem; min-width: 0;
  font-size: .8125rem; line-height: 1.5; color: var(--muted);
}
.consent p b { color: var(--text); font-weight: 600; }
.consent-act { display: flex; gap: .5rem; flex: none; }
.consent .btn { font-size: 12.5px; padding: .4375rem .875rem; }
@media (max-width: 560px) {
  .consent { gap: .625rem; }
  .consent-act { width: 100%; }
  .consent-act .btn { flex: 1; justify-content: center; }
}

/* agent byline */

.byline {
  display: flex; align-items: center; gap: .875rem;
  margin: 0 0 1.75rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hair);
}
.byline img {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  object-fit: cover; display: block; border: 1px solid var(--line);
}
.byline-t { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.byline-t a { text-decoration: none; }
.byline-t a:hover { color: var(--brand); }
.byline-s {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim); margin-top: .1875rem;
}

.agent-card {
  display: flex; align-items: center; gap: 1.25rem;
  margin-top: 2.5rem; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
}
.agent-card img {
  width: 104px; height: 104px; flex: none; border-radius: 3px;
  object-fit: cover; display: block;
}
.agent-card .n { font-size: 1.125rem; font-weight: 620; letter-spacing: -.02em; }
.agent-card .r { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); margin-top: .25rem; }
.agent-card .d { font-size: .875rem; color: var(--muted); margin-top: .625rem; max-width: 62ch; }
@media (max-width: 560px) { .agent-card { flex-direction: column; align-items: flex-start; } }

/* author card */

.author {
  display: flex; align-items: center; gap: 1.125rem;
  margin: 0 0 2.25rem; padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hair);
}
.author-pic {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  object-fit: cover; display: block;
  border: 1px solid var(--line);
}
.author-mono {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 1.125rem; font-weight: 620; letter-spacing: -.02em; color: var(--muted);
}
.author-name { font-size: 1.0625rem; font-weight: 620; letter-spacing: -.02em; }
.author-name a { text-decoration: none; }
.author-name a:hover { color: var(--brand); }
.author-role { font-size: .875rem; color: var(--muted); margin-top: .1875rem; }
.author-link {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--brand); text-decoration: none;
  margin-top: .4375rem; display: inline-block;
}
.author-link:hover { text-decoration: underline; }

.defs { margin-top: 2.5rem; border-top: 1px solid var(--hair); }
.def-item { padding-block: 1.5rem; border-bottom: 1px solid var(--hair); }
.def-item h3 { font-size: 1.0625rem; font-weight: 620; letter-spacing: -.018em; margin: 0; }
.def-item p { color: var(--muted); margin: .5rem 0 0; font-size: .9375rem; max-width: 66ch; }

/* ---------- learning centre ---------- */

.learn { background: var(--surface-2); border-top: 1px solid var(--hair); }
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 900px) { .learn-grid { grid-template-columns: 1fr; } }
/* Banded sections reuse .learn for the surface, not the teaser's narrow measure.
   Paragraphs get the standard reading width; the 20ch/48ch squeeze below is
   scoped to the homepage teaser column, where it belongs. */
.learn p { color: var(--muted); max-width: 62ch; margin: 1rem 0 0; line-height: 1.7; }
.learn-grid h2 { max-width: 20ch; }
.learn-grid p { max-width: 48ch; }

.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: flex; align-items: baseline; gap: 1rem; padding: .8125rem .25rem; text-decoration: none; transition: padding-left .2s; }
.toc a:hover { padding-left: .625rem; }
.toc-n { font-family: var(--mono); font-size: 10px; color: var(--dim); flex: none; }
.toc-t { font-size: 1rem; }
.toc a:hover .toc-t { color: var(--brand); }
.toc-m { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: var(--dim); flex: none; }

.track { margin-top: 3rem; }
.track:first-of-type { margin-top: 2rem; }
.track-h { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin: 0 0 .75rem; }

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

.article { max-width: 68ch; margin: 0 auto; }
.article > p, .article ul, .article ol {
  font-size: 1.0625rem; line-height: 1.72; color: var(--text);
}
.article > p { margin: 1.375rem 0 0; }
.article .standfirst { font-size: 1.1875rem; color: var(--muted); border-left: 2px solid var(--brand); padding-left: 1.125rem; margin-top: 0; }
.article h2 { font-size: 1.375rem; font-weight: 620; letter-spacing: -.022em; margin: 2.75rem 0 0; max-width: none; }
.article h3 { font-size: 1.125rem; font-weight: 620; letter-spacing: -.018em; margin: 2rem 0 0; }
.article ul, .article ol { margin: 1.25rem 0 0; padding-left: 1.375rem; display: flex; flex-direction: column; gap: .625rem; }
.article li b, .article p b { font-weight: 600; }
.article code { font-family: var(--mono); font-size: .8125em; background: var(--surface-2); padding: .125rem .3125rem; border-radius: 2px; }
.article pre {
  background: var(--surface-2); border: 1px solid var(--hair); border-radius: 3px;
  padding: 1rem 1.125rem; overflow-x: auto; margin: 1.5rem 0 0;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
}
.article pre code { background: none; padding: 0; font-size: inherit; }
.article blockquote {
  margin: 1.75rem 0 0; padding: 1rem 1.25rem; border-left: 2px solid var(--brand);
  background: var(--surface-2); color: var(--muted);
}
.article blockquote p { margin: 0; }
.article hr { border: none; border-top: 1px solid var(--hair); margin: 2.75rem 0 0; }

.art-meta {
  display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 0 0 2rem;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim);
}
.art-next {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.art-next a { text-decoration: none; font-size: .9375rem; color: var(--brand); }

/* ---------- capital ---------- */

.cap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: end; margin-top: 2.25rem; }
@media (max-width: 900px) { .cap-grid { grid-template-columns: 1fr; } }
.bv-fig { font-size: clamp(2.75rem, 7vw, 4.5rem); font-weight: 620; letter-spacing: -.048em; line-height: .95; }
.bv-p { font-size: .9375rem; color: var(--muted); margin: 1rem 0 0; max-width: 46ch; }
.bv-p b { color: var(--text); font-weight: 600; }
.bv-def { font-family: var(--mono); font-size: 10.5px; line-height: 1.9; letter-spacing: .04em; color: var(--dim); border-left: 1px solid var(--line); padding-left: 1rem; max-width: 42ch; }
.bv-motto { font-family: var(--mono); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); opacity: .5; margin-top: 3.5rem; }
.bv-letter {
  margin-top: 2.5rem; border-left: 2px solid var(--line); padding-left: 1.5rem;
  font-size: 1rem; line-height: 1.7; color: var(--muted); max-width: 58ch;
}
.bv-letter p { margin: 0 0 1rem; }
.bv-sig { font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); }

/* ---------- close ---------- */

.close h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); max-width: 20ch; }
.close .hero-cta { margin-top: 2rem; }

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

.foot { border-top: 1px solid var(--hair); padding-block: 3rem 3.5rem; }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2.75rem; }
@media (max-width: 760px) { .foot-cols { grid-template-columns: repeat(2, 1fr); } }
.foot h4 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); margin: 0 0 .875rem; font-weight: 400; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.foot a { text-decoration: none; font-size: .875rem; color: var(--muted); transition: color .18s; }
.foot a:hover { color: var(--brand); }
.disc { border-top: 1px solid var(--hair); padding-top: 1.5rem; font-size: 12px; line-height: 1.8; color: var(--dim); }
.disc b { color: var(--muted); font-weight: 600; }
.disc-legal {
  margin: 1.25rem 0 0; padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--dim);
}
/* `.foot a` sets 14px at equal specificity, so the size has to be restated here
   or the links tower over the copyright line beside them. */
.disc-legal a { text-decoration: none; font-size: inherit; letter-spacing: inherit; color: inherit; }
.disc-legal a:hover { color: var(--brand); }

/* directory */
.dir-group { margin-top: 2.75rem; }
.dir-group h2 { font-size: 1.0625rem; font-weight: 620; letter-spacing: -.018em; margin: 0 0 .25rem; max-width: none; }
.dir-group .n { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); }
.dir-list { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--hair); columns: 2; column-gap: 2.5rem; }
@media (max-width: 720px) { .dir-list { columns: 1; } }
.dir-list li { break-inside: avoid; border-bottom: 1px solid var(--hair); }
.dir-list a { display: block; padding: .625rem .25rem; text-decoration: none; font-size: .90625rem; transition: padding-left .18s; }
.dir-list a:hover { padding-left: .5rem; color: var(--brand); }

/* ---------- motion ---------- */

.rise { opacity: 0; transform: translateY(12px); }
.rise.in { opacity: 1; transform: none; transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }
.hero .rise { transition-duration: .9s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .rise { opacity: 1 !important; transform: none !important; }
}
