/* Fundamental Density Theory — site styles
   Concept: the plate and the dial. Line-art figures on a cool ground, Prussian ink,
   and one functional colour code: cobalt below the seam (α < ½, the spacetime phase),
   brass above it (α > ½, the matter phase), grey at the seam. */

@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "STIX Two Math"; src: url("../fonts/stix-two-math.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+2190-21FF, U+2200-22FF, U+2308-230B, U+27E8-27E9, U+27F6-27F8, U+2A00-2A06, U+2A2F, U+2102, U+2124, U+1D4AB, U+1D4B0, U+1D4DC, U+1D50D-1D50F, U+1D513, U+1D51A, U+1D522-1D523, U+1D526, U+1D52A, U+1D52F-1D531; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semicondensed-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* colour — light */
  --paper: #FDFDFC;
  --paper-2: #EFF2F6;
  --paper-3: #E3E8EF;
  --ink: #13213A;
  --ink-2: #4B5873;
  --ink-3: #6E7A91;
  --rule: #D3DAE4;
  --space: #2257C9;
  --space-soft: #DCE6FA;
  --matter: #9C5D00;
  --matter-soft: #F6E7CF;
  --seam: #5F687D;
  --port-3: #1F7A6B;
  --plate: #0E1B33;
  --plate-2: #15284A;
  --sand: #EADFC4;
  --plate-ink: #DCE4F2;
  --plate-ink-2: #9FB0CB;
  --focus: #2257C9;
  --shadow: 0 1px 2px rgba(19, 33, 58, .06), 0 8px 24px rgba(19, 33, 58, .06);

  /* type */
  --font-text: "STIX Two Text", "STIX Two Math", Cambria, "Times New Roman", serif;
  --font-ui: "Barlow", "STIX Two Text", "STIX Two Math", "Helvetica Neue", Arial, sans-serif;
  --font-ui-narrow: "Barlow Semi Condensed", "Barlow", "STIX Two Text", "STIX Two Math", "Arial Narrow", sans-serif;
  --step--1: .875rem;
  --step-0: clamp(1.0625rem, .98rem + .35vw, 1.1875rem);
  --step-1: clamp(1.3rem, 1.15rem + .55vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.1vw, 2rem);
  --step-3: clamp(2.1rem, 1.6rem + 2vw, 2.85rem);
  --step-4: clamp(2.5rem, 1.6rem + 4.2vw, 4.6rem);

  /* layout */
  --measure: 40rem;
  --rail: 15rem;
  --wrap: 74rem;
  --radius: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1B2E; --paper-2: #16263F; --paper-3: #1D3050; --ink: #E6EBF3; --ink-2: #A6B2C5; --ink-3: #8592A8;
    --rule: #2A3C5A; --space: #86A8FF; --space-soft: #1C2E57; --matter: #E9AE4B; --matter-soft: #3A2E17; --seam: #8F99AD;
    --port-3: #5FC2AE; --plate: #0A1527; --plate-2: #12223D; --sand: #EADFC4; --plate-ink: #DCE4F2; --plate-ink-2: #9FB0CB;
    --focus: #86A8FF; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1B2E; --paper-2: #16263F; --paper-3: #1D3050; --ink: #E6EBF3; --ink-2: #A6B2C5; --ink-3: #8592A8;
  --rule: #2A3C5A; --space: #86A8FF; --space-soft: #1C2E57; --matter: #E9AE4B; --matter-soft: #3A2E17; --seam: #8F99AD;
  --port-3: #5FC2AE; --plate: #0A1527; --plate-2: #12223D; --sand: #EADFC4; --plate-ink: #DCE4F2; --plate-ink-2: #9FB0CB;
  --focus: #86A8FF; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--step-0); line-height: 1.62;
  font-feature-settings: "kern", "liga", "onum" 0;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }

a { color: var(--space); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--space-soft); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--font-text); font-weight: 500; line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -.005em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); line-height: 1.25; }
h4 { font-family: var(--font-ui); font-size: 1rem; font-weight: 600; letter-spacing: .01em; }
p { margin: 0; }
p + p { margin-top: .9em; }
strong { font-weight: 600; }
var, .v { font-style: italic; font-family: var(--font-text); }
sub, sup { line-height: 0; }
abbr { text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--ink); padding: .5rem .8rem; z-index: 50; font-family: var(--font-ui); }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 8px); }

