/* VOICE   work: the homepage of a signal-processing paper, for researchers; exact and calm,
           to the standard of a newspaper graphics desk.
   IDEA    the paper's own error-versus-depth plot: the worst-case bound is one solid
           vermilion mass, the truth is a thin line at its foot; one chart language throughout.
   PICTURE hero: VGG-16 relative error by layer, log axis; the Lipschitz bound climbs to
           5.6e11 as a vermilion mass, the paper's bound and the measured error run beneath.
   COLOUR  white ground, ink #141211; vermilion #f04a1a leads (worst case); cobalt #2457e6
           supports (the paper's analysis); teal #0f9b74 third series; night #120d0b.
   TYPE    Sofia Sans Condensed 800 display + Instrument Sans text; KaTeX for mathematics.
   LAYOUT  laptop: title across the top with the links on its right, the chart full width
           beneath with the finding in its empty upper-left corner; phone: title, links,
           chart, finding. */

@font-face { font-family: "Sofia Sans Condensed"; src: url(../fonts/sofia-sans-condensed.woff2) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-italic.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #141211;
  --ink-2: #57514d;
  --rule: #e5e0dc;
  --panel: #f7f5f3;
  --verm: #f04a1a;
  --cobalt: #2457e6;
  --teal: #0f9b74;
  --gray: #8b8581;
  --on-verm: #120d0b;
  --deep: #141211;
  --on-deep: #ffffff;
  --deep-2: #c9c1bc;
  --maxw: 1240px;
  --gut: max(5vw, 16px, env(safe-area-inset-left, 0px));
  --display: "Sofia Sans Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #120d0b;
    --ink: #f3ede9;
    --ink-2: #b9afa9;
    --rule: #352b28;
    --panel: #1b1411;
    --verm: #f2592b;
    --cobalt: #5f86ff;
    --teal: #1fa882;
    --gray: #857b76;
    --deep: #f3ede9;
    --on-deep: #120d0b;
    --deep-2: #4f4440;
  }
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--text); overflow-x: clip; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
p { margin: 0 0 1em; }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.04; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(34px, 4.4vw, 56px); max-width: 21em; }
h2 { font-size: clamp(28px, 3.3vw, 42px); max-width: 24em; margin-bottom: 18px; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 650; margin: 0 0 10px; }
strong, b { font-weight: 650; }
sup { line-height: 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
caption.cap { caption-side: top; text-align: left; margin: 0 0 8px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.band { padding-block: clamp(40px, 6vw, 88px); padding-inline: var(--gut); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.lead { font-size: 19px; line-height: 1.55; max-width: 44em; color: var(--ink); }
.prose p, .prose li { max-width: 40em; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split + .split { margin-top: clamp(40px, 5vw, 72px); }
.sticky { position: sticky; top: 76px; }
.rule-top { border-top: 1px solid var(--rule); padding-top: clamp(28px, 4vw, 48px); margin-top: clamp(36px, 5vw, 64px); }
@media (max-width: 980px) {
  .split, .split.even { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--rule); padding-inline: var(--gut); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 19px; text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.brand-short { display: none; }
.nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex: none; padding: 8px 10px; font-size: 15px; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-radius: 4px; }
.brand, .nav-cta, .nav-cta .btn { flex: none; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--verm); border-radius: 0; }
.nav-cta { display: flex; gap: 8px; }
@media (max-width: 900px) { .nav-cta { display: none; } }
@media (max-width: 600px) {
  .brand-long { display: none; }
  .brand-short { display: inline; }
  .nav .wrap { gap: 8px; }
  .nav-links a { padding: 8px 7px; }
}

/* ---------------------------------------------------------------- buttons and controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 16px/1.2 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--verm); border-color: var(--verm); color: var(--on-verm); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 16px; }
.ctl { display: grid; gap: 6px; }
.ctl > span, .ctl > label { font-size: 14px; color: var(--ink-2); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg button { font: 500 15px/1.2 var(--text); color: var(--ink); background: var(--bg); border: 0; border-right: 1px solid var(--rule); padding: 9px 14px; min-height: 42px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--panel); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.slider { display: grid; gap: 2px; min-width: 200px; flex: 1 1 220px; }
.slider label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.slider output { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--cobalt); cursor: pointer; }
.panel { border: 1px solid var(--rule); border-radius: 8px; padding: clamp(14px, 2vw, 22px); background: var(--bg); }

/* ---------------------------------------------------------------- charts */
.fig { position: relative; height: 340px; }
.fig > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.fig.tall { height: 400px; }
.fig.short { height: 280px; }
svg text { font-family: var(--text); font-size: 13px; fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .axis { stroke: var(--gray); stroke-width: 1; }
svg .ref { stroke: var(--gray); stroke-width: 1.2; stroke-dasharray: 5 4; }
svg .cross { stroke: var(--ink-2); stroke-width: 1; }
svg .dlab, svg .lab { fill: var(--ink); }
svg .reflab, svg .tick { fill: var(--ink-2); }
svg .big { font-family: var(--display); font-weight: 800; fill: var(--ink); }
svg [tabindex]:focus { outline: none; }
.fig > svg:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 4px; }
.chart-title { font-weight: 650; font-size: 16px; margin: 0 0 4px; }
.chart-sub { font-size: 14px; color: var(--ink-2); margin: 0 0 6px; }
.cap { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; max-width: 60em; }
.legend { display: flex; flex-wrap: wrap; gap: 0 14px; list-style: none; padding: 0; margin: 0 0 4px; font-size: 14px; color: var(--ink-2); }
.legend li, .lg { display: inline-flex; align-items: center; gap: 6px; }
.lg { background: none; border: 0; padding: 6px 2px; min-height: 34px; font: inherit; color: inherit; cursor: pointer; }
.lg[aria-pressed="false"] { opacity: 0.45; }
.lg[aria-pressed="false"] span { text-decoration: line-through; }
.key { width: 26px; height: 12px; flex: none; overflow: visible; }
.tip { position: absolute; z-index: 6; min-width: 160px; max-width: 290px; padding: 8px 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 2px 10px rgba(20, 18, 17, 0.1); font-size: 13px; line-height: 1.35; pointer-events: none; }
.tip-h { font-weight: 650; margin-bottom: 4px; }
.tip-r { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); gap: 6px; align-items: center; }
.tip-r strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-r span, .tip-x { color: var(--ink-2); }
.tip-x { margin-top: 4px; }
.tip sup, .stat sup, .wf sup, td sup { font-size: 0.72em; line-height: 0; }

/* readouts and figures */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5em, 1fr)); gap: 16px 24px; margin: 4px 0 20px; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.05; white-space: nowrap; }
.stat span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.35; margin-top: 4px; }
.stat.hl b { color: var(--verm); }

