/* Daedalus website: one stylesheet, two themes. Design tokens on :root (dark) and :root[data-theme="light"]; components
   below, reading every colour from the tokens. */

:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e9ebf5;
  --muted: #9aa2bb;
  --faint: #6b7390;
  --accent: #34d399;
  --accent-deep: #059669;
  --cyan: #22d3ee;
  --orange: #ff922b;
  --green: #51cf66;
  --yellow: #ffc300;
  --red: #ff6b6b;
  --purple: #a78bfa;
  --grad: linear-gradient(110deg, #bbf7d0 0%, #34d399 38%, #22d3ee 100%);
  /* the colours that the CSS and the canvases share, beyond the palette above */
  --strong: #ffffff;
  --text-soft: #d7dbef;
  --prose: #cfd3e6;
  --link: #8ef0c4;
  --on-accent: #062a1f;
  --on-grad: #0b0d14;
  --well: #05060c;
  --field-input: rgba(0, 0, 0, 0.35);
  --inset: rgba(0, 0, 0, 0.3);
  --tag-bg: rgba(0, 0, 0, 0.6);
  --tag-text: #ffffff;
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --shadow: rgba(0, 0, 0, 0.8);
  --bar-bg: rgba(9, 11, 18, 0.72);
  --handle-bg: rgba(20, 23, 38, 0.8);
  --menu-bg: rgba(12, 14, 26, 0.92);
  /* the navigation's panels sit inside the blurred top bar, where a blur of their own cannot reach the page: opaque */
  --panel-bg: #0d101b;
  --scrim: rgba(0, 0, 0, 0.35);
  --lightbox-bg: rgba(4, 8, 8, 0.94);
  --badge-text: #c9f7e4;
  --error-text: #ffc9c9;
  --warn-text: #ffd8a8;
  --stage-bg: radial-gradient(ellipse at center, #0e2622 0%, #0a0c16 75%);
  --glow-1: rgba(52, 211, 153, 0.18);
  --glow-2: rgba(34, 211, 238, 0.08);
  --glow-3: rgba(52, 211, 153, 0.10);
  /* "r, g, b" triples, for rgba() in the CSS and in the canvases (theme.js:rgba) */
  --ink-rgb: 255, 255, 255;
  --bg-rgb: 9, 11, 18;
  --accent-rgb: 52, 211, 153;
  --mint-rgb: 110, 231, 183;
  --cyan-rgb: 34, 211, 238;
  --sky-rgb: 125, 211, 252;
  --yellow-rgb: 255, 195, 0;
  --orange-rgb: 255, 146, 43;
  --red-rgb: 255, 107, 107;
  --seam-rgb: 255, 236, 160;
  --mark-rgb: 255, 255, 255;
  --radius: 18px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --container: 1180px;
  --bar-h: 70px;  /* the top bar's height, which every offset under it follows */
}

/* the light theme: the same tokens, for a white page (theme.js; the toggle in the top bar) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: rgba(15, 23, 42, 0.035);
  --surface-2: rgba(15, 23, 42, 0.07);
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #141a2e;
  --muted: #4a5370;
  --faint: #6b7390;
  --accent: #047857;
  --accent-deep: #047857;
  --cyan: #0e7490;
  --orange: #d9480f;
  --green: #2b8a3e;
  --yellow: #b07800;
  --red: #e03131;
  --purple: #7048e8;
  --grad: linear-gradient(110deg, #059669 0%, #0d9488 45%, #0e7490 100%);
  --strong: #05070d;
  --text-soft: #2a3148;
  --prose: #2a3148;
  --link: #047857;
  --on-accent: #ffffff;
  --on-grad: #ffffff;
  --well: #eef1f6;
  --field-input: #ffffff;
  --inset: rgba(15, 23, 42, 0.05);
  --tag-bg: rgba(255, 255, 255, 0.86);
  --tag-text: #141a2e;
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7));
  --shadow: rgba(15, 23, 42, 0.16);
  --bar-bg: rgba(247, 248, 251, 0.82);
  --handle-bg: rgba(255, 255, 255, 0.85);
  --menu-bg: rgba(255, 255, 255, 0.95);
  --panel-bg: #ffffff;
  --scrim: rgba(15, 23, 42, 0.2);
  --lightbox-bg: rgba(247, 248, 251, 0.97);
  --badge-text: #065f46;
  --error-text: #c92a2a;
  --warn-text: #a64b00;
  --stage-bg: radial-gradient(ellipse at center, #e6f5ef 0%, #f7f8fb 75%);
  --glow-1: rgba(16, 185, 129, 0.13);
  --glow-2: rgba(14, 165, 233, 0.07);
  --glow-3: rgba(16, 185, 129, 0.08);
  --ink-rgb: 20, 26, 46;
  --bg-rgb: 247, 248, 251;
  --accent-rgb: 5, 150, 105;
  --mint-rgb: 12, 140, 98;
  --cyan-rgb: 14, 116, 144;
  --sky-rgb: 2, 132, 199;
  --yellow-rgb: 232, 160, 0;
  --orange-rgb: 232, 89, 12;
  --red-rgb: 224, 49, 49;
  --seam-rgb: 236, 168, 0;
  --mark-rgb: 20, 26, 46;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 28px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, var(--glow-2), transparent 60%),
    radial-gradient(800px 800px at 50% 120%, var(--glow-3), transparent 60%);
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--strong); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
::selection { background: rgba(var(--accent-rgb), 0.45); }

.container { width: min(var(--container), 100% - 48px); margin: 0 auto; }
.section { padding: 55px 0; position: relative; }
.section.tight { padding: 35px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--grad); border-radius: 2px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.reveal.visible { opacity: 1; transform: none; }
.static .reveal { transition: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* top bar (common.js:buildTopbar): the brand, the two groups of the navigation, the theme toggle */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--bar-h); display: flex; align-items: center;
  gap: 30px; padding: 0 26px; transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled, .topbar.menu-open { background: var(--bar-bg); backdrop-filter: blur(14px); border-color: var(--border); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.28rem; font-weight: 800; letter-spacing: 0.05em; color: var(--text); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
/* the Daedalus mark (assets/img/icon.svg, web/precompute/brand.py; also the favicon of every page) */
.brand-mark { width: 44px; height: 44px; flex: none; border-radius: 50%; background: url('../img/icon.svg') center / contain no-repeat; box-shadow: 0 0 16px rgba(168, 85, 31, 0.45); }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* the project's links in the top bar (common.js:projectLinks): small pills, icons alone on a phone; a placeholder is
   dimmed with a "soon" tooltip instead of the badge the page's buttons carry */
.top-links { display: flex; gap: 6px; }
.top-link {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--handle-bg); backdrop-filter: blur(10px); color: var(--text-soft); font-size: 0.88rem; font-weight: 600;
  text-decoration: none; transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.top-link:hover { background: var(--accent-deep); color: #fff; border-color: transparent; }
.top-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.top-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.top-link.placeholder-link { opacity: 0.6; cursor: default; }
.top-link.placeholder-link::after { content: none; }
.top-link.placeholder-link:hover { background: var(--handle-bg); color: var(--text-soft); border-color: var(--border); }
@media (max-width: 900px) { .top-link { width: 38px; padding: 0; justify-content: center; } .top-link span { display: none; } }
.nav-sheet-links { display: none; }
@media (max-width: 760px) {
  .topbar-end > .top-links { display: none; }
  .nav-sheet-links { display: block; }
  .nav-sheet-links .top-links { flex-wrap: wrap; }
  .nav-sheet-links .top-link { width: auto; padding: 0 14px; }
  .nav-sheet-links .top-link span { display: inline; }
}
/* the theme toggle (common.js:themeToggle), at the top of every page, on phones too */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--handle-bg); backdrop-filter: blur(10px);
  display: grid; place-items: center; cursor: pointer; color: var(--text); padding: 0; flex: none; transition: transform 0.25s, background 0.25s, color 0.25s;
}
.theme-toggle:hover { background: var(--accent-deep); color: #fff; transform: scale(1.06); }
.theme-toggle:focus-visible, .nav-toggle:focus-visible, .nav-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle svg path:only-child { fill: currentColor; stroke: none; }

/* the wide-screen navigation: a trigger per group, right after the brand, and its panel of icon tiles under the bar;
   both panels sit in one place, aligned with the left end of the groups, so that moving from one group to the other
   cross-fades them */
.topnav {
  position: relative; display: flex; gap: 4px; padding: 4px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--handle-bg);
}
.nav-trigger {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font: 600 0.92rem/1.4 var(--font); position: relative; transition: color 0.2s, background 0.2s;
}
.nav-trigger > svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s cubic-bezier(.2, .7, .2, 1); }
.nav-trigger:hover, .nav-trigger[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.nav-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); }
/* the small icon before the label of every group of the menu, in the bar and in the phone's sheet */
.nav-icon { display: inline-flex; margin-right: 6px; vertical-align: -2px; }
.nav-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-trigger .nav-icon { margin-right: 0; opacity: 0.8; }
/* the group of the page shown: its name in the accent, with a small mark under it */
.nav-trigger.current { color: var(--text); }
.nav-trigger.current::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 16px; height: 2px; margin-left: -11px; border-radius: 2px; background: var(--grad);
}
.nav-panel {
  position: absolute; top: calc(100% + 17px); left: -6px; width: 680px; max-width: calc(100vw - 32px); padding: 10px;
  border-radius: 20px; border: 1px solid var(--border-strong); background: var(--panel-bg);
  box-shadow: 0 28px 70px -24px var(--shadow), 0 2px 0 rgba(var(--ink-rgb), 0.03) inset;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: 0 0;
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear 0.32s;
}
/* a bridge over the gap between the bar and the panel, so that the pointer can travel down without closing it */
.nav-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -19px; height: 19px; }
.nav-panel.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.22s ease, transform 0.32s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
/* the method overview, where the articles start, spans the articles' panel */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.nav-tile {
  display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 14px; color: var(--text); min-width: 0;
  transition: background 0.2s, color 0.2s;
}
.nav-panel .nav-tile { opacity: 0; transform: translateY(4px); transition: background 0.2s, opacity 0.3s ease, transform 0.36s cubic-bezier(.2, .8, .2, 1); }
.nav-panel.open .nav-tile { opacity: 1; transform: none; transition-delay: 0s, calc(var(--i) * 22ms + 40ms), calc(var(--i) * 22ms + 40ms); }
.nav-tile:hover, .nav-tile:focus-visible { background: var(--surface-2); color: var(--strong); outline: none; }
.nav-tile:focus-visible { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.7) inset; }
.nav-ico {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; line-height: 1;
  color: var(--accent); background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.18);
  transition: background 0.25s, color 0.25s, transform 0.25s, border-color 0.25s;
}
.nav-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.nav-tile:hover .nav-ico, .nav-tile:focus-visible .nav-ico { background: var(--grad); color: var(--on-grad); border-color: transparent; transform: scale(1.05); }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav-text b { font-size: 0.95rem; font-weight: 650; }
.nav-text small { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
/* the page shown: its tile tinted, with a dot after its name */
.nav-tile.active { background: rgba(var(--accent-rgb), 0.12); }
.nav-tile.active b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.nav-more {
  display: flex; justify-content: flex-end; gap: 6px; margin: 6px 4px 0; padding: 10px 12px 4px; border-top: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600; color: var(--link);
}
.nav-more span { transition: transform 0.2s; }
.nav-more:hover span { transform: translateX(3px); }

/* the phone navigation: a menu button (three bars that turn into a cross) and a full-width sheet under the bar */
.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--handle-bg); backdrop-filter: blur(10px);
  cursor: pointer; padding: 0; color: var(--text); flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), opacity 0.2s; }
