/* ==========================================================================
   webreceptor.net — synthesis direction 08 "Pearl Ledger"  (round two)
   Night Desk skeleton (rail + honest header + panel-cards on a ground),
   rendered light, now themed, collapsible, and mastheaded.
   No glow, no halos, no text-shadow. Depth from hairlines, inset highlights,
   bevels, and neutral cool cast shadows only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. structural tokens — identical in every theme
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;

  --rail-w: 226px;
  --measure: 66ch;

  --fast: 120ms;
  --base: 180ms;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

:root[data-rail="mini"] { --rail-w: 62px; }

/* --------------------------------------------------------------------------
   1. themes — every material token retunes here, and only here
   -------------------------------------------------------------------------- */

/* --- pearl (default): greyish-white pearl, metallic lines, cool neutral,
       blue held back to small authority moments -------------------------- */
:root,
:root[data-theme="pearl"] {
  --pearl-0: #fdfdfc;
  --pearl-1: #f4f5f4;
  --pearl-2: #e9ebea;
  --pearl-3: #dbdedd;
  --pearl-4: #c9cdcd;
  --lift: #ffffff;

  --line: #c8cccb;
  --line-soft: #dee1e0;
  --metal-line: #a2a8a7;

  --ink: #1e2426;
  --ink-2: #4d5658;
  --ink-3: #616a6d;

  --accent: #2f6d86;
  --accent-deep: #1d5065;
  --accent-soft: #dde8ec;
  --accent-bright: #8fb3c0;

  --signal: #c05f3c;
  --signal-ink: #9a4526;
  --success: #3a7a63;

  --paper: #fdfcf7;
  --paper-edge: #e8e5da;

  --ground: linear-gradient(180deg, #f3f4f3 0%, #ebeded 46%, #e2e5e5 100%);
  --grid-line: rgba(70, 78, 80, .05);
  --shadow-ink: 42, 48, 50;
  --veil: 253, 253, 252;

  --kind-a: #2f6d86;
  --kind-b: #3f5f7d;
  --kind-c: #9a4526;
  --kind-d: #4d5658;

  --cloud-hi: #f6f7f6;
  --cloud-mid: #eceeed;
  --cloud-lo: #dfe3e3;
  --cloud-lamp: 255, 255, 255;
  --cloud-tint: 47, 109, 134;
  --cloud-shade: 250;
  --cloud-ink: #5b6668;
}

/* --- playroom: darker and more saturated, still light-mode ------------- */
:root[data-theme="playroom"] {
  --pearl-0: #fbfcfe;
  --pearl-1: #edf2f7;
  --pearl-2: #dfe7f0;
  --pearl-3: #cdd8e6;
  --pearl-4: #bac8da;
  --lift: #ffffff;

  --line: #b3c1d2;
  --line-soft: #d3dce7;
  --metal-line: #8a9bb0;

  --ink: #17222e;
  --ink-2: #3c4d61;
  --ink-3: #53637a;

  --accent: #3a6ea5;
  --accent-deep: #22456e;
  --accent-soft: #d3e2f2;
  --accent-bright: #8fb4d8;

  --signal: #c9563f;
  --signal-ink: #9c3a26;
  --success: #2f7a5e;

  --paper: #fdfcf8;
  --paper-edge: #e6e3d8;

  --ground: linear-gradient(180deg, #e9eff6 0%, #e0e9f2 46%, #d5e1ee 100%);
  --grid-line: rgba(34, 69, 110, .07);
  --shadow-ink: 24, 42, 64;
  --veil: 251, 252, 254;

  --kind-a: #33628f;
  --kind-b: #4a5b96;
  --kind-c: #9c3a26;
  --kind-d: #3c4d61;

  --cloud-hi: #eef3f9;
  --cloud-mid: #e2eaf4;
  --cloud-lo: #d2deee;
  --cloud-lamp: 255, 255, 255;
  --cloud-tint: 34, 69, 110;
  --cloud-shade: 242;
  --cloud-ink: #3f5c80;
}

/* --- desk: manila, kraft, paper and wood. ink-forward. not fruit ------- */
:root[data-theme="desk"] {
  --pearl-0: #fbf8f1;
  --pearl-1: #f3eee2;
  --pearl-2: #e9e1d0;
  --pearl-3: #dbd0ba;
  --pearl-4: #c9bca2;
  --lift: #fffdf6;

  --line: #c8bda6;
  --line-soft: #ded5c2;
  --metal-line: #a0937b;

  --ink: #241f18;
  --ink-2: #4c4438;
  --ink-3: #6b6151;

  --accent: #2f5068;
  --accent-deep: #1d3547;
  --accent-soft: #dde5ea;
  --accent-bright: #8ba4b6;

  --signal: #b04a30;
  --signal-ink: #8c3520;
  --success: #4d6b3e;

  --paper: #fdf9ee;
  --paper-edge: #e6dcc4;

  --ground: linear-gradient(180deg, #f0eade 0%, #e9e2d1 46%, #dfd6c1 100%);
  --grid-line: rgba(94, 78, 54, .07);
  --shadow-ink: 62, 52, 38;
  --veil: 251, 248, 241;

  --kind-a: #2f5068;
  --kind-b: #5a5330;
  --kind-c: #8c3520;
  --kind-d: #4c4438;

  --cloud-hi: #f6f1e5;
  --cloud-mid: #efe8d8;
  --cloud-lo: #e2d9c3;
  --cloud-lamp: 255, 252, 242;
  --cloud-tint: 108, 88, 56;
  --cloud-shade: 248;
  --cloud-ink: #7a6c53;
}

/* --- aqua: the round-one palette, deepened off the baby-blue ----------- */
:root[data-theme="aqua"] {
  --pearl-0: #fbfdfd;
  --pearl-1: #eff4f5;
  --pearl-2: #e2eaec;
  --pearl-3: #d2dcdf;
  --pearl-4: #c0cccf;
  --lift: #ffffff;

  --line: #bcc7ca;
  --line-soft: #d6dedf;
  --metal-line: #93a1a4;

  --ink: #16262b;
  --ink-2: #41545a;
  --ink-3: #566669;

  --accent: #0f6478;
  --accent-deep: #084b5c;
  --accent-soft: #cfe6ea;
  --accent-bright: #5aa8b5;

  --signal: #c05a37;
  --signal-ink: #93401f;
  --success: #2f7562;

  --paper: #fffdf6;
  --paper-edge: #efe9da;

  --ground: linear-gradient(180deg, #eef4f6 0%, #e6eef1 46%, #dce7ea 100%);
  --grid-line: rgba(30, 78, 90, .06);
  --shadow-ink: 38, 55, 59;
  --veil: 251, 253, 253;

  --kind-a: #0f6478;
  --kind-b: #2f6080;
  --kind-c: #93401f;
  --kind-d: #41545a;

  --cloud-hi: #f2f8f9;
  --cloud-mid: #e7eff1;
  --cloud-lo: #d8e4e8;
  --cloud-lamp: 255, 255, 255;
  --cloud-tint: 15, 100, 120;
  --cloud-shade: 247;
  --cloud-ink: #4a6b73;
}

/* --------------------------------------------------------------------------
   2. depth — derived from the theme, never invented per-component
   -------------------------------------------------------------------------- */

:root {
  --sh-1: 0 1px 2px rgba(var(--shadow-ink), .07);
  --sh-2: 0 8px 20px rgba(var(--shadow-ink), .10), 0 1px 3px rgba(var(--shadow-ink), .08);
  --sh-3: 0 20px 48px rgba(var(--shadow-ink), .14), 0 2px 6px rgba(var(--shadow-ink), .08);
  --bevel: inset 0 1px 0 rgba(255, 255, 255, .92);
  --bevel-soft: inset 0 1px 0 rgba(255, 255, 255, .7);
  --well-in: inset 0 2px 4px rgba(var(--shadow-ink), .15), inset 0 -1px 0 rgba(255, 255, 255, .72);
  --press-in: inset 0 2px 3px rgba(var(--shadow-ink), .2);
}

/* --------------------------------------------------------------------------
   3. base
   -------------------------------------------------------------------------- */

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

html { background: var(--pearl-2); }

body {
  margin: 0;
  min-height: 100vh;
  min-width: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background var(--base) var(--ease), color var(--base) var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(255, 255, 255, .55) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
}

h1, h2, h3, h4, p, figure, blockquote, pre, ul, ol, dl { margin: 0; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
img, svg, video, iframe { display: block; max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--accent-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--accent-soft); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  z-index: 90;
  top: 8px; left: 8px;
  padding: 9px 14px;
  transform: translateY(-200%);
  color: #fff;
  background: var(--accent);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { transform: translateY(0); }

.mono, .eyebrow, .chip, .rail-slot, .rail-status, .deck-path,
.panel-note, .cap, .certline, .odo-cap, .count-line,
.card-top, .card-foot, .mount-strip, .route-kind, .foot-meta,
.masthead-counts, .fctl-head, .lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .01em;
  text-transform: lowercase;
  color: var(--ink-3);
}

.eyebrow { font-size: 10px; color: var(--accent-deep); letter-spacing: .06em; }

/* --------------------------------------------------------------------------
   4. shell + collapsible rail
   -------------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--base) var(--ease);
}

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 14px 12px;
  overflow: auto;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .5), 6px 0 18px rgba(var(--shadow-ink), .05);
  transition: padding var(--base) var(--ease);
}

:root[data-rail="mini"] .rail { padding: 14px 7px; align-items: center; }

.rail-brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 5px;
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}
.rail-brand:hover { background: rgba(255, 255, 255, .6); }
:root[data-rail="mini"] .rail-brand { grid-template-columns: 40px; padding: 5px; gap: 0; }
:root[data-rail="mini"] .brand-copy { display: none; }

.mark {
  display: grid;
  width: 40px; height: 40px;
  place-items: center;
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--bevel), var(--sh-1);
}

.wmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-deep);
}
.wmark i { width: 4px; height: 4px; border-radius: 50%; background: var(--signal); }
.wmark b { font-weight: 700; }
.mark--lg { width: 58px; height: 58px; border-radius: 16px; }
.mark--lg .wmark { font-size: 25px; gap: 4px; }
.mark--lg .wmark i { width: 5px; height: 5px; }

.brand-copy { display: grid; min-width: 0; gap: 1px; }
.brand-copy strong { font-size: 13.5px; font-weight: 640; letter-spacing: -.005em; }
.brand-copy small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: lowercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the collapse control — an honest button, not a hotspot */
.rail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel), var(--sh-1);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: lowercase;
}
.rail-toggle:hover { color: var(--accent-deep); }
.rail-toggle:active { box-shadow: var(--press-in); }
.rail-toggle svg { width: 13px; height: 13px; flex: 0 0 13px; }
.rail-toggle .rail-toggle-text { transition: opacity var(--fast) var(--ease); }
:root[data-rail="mini"] .rail-toggle { padding: 0; }
:root[data-rail="mini"] .rail-toggle .rail-toggle-text { display: none; }
:root[data-rail="mini"] .rail-toggle svg { transform: scaleX(-1); }

.rail-heading {
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
:root[data-rail="mini"] .rail-heading { display: none; }

.rail-nav { display: grid; gap: 4px; }

.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 9px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.rail-link:hover { background: rgba(255, 255, 255, .68); border-color: var(--line-soft); transform: translateX(1px); }
.rail-link[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(180deg, var(--lift), var(--accent-soft));
  border-color: color-mix(in oklab, var(--accent) 26%, var(--line));
  box-shadow: var(--bevel), var(--sh-1);
}
/* the notch — 04-porcelain-playroom's indicator, geometry unchanged */
.rail-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 7px; bottom: 7px; left: -1px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
:root[data-rail="mini"] .rail-link {
  grid-template-columns: 26px;
  justify-content: center;
  justify-items: center;
  padding: 5px;
  gap: 0;
}
:root[data-rail="mini"] .rail-label,
:root[data-rail="mini"] .rail-slot { display: none; }

.rail-blob { width: 24px; height: 24px; }
.rail-label { display: grid; min-width: 0; gap: 0; }
.rail-label strong { font-size: 12.5px; font-weight: 620; }
.rail-label small {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  text-transform: lowercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-slot { font-size: 9px; }
.rail-link[aria-current="page"] .rail-slot { color: var(--accent-deep); }

.rail-foot { margin-top: auto; display: grid; gap: 8px; width: 100%; }

/* theme switcher — quiet segmented swatches */
.themebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: var(--pearl-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--well-in);
}
:root[data-rail="mini"] .themebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.swatch {
  display: grid;
  place-items: center;
  min-height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
}
.swatch i {
  width: 13px; height: 13px;
  border-radius: 4px;
  border: 1px solid rgba(var(--shadow-ink), .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
  background: linear-gradient(135deg, var(--sw-pearl) 48%, var(--sw-accent) 48%);
}
.swatch:hover { background: rgba(255, 255, 255, .55); }
.swatch[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--lift), var(--pearl-1));
  border-color: var(--line);
  box-shadow: var(--bevel), var(--sh-1);
}
.themebar-label {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-3);
}
:root[data-rail="mini"] .themebar-label { display: none; }

.rail-status {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  background: var(--pearl-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--well-in);
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.5;
}
.rail-status .live { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.rail-status .live::before {
  content: "";
  width: 6px; height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--success);
  border: 1px solid color-mix(in oklab, var(--success) 60%, #000);
}
:root[data-rail="mini"] .rail-status { display: none; }

.rail-hub {
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel), var(--sh-1);
  white-space: nowrap;
  overflow: hidden;
}
.rail-hub:hover { color: var(--accent-deep); }
:root[data-rail="mini"] .rail-hub { padding: 7px 2px; font-size: 11px; }
:root[data-rail="mini"] .rail-hub .hub-text { display: none; }

/* --------------------------------------------------------------------------
   5. stage + honest header
   -------------------------------------------------------------------------- */

.stage { min-width: 0; display: flex; flex-direction: column; }

.deck, .main, .foot {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: clamp(12px, 2.2vw, 28px);
}

.deck {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding-top: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}
.deck-id { min-width: 0; flex: 1 1 320px; }
.deck-title { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.deck-path { margin-top: 1px; }
.deck-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.chip {
  padding: 3px 9px;
  background: var(--pearl-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--bevel-soft);
  color: var(--ink-2);
}
.chip--live { display: inline-flex; align-items: center; gap: 6px; }
.chip--live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  border: 1px solid color-mix(in oklab, var(--signal) 62%, #000);
}

.main { flex: 1 1 auto; padding-bottom: 40px; display: grid; gap: 18px; align-content: start; }

/* --------------------------------------------------------------------------
   6. panels
   -------------------------------------------------------------------------- */

.panel {
  min-width: 0;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--bevel), var(--sh-2);
}

.panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--bevel);
}
.panel-bar h2 { font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.panel-body { padding: 16px; display: grid; gap: 14px; }

/* --------------------------------------------------------------------------
   7. controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 15px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel), var(--sh-1);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.btn:hover { background: linear-gradient(180deg, var(--lift), var(--pearl-1)); }
.btn:active { transform: translateY(1px); box-shadow: var(--press-in); }

.btn--gel {
  color: #fff;
  /* the lighten stop is kept small so white text clears AA over the whole face */
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 92%, #fff 8%),
    var(--accent) 38%,
    color-mix(in oklab, var(--accent) 84%, #000 16%));
  border-color: color-mix(in oklab, var(--accent) 76%, #000 14%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 2px rgba(0, 0, 0, .18), var(--sh-1);
}
.btn--gel:hover { background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 88%, #fff 12%), var(--accent) 40%, color-mix(in oklab, var(--accent) 86%, #000 14%)); }

.btn--ghost { background: transparent; border-color: var(--line); box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: rgba(255, 255, 255, .6); }
.btn--sm { min-height: 28px; padding: 0 11px; font-size: 12px; }

.well {
  background: var(--pearl-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--well-in);
}

/* --------------------------------------------------------------------------
   8. home
   -------------------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 26px; padding: 22px; align-items: center; }
.hero-copy { display: grid; gap: 10px; min-width: 0; max-width: 60ch; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.018em;
}
.hero h1 em { font-style: italic; color: var(--accent-deep); }
.hero p { font-size: 14.5px; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }

.hero-id {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--pearl-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--bevel-soft);
}
.hero-id .cap { text-align: center; line-height: 1.5; }

/* funnel cards — "cards as little windows", card scale only */
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.wcard {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--bevel), var(--sh-1);
  overflow: hidden;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.wcard:hover { transform: translateY(-2px); box-shadow: var(--bevel), var(--sh-2); }
.wcard:active { transform: translateY(0); }

.wcap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--bevel);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: lowercase;
}
.wcap .pips { display: flex; gap: 4px; }
.wcap .pips i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pearl-3);
  box-shadow: inset 0 1px 1px rgba(var(--shadow-ink), .22);
}
.wcap .pips i:first-child { background: var(--accent-bright); }