/* ---------------------------------------------------------------- hero */
.hero { padding-top: clamp(28px, 4vw, 52px); padding-bottom: clamp(24px, 3vw, 40px); }
.hero-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 48px; align-items: end; }
.byline { margin: 16px 0 2px; font-size: 17px; }
.byline a { font-weight: 650; }
.venue { margin: 0; font-size: 16px; color: var(--ink-2); }
.hero-actions { display: flex; flex-direction: column; gap: 10px; }
.hero-chart { position: relative; margin-top: clamp(20px, 3vw, 36px); }
.hero-chart .fig { height: clamp(380px, 54vh, 520px); }
.hero-note { position: absolute; left: 0; top: 6px; width: min(470px, 44%); z-index: 2; }
.hero-note .lede { font-size: 18px; line-height: 1.5; margin-bottom: 12px; }
.hero-cap { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
@media (max-width: 860px) {
  .hero-head { grid-template-columns: minmax(0, 1fr); }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .hero-note { position: static; width: auto; margin-top: 14px; }
  .hero-chart .fig { height: 330px; }
}

/* ---------------------------------------------------------------- key figures band */
.facts { background: var(--verm); color: var(--on-verm); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13em, 1fr)); gap: 28px 40px; }
.fact .num { font-family: var(--display); font-weight: 800; font-size: clamp(42px, 5vw, 64px); line-height: 1; margin: 0 0 10px; letter-spacing: -0.01em; white-space: nowrap; }
.fact p { margin: 0; font-size: 16px; line-height: 1.45; max-width: 24em; }
.facts .btn:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.facts h2 { color: var(--on-verm); }