.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-sheet {
  display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - var(--bar-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px 22px; background: var(--panel-bg); border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -30px var(--shadow);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 0.38s cubic-bezier(.2, .8, .2, 1), visibility 0s linear 0.38s;
}
.menu-open .nav-sheet { clip-path: inset(0 0 -60px 0); visibility: visible; transition: clip-path 0.42s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.nav-sheet h6 { margin: 14px 4px 6px; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.nav-sheet .nav-grid { grid-template-columns: 1fr; gap: 0; }
.nav-sheet .nav-tile { padding: 8px 8px; opacity: 0; transform: translateY(-6px); transition: background 0.2s, opacity 0.3s ease, transform 0.36s cubic-bezier(.2, .8, .2, 1); }
.menu-open .nav-sheet .nav-tile { opacity: 1; transform: none; transition-delay: 0s, calc(var(--i) * 25ms + 60ms), calc(var(--i) * 25ms + 60ms); }
/* the demos in two columns of compact tiles, without their line, so that both groups fit a phone's screen */
.nav-sheet [data-group="demos"] .nav-grid { grid-template-columns: 1fr 1fr; gap: 2px; }
.nav-sheet [data-group="demos"] .nav-text small { display: none; }
.nav-sheet [data-group="demos"] .nav-tile { gap: 10px; padding: 7px 6px; }
.nav-sheet [data-group="demos"] .nav-text b { font-size: 0.9rem; }
.nav-sheet [data-group="demos"] .nav-ico { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
.nav-sheet .nav-more { justify-content: flex-start; padding-left: 8px; }
.nav-scrim { position: fixed; inset: 0; z-index: 39; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.nav-locked { overflow: hidden; }
.nav-locked .nav-scrim { opacity: 1; pointer-events: auto; }
@media (max-width: 760px) {
  .topbar { padding: 0 14px 0 16px; }
  .topnav { display: none; }
  .nav-toggle { display: flex; }
  .nav-sheet { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-panel, .nav-panel .nav-tile, .nav-sheet, .nav-sheet .nav-tile, .nav-toggle span, .nav-trigger svg { transition: none !important; }
}
/* the logos drawn in white for the dark page turn black on the light one */
:root[data-theme="light"] .logos .logo-eth, :root[data-theme="light"] .logos .logo-cmg { filter: brightness(0); opacity: 0.86; }
/* the two colour logos have white lettering: inverted in lightness with their hues kept */
:root[data-theme="light"] .logos .logo-camlab, :root[data-theme="light"] .logos .logo-ai { filter: invert(1) hue-rotate(180deg) saturate(1.3); }

/* buttons, chips */
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); cursor: pointer; font-family: inherit;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); background: var(--surface-2); color: var(--strong); border-color: rgba(var(--ink-rgb), 0.3); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-grad); box-shadow: 0 10px 30px -8px rgba(var(--accent-rgb), 0.7); }
.btn.primary:hover { box-shadow: 0 14px 40px -8px rgba(var(--cyan-rgb), 0.6); color: var(--on-grad); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .ico { font-size: 1.05em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.placeholder-link { position: relative; }
.placeholder-link::after {
  content: "soon"; position: absolute; top: -9px; right: -6px; font-size: 0.62rem; padding: 2px 6px; border-radius: 999px;
  background: var(--orange); color: #111; font-weight: 800; letter-spacing: 0.05em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 0.88rem; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: rgba(var(--accent-rgb), 0.25); border-color: var(--accent); color: var(--strong); box-shadow: 0 0 0 1px var(--accent) inset; }

/* cards */
.card {
  background: var(--card-grad); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: 0 20px 50px -30px var(--shadow); position: relative;
}
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; } }

/* hero */
.hero { min-height: min(100vh, 980px); display: flex; align-items: center; padding: calc(var(--bar-h) + 48px) 0 70px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 40px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.9rem); font-weight: 850; margin-bottom: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  border: 1px solid rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.14); color: var(--badge-text); margin-bottom: 20px;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.authors { font-size: 1.04rem; margin-bottom: 4px; }
.authors span { color: var(--text); font-weight: 600; }
.authors sup { color: var(--cyan); font-weight: 700; margin-left: 1px; }
.affils { font-size: 0.86rem; color: var(--muted); margin-bottom: 26px; }
.affils sup { color: var(--cyan); }
.tldr {
  border-left: 3px solid var(--accent); padding: 14px 18px; margin: 0 0 28px; background: rgba(var(--accent-rgb), 0.08); border-radius: 0 12px 12px 0;
  color: var(--text-soft); font-size: 1.02rem;
}
.tldr b { color: var(--strong); }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 24px 0 30px; }
.logos img { width: auto; opacity: 0.92; transition: opacity 0.2s; }
.logos img:hover { opacity: 1; }
.logos .logo-eth { height: 24px; }
.logos .logo-camlab { height: 50px; }
.logos .logo-ai { height: 44px; }
.logos .logo-cmg { height: 54px; }
.hero-visual { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.hero-visual canvas { width: 100%; height: 100%; display: block; }
.hero-caption {
  position: absolute; bottom: -5%; left: 50%; transform: translateX(-50%); font-size: 0.82rem; color: var(--muted); white-space: nowrap;
  padding: 6px 14px; border-radius: 999px; background: rgba(var(--bg-rgb), 0.7); border: 1px solid var(--border);
}

/* numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat .value { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 850; letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px; }
.stat .label { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
/* the performance headlines: seven numbers on one card each (a number, a title, a sentence and the setting in small
   print), a title above and the common condition below; the last card spans two columns so the rows close */
.stats.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.seven > .stat:last-child { grid-column: span 2; }
@media (max-width: 1100px) { .stats.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats.seven { grid-template-columns: minmax(0, 1fr); } .stats.seven > .stat:last-child { grid-column: auto; } }
.stat .stat-title { color: var(--text); font-weight: 700; font-size: 1rem; line-height: 1.3; margin-bottom: 6px; }
.headlines-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 34px 0 14px; }
.headlines-note { margin: 14px 0 0; color: var(--text); font-size: 0.95rem; }
/* the projected headlines: two more cards in the same style, set apart by a dashed border, a muted number and a
   "projected" tag, under a title of their own; the measured cards above stay as they are */
.projected-title { margin-top: 30px; }
.stats.projected { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .stats.projected { grid-template-columns: minmax(0, 1fr); } }
.stats.projected .stat { display: flex; flex-direction: column; border-style: dashed; border-color: rgba(var(--accent-rgb), 0.4); background: transparent; }
.stats.projected .stat .value { opacity: 0.78; }
.stats.projected .proj-tag {
  align-self: flex-start; display: inline-block; margin-bottom: 12px; padding: 2px 8px; border-radius: 999px; border: 1px dashed rgba(var(--accent-rgb), 0.55);
  color: var(--muted); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.5;
}

/* the journey */
.stage-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 12px; }
@media (max-width: 760px) { .stage-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stage-tab {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; row-gap: 2px; align-items: center;
  text-align: left; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; font-family: inherit; font-size: 0.9rem; position: relative; overflow: hidden; transition: color 0.25s, border-color 0.25s;
}
.stage-tab b { color: var(--text); font-size: 0.98rem; line-height: 1.25; }
.stage-tab .sub { grid-column: 2; font-size: 0.86rem; line-height: 1.3; }
.stage-tab .letter {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-deep); color: #fff;
  font-weight: 800; font-size: 0.8rem;
}
.stage-tab.active { border-color: var(--accent); color: var(--text-soft); }
.stage-tab .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--grad); }
.stage-canvas-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--stage-bg); }
.stage-canvas-wrap canvas { width: 100%; height: auto; display: block; aspect-ratio: 16 / 7.4; }
/* the journey's pause/play button, in the bottom-right corner of the canvas */
.stage-play {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--handle-bg); backdrop-filter: blur(10px); color: var(--text); cursor: pointer; padding: 0; display: grid; place-items: center;
  opacity: 0.75; transition: opacity 0.2s, transform 0.2s, background 0.2s, color 0.2s;
}
.anim-wrap { position: relative; }
.stage-canvas-wrap:hover .stage-play, .anim-wrap:hover .stage-play, .stage-play:focus-visible, .stage-play.paused { opacity: 1; }
.stage-play:hover { background: var(--accent-deep); color: #fff; transform: scale(1.06); }
.stage-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-play svg { width: 17px; height: 17px; fill: currentColor; }
/* on a phone the canvas is short: the button keeps to the corner below the labels */
@media (max-width: 600px) { .stage-play { right: 5px; bottom: 5px; width: 26px; height: 26px; } .stage-play svg { width: 12px; height: 12px; } }
/* the stage's description, top right between the step cells and the canvas */
.stage-caption {
  /* the stage's description, over the top of the canvas on a soft shadow so that the figure keeps its height */
  position: absolute; top: 10px; left: 0; right: 0; z-index: 2; width: fit-content; max-width: min(820px, calc(100% - 32px)); margin: 0 auto;
  padding: 8px 16px; border-radius: 12px; text-align: center; color: var(--text-soft); font-size: 0.95rem; line-height: 1.45;
  background: rgba(var(--bg-rgb), 0.62); box-shadow: 0 6px 28px 10px rgba(var(--bg-rgb), 0.55); backdrop-filter: blur(6px);
  pointer-events: none; transition: opacity 0.3s;
}
/* on a phone the canvas is too short to carry it: the description sits below the figure */
@media (max-width: 760px) {
  .stage-caption { position: static; width: auto; max-width: none; margin: 0; padding: 10px 12px 12px; border-radius: 0; box-shadow: none; backdrop-filter: none; background: transparent; color: var(--muted); font-size: 0.9rem; }
  .stage-canvas-wrap { display: flex; flex-direction: column-reverse; }
}
.stage-caption b { color: var(--text); }

/* geodesic module */
.geo { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .geo { grid-template-columns: 1fr 1fr; } .geo .globe-panel { grid-column: 1 / -1; } }
@media (max-width: 600px) { .geo { grid-template-columns: 1fr; } }
.panel { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 14px; }
.panel h4 { font-size: 0.95rem; margin: 2px 4px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel h4 small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 0.8rem; }
.panel canvas, .panel .frame { width: 100%; aspect-ratio: 1; display: block; border-radius: 12px; }
.frame-wrap { position: relative; }
.frame-tag {
  position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: 0.78rem; padding: 3px 9px; border-radius: 8px;
  background: var(--tag-bg); color: var(--tag-text);
}
.frame-tag.anchor { background: rgb(var(--yellow-rgb)); color: #111; font-weight: 700; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.controls .grow { flex: 1 1 260px; }
.play {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; background: var(--grad); color: var(--on-grad); font-size: 1.1rem;
  display: grid; place-items: center; box-shadow: 0 8px 26px -6px rgba(var(--accent-rgb), 0.8);
}
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--surface-2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.84rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; }
.legend i.dash { background: repeating-linear-gradient(90deg, rgb(var(--sky-rgb)) 0 5px, transparent 5px 9px); }
/* a compact key under a small chart (the series of the chart, named where the caption used to be the only key) */
.legend.chart-key { gap: 4px 12px; font-size: 0.74rem; margin-top: 6px; }
.legend i.box { width: 12px; height: 9px; border-radius: 3px; }
.legend i.dashed { background: none !important; border-top: 2px dashed currentColor; height: 0; }
.chart { width: 100%; height: 120px; display: block; }

/* compare slider */
.compare { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: ew-resize; user-select: none; touch-action: pan-y; background: var(--well); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgb(var(--yellow-rgb)); box-shadow: 0 0 12px rgba(var(--yellow-rgb), 0.8); }
.compare .divider::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  background: rgb(var(--yellow-rgb)); color: #111; display: grid; place-items: center; font-weight: 800;
}
.compare .tag { position: absolute; top: 10px; font-size: 0.72rem; padding: 3px 8px; border-radius: 6px; background: var(--tag-bg); color: var(--tag-text); }
.compare .tag.l { left: 10px; } .compare .tag.r { right: 10px; }
.gallery-card .meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; margin-top: 12px; }
.gallery-card .meta .what, .gallery-card .meta .count { grid-column: 1 / -1; color: var(--muted); }
.gallery-card .meta .count:empty { display: none; }
.gallery-card .meta b { font-size: 0.98rem; }
.gallery-card .meta span { color: var(--muted); font-size: 0.82rem; }
.gallery-card .metric { font-family: var(--mono); font-size: 0.82rem; color: var(--cyan); white-space: nowrap; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 26px; }
.tabs button { border: none; background: none; color: var(--muted); padding: 8px 18px; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 600; }
.tabs button.active { background: var(--accent-deep); color: #fff; }

/* direction explorer */
.explorer { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .explorer { grid-template-columns: 1fr; } }
.anchors { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 14px 0; }
.anchors img { border-radius: 10px; aspect-ratio: 1; width: 100%; }
.anchors .arrow { color: var(--yellow); font-size: 1.4rem; }
.anchors figcaption { font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 4px; }
.strip-view { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--well); box-shadow: 0 30px 70px -30px rgba(var(--accent-rgb), 0.55); }
.ex-stage { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; align-items: start; }
@media (max-width: 700px) { .ex-stage { grid-template-columns: 1fr; } }
.ex-side { display: flex; flex-direction: column; gap: 14px; }
.ex-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ex-thumbs canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.ex-thumbs canvas.active { border-color: var(--yellow); }
.ex-thumbs span { display: block; text-align: center; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.coef { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--yellow); }

