/* Shared shell for the proposal index and every demo page.
   The illustrations are drawn in black ink on white, so the stages they sit on ("paper") stay light
   in dark mode too; only the page chrome around them follows the colour scheme. */

:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --paper: #fbfaf7;
  --ink: #16151a;
  --muted: #5d5b66;
  --line: #e3e0d9;
  --accent: #3b4cff;
  --accent-ink: #ffffff;
  --radius: 20px;
  --shadow: 0 1px 2px rgb(22 21 26 / 0.06), 0 12px 32px -12px rgb(22 21 26 / 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="contrast"]) {
    --bg: #121116;
    --surface: #1c1b22;
    --paper: #f6f4ef;
    --ink: #f1f0f4;
    --muted: #a3a1ad;
    --line: #2d2b35;
    --accent: #8d98ff;
    --accent-ink: #121116;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121116;
  --surface: #1c1b22;
  --paper: #f6f4ef;
  --ink: #f1f0f4;
  --muted: #a3a1ad;
  --line: #2d2b35;
  --accent: #8d98ff;
  --accent-ink: #121116;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* High contrast: pure ground, near-black/near-white secondary text (AAA against the ground) and
   visible edges instead of soft shadows, so every surface and control is outlined. Picked with
   js/theme-switch.js; components that read [data-theme$="dark"] treat contrast-dark as dark. */
:root[data-theme="contrast"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #2e2d33;
  --line: #16151a;
  --accent: #2233cc;
  --accent-ink: #ffffff;
  --shadow: 0 0 0 1.5px #16151a;
  color-scheme: light;
}

:root[data-theme="contrast-dark"] {
  --bg: #000000;
  --surface: #0e0d12;
  --paper: #f6f4ef;
  --ink: #ffffff;
  --muted: #d6d4de;
  --line: #e9e7ef;
  --accent: #aab3ff;
  --accent-ink: #000000;
  --shadow: 0 0 0 1.5px #e9e7ef;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  /* clip, not hidden: hidden turns body into a scroll container and breaks position: sticky (05G). */
  overflow-x: clip;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 750;
  text-wrap: nowrap;
}

.lede { margin: 18px 0 0; max-width: 46ch; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.button:focus-visible, .chip:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font: 500 14px/1 var(--font);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
/* Paper pins --ink light but not --bg (components read the page's --bg), so a pressed chip on paper
   takes its text colour from the paper itself; otherwise it is dark on dark in dark mode. */
.paper .chip[aria-pressed="true"] { color: var(--paper); }

/* Deep links from links.html land on one card: leave breathing room above it and ring it. */
[id] { scroll-margin-top: 32px; }
:target { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: var(--radius); }

/* ---------- Demo page chrome ---------- */

/* Set kits: tabs across every proposal of one set (rendered by js/family-nav.js). */
.family {
  display: flex;
  gap: 6px;
  margin: 4px 0 0;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.family a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  text-decoration: none;
  color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.family a:hover { color: var(--ink); }
.family a[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.family .code { font-weight: 700; font-variant-numeric: tabular-nums; }

.brand-chip { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 18px; height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--a) 0 33%, var(--b) 33% 66%, var(--c) 66%); }

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  font-size: 14px;
}
.demo-bar a { text-decoration: none; color: var(--muted); }
.demo-bar a:hover { color: var(--ink); }
.pager { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }

.demo-head { padding-block: clamp(16px, 4vw, 40px) 24px; }
.demo-head h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.025em; line-height: 1.1; }
.demo-head p { margin: 10px 0 0; max-width: 62ch; color: var(--muted); }

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: hint-pulse 1.6s ease-in-out infinite; }
/* Every hint is about the pointer, so touch screens hide the whole line, dot included. */
@media (hover: none) { .hint:has(.pointer-only) { display: none; } }
@keyframes hint-pulse { 50% { opacity: 0.25; } }

/* Paper stays light in both schemes, so it pins the light tokens for everything drawn on it.
   --brand-accent lets a brand-themed ancestor (07B, 05B) recolour buttons on paper too. */
.paper {
  --ink: #16151a;
  --muted: #5d5b66;
  --line: #e3e0d9;
  --surface: #ffffff;
  --accent: var(--brand-accent, #3b4cff);
  --accent-ink: #ffffff;
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: #16151a;
}

/* A stage is a box with the illustration's aspect ratio; every plane fills it exactly. */
.stage { position: relative; }
.stage > .layer, .stage .plane { position: absolute; inset: 0; will-change: transform; }
.stage .plane > svg, .stage .layer > svg { width: 100%; height: 100%; }

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin-block: 28px 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}
.spec > div { padding: 18px 20px; background: var(--surface); }
.spec dt { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 0; font-size: 14.5px; }

.credit {
  padding-block: 28px 40px;
  font-size: 13px;
  color: var(--muted);
}
.credit a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