/* ---------- page frame ---------- */
.gutter { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: var(--wrap); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; flex-wrap: wrap; padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-family: var(--font-text); font-size: 1.22rem; font-weight: 500; letter-spacing: .005em; white-space: nowrap; }
.brand .mark { width: 2.05rem; height: 2.05rem; flex: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: .25rem; font-family: var(--font-ui); font-weight: 500; font-size: 1rem; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius); }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--space); border-radius: 0; }
.theme-toggle { margin-left: .35rem; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }

.site-footer { margin-top: 6rem; border-top: 1px solid var(--rule); background: var(--paper); font-family: var(--font-ui); font-size: .95rem; color: var(--ink-2); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; padding-block: 2.6rem 3rem; }
.site-footer h2 { font-family: var(--font-ui); font-size: .95rem; font-weight: 600; color: var(--ink); margin-bottom: .5rem; letter-spacing: .01em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .footer-mark { display: block; width: 2.75rem; height: 2.75rem; color: var(--ink); margin-bottom: 1.1rem; }
.site-footer .chain-small { font-family: var(--font-text); font-size: 1.15rem; color: var(--ink); margin-bottom: .4rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; } }

/* ---------- hero plate ---------- */
.plate-hero { position: relative; background: var(--plate); color: var(--plate-ink); overflow: hidden; isolation: isolate; }
.plate-hero canvas.plate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.plate-hero .wrap { position: relative; padding-block: clamp(3rem, 7vw, 6.2rem) clamp(2.6rem, 5vw, 4.2rem); display: grid; gap: 2.2rem; }
.hero-kicker { font-family: var(--font-ui); font-weight: 500; font-size: 1.05rem; color: var(--plate-ink-2); letter-spacing: .01em; }
.chain { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .1em .28em; font-family: var(--font-text); font-size: var(--step-4); line-height: 1; color: var(--plate-ink); margin: 0; font-weight: 400; letter-spacing: -.01em; }
.chain .term { display: inline-grid; justify-items: start; gap: .55rem; }
.chain .term > span:first-child { white-space: nowrap; }
.chain .eq { color: var(--plate-ink-2); padding-inline: .02em; }
.chain .reading { font-family: var(--font-ui); font-size: .9rem; line-height: 1.25; font-weight: 500; letter-spacing: .01em; color: var(--plate-ink-2); white-space: nowrap; }
.hero-lede { max-width: 36rem; font-size: var(--step-1); line-height: 1.45; color: var(--plate-ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.plate-note { font-family: var(--font-ui); font-size: .9rem; color: var(--plate-ink-2); max-width: 30rem; }
.plate-note button { font: inherit; color: var(--sand); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-ui); font-size: 1rem; font-weight: 600; letter-spacing: .01em;
  padding: .72rem 1.15rem; border-radius: var(--radius); text-decoration: none; border: 1px solid transparent; cursor: pointer; line-height: 1.1; }
.btn-primary { background: var(--sand); color: var(--plate); }
.btn-primary:hover { background: #F5EDD8; text-decoration: none; }
.btn-ghost { color: var(--plate-ink); border-color: color-mix(in srgb, var(--plate-ink) 40%, transparent); }
.btn-ghost:hover { border-color: var(--plate-ink); text-decoration: none; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { text-decoration: none; opacity: .92; }
.btn-line { color: var(--ink); border-color: var(--rule); background: var(--paper); }
.btn-line:hover { border-color: var(--ink-3); text-decoration: none; }
.btn svg { width: 1rem; height: 1rem; flex: none; }

/* ---------- reading layout ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem) 0; }
.doc { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, var(--rail)); column-gap: clamp(2rem, 4vw, 4.5rem); align-items: start; }
.doc > * { grid-column: 1; min-width: 0; }
.doc > .wide { grid-column: 1 / -1; }
.doc > .rail { grid-column: 2; }
@media (max-width: 1100px) { .doc { grid-template-columns: minmax(0, 1fr); } .doc > .rail { grid-column: 1; } }
.prose > * + * { margin-top: 1.05rem; }
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin-bottom: 0; }
.prose li + li { margin-top: .35rem; }
.prose .lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: .92em; }
.ui { font-family: var(--font-ui); }

.page-head { padding-block: clamp(2.6rem, 6vw, 4.5rem) 0; }
.page-head h1 { max-width: 22ch; }
.page-head .lede { margin-top: 1.1rem; max-width: 38rem; font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); }
.crumb { font-family: var(--font-ui); font-weight: 500; font-size: .98rem; margin-bottom: 1rem; display: inline-block; color: var(--ink-2); text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; }

/* chapter with a locator in the rail */
.chapter { padding-top: clamp(3rem, 6vw, 4.6rem); }
.chapter-head { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, var(--rail)); column-gap: clamp(2rem, 4vw, 4.5rem); align-items: baseline; margin-bottom: 1.2rem; }
.chapter-head h2 { grid-column: 1; }
.chapter-head .loc { grid-column: 2; grid-row: 1; }
@media (max-width: 1100px) { .chapter-head { grid-template-columns: minmax(0, 1fr); } .chapter-head .loc { grid-column: 1; grid-row: auto; order: -1; margin-bottom: .4rem; } }
.loc { font-family: var(--font-ui-narrow); font-weight: 500; font-size: 1rem; color: var(--ink-3); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.loc b { font-weight: 500; color: var(--ink); }

.sidenote { font-family: var(--font-ui); font-size: .92rem; line-height: 1.45; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: .55rem; }
.sidenote + .sidenote { margin-top: 1.2rem; }
.sidenote .loc { display: block; margin-bottom: .15rem; }
@media (max-width: 1100px) { .sidenote { margin-top: 1rem; } }

/* display equations, typeset as math */
.eq-block { font-family: var(--font-text); font-size: 1.25em; line-height: 1.5; padding: .9rem 0 .9rem 1.1rem; border-left: 2px solid var(--rule); overflow-x: auto; white-space: nowrap; }
.eq-block .lbl { font-family: var(--font-ui); font-size: .78rem; color: var(--ink-3); margin-left: 1.2rem; white-space: nowrap; vertical-align: middle; letter-spacing: .02em; }
.eq-block .row { display: block; }
.math { font-family: var(--font-text); white-space: nowrap; }

/* regime colour code */
.rg-space { color: var(--space); }
.rg-matter { color: var(--matter); }
.rg-seam { color: var(--seam); }
.chip { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-ui); font-weight: 500; font-size: .92rem; padding: .18rem .6rem; border-radius: 999px; border: 1px solid currentColor; line-height: 1.3; white-space: nowrap; }
.chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }

/* ---------- figures (plates) ---------- */
.fig { margin-block: 2.2rem 0; }
.fig-frame { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.fig-stage { position: relative; width: 100%; touch-action: pan-y; }
.fig-stage canvas { display: block; width: 100%; height: 100%; }
.fig-stage.grab { cursor: grab; }
.fig-stage.grab:active { cursor: grabbing; }
.fig-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: flex-end; padding: .95rem 1.1rem 1.05rem; border-top: 1px solid var(--rule); background: var(--paper); font-family: var(--font-ui); }
.fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fig-readout { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; padding: .85rem 1.1rem; border-top: 1px solid var(--rule); font-family: var(--font-ui); font-size: .98rem; background: var(--paper); }
.fig-readout .ro { display: grid; gap: .1rem; min-width: 0; }
.fig-readout .ro-k { font-size: .82rem; color: var(--ink-3); letter-spacing: .01em; }
.fig-readout .ro-v { font-family: var(--font-text); font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.fig-caption { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, var(--rail)); column-gap: clamp(2rem, 4vw, 4.5rem); margin-top: .85rem; font-family: var(--font-ui); font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.fig-caption > p { grid-column: 1; }
.fig-caption > .loc { grid-column: 2; }
.fig-caption b { color: var(--ink); font-weight: 600; }
@media (max-width: 1100px) { .fig-caption { grid-template-columns: minmax(0, 1fr); } .fig-caption > .loc { grid-column: 1; } }
.fig-hint { position: absolute; right: .75rem; bottom: .6rem; font-family: var(--font-ui); font-size: .82rem; color: var(--ink-3); pointer-events: none; }
.fig-tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .6rem .7rem 0; border-bottom: 1px solid var(--rule); background: var(--paper); font-family: var(--font-ui); }
.fig-tabs button { font: inherit; font-weight: 500; font-size: .95rem; color: var(--ink-2); background: none; border: 0; padding: .5rem .75rem .6rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fig-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--space); }
.fig-tabs button:hover { color: var(--ink); }