/* findings */
.finding { display: flex; gap: 16px; }
.finding .icon { flex: none; width: 84px; height: 84px; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem; background: rgba(var(--accent-rgb), 0.08); border: 1px solid rgba(var(--accent-rgb), 0.3); overflow: hidden; }
.finding-anim { width: 100%; height: 100%; display: block; }
.finding h3 { font-size: 1.08rem; margin-bottom: 6px; }
.finding p { color: var(--muted); font-size: 0.95rem; margin: 0; }
/* a finding's "Show more" on a line of its own, under its lead */
.finding .desc-toggle { display: block; margin-top: 6px; padding-left: 0; }

/* demo cards */
.demo-card { display: block; color: var(--text); transition: transform 0.25s, border-color 0.25s; overflow: hidden; }
.demo-card:hover { transform: translateY(-5px); border-color: var(--accent); color: var(--text); }
/* the thumb keeps the covers' own aspect (precompute/covers.py: 1200 x 750), so no cover is cropped */
.demo-card .thumb { aspect-ratio: 1200 / 750; border-radius: 12px; margin: -6px -6px 18px; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.demo-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(var(--bg-rgb), 0.8)); }
.demo-card p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.demo-card .go { margin-top: 14px; color: var(--cyan); font-weight: 600; font-size: 0.9rem; }