.wcard-body { display: grid; gap: 6px; align-content: start; padding: 12px 13px 13px; }
.wcard-body h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--accent-deep); }
.wcard-body p { font-size: 12.8px; color: var(--ink-2); }
.wcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: lowercase;
}
.wcard:hover .go { color: var(--accent-deep); }

/* the one fidget: the reception counter */
.home-lower { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); gap: 18px; align-items: stretch; }
.route-list { display: grid; }

.counter-body { display: grid; gap: 12px; justify-items: center; padding: 18px 16px; }

.odo {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 11px 14px;
  background: var(--pearl-3);
  border: 1px solid var(--metal-line);
  border-radius: var(--r-md);
  box-shadow: var(--well-in);
}
.odo-d {
  position: relative;
  display: grid;
  width: 30px;
  place-items: center;
  padding: 3px 0;
  background: linear-gradient(180deg, var(--pearl-4), var(--pearl-3) 42%, var(--lift));
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 3px rgba(var(--shadow-ink), .1);
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
  overflow: hidden;
}
.odo-d span { display: block; }
.odo-d.rolling span { animation: roll 200ms var(--ease-out); }
@keyframes roll {
  from { transform: translateY(-72%); opacity: .15; }
  to { transform: translateY(0); opacity: 1; }
}

.counter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }

.tickstrip { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 14px; width: 100%; }
.tickstrip i {
  width: 3px; height: 13px;
  border-radius: 1px;
  background: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.tickstrip i:nth-child(5n) { background: var(--signal); }

/* route rows */
.routes { display: grid; }
.route-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 14px;
  padding: 13px 16px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line-soft);
  transition: background var(--fast) var(--ease);
}
.route-row:first-child { border-top: 0; }
.route-row:hover { background: color-mix(in oklab, var(--accent-soft) 46%, var(--lift)); }
.route-index {
  display: grid;
  width: 34px; height: 30px;
  place-items: center;
  background: var(--pearl-1);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  box-shadow: var(--bevel-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.route-copy { display: grid; gap: 2px; min-width: 0; }
.route-copy h3 { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--accent-deep); }
.route-copy p { font-size: 12.6px; color: var(--ink-2); }
.route-go { font-family: var(--mono); font-size: 11px; color: var(--accent-deep); text-transform: lowercase; }

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--pearl-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: lowercase;
}

/* --------------------------------------------------------------------------
   9. index masthead + moiré cloudscape + field controls
   -------------------------------------------------------------------------- */

.masthead {
  position: relative;
  min-height: 208px;
  padding: 0;
}

.masthead-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  background: var(--pearl-1);
}