/* controls */
.ctl { display: grid; gap: .35rem; min-width: 11rem; flex: 1 1 13rem; max-width: 26rem; }
.ctl-label { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; color: var(--ink-2); }
.ctl-label output { font-family: var(--font-text); font-size: 1.02rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.6rem; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: var(--rule); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 3px; background: var(--rule); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); margin-top: -.42rem; }
input[type="range"]::-moz-range-thumb { width: .95rem; height: .95rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
input[type="range"]:focus-visible { outline-offset: 2px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.seg button { font-family: var(--font-ui); font-size: .93rem; font-weight: 500; color: var(--ink-2); background: none; border: 0; border-right: 1px solid var(--rule); padding: .48rem .8rem; cursor: pointer; line-height: 1.15; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--paper-2); color: var(--ink); }
.ctl-group { display: grid; gap: .35rem; }
.ctl-group > span { font-size: .9rem; color: var(--ink-2); }
.btn-sm { font-family: var(--font-ui); font-size: .93rem; font-weight: 600; padding: .5rem .85rem; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; line-height: 1.15; }
.btn-sm.alt { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn-sm:hover { opacity: .9; }
.btn-sm:disabled { opacity: .45; cursor: default; }
.ctl-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.tooltip { position: absolute; z-index: 5; pointer-events: none; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); box-shadow: var(--shadow); border-radius: var(--radius);
  padding: .5rem .65rem; font-family: var(--font-ui); font-size: .88rem; line-height: 1.35; max-width: 17rem; transform: translate(-50%, calc(-100% - 12px)); }
.tooltip b { font-weight: 600; }

/* data tables */
.table-wrap { overflow-x: auto; margin-top: 1.4rem; border-top: 1px solid var(--ink); }
table.data { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: .95rem; font-variant-numeric: tabular-nums; }
table.data caption { text-align: left; font-size: .9rem; color: var(--ink-2); padding: .6rem 0; caption-side: bottom; }
table.data th, table.data td { text-align: left; padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-weight: 600; color: var(--ink); white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; padding-left: .75rem; white-space: nowrap; }
table.data .math { font-size: 1.05em; }

/* key-value list (paper facts) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.2rem; font-family: var(--font-ui); font-size: .95rem; margin: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* ---------- home: dial ---------- */
.dial-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.6rem, 4vw, 4rem); align-items: end; }
@media (max-width: 900px) { .dial-intro { grid-template-columns: minmax(0, 1fr); } }