/* bibtex */
pre.bib { background: var(--well); border: 1px solid var(--border); border-radius: 14px; padding: 22px; overflow-x: auto; font-size: 0.85rem; color: var(--text-soft); margin: 0; }
.copy { position: absolute; top: 14px; right: 14px; }

/* footer */
footer { padding: 50px 0 70px; color: var(--faint); font-size: 0.86rem; border-top: 1px solid var(--border); }
footer a { color: var(--muted); }

/* article (blog) */
.article { max-width: 820px; margin: 0 auto; }
.article h2 { font-size: 1.85rem; margin-top: 2.2em; }
.article h3 { margin-top: 1.8em; }
.article p, .article li { color: var(--prose); }
.article figure { margin: 34px 0; }
/* a figure narrower than its column is centred in it (an image is a block, which would otherwise sit at the left) */
.article figure img { border-radius: 14px; background: rgba(var(--ink-rgb), 0.02); border: 1px solid var(--border); padding: 10px; margin-left: auto; margin-right: auto; }
.article figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 10px; }
.article .wide { margin-left: -12%; margin-right: -12%; }
@media (max-width: 1280px) { .article .wide { margin-left: 0; margin-right: 0; } }
.callout { border: 1px solid rgba(var(--cyan-rgb), 0.35); background: rgba(var(--cyan-rgb), 0.07); border-radius: 14px; padding: 16px 20px; margin: 26px 0; }
.toc { position: sticky; top: calc(var(--bar-h) + 28px); font-size: 0.88rem; }
.toc a { display: block; color: var(--muted); padding: 5px 0 5px 12px; border-left: 2px solid var(--border); }
.toc a:hover, .toc a.active { color: var(--strong); border-color: var(--accent); }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 50px; }
@media (max-width: 1000px) { .article-layout { grid-template-columns: 1fr; } .toc { display: none; } }