/* the veil keeps the field from competing with the words it carries:
   near-opaque under the text, thinning to the right where the sky shows */
.masthead-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(100deg,
    rgba(var(--veil), .97) 0%,
    rgba(var(--veil), .95) 46%,
    rgba(var(--veil), .68) 74%,
    rgba(var(--veil), .38) 100%);
}

.masthead-body {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  align-content: center;
  max-width: 60ch;
  min-height: 208px;
  padding: 26px clamp(16px, 2.4vw, 28px);
}
.masthead-body h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 3.3vw, 36px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.02em;
}
.masthead-deck { font-size: 14.5px; color: var(--ink-2); }
.masthead-counts { display: flex; flex-wrap: wrap; gap: 3px 0; margin-top: 2px; }
.masthead-counts span { padding: 0 11px; border-left: 1px solid var(--line); }
.masthead-counts span:first-child { padding-left: 0; border-left: 0; }
.masthead-counts b { color: var(--ink-2); font-weight: 600; }

/* field controls — a pearl instrument, tucked in the corner */
.fieldctl { position: absolute; z-index: 3; top: 12px; right: 12px; }

.fieldctl > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  list-style: none;
  cursor: pointer;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel), var(--sh-1);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: lowercase;
  white-space: nowrap;
}
.fieldctl > summary::-webkit-details-marker { display: none; }
.fieldctl > summary::after { content: "▾"; font-size: 9px; color: var(--ink-3); }
.fieldctl[open] > summary::after { content: "▴"; }
.fieldctl > summary:hover { color: var(--accent-deep); }