/* ---------- applications ---------- */
.app-group { margin-top: clamp(2.6rem, 5vw, 4rem); }
.app-group header { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, var(--rail)); column-gap: clamp(2rem, 4vw, 4.5rem); margin-bottom: 1.4rem; }
.app-group header p { margin-top: .5rem; color: var(--ink-2); max-width: var(--measure); }
.app-group header { padding-bottom: .4rem; }
@media (max-width: 1100px) { .app-group header { grid-template-columns: minmax(0, 1fr); } }
.app-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.app-item { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 12rem); gap: 1.6rem; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); align-items: start; position: relative; }
.app-item:hover .app-thumb img { transform: scale(1.015); }
.app-thumb { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); border: 1px solid var(--rule); }
.app-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.app-body h3 { font-size: var(--step-1); }
.app-body h3 a { color: var(--ink); text-decoration: none; }
.app-body h3 a::after { content: ""; position: absolute; inset: 0; }
.app-body h3 a:hover { text-decoration: underline; }
.app-body p { margin-top: .5rem; color: var(--ink-2); max-width: 36rem; }
.app-meta { font-family: var(--font-ui); font-size: .9rem; color: var(--ink-3); display: grid; gap: .25rem; }
.app-meta .loc { color: var(--ink-2); }
@media (max-width: 900px) { .app-item { grid-template-columns: minmax(0, 1fr); gap: .9rem; } .app-meta { order: 3; } }
.app-item.lead { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); grid-template-rows: auto 1fr; row-gap: .9rem; }
.app-item.lead .app-thumb { grid-row: 1 / span 2; }
.app-item.lead .app-meta { grid-column: 2; align-self: start; }
@media (max-width: 900px) { .app-item.lead { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; } .app-item.lead .app-thumb { grid-row: auto; } .app-item.lead .app-meta { grid-column: 1; } }