/* live demos */
.page-head { padding: calc(var(--bar-h) + 68px) 0 30px; }
.demo-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px 26px; align-items: start; grid-template-areas: "bar bar" "input result"; }
/* every demo: the small settings in a bar across the top, the input in the left panel, the result on the right; the
   form spans the bar and the panel (display: contents, so both are items of the layout's grid) */
.demo-form { display: contents; }
.settings-bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; padding: 16px 20px; }
.demo-input { grid-area: input; min-width: 0; }
.demo-layout > #result { grid-area: result; min-width: 0; }
.setting { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 0 1 auto; }
.setting[hidden] { display: none; }
.setting > label, .setting-label { font-weight: 600; font-size: 0.84rem; color: var(--text-soft); white-space: nowrap; }
.setting-label small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.setting select, .setting input[type=number] { width: auto; min-width: 118px; max-width: 100%; padding: 8px 12px; font-size: 0.9rem; }
.setting input[type=number] { width: 118px; }
.setting .segmented { width: auto; }
.setting .segmented button { flex: 0 0 auto; white-space: nowrap; }
.setting-wide { flex: 1 1 100%; }
/* a setting as a slider (the perturbations' strength): the value beside the label, the slider wide enough to step */
.setting-slider { flex: 1 1 260px; max-width: 420px; }
.setting-slider label small { color: var(--accent); font-weight: 700; margin-left: 6px; font-variant-numeric: tabular-nums; }
.setting-slider input[type=range] { width: 100%; min-width: 180px; accent-color: var(--accent); }
@media (max-width: 980px) { .demo-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "input" "result"; } }
@media (max-width: 560px) { .settings-bar { padding: 14px; gap: 12px 14px; } .setting { flex: 1 1 calc(50% - 7px); } .setting-seg { flex-basis: 100%; } .setting select, .setting input[type=number] { width: 100%; min-width: 0; } .setting-wide, .setting-slider { flex-basis: 100%; max-width: none; } .setting .segmented { width: 100%; } .setting .segmented button { flex: 1 1 auto; white-space: normal; } }
.form-group { margin-bottom: 20px; }
.form-group > label, .form-label { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.form-group > label small, .form-label small { color: var(--muted); font-weight: 500; text-align: right; margin-left: auto; }
/* in one column, the input panel's square widgets keep a reading size */
@media (max-width: 980px) { .demo-input .fi-stage, .demo-input .painter { max-width: 460px; margin-left: auto; margin-right: auto; } }
select, input[type=text], input[type=number], textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--field-input);
  color: var(--text); font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