.fieldctl-body {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 246px;
  display: grid;
  gap: 11px;
  padding: 13px;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--bevel), var(--sh-3);
}

.fctl { display: grid; gap: 5px; }
.fctl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 9.5px; }
.fctl-head b { color: var(--ink-2); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.fctl-head output { color: var(--accent-deep); font-family: var(--mono); font-size: 10px; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--pearl-3);
  border: 1px solid var(--line);
  box-shadow: var(--well-in);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  margin-top: -5px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--metal-line);
  box-shadow: var(--bevel), var(--sh-1);
}
.slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--pearl-3);
  border: 1px solid var(--line);
}
.slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--metal-line);
  box-shadow: var(--bevel), var(--sh-1);
}

.fieldctl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 3px; border-top: 1px solid var(--line-soft); }

/* --------------------------------------------------------------------------
   10. index toolbar
   -------------------------------------------------------------------------- */

.toolbar { display: grid; gap: 12px; padding: 14px 16px; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.toolbar-row + .toolbar-row { padding-top: 12px; border-top: 1px solid var(--line-soft); }

.lbl { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; }

/* filter tabs carry the same notch as the rail */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.keys { display: flex; flex-wrap: wrap; gap: 0; }
.tab {
  position: relative;
  min-height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--lift), var(--pearl-1));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel-soft);
  font-size: 12.5px;
  font-weight: 560;
}
.tab:hover { background: linear-gradient(180deg, var(--lift), var(--pearl-2)); }
.tab .n { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.tab[aria-pressed="true"] {
  color: var(--ink);
  background: linear-gradient(180deg, var(--lift), var(--accent-soft));
  border-color: color-mix(in oklab, var(--accent) 30%, var(--line));
  box-shadow: var(--bevel), var(--sh-1);
}
.tab[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  top: 5px; bottom: 5px; left: -1px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.tab[aria-pressed="true"] .n { color: var(--accent-deep); }

/* sort as tactile keys */
.sortrail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.key {
  min-height: 28px;
  padding: 0 11px;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--lift), var(--pearl-2));
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  box-shadow: var(--bevel), 0 2px 0 var(--pearl-4), var(--sh-1);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: lowercase;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.key:hover { color: var(--ink); }
.key:active, .key[aria-pressed="true"] { transform: translateY(2px); box-shadow: var(--press-in); }
.key[aria-pressed="true"] {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 32%, var(--line));
}