/* ---------- paper pages ---------- */
.paper-head { padding-block: clamp(2.4rem, 5vw, 4rem) 0; }
.paper-head .doc { row-gap: 1rem; }
.paper-head h1 { font-size: var(--step-3); max-width: 24ch; }
.paper-head .lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 38rem; margin-top: 1.1rem; }
.paper-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.source-card { font-family: var(--font-ui); font-size: .92rem; color: var(--ink-2); line-height: 1.45; border-top: 1px solid var(--rule); padding-top: .6rem; }
.source-card b { color: var(--ink); font-weight: 600; display: block; margin-bottom: .2rem; }
.predictions { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; }
.predictions li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: .8rem; align-items: baseline; }
.predictions .tag { font-family: var(--font-ui-narrow); font-weight: 500; color: var(--ink-3); font-size: 1rem; }
.declined { display: grid; gap: 1.1rem; margin-top: 1.2rem; }
.declined > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.declined .std { color: var(--ink-2); }
.declined h4 { margin-bottom: .3rem; color: var(--ink-3); font-weight: 500; font-size: .85rem; }
@media (max-width: 700px) { .declined > div { grid-template-columns: minmax(0, 1fr); gap: .5rem; } }
.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 4rem; border-top: 1px solid var(--ink); padding-top: 1.2rem; font-family: var(--font-ui); }
.pager a { text-decoration: none; color: var(--ink); display: grid; gap: .2rem; }
.pager a span { color: var(--ink-3); font-size: .9rem; }
.pager a b { font-family: var(--font-text); font-weight: 500; font-size: 1.2rem; }
.pager a:hover b { text-decoration: underline; }
.pager .next { text-align: right; }

/* invariants list (home) */
.inv-list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 0 2.5rem; border-top: 1px solid var(--ink); }
.inv-list li { display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); gap: .6rem; padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.inv-list .loc { padding-top: .15rem; }
.inv-list h3 { font-size: 1.12rem; line-height: 1.3; }
.inv-list p { color: var(--ink-2); font-size: .97em; margin-top: .2rem; }
.inv-list .math { font-size: 1.02em; }

/* theory contents */
.toc { list-style: none; margin: 1.8rem 0 0; padding: 0; columns: 2 18rem; column-gap: 3rem; font-family: var(--font-ui); }
.toc li { break-inside: avoid; display: grid; grid-template-columns: 2.9rem minmax(0, 1fr); gap: .4rem; padding: .42rem 0; border-bottom: 1px solid var(--rule); }
.toc a { color: var(--ink); text-decoration: none; font-weight: 500; }
.toc a:hover { text-decoration: underline; }

.callout { background: var(--paper-2); border-radius: var(--radius); padding: 1.1rem 1.25rem; font-size: .98em; }
.callout p + p { margin-top: .6rem; }

.noscript { font-family: var(--font-ui); font-size: .95rem; color: var(--ink-2); padding: 1rem 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header nav, .theme-toggle, .fig-controls, .fig-tabs, .hero-actions { display: none !important; }
  .plate-hero { background: none; color: #000; }
  body { background: #fff; color: #000; }
}

/* hero plate layer */
.plate-hero .plate-layer { position: absolute; inset: 0; z-index: -1; }
.plate-hero .plate-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* paper pages: breadcrumbs, actions, rail cards */
.crumbs { font-family: var(--font-ui); font-size: .93rem; color: var(--ink-3); margin-bottom: 1.3rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.paper-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.paper-head .rail { display: grid; gap: 1rem; align-content: start; }
.fig + .fig-caption + .fig { margin-top: 2.4rem; }
.prose .data-wrap, .data-wrap { overflow-x: auto; margin-top: 1.2rem; }
.predictions b { font-weight: 600; }

/* about page */
.about-mark-row { display: grid; grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr); gap: 2.2rem; align-items: center; }
.about-mark { width: 100%; height: auto; display: block; color: var(--ink); }
.about-mark-row h2 { margin-bottom: .6rem; }
@media (max-width: 560px) { .about-mark-row { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; } .about-mark { width: 8.5rem; } }
.papers-table td:first-child { min-width: 14rem; }

/* application thumbnails follow the theme */
.app-thumb .th-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-thumb .th-light { display: none; }
  :root:not([data-theme="light"]) .app-thumb .th-dark { display: block; }
}
:root[data-theme="dark"] .app-thumb .th-light { display: none; }
:root[data-theme="dark"] .app-thumb .th-dark { display: block; }

/* download buttons carry the file details in a lighter weight; on phones they drop to a second line */
.btn .btn-meta { font-weight: 500; opacity: .8; }
@media (max-width: 520px) { .paper-actions .btn { flex-wrap: wrap; row-gap: .1rem; } .paper-actions .btn .btn-meta { flex-basis: 100%; } }
/* table captions stay in view when a wide table scrolls sideways */
.data-wrap table.data caption { position: sticky; left: 0; max-width: min(100%, calc(100vw - 2rem)); }

/* figures reserve room before they start, so the page settles quickly */
.fig[data-viz]:empty { min-height: 30rem; }
@media (max-width: 640px) { .fig[data-viz]:empty { min-height: 36rem; } }