/* ---------------------------------------------------------------- deep band (theory, footer) */
.deep { background: var(--deep); color: var(--on-deep); }
.deep .muted, .deep .cap { color: var(--deep-2); }
.deep .panel { background: transparent; border-color: color-mix(in srgb, var(--on-deep) 22%, transparent); }
.deep a { color: inherit; }
.thm { border-top: 3px solid var(--verm); padding-top: 14px; }
.thm h3 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.01em; }
.thm .katex-display { margin: 0.8em 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.syms { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 14px 0 0; font-size: 15px; }
.syms dt { font-weight: 650; }
.syms dd { margin: 0; color: var(--deep-2); }
.deep .syms dd { color: var(--deep-2); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
@media (max-width: 980px) { .cols3 { grid-template-columns: minmax(0, 1fr); } }
.enclosing[class*="sym-"] { cursor: help; border-radius: 3px; transition: background-color 0.15s; }
.enclosing[class*="sym-"]:hover, .enclosing[class*="sym-"]:focus { background: color-mix(in srgb, var(--verm) 35%, transparent); outline: none; }
.symtip { position: absolute; z-index: 40; max-width: 300px; padding: 8px 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; line-height: 1.4; pointer-events: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); }

/* ---------------------------------------------------------------- details, tables, code */
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
.deep details { border-color: color-mix(in srgb, var(--on-deep) 22%, transparent); }
summary { cursor: pointer; padding: 12px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary > span { flex: 1; }
summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; }
details[open] > summary::after { content: "\2212"; }
details > div { padding: 0 0 14px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th { font-weight: 650; color: var(--ink-2); }
th:first-child, td:first-child { text-align: left; }
pre { margin: 0; overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; font: 14px/1.55 var(--mono); }
code { font-family: var(--mono); font-size: 0.92em; }
.copyrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.copied { font-size: 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- widgets */
.cube { height: 360px; touch-action: pan-y; cursor: grab; }
.cube:active { cursor: grabbing; }
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); gap: 12px 20px; margin-top: 12px; }
.readouts div b { display: block; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readouts div span { font-size: 14px; color: var(--ink-2); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wf { display: grid; gap: 8px; margin-top: 8px; }
.wf-row { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr) 5.5em; gap: 10px; align-items: center; font-size: 14px; }
.wf-track { position: relative; height: 16px; background: linear-gradient(var(--gray), var(--gray)) 50% 0 / 1px 100% no-repeat; }
.wf-bar { position: absolute; top: 2px; height: 12px; border-radius: 2px; }
.wf-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-axis { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr) 5.5em; gap: 10px; font-size: 13px; color: var(--ink-2); }
.wf-axis div:nth-child(2) { display: flex; justify-content: space-between; }
.insp-sum { margin-top: 14px; font-size: 15px; }
@media (max-width: 600px) {
  .wf-row, .wf-axis { grid-template-columns: minmax(0, 1fr) 4.8em; }
  .wf-row .wf-lab { grid-column: 1 / -1; }
  .wf-axis div:first-child { display: none; }
}
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em; gap: 4px 12px; align-items: center; font-size: 15px; }
.bar-row .lab { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }
.bar-track { height: 14px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.25s; }
.bar-row .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .bar-fill { transition: none; } }
.schemes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 8px 0 28px; }
.scheme { border-top: 3px solid var(--ink); padding-top: 12px; }
.scheme.s-cob { border-color: var(--cobalt); }
.scheme.s-teal { border-color: var(--teal); }
.scheme.s-verm { border-color: var(--verm); }
.scheme p { font-size: 15px; margin: 6px 0 0; }
.scheme .fit { font-size: 16px; margin-top: 2px; }
@media (max-width: 900px) { .schemes { grid-template-columns: minmax(0, 1fr); } }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; font-size: 15px; }
.flow .node { border: 1px solid var(--rule); border-radius: 6px; padding: 7px 11px; background: var(--bg); text-align: center; line-height: 1.3; }
.flow .arr { font-size: 18px; }
.flow .node.hl { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.flow .arr { color: var(--ink-2); }
.scope { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
.scope li { border-top: 1px solid var(--rule); padding-top: 12px; }
.scope li b { display: block; margin-bottom: 4px; }
@media (max-width: 760px) { .scope { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- footer */
.foot { font-size: 15px; }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px 48px; }
.foot p { margin: 0 0 8px; }
.foot .links { display: grid; gap: 6px; align-content: start; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .lead { font-size: 17px; }
  .fig { height: 300px; }
  table { font-size: 13px; }
  th, td { padding: 6px 5px; }
}