.findwell { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 160px; padding: 4px 10px; }
.findwell label { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.findwell input { flex: 1 1 auto; min-width: 0; min-height: 26px; border: 0; background: transparent; font-size: 13px; }
.findwell input:focus { outline: none; }
.findwell:focus-within { border-color: var(--accent); }

.count-line { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; padding: 0 2px; }
.count-line b { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   11. the uniform card grid — one geometry, no exceptions
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--bevel), var(--sh-1);
  overflow: hidden;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--bevel), var(--sh-2); }
.card:active { transform: translateY(0); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 13px;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--bevel);
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.card-kind { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--kind-d); font-weight: 500; }
.card-kind i {
  width: 7px; height: 7px;
  flex: 0 0 7px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
.card-kind[data-cat="software"], .card-kind[data-cat="apps"] { color: var(--kind-a); }
.card-kind[data-cat="design"], .card-kind[data-cat="toys"],
.card-kind[data-cat="artifacts"] { color: var(--kind-b); }
.card-kind[data-cat="math"], .card-kind[data-cat="elsewhere"] { color: var(--kind-c); }
.card-kind[data-cat="essay"] { color: var(--kind-d); }
.card-date { white-space: nowrap; }

.card-main { display: flex; align-items: flex-start; gap: 13px; padding: 14px 13px 15px; min-width: 0; }

.card-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--pearl-1);
  background-size: 11px 11px, 11px 11px, auto;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  box-shadow: var(--well-in);
}
.card-thumb svg { width: 100%; height: auto; }
/* `thumb` frontmatter ships a real image through the assets pipeline; the build
   guarantees the file exists, so this never renders a broken reference. */
.card-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }

.card-text { display: grid; gap: 6px; align-content: start; min-width: 0; }
.card-text h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.014em;
  color: var(--accent-deep);
}
.card-text p { font-size: 13px; color: var(--ink-2); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-top: 1px solid var(--line-soft);
  box-shadow: var(--bevel);
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.card-len { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-go { color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.card:hover .card-go { text-decoration: underline; text-underline-offset: 3px; }

/* the outbound parcel keeps its identity inside the uniform geometry */
.card--parcel { border-color: var(--metal-line); }
.card--parcel .card-top {
  background: repeating-linear-gradient(135deg, var(--pearl-3) 0 7px, var(--pearl-2) 7px 14px);
  border-bottom: 1px dashed var(--metal-line);
}
.card--parcel .card-go { color: var(--signal-ink); }

.stamp {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--pearl-0);
  border: 1px solid var(--metal-line);
  border-radius: var(--r-xs);
  box-shadow: var(--bevel-soft);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: .05em;
  /* perforation, drawn as geometry rather than an effect */
  outline: 2px dotted var(--pearl-3);
  outline-offset: -5px;
}

.card-addr {
  display: grid;
  gap: 1px;
  margin-top: 2px;
  padding: 7px 9px;
  background: var(--pearl-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.card-addr b { color: var(--ink-2); font-weight: 600; }

.zero {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 34px 20px;
  background: var(--pearl-1);
  border: 1px dashed var(--metal-line);
  border-radius: var(--r-md);
}
.zero h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.zero p { max-width: 44ch; font-size: 13px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   12. writeup — the 03-sticker-archive reading surface
   -------------------------------------------------------------------------- */

.sheet {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--bevel), var(--sh-3);
  overflow: hidden;
}

.certhead {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 34px clamp(18px, 4vw, 56px) 26px;
  text-align: center;
  background: linear-gradient(180deg, var(--pearl-1), var(--paper));
  border-bottom: 1px solid var(--paper-edge);
}

.insignia { width: 104px; height: 104px; }

.certhead h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.022em;
  max-width: 20ch;
}
.epigraph { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-2); max-width: 46ch; }
.certline { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-top: 4px; }
.certline span { padding: 0 12px; border-left: 1px solid var(--line); }
.certline span:first-child { border-left: 0; }

/* three-track grid: the wide plate claims all tracks, never overflows */
.prose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(var(--measure), 100%) minmax(0, 1fr);
  gap: 18px 0;
  padding: 30px clamp(14px, 3vw, 40px) 26px;
  font-size: 16px;
  line-height: 1.68;
}
.prose > * { grid-column: 2; min-width: 0; }
.prose > .full { grid-column: 1 / -1; }

.prose p { color: var(--ink); }
.prose h2 { margin-top: 14px; font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.014em; }
.prose h2::after {
  content: "";
  display: block;
  width: 46px; height: 2px;
  margin-top: 7px;
  background: var(--accent);
  border-radius: 1px;
}
.prose a { color: var(--accent-deep); }
.prose em { font-style: italic; }
.prose strong, .prose b { font-weight: 650; }

/* Production markdown uses the same reading lane as the authored specimen. */
.prose h1, .prose h3, .prose h4 { font-family: var(--serif); color: var(--ink); }
.prose h1 { font-size: clamp(25px, 3.5vw, 34px); line-height: 1.16; letter-spacing: -.018em; }
.prose h3 { margin-top: 8px; font-size: 18px; line-height: 1.25; }
.prose h4 { margin-top: 6px; font-size: 16px; line-height: 1.3; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose hr { width: 100%; height: 1px; border: 0; background: var(--paper-edge); }
.prose table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; }
.prose th, .prose td { padding: 7px 9px; border: 1px solid var(--paper-edge); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.prose th { background: var(--pearl-1); color: var(--accent-deep); font-weight: 650; }
.prose > img, .prose figure img { width: 100%; height: auto; border: 1px solid var(--line-soft); border-radius: var(--r-xs); }
.prose figure { display: grid; gap: 8px; }
.prose figcaption { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.unfiled-ref { color: var(--ink-3); border-bottom: 1px dotted var(--metal-line); cursor: help; }

.prose blockquote {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
  background: var(--pearl-1);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  color: var(--ink-2);
}
.prose blockquote cite { font-family: var(--mono); font-size: 10.5px; font-style: normal; color: var(--ink-3); text-transform: lowercase; }

.prose pre {
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--pearl-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--well-in);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink);
}
.prose pre b { color: var(--accent-deep); font-weight: 600; }
.prose pre i { color: var(--ink-3); font-style: normal; }
.prose code { font-family: var(--mono); font-size: .9em; }
.prose p code { padding: 1px 5px; background: var(--pearl-1); border: 1px solid var(--line-soft); border-radius: 4px; }

.plate, .mount {
  display: grid;
  gap: 0;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--bevel), var(--sh-1);
  overflow: hidden;
}
.plate-face { padding: 12px; background: linear-gradient(180deg, var(--pearl-1), var(--pearl-0)); }
.plate-face svg, .plate-face video, .plate-face img {
  width: 100%;
  height: auto;
  background: var(--pearl-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xs);
}
.cap { line-height: 1.62; text-transform: none; }
.cap b { color: var(--accent-deep); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.plate .cap, .mount .cap {
  padding: 9px 13px 11px;
  border-top: 1px solid var(--line-soft);
  background: var(--pearl-1);
}

.mount-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 6px 12px;
  background: linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--bevel);
  font-size: 9.5px;
}
.mount-window { padding: 12px; background: var(--pearl-2); }
.mount-window iframe {
  width: 100%;
  height: 268px;
  background: var(--pearl-0);
  border: 1px solid var(--metal-line);
  border-radius: var(--r-xs);
  box-shadow: var(--well-in);
}