textarea, input.code { font-family: var(--mono); font-size: 0.9rem; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25); }
.mode.rgb { background: linear-gradient(90deg, #ff6b6b, #51cf66, #4dabf7); color: #111; }
.status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 0.92rem; margin-top: 16px; }
.status.error { border-color: rgba(var(--red-rgb), 0.5); background: rgba(var(--red-rgb), 0.08); color: var(--error-text); }
.status.ok { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.07); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--surface-2); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.server-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.server-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.server-pill.on .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.server-pill.off .dot { background: var(--red); }
.result-stage { min-height: 420px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.viewer { width: 100%; }
.viewer .frame-box { position: relative; border-radius: 16px; overflow: hidden; background: var(--well); aspect-ratio: 1; max-width: 560px; margin: 0 auto; cursor: ns-resize; }
.viewer .frame-box img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.viewer .readout { display: flex; justify-content: space-between; align-items: center; margin: 14px auto 0; max-width: 560px; gap: 14px; }
.viewer .hint { font-size: 0.8rem; color: var(--faint); text-align: center; margin-top: 8px; }
.numbers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; justify-content: center; }
.numbers span { font-family: var(--mono); font-size: 0.82rem; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.trio figure, .quad figure { margin: 0; }
.trio figcaption, .quad figcaption { font-size: 0.84rem; color: var(--muted); text-align: center; margin-top: 6px; }
.trio img, .quad img { width: 100%; border-radius: 12px; background: var(--well); aspect-ratio: 1; object-fit: contain; }
/* the reconstruction demo's disk: everything outside it is transparent, with no well behind it */
.quad img { background: none; border-radius: 0; }
.quad .fig-media { border-radius: 50%; }
.quad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.bench { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 22px; align-items: start; margin-top: 28px; }
.bench figure { margin: 0; }
.bench img { width: 100%; height: auto; }
.bench figcaption { font-size: 0.84rem; color: var(--muted); margin-top: 10px; }
@media (max-width: 760px) { .trio, .bench { grid-template-columns: 1fr; } .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { font-size: 0.84rem; color: var(--faint); }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.examples button { font-family: var(--mono); font-size: 0.74rem; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.examples button:hover { color: var(--strong); border-color: var(--accent); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.dir-option { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 0.82rem; color: var(--muted); text-align: left; font-family: inherit; }
/* the anchors A -> B in a row, the name of the edit under them */
.dir-option { flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.dir-option span { flex-basis: 100%; min-width: 0; text-align: center; line-height: 1.25; }
.dir-option img { flex: none; }
.dir-option img { width: 30px; height: 30px; border-radius: 6px; }
.dir-option.active { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.18); color: var(--strong); }

/* the drifting topographic backdrop (backdrop.js) */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; filter: blur(0.35px); }

/* how it works (every demo page) */
.how { padding-top: 10px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px 18px; margin-top: 26px; }
.how-step { position: relative; padding: 24px 22px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.how-step .num {
  position: absolute; top: -13px; left: 18px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: var(--on-grad); font-weight: 800; font-size: 0.85rem;
}
.how-step h3 { font-size: 1.02rem; margin: 6px 0 8px; }
.how-step p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.how-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.how-links a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.88rem; }
.how-links a:hover { border-color: var(--accent); }
.how .formula { font-family: var(--mono); font-size: 0.86rem; color: var(--text-soft); background: var(--inset); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
@media (max-width: 560px) { .how .formula { white-space: normal; overflow-wrap: anywhere; } }
.how .caveat { margin-top: 18px; color: var(--muted); font-size: 0.9rem; }

/* demo helpers */
.estimate { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin-top: 10px; text-align: center; }
.estimate.over { color: var(--error-text); }
.store-note { font-size: 0.78rem; color: var(--faint); margin-top: 12px; }
.offline-banner { margin-top: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(var(--orange-rgb), 0.5); background: rgba(var(--orange-rgb), 0.08); color: var(--warn-text); font-size: 0.9rem; }
.status .btn { margin-left: auto; padding: 6px 14px; font-size: 0.82rem; }
.segmented { display: flex; padding: 4px; border-radius: 12px; background: var(--inset); border: 1px solid var(--border); width: 100%; }
.segmented button { flex: 1; border: none; background: none; color: var(--muted); padding: 8px 10px; border-radius: 9px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.88rem; }
.segmented button.active { background: var(--accent-deep); color: #fff; }
.painter { position: relative; border-radius: 14px; overflow: hidden; background: var(--well); aspect-ratio: 1; touch-action: none; cursor: crosshair; border: 1px solid var(--border); }
.painter canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.painter .hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 0.88rem; pointer-events: none; text-align: center; padding: 20px; }
.painter-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.painter-tools .chip { padding: 6px 12px; font-size: 0.8rem; }
.painter-tools input[type=range] { flex: 1 1 90px; }
.match-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
@media (max-width: 700px) { .match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.match { border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.match:hover { transform: translateY(-3px); border-color: var(--accent); }
.match canvas { width: 100%; aspect-ratio: 1; display: block; }
.match .info { padding: 8px 10px; font-size: 0.78rem; }
.match .info b { display: block; color: var(--text); font-size: 0.82rem; }
.match .info span { color: var(--muted); font-family: var(--mono); }
.perturb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.perturb-grid figure { margin: 0; }
.perturb-grid img { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--well); }
.perturb-grid figcaption { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 4px; }
.perturb-grid figure.original img { box-shadow: 0 0 0 2px var(--yellow); }
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.partitions-toggle { align-items: center; }
.partitions-toggle > span:first-child { color: var(--muted); font-size: 0.82rem; padding: 0 8px 0 12px; }
.partitions-toggle #gallery-partitions { display: inline-flex; }
.partitions-toggle button { font-family: var(--mono); min-width: 52px; }

/* figure zoom (lightbox.js) */
img.zoomable { cursor: zoom-in; transition: box-shadow 0.2s; }
img.zoomable:hover { box-shadow: 0 0 0 2px var(--accent); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: var(--lightbox-bg); display: flex; flex-direction: column; }
.lb-stage { flex: 1; overflow: hidden; display: grid; place-items: center; cursor: grab; touch-action: none; }
.lb-stage img { max-width: 94vw; max-height: 84vh; transform-origin: center; user-select: none; background: rgba(var(--ink-rgb), 0.02); border-radius: 8px; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); }
.lb-caption { flex: 1; color: var(--muted); font-size: 0.85rem; max-height: 3.2em; overflow: hidden; }
.lb-zoom { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; min-width: 48px; text-align: right; }
.lb-bar .btn { padding: 6px 14px; }

/* the demos' input: samples, upload or painting (demo.js:fieldInput) */
.field-input { display: grid; gap: 10px; }
.segmented.small { padding: 3px; border-radius: 10px; }
.segmented.small button { padding: 5px 8px; font-size: 0.8rem; border-radius: 7px; }
.fi-stage {
  position: relative; aspect-ratio: 1; width: 100%; border-radius: 14px; overflow: hidden; background: var(--well);
  border: 1px dashed var(--border-strong); display: grid; place-items: center; outline: none;
}
.field-input .fi-stage { max-width: 380px; margin: 0 auto; }
.fi-stage.clickable { cursor: pointer; }
.fi-stage.clickable:hover, .fi-stage.drag { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.07); }
.fi-stage:focus-visible { border-color: var(--accent); }
.fi-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fi-stage .painter { position: absolute; inset: 0; border: none; border-radius: 0; aspect-ratio: auto; }
.fi-stage .mode { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 0.66rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.06em; pointer-events: none; }
.mode.gray { background: linear-gradient(90deg, #093691, #ffffff, #911b09); color: #111; }
:root[data-theme="light"] .mode.gray { background: linear-gradient(90deg, #8ea6d6, #093691, #000000, #911b09, #d6958e); color: #fff; }
.fi-caption { position: absolute; left: 8px; bottom: 8px; z-index: 2; max-width: calc(100% - 16px); font-size: 0.74rem; padding: 2px 8px; border-radius: 6px; background: var(--tag-bg); color: var(--tag-text); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-prompt { position: relative; z-index: 1; color: var(--faint); font-size: 0.88rem; text-align: center; padding: 16px; pointer-events: none; }
.fi-stage[data-label]::before { content: attr(data-label); position: absolute; top: 7px; left: 8px; z-index: 3; font-weight: 800; font-size: 0.75rem; padding: 2px 7px; border-radius: 6px; background: var(--accent); color: var(--on-accent); pointer-events: none; }
.fi-panel { display: grid; gap: 8px; }
.fi-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); font-weight: 700; }
.fi-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 7px; }
.fi-thumb { display: grid; gap: 3px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 0.64rem; line-height: 1.2; cursor: pointer; text-align: center; transition: border-color 0.15s, transform 0.15s; }
.fi-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; display: block; }
.fi-thumb span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; overflow-wrap: anywhere; hyphens: auto; }
.fi-thumb:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.fi-thumb.active { border-color: var(--accent); color: var(--strong); box-shadow: 0 0 0 1px var(--accent) inset; }
.painter-tools .segmented { width: 100%; }
.tool-range { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); flex: 1 1 140px; }
.tool-range input { flex: 1; min-width: 60px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.painter-tools select { flex: 0 1 auto; width: auto; padding: 5px 8px; font-size: 0.8rem; }
/* pre-computed sample sets of the demos with several inputs: thumbnails in a row per set */
.sample-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sample-set { display: grid; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 0.72rem; cursor: pointer; text-align: left; }
.sample-set .row { display: flex; align-items: center; gap: 4px; }
.sample-set img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.sample-set .arrow { color: var(--faint); font-size: 0.8rem; }
.sample-set:hover { border-color: var(--border-strong); color: var(--text); }
.sample-set.active { border-color: var(--accent); color: var(--strong); box-shadow: 0 0 0 1px var(--accent) inset; }
/* the slots of the demos with several inputs (demo.js:slotInputs) */
.slots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.slot { position: relative; display: grid; justify-items: center; gap: 4px; padding: 7px 6px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 0.74rem; cursor: pointer; transition: border-color 0.15s; }
.slot img, .slot-empty { width: 100%; max-width: 96px; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.slot-empty { display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--faint); font-size: 0.7rem; }
.slot-label { position: absolute; top: 4px; left: 6px; z-index: 1; font-weight: 800; font-size: 0.72rem; padding: 1px 6px; border-radius: 5px; background: var(--accent); color: var(--on-accent); }
.slot:hover { border-color: var(--border-strong); color: var(--text); }
.slot.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--strong); }
.credits { display: grid; gap: 8px; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.credits a { color: var(--text); }
.result-stage .idle-canvas { display: block; width: min(300px, 72%); aspect-ratio: 1; margin: 0 auto 14px; opacity: 0.9; }
button.match { display: block; width: 100%; padding: 0; font: inherit; color: inherit; text-align: left; }
button.match:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a result that no longer matches the form (demo.js:formGuard), until the page shows a new one */
#result { position: relative; }
#result.stale > * { opacity: 0.4; transition: opacity 0.2s; }
#result.stale::after { content: "out of date: the input or the settings changed"; position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 8px; font-size: 0.78rem; color: var(--warn-text); background: rgba(var(--bg-rgb), 0.85); border: 1px solid var(--orange); }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* an optional detail of an article, folded */
details.aside { margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; background: var(--surface); }
details.aside > summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
details.aside[open] > summary { color: var(--text); }
.compare:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* headline cards: accuracy (violet) and performance (amber) groups, each a filled card in its own colour; the projected
   performance cards are filled too, with a dashed rim */
:root { --acc-rgb: 167, 139, 250; --perf-rgb: 251, 191, 36; --acc-ink: #c4b5fd; --perf-ink: #fcd34d; }
:root[data-theme="light"] { --acc-rgb: 109, 40, 217; --perf-rgb: 180, 83, 9; --acc-ink: #6d28d9; --perf-ink: #b45309; }
.stats.acc .stat, .ops-tiles .ops-tile { background: linear-gradient(160deg, rgba(var(--acc-rgb), 0.13), rgba(var(--acc-rgb), 0.04)); border-color: rgba(var(--acc-rgb), 0.38); }
.stats.acc .stat .value.gradient-text { background: linear-gradient(110deg, var(--acc-ink), rgb(var(--acc-rgb))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ops-tiles .ops-tile .v { color: var(--acc-ink); }
.stats.perf .stat { background: linear-gradient(160deg, rgba(var(--perf-rgb), 0.12), rgba(var(--perf-rgb), 0.035)); border-color: rgba(var(--perf-rgb), 0.38); }
.stats.perf .stat .value.gradient-text { background: linear-gradient(110deg, var(--perf-ink), rgb(var(--perf-rgb))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats.perf .stat-title { color: var(--perf-ink); }
.stats.projected.perf .stat { background: linear-gradient(160deg, rgba(var(--perf-rgb), 0.09), rgba(var(--perf-rgb), 0.025)); border-style: dashed; border-color: rgba(var(--perf-rgb), 0.6); }
.stats.projected.perf .stat .value { opacity: 1; }
.stats.projected.perf .proj-tag { color: var(--perf-ink); border-color: rgba(var(--perf-rgb), 0.6); background: rgba(var(--perf-rgb), 0.1); }
.headlines-title.perf-title { color: var(--perf-ink); }
/* the small visual of every performance card (assets/js/perf-viz.js): a badge in the top-right corner, beside the big
   number, with the title and the sentence below them across the whole card; the canvas keeps the 2:1 aspect of the
   module's design box */
.stats.perf .stat.has-viz { --viz-w: 140px; position: relative; }
/* a fixed width (not a share of the card), since the number's min-height must resolve it too: narrower on the home
   page's four cards per row */
@media (min-width: 1101px) { .stats.seven.rows .stat.has-viz { --viz-w: 112px; } }
.stats.perf .stat.has-viz > .perf-viz { position: absolute; top: 12px; right: 12px; width: var(--viz-w); }
/* the number keeps clear of the badge on its right and is as tall as it, so the title below never meets it */
.stats.perf .stat.has-viz > .value {
  padding-right: calc(var(--viz-w) + 6px); min-height: calc(var(--viz-w) / 2 - 4px); display: flex; align-items: center;
  margin-bottom: 4px; font-size: clamp(1.9rem, 3vw, 2.4rem);
}
.perf-viz canvas { display: block; width: 100%; aspect-ratio: 2 / 1; height: auto; }

/* "Related articles" at the end of every article (common.js:buildRelated): the top bar's tiles, as cards */
.related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.related h2 { margin: 0 0 16px; font-size: 1.25rem; }
.related .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related .nav-tile { border: 1px solid var(--border); background: var(--surface); }
.related .nav-tile:hover { border-color: rgba(var(--accent-rgb), 0.5); }
@media (max-width: 560px) { .related .related-grid { grid-template-columns: minmax(0, 1fr); } }

/* an article's heading is its name in the menu; its own title follows as a subtitle */
.article-subtitle { margin: -4px 0 14px; font-size: clamp(1.1rem, 1.9vw, 1.45rem); font-weight: 600; color: var(--text-soft); letter-spacing: -0.01em; }

/* the shortcut on every globe to the interactive sphere of the interpretability article (common.js:buildGlobeLinks) */
.has-globe-link { position: relative; }
.globe-link {
  position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), 0.45); background: var(--handle-bg); backdrop-filter: blur(8px);
  color: var(--accent); font-size: 0.78rem; font-weight: 700; text-decoration: none; transition: background 0.2s, color 0.2s, transform 0.2s;
}
.globe-link:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); }
.globe-link span { font-size: 1rem; line-height: 1; }
/* in the journey, only on the stage that shows the hypersphere, in the corner left free by the pause button */
.stage-canvas-wrap .globe-link { display: none; top: auto; right: auto; bottom: 12px; left: 12px; }
.stage-canvas-wrap[data-stage="3"] .globe-link { display: inline-flex; }
/* in a globe panel the corner holds the panel's heading: the shortcut follows its legend instead */
.globe-panel .globe-link { position: static; margin-top: 12px; width: fit-content; }

/* the reset button after every range slider (common.js:buildResets) */
.range-reset {
  flex: none; width: 24px; height: 24px; margin-left: 6px; padding: 0; border-radius: 50%; border: 1px solid var(--border);
  background: var(--handle-bg); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; vertical-align: middle;
  transition: color 0.2s, background 0.2s, transform 0.25s;
}
.range-reset:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); transform: rotate(-60deg); }
.range-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.range-reset svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.range-wrap { display: flex; align-items: center; width: 100%; }
.range-wrap input[type=range] { flex: 1 1 auto; min-width: 0; }

/* section links on every h2 (common.js:sectionLinks): a link mark after the heading, shown on hover or focus, and a
   short note when a link is copied */
.has-anchor { position: relative; }
.anchor-link {
  display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; margin-left: 0.35em; vertical-align: middle; border-radius: 6px;
  color: var(--faint); opacity: 0; transition: opacity 0.2s, color 0.2s, background 0.2s; text-decoration: none;
}
.anchor-link svg { width: 0.62em; height: 0.62em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.has-anchor:hover .anchor-link, .anchor-link:focus-visible { opacity: 1; }
.anchor-link:hover { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.anchor-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* on touch screens there is no hover: the mark stays faintly visible */
@media (hover: none) { .anchor-link { opacity: 0.45; } }
.copy-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 60; padding: 8px 16px; border-radius: 999px;
  background: var(--handle-bg); backdrop-filter: blur(10px); border: 1px solid rgba(var(--accent-rgb), 0.5); color: var(--text);
  font-size: 0.88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.copy-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* a long description folded to its bold lead and a "Show more" (common.js:collapseDescriptions) */
.has-more .desc-lead { font-weight: 700; color: var(--text); }
.has-more .desc-more[hidden] { display: none; }
.desc-toggle { display: inline; padding: 0; margin: 0 0 0 2px; border: none; background: none; font: inherit; font-weight: 600;
  color: var(--accent); cursor: pointer; white-space: nowrap; }
.desc-toggle:hover { text-decoration: underline; }

/* the section navigator (section-nav.js): on a laptop a rail of ticks at the left edge, the names shown on hover; on a
   phone a small handle that shows while the page scrolls and opens the list when touched */
.secnav { position: fixed; z-index: 60; left: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.secnav-off { display: none; }
.secnav-grip { display: none; }
.secnav-list { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 6px; border-radius: 14px;
  transition: background 0.25s, box-shadow 0.25s; }
.secnav-item { display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 10px; padding: 3px 2px;
  border: none; background: none; cursor: pointer; font: inherit; color: var(--muted); }
.secnav-name { font-size: 0.8rem; font-weight: 700; white-space: nowrap; opacity: 0; transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.secnav-tick { display: block; width: 12px; height: 3px; border-radius: 2px; background: rgba(var(--ink-rgb), 0.28); transition: width 0.2s, background 0.2s; }
.secnav-item.on .secnav-tick { width: 22px; background: var(--accent); }
.secnav-item:hover .secnav-tick { background: var(--text); }
.secnav-item.on .secnav-name { color: var(--accent); }
/* no box: a shade from the outer edge that fades out towards the page */
.secnav-list::before { content: ''; position: absolute; z-index: -1; inset: -40px -90px -40px -24px; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 100% 70% at 0% 50%, rgba(var(--bg-rgb), 0.97) 35%, rgba(var(--bg-rgb), 0.7) 60%, rgba(var(--bg-rgb), 0) 100%);
  transition: opacity 0.25s; }
.secnav-list { position: relative; }
.secnav:hover .secnav-list::before { opacity: 1; }
.secnav:hover .secnav-name { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 1100px) and (min-width: 761px) { .secnav { left: 4px; } }
@media (max-width: 760px) {
  .secnav { left: 0; top: 0; bottom: 0; transform: none; pointer-events: none; }
  .secnav-grip { display: block; position: absolute; left: 0; width: 26px; height: 56px; padding: 0; border: none; background: none;
    /* it travels with the page within the middle 60% of the screen's height */
    top: calc(20vh + var(--secnav-p, 0) * (60vh - 56px)); pointer-events: auto;
    opacity: 0; transition: opacity 0.3s; touch-action: none; }
  /* the handle glows and pulses softly, with a chevron, so that it reads as something to touch and open */
  .secnav-grip i { position: absolute; left: 4px; top: 6px; bottom: 6px; width: 6px; border-radius: 4px; background: var(--accent);
    box-shadow: 0 0 10px 2px rgba(var(--accent-rgb), 0.55); animation: secnav-glow 2.2s ease-in-out infinite; }
  .secnav-grip::after { content: '\203A'; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); font-size: 1.15rem;
    font-weight: 800; line-height: 1; color: var(--accent); text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6); }
  .secnav-open .secnav-grip::after { content: '\2039'; }
  @keyframes secnav-glow { 0%, 100% { box-shadow: 0 0 6px 1px rgba(var(--accent-rgb), 0.4); }
    50% { box-shadow: 0 0 16px 4px rgba(var(--accent-rgb), 0.75); } }
  .secnav-awake .secnav-grip, .secnav-open .secnav-grip { opacity: 0.85; }
  .secnav-list { position: absolute; left: 14px; top: 50%; transform: translateY(-50%) translateX(-12px); max-height: 80vh;
    padding: 10px 12px; opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s; }
  .secnav-list::before { inset: -90px -62vw -90px -14px; opacity: 1;
    background: radial-gradient(ellipse 100% 62% at 0% 50%, rgba(var(--bg-rgb), 0.98) 52%, rgba(var(--bg-rgb), 0.9) 68%, rgba(var(--bg-rgb), 0) 100%); }
  .secnav-open .secnav-list { opacity: 1; visibility: visible; transform: translateY(-50%); pointer-events: auto; transition: opacity 0.2s, transform 0.2s; }
  .secnav-item { padding: 7px 2px; }
  .secnav-name { opacity: 1; transform: none; font-size: 0.95rem; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .secnav-list, .secnav-name, .secnav-grip { transition: none; } .secnav-grip i { animation: none; } }

/* the carousels (phone-carousel.js): the cards stacked in one cell, one shown at a time, with arrows and dots under
   them; on phones every row of cards, on every screen the home page's articles (four per slide, two on a phone) */
.pc-car { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto !important;
  grid-auto-flow: row !important; touch-action: pan-y; }
.pc-car > .pc-item { grid-area: 1 / 1 !important; transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0s; }
.pc-car > .pc-item:not(.pc-on) { opacity: 0 !important; visibility: hidden; pointer-events: none; transform: translateX(14px) !important;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s; }
.pc-car > .pc-item.pc-on { opacity: 1 !important; transform: none !important; }
.pc-group-label { margin: 18px 0 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--perf-ink, var(--muted)); }
.pc-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.pc-nav button.pc-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong, var(--border));
  background: var(--surface); color: var(--text); font-size: 1rem; line-height: 1; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; flex: none; }
.pc-dots { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center; max-width: 70%; }
.pc-dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(var(--ink-rgb), 0.22); transition: width 0.3s, background 0.3s; }
.pc-dots button.on { width: 24px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .pc-car > .pc-item { transition: none !important; } }
.pc-slide { display: grid; gap: 14px; align-content: start; }
@media (min-width: 761px) { .article-list.pc-car .pc-slide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