.linkcard {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  color: inherit;
  text-decoration: none;
  background: var(--pearl-0);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: var(--bevel), var(--sh-1);
  transition: transform var(--fast) var(--ease);
}
.linkcard:hover { transform: translateX(2px); }
.linkcard .kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
.linkcard b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.linkcard span:last-child { font-size: 13px; color: var(--ink-2); }
.linkcard--out { border-left-color: var(--signal); }
.linkcard--out .kicker { color: var(--signal-ink); }

.colophon-line {
  padding: 16px clamp(14px, 3vw, 40px) 24px;
  border-top: 1px solid var(--paper-edge);
  background: linear-gradient(180deg, var(--paper), var(--pearl-1));
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
  color: var(--ink-3);
  text-transform: lowercase;
}

/* --------------------------------------------------------------------------
   13. footer
   -------------------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 14px;
  padding-bottom: 26px;
  border-top: 1px solid var(--line-soft);
}
.foot p { font-size: 12.5px; color: var(--ink-2); }
.foot-meta { margin-left: auto; }

/* --------------------------------------------------------------------------
   14. responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .home-lower { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-id { justify-self: start; }
}

@media (max-width: 900px) {
  .masthead-veil {
    background: linear-gradient(180deg, rgba(var(--veil), .93) 0%, rgba(var(--veil), .96) 62%, rgba(var(--veil), .9) 100%);
  }
  .masthead-body { max-width: none; padding-right: 128px; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px clamp(12px, 3vw, 20px) !important;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }
  .rail-heading, .rail-toggle { display: none; }
  /* the collapse control is a desktop affordance; on a top bar there is
     nothing to collapse, so the full labels always show */
  :root[data-rail="mini"] .rail-brand { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 5px 8px 5px 5px; }
  :root[data-rail="mini"] .brand-copy { display: grid; }
  :root[data-rail="mini"] .rail-link { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 5px 9px; gap: 9px; justify-items: stretch; }
  :root[data-rail="mini"] .rail-label { display: grid; }
  :root[data-rail="mini"] .rail-slot { display: block; }
  :root[data-rail="mini"] .rail-status { display: grid; }
  :root[data-rail="mini"] .themebar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root[data-rail="mini"] .themebar-label { display: block; }
  :root[data-rail="mini"] .rail-hub .hub-text { display: inline; }
  .rail-nav { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); flex: 1 1 100%; gap: 6px; }
  .rail-link { min-height: 40px; }
  .rail-foot { margin-top: 0; display: flex; flex: 1 1 100%; gap: 8px; align-items: center; }
  .rail-status { flex: 1 1 auto; }
  .themebar { flex: 0 0 auto; }
  .rail-hub { flex: 0 0 auto; }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .funnel { grid-template-columns: minmax(0, 1fr); }
  .route-row { grid-template-columns: 34px minmax(0, 1fr); }
  .route-row .route-kind { grid-column: 2; }
  .route-row .route-go { grid-column: 2; justify-self: start; }
  .rail-label small { display: none; }
  .prose { font-size: 15.5px; }
  .certhead { padding-top: 26px; }
  .odo-d { width: 26px; font-size: 23px; }
  .masthead, .masthead-body { min-height: 0; }
  .masthead-body { padding-right: clamp(16px, 2.4vw, 28px); padding-top: 58px; }
  .fieldctl { top: 10px; right: 10px; }
  .fieldctl-body { width: min(246px, calc(100vw - 44px)); }
  .card-main { gap: 11px; }
  .card-thumb, .stamp { flex-basis: 74px; width: 74px; height: 74px; }
}

/* --------------------------------------------------------------------------
   15. reduced motion + print
   -------------------------------------------------------------------------- */

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

@media print {
  .rail, .deck-chips, .toolbar, .foot, .fieldctl, .masthead-field { display: none; }
  body { background: #fff; }
  .sheet, .panel, .card { box-shadow: none; border-color: #ccc; }
}
