/* ParqueMedia — cinematic dark design system.
   The one token file: every colour, type size and spacing value lives in :root below.
   Dark only, by decision. Print is black on white.
   Every text/background pair is gated by an automated contrast check (WCAG 2.2 AA).
   Glow and gradients are allowed ONLY in the four set-pieces: the intro canvas, the hero
   ribbon, the pipeline pulses and the card-border spotlight (Joshua, 2026-11-28). */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so text doesn't shift when the web font arrives */
@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 102.5%;
  ascent-override: 94.6%;
  descent-override: 24.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Surfaces: a near-black base and two elevation steps (Joshua, 2026-11-29). Raised
     surfaces (cards, stage cards, code drawers, the command menu, table rows) use --surface
     (elevation 1); answers, frames and inputs use --surface-2 (elevation 2). */
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #18181b;
  --surface-3: #18181b;

  /* Text: headlines pure white; body off-white to cut glare on the dark base */
  --ink-head: #ffffff;
  --ink: #e4e4e7;
  --ink-2: #a1a1aa;
  --muted: #8b8b94;
  --on-light: #000000;

  /* Lines */
  --rule: #27272a;
  --rule-strong: #66666e;
  --frame-dot: #3f3f46;

  /* Accents, sampled from the reference video (frames 0.25 s–8.5 s) */
  --core: #78f6f3;
  --flare: #e8fdff;
  --cyan: #51e2f2;
  --sky: #3da7eb;
  --blue: #215fb3;
  --violet: #645dc8;
  --violet-ink: #a99bff;
  --link: #6bc1f3;
  --live: #4ade80;
  --focus: #78f6f3;

  /* Set-piece light (decorative only; never behind body copy) */
  --glow-cyan: rgba(81, 226, 242, 0.55);
  --glow-soft: rgba(81, 226, 242, 0.16);
  --scrim: rgba(9, 9, 11, 0.82);
  --veil: rgba(9, 9, 11, 0.98);
  /* Depth: a faint, static accent glow behind the hero, Architecture and the closing section,
     with a fine noise dither so the gradient never bands (Joshua, 2026-11-29) */
  --depth-glow: rgba(107, 193, 243, 0.05);
  --dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --sans: "Instrument Sans", "Instrument Sans Fallback", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale, fluid 375px → 1440px */
  --t-display: clamp(2.5rem, 1.5rem + 4.27vw, 5.25rem);
  --t-h2: clamp(1.875rem, 1.567rem + 1.31vw, 2.75rem);
  --t-quote: clamp(1.5rem, 1.192rem + 1.31vw, 2.375rem);
  --t-h3: clamp(1.1875rem, 1.143rem + 0.19vw, 1.3125rem);
  --t-lede: clamp(1.0625rem, 0.996rem + 0.28vw, 1.25rem);
  --t-body: clamp(1rem, 0.978rem + 0.09vw, 1.0625rem);
  --t-small: 0.875rem;
  --t-xs: 0.8125rem;

  /* Space: an 8px grid */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 64px;
  --s-7: 96px;
  --s-8: 128px;

  --margin: var(--s-3);
  --gutter: var(--s-3);
  --max: 1200px;
  --measure: 40rem;
  --measure-prose: 36rem; /* long legal paragraphs: about 75 characters a line */
  --measure-card: 28rem; /* small text in cards: about 76 characters a line */
  --section: var(--s-6);
  --head: var(--s-6);
  --r-1: 8px;
  --r-2: 16px;
  --r-pill: 999px;
  --tap: 48px;
  --dot: 8px;
  --hair: 1px;
  --line: 2px;

  /* Buttons (Joshua's spec, 2026-11-29). The 12px/20px padding is off the 8px grid by his
     decision. The secondary border (about 1.35:1) is a named contrast exception: the button's
     text identifies it (WCAG 1.4.11), and the focus ring stays 3:1 or better. */
  --btn-radius: 8px;
  --btn-pad-y: 12px;
  --btn-pad-x: 20px;
  --btn-track: -0.01em;
  --btn-bg: #ffffff;
  --btn-ink: #09090b;
  --btn-bg-hover: #e4e4e7;
  --btn-highlight: rgba(255, 255, 255, 0.6);
  --btn-ring: rgba(255, 255, 255, 0.1);
  --btn2-bg: rgba(255, 255, 255, 0.04);
  --btn2-bg-hover: rgba(255, 255, 255, 0.08);
  --btn2-ink: #ffffff;
  --btn2-border: rgba(255, 255, 255, 0.14);
  --btn2-border-hover: rgba(255, 255, 255, 0.3);
  --btn2-highlight: rgba(255, 255, 255, 0.08);

  /* Command menu */
  --palette-bg: rgba(17, 17, 20, 0.9);
  --palette-border: rgba(255, 255, 255, 0.12);
  --palette-scrim: rgba(0, 0, 0, 0.6);
  --palette-active: rgba(255, 255, 255, 0.08);
  --palette-blur: 16px;
  --palette-top: 12vh;
  --palette-width: 560px;
  --palette-max: 70vh;

  /* Blueprint details (decorative) */
  --rail: rgba(255, 255, 255, 0.06);
  --cross: rgba(255, 255, 255, 0.22);
  --cross-size: 12px;

  /* Closing section: the ribbon's faint bookend, and the headline's seal (a period drawn as the
     mark's dot). Both reuse set-pieces Joshua approved (ribbon; the seal's soft shadow, 2026-11-29). */
  --bookend-opacity: 0.4;
  --seal-shadow: rgba(107, 193, 243, 0.35);

  /* Operating-principle band (Joshua, 2026-11-29): the quote's two tones, its eyebrow and
     ticker dots. The dim tone is large display text, so the WCAG large-text bar (3:1) applies;
     both are gated by the contrast check. The eyebrow uses --muted (4.5:1 or better), not the dim tone. */
  --quote-dim: #71717a;
  --quote-bright: #fafafa;
  --quote-track: -0.03em;
  --quote-leading: 1.15;
  --t-eyebrow: 0.6875rem;
  --eyebrow-track: 0.14em;
  --ticker-dot: rgba(107, 193, 243, 0.6);
  --ticker-fade: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);

  /* Brand mark in the wordmark */
  --mark-size: 26px;

  /* Code drawers: hand-written highlighting, every colour gated against --bg */
  --code-k: #a99bff;
  --code-s: #78f6f3;
  --code-f: #6bc1f3;
  --code-n: #3da7eb;
  --code-c: #8b8b94;
  --code-ln: #8b8b94;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --t-slow: 900ms;
}
@media (min-width: 768px) {
  :root {
    --margin: var(--s-4);
    --section: var(--s-8);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: calc(var(--head) + var(--s-2));
}
/* No page-wide smooth scrolling: Chrome applies it to scroll restoration too, so a refresh
   would visibly scroll down from the top. Section jumps ask for smooth scrolling in home.js
   and palette.js instead (and skip it under reduced motion). */
body {
  margin: 0;
  font-size: var(--t-body);
  overflow-x: clip;
}
img,
canvas {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
h4 {
  color: var(--ink-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: var(--hair);
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness var(--t-fast) ease;
}
a:hover {
  text-decoration-thickness: var(--line);
}
:focus-visible {
  outline: var(--line) solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--blue);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--margin));
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* Skip link */
.skip {
  position: absolute;
  left: var(--s-2);
  top: var(--s-2);
  z-index: 60;
  padding: var(--s-1) var(--s-2);
  background: var(--ink);
  color: var(--on-light);
  border-radius: var(--r-1);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus-visible {
  transform: none;
}

/* ---------- Header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--veil);
  border-bottom: var(--hair) solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--head);
}
/* Wordmark: the "Gate" mark at 26px plus "Parque" (ink) "Media" (muted), Instrument Sans 600.
   The mark is drawn with the site's tokens (the same shapes as /favicon.svg). */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: var(--tap);
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .mark {
  flex: none;
  width: var(--mark-size);
  height: var(--mark-size);
}
.mark-bg {
  fill: var(--surface);
  stroke: var(--rule);
}
.mark-p {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mark-dot {
  fill: var(--link);
}
.wm-a {
  color: var(--ink-head);
}
.wm-b {
  color: var(--muted);
}
/* Dark text on a light button: macOS's "antialiased" smoothing thins it until it reads as grey,
   so the primary button uses the system's normal smoothing (light-on-dark text keeps antialiased). */
.btn:not(.quiet) {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}
.site-nav {
  margin-left: auto;
}
.site-nav ul {
  position: relative;
  display: flex;
  gap: var(--s-1);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--s-1);
  white-space: nowrap;
  color: var(--ink-2);
  font-size: var(--t-small);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--ink);
}
.site-nav .here {
  position: absolute;
  left: 0;
  bottom: var(--s-1);
  width: 1px;
  height: var(--line);
  background: var(--ink);
  transform: translateX(var(--x, 0)) scaleX(var(--w, 0));
  transform-origin: left;
  opacity: var(--o, 0);
  transition:
    transform var(--t-med) var(--ease-out),
    opacity var(--t-med) ease;
}
/* Below 720px the three section links get their own row under the wordmark, so every
   control fits on one line down to 320px (WCAG 1.4.10). */
@media (max-width: 719px) {
  html {
    scroll-padding-top: calc(var(--head) + var(--tap) + var(--s-2));
  }
  .site-head .wrap {
    flex-wrap: wrap;
    column-gap: var(--s-1);
    row-gap: 0;
    padding-inline: var(--s-2);
  }
  .wordmark {
    margin-right: auto;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin-left: calc(-1 * var(--s-1));
    border-top: var(--hair) solid var(--rule);
  }
  .site-nav ul {
    gap: 0;
  }
}
.wide-only {
  display: none;
}
@media (min-width: 1024px) {
  .wide-only {
    display: list-item;
  }
}

/* Pause motion (WCAG 2.2.2). Icon only on phones, with a label from 768px. */
.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: var(--tap);
  min-width: var(--tap);
  justify-content: center;
  padding-inline: var(--s-2);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}
.motion-toggle:hover {
  border-color: var(--ink);
}
.motion-toggle .icon {
  position: relative;
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
}
.motion-toggle[aria-pressed="true"] .icon {
  width: 0;
  height: 0;
  border-inline: 0;
  border-left: 10px solid currentColor;
  border-block: 6px solid transparent;
}
.motion-toggle .label {
  display: none;
}
@media (min-width: 768px) {
  .motion-toggle .label {
    display: inline;
  }
}
:root:not(.motion) .motion-toggle {
  display: none;
}

/* Command menu button: a fixed width so the ⌘K / Ctrl K label never shifts the nav. It takes
   its space from first paint but shows only once palette.js has started (no layout shift). */
.cmdk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: calc(var(--s-8) - var(--s-6));
  min-height: var(--tap);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  cursor: pointer;
  visibility: hidden;
}
.has-palette .cmdk {
  visibility: visible;
}
.cmdk:hover {
  border-color: var(--ink);
  color: var(--ink);
}
:root:not(.js) .cmdk {
  display: none;
}
@media (max-width: 599px) {
  /* phones: no keyboard shortcut to show, and the nav needs the room */
  .cmdk {
    display: none;
  }
}

/* Scroll progress: 1px under the nav, the link blue, no glow. Hidden under reduced motion
   (no .motion class) and where scroll-linked animation isn't supported; frozen by Pause. */
.progress {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--hair));
  height: var(--hair);
  background: var(--link);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .motion .progress {
    display: block;
    animation: progress-grow linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes progress-grow {
  to {
    transform: scaleX(1);
  }
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: var(--hair) solid transparent;
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  box-shadow:
    inset 0 1px 0 var(--btn-highlight),
    0 0 0 1px var(--btn-ring);
  color: var(--btn-ink);
  font: inherit;
  font-weight: 600;
  letter-spacing: var(--btn-track);
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--t-fast) var(--ease-out),
    background-color var(--t-fast) ease,
    border-color var(--t-fast) ease;
}
.btn:hover {
  text-decoration: none;
  background: var(--btn-bg-hover);
}
/* the lift only when motion is allowed (not under reduced motion) */
.motion .btn:hover {
  transform: translateY(-1px);
}
.motion .btn:active {
  transform: none;
}
.btn.quiet {
  background: var(--btn2-bg);
  border-color: var(--btn2-border);
  box-shadow: inset 0 1px 0 var(--btn2-highlight);
  color: var(--btn2-ink);
}
.btn.quiet:hover {
  background: var(--btn2-bg-hover);
  border-color: var(--btn2-border-hover);
}

/* ---------- Intro cover (needle drop) ---------- */
.intro-cover,
.skip-intro {
  display: none;
}
.intro .intro-cover {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  /* failsafe: if the script never runs, the cover clears itself at 1.8 s */
  animation: cover-failsafe var(--t-med) linear 1.8s forwards;
}
.intro .intro-cover canvas {
  width: 100%;
  height: 100%;
}
.intro-running .intro-cover {
  background: transparent;
  animation: none;
}
.intro .skip-intro {
  display: inline-flex;
  position: fixed;
  bottom: var(--s-3);
  right: var(--s-3);
  z-index: 90;
  animation: cover-failsafe var(--t-med) linear 1.8s forwards;
}
.intro-running .skip-intro {
  animation: none;
}
@keyframes cover-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: var(--s-7) 0 var(--s-6);
}
@media (min-width: 768px) {
  .hero {
    padding: var(--s-8) 0 var(--s-7);
  }
}
.ribbon {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  pointer-events: none;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-2);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: var(--scrim);
  color: var(--ink-2);
  font-size: var(--t-xs);
  line-height: 1.4;
  max-width: 100%;
}
/* the badge links to the contact section (Joshua, 2026-11-30): it keeps its pill look */
a.badge {
  text-decoration-line: none;
  transition: border-color var(--t-fast) ease;
}
a.badge:hover {
  border-color: var(--link);
  color: var(--ink);
}
a.badge:focus-visible {
  border-radius: var(--r-pill);
}
/* a numbered marker stays on the line with the word before it */
.nw {
  white-space: nowrap;
}
.badge .dot {
  position: relative;
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--live);
}
.badge .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: var(--hair) solid var(--live);
}
.motion .badge .dot::after {
  animation: dot-pulse 2.4s var(--ease-out) infinite;
}
@keyframes dot-pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}
.hero h1 {
  margin-top: var(--s-3);
  max-width: 24ch;
  font-size: var(--t-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
p,
li {
  text-wrap: pretty;
}
.tally {
  text-wrap: balance;
}
.lede {
  margin-top: var(--s-3);
  max-width: var(--measure);
  text-wrap: balance;
  color: var(--ink-2);
  font-size: var(--t-lede);
  line-height: 1.6;
}
.tally {
  margin-top: var(--s-2);
  color: var(--ink-2);
  font-size: var(--t-body);
}
.claim {
  transition: color var(--t-fast) ease;
}
.claim.is-active {
  color: var(--ink);
}
.num {
  position: relative;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}
.num .roll {
  position: absolute;
  inset: 0;
  color: var(--ink);
}
.num.rolling {
  color: transparent;
}
sup {
  position: relative;
  top: -0.55em;
  vertical-align: baseline;
  line-height: 0;
}
.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-pill);
  color: var(--link);
  font-size: var(--t-xs);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color var(--t-fast) ease,
    color var(--t-fast) ease,
    border-color var(--t-fast) ease;
}
.cite:hover,
.cite.is-active,
.cite[aria-expanded="true"] {
  background: var(--link);
  border-color: var(--link);
  color: var(--on-light);
}
.hero .actions {
  margin-top: var(--s-4);
  justify-content: center;
}

/* Hero arrival after the intro: blur to sharp, rising. Never from opacity 0. */
.intro .arrive {
  filter: blur(12px);
  transform: translateY(var(--s-2));
}
.arriving .arrive {
  animation: arrive var(--t-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes arrive {
  from {
    filter: blur(12px);
    transform: translateY(var(--s-2));
  }
  to {
    filter: blur(0);
    transform: none;
  }
}

/* Sources: a row of three cards on wide screens; disclosures on phones */
.sources {
  display: grid;
  gap: var(--s-2);
  width: 100%;
  margin-top: var(--s-5);
  text-align: left;
}
@media (min-width: 960px) {
  /* five cards: three on the first row, two wider ones on the second */
  .sources {
    grid-template-columns: repeat(6, 1fr);
    max-width: var(--max);
  }
  .source {
    grid-column: span 2;
  }
  .source:nth-child(n + 4) {
    grid-column: span 3;
  }
}
.source {
  padding: var(--s-2) var(--s-3) var(--s-3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--scrim);
  font-size: var(--t-small);
  color: var(--ink-2);
  transition: border-color var(--t-med) ease;
}
.source.is-active {
  border-color: var(--link);
}
.js .source {
  display: none;
}
.js .source.open {
  display: block;
}
@media (min-width: 960px) {
  .js .source {
    display: flex;
    flex-direction: column;
  }
  .source .src-links {
    margin-top: auto;
    padding-top: var(--s-2);
  }
}
.source .src-text {
  max-width: var(--measure-card);
}
.motion .source.open {
  animation: open-source var(--t-med) var(--ease-out);
}
@keyframes open-source {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.source > p:first-child {
  display: flex;
  align-items: baseline;
  gap: var(--s-1);
  color: var(--ink);
  font-weight: 600;
}
.src-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 24px;
  min-height: 24px;
  border-radius: var(--r-pill);
  border: var(--hair) solid var(--rule-strong);
  color: var(--link);
  font-size: var(--t-xs);
}
.source blockquote,
.source ul,
.source .src-text {
  margin-top: var(--s-1);
  color: var(--ink-2);
}
.source ul li + li {
  margin-top: var(--s-1);
}
.src-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin-top: var(--s-2);
}
.src-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.check {
  min-height: 1.6em;
  margin-top: var(--s-1);
  display: flex;
  align-items: center;
  gap: var(--s-1);
  color: var(--ink-2);
}
.check .mark {
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--rule-strong);
}
.check.ok .mark {
  background: var(--live);
}
.check.ok {
  color: var(--live);
}
.check.fail .mark {
  background: var(--violet-ink);
}
.check.fail {
  color: var(--violet-ink);
}
.motion .check.pending .mark {
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section);
  border-top: var(--hair) solid var(--rule);
}
.section-head {
  max-width: var(--measure);
  margin-bottom: var(--s-5);
}
.section-head h2 {
  font-size: var(--t-h2);
}
.section-head p {
  margin-top: var(--s-2);
  color: var(--ink-2);
  font-size: var(--t-lede);
}

/* ---------- Work: product panels ---------- */
.panels {
  display: grid;
  gap: var(--s-3);
}
@media (min-width: 900px) {
  .panels {
    grid-template-columns: repeat(2, 1fr);
  }
}
.panel {
  min-width: 0; /* grid item: may shrink to the phone width (WCAG 1.4.10 reflow at 320px) */
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface);
}
.panel.quiet {
  background: var(--bg);
}
/* Card-border spotlight (fine pointers only; set-piece) */
.fine .panel::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--hair));
  border-radius: inherit;
  padding: var(--hair);
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, -200px), var(--glow-cyan), transparent 70%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity var(--t-med) ease;
  pointer-events: none;
}
.fine.motion .panel:hover::before {
  opacity: 1;
}
.frame {
  margin: var(--s-1) var(--s-1) 0;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-1);
  overflow: hidden;
  background: var(--surface-2);
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-height: var(--s-4);
  padding-inline: var(--s-2);
  border-bottom: var(--hair) solid var(--rule);
}
.frame-bar .dots {
  display: flex;
  gap: var(--s-1);
}
.frame-bar .dots i {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--frame-dot);
}
.frame-bar .url {
  flex: 1;
  margin-right: var(--s-4);
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}
.frame figcaption {
  padding: var(--s-1) var(--s-2);
  border-top: var(--hair) solid var(--rule);
  color: var(--muted);
  font-size: var(--t-xs);
}
.panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex: 1;
  padding: var(--s-3);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-2);
}
.panel h3 {
  font-size: var(--t-h3);
}
.panel h3 .sub {
  display: block;
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 400;
  letter-spacing: 0;
}
.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 0 var(--s-1);
  line-height: 1.8;
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--t-xs);
  font-weight: 600;
}
.status.live {
  color: var(--live);
  border-color: var(--live);
}
.purpose {
  color: var(--ink-2);
}
.facts {
  display: grid;
  gap: var(--s-1) var(--s-2);
  font-size: var(--t-small);
}
@media (min-width: 560px) {
  .facts {
    grid-template-columns: max-content 1fr;
  }
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  color: var(--ink);
}
.facts dd + dt {
  margin-top: var(--s-1);
}
@media (min-width: 560px) {
  .facts dd + dt {
    margin-top: 0;
  }
}
.record-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: auto;
  padding-top: var(--s-1);
  font-size: var(--t-small);
}
.record-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.panels-minor {
  margin-top: var(--s-3);
}
/* Lexmere, the featured system: full width. Its capture is nearly square, so it stacks above
   the details below 1024px, and from 1024px sits beside them, large enough to read, with the
   details centred against it (Joshua, 2026-11-30); the details step up one size on the type
   scale to sit better beside it. Below 1024px the capture is too small to read, so the whole
   image is a link to the full-size file (".shot-open", laid over the image so the image keeps
   its own alt text); from 1024px the link is removed (display: none: not focusable, not read). */
.panel.featured {
  grid-column: 1 / -1;
}
.shot {
  position: relative;
}
.shot-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--s-1);
}
.shot-open:focus-visible {
  outline-offset: calc(-2 * var(--line));
  border-radius: var(--r-1);
}
.shot-hint {
  padding: 0 var(--s-1);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-xs);
}
@media (min-width: 1024px) {
  .shot-open {
    display: none;
  }
  .panel.featured {
    display: grid;
    grid-template-columns: 7fr 5fr;
    align-items: center;
  }
  .panel.featured .frame {
    margin: var(--s-1);
  }
  .panel.featured .purpose {
    font-size: var(--t-lede);
  }
  .panel.featured .facts {
    font-size: var(--t-body);
  }
}
/* the Lexmere capture is shown whole at its real shape (1640×1562; files 1120×1067 and 640×610):
   never cropped. The aspect ratio reserves its space (no layout shift); contain guarantees no crop. */
.panel.featured .frame figcaption .cap {
  display: block;
  max-width: 65ch;
}
.panel.featured .frame img {
  aspect-ratio: 1120 / 1067;
  object-fit: contain;
}
/* the Security Scanner, last and alone: full width */
.panels-minor .panel:only-child {
  grid-column: 1 / -1;
}

/* ---------- How I build: Repo Explainer's request path ---------- */
.path-title {
  font-size: var(--t-h3);
}
.path-intro {
  max-width: var(--measure);
  margin-top: var(--s-1);
  color: var(--ink-2);
}
.pipeline {
  position: relative;
  margin-top: var(--s-4);
}
.stages {
  display: grid;
  gap: var(--s-2);
}
.pipe-track {
  position: absolute;
  left: calc(var(--s-3) - 1px);
  top: var(--s-3);
  bottom: var(--s-3);
  width: var(--line);
  background: var(--rule);
  overflow: hidden;
  pointer-events: none;
}
.pipe-track .pulse {
  position: absolute;
  inset: 0;
  transform: translateY(-100%);
}
.pipe-track .pulse::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 56px;
  margin-left: -3px;
  border-radius: var(--r-pill);
  background: linear-gradient(to bottom, transparent, var(--cyan));
  box-shadow: 0 0 16px var(--glow-cyan);
}
.motion .pipeline.in-view .pulse {
  animation: lane-y 3.6s linear infinite;
  animation-delay: calc(var(--p, 0) * -1.2s);
}
@keyframes lane-y {
  to {
    transform: translateY(100%);
  }
}
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0; /* a grid item may shrink below its code's width, so the code scrolls inside */
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-6);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface);
  transition:
    border-color var(--t-fast) ease,
    translate var(--t-fast) var(--ease-out);
}
.stage .node {
  position: absolute;
  left: var(--s-1);
  top: var(--s-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--s-4);
  height: var(--s-4);
  border-radius: 50%;
  border: var(--hair) solid var(--rule-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
}
.stage h4 {
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1.3;
}
.stage p {
  margin-top: var(--s-1);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.stage details {
  margin-top: var(--s-1);
  font-size: var(--t-small);
}
.stage summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--link);
  cursor: pointer;
}
.stage summary:hover {
  text-decoration: underline;
}
.stage blockquote {
  margin-top: var(--s-1);
  padding-left: var(--s-2);
  border-left: var(--line) solid var(--rule-strong);
  color: var(--ink);
}
/* "View code" sits at the bottom of every card and opens its drawer. The whole card is its
   hit area, except "From the case study", which stays a separate control above it. */
.stage-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--s-1);
  min-height: var(--tap);
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  cursor: pointer;
}
.stage-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.stage details {
  position: relative;
  z-index: 1;
  margin-bottom: var(--s-1);
}
.code-icon {
  font-family: var(--mono);
  font-size: var(--t-xs);
}
.chev {
  width: var(--s-1);
  height: var(--s-1);
  margin-left: calc(var(--hair) * 2);
  border-right: var(--line) solid currentColor;
  border-bottom: var(--line) solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform var(--t-fast) var(--ease-out);
}
.stage-btn[aria-expanded="true"] {
  color: var(--ink);
}
.stage-btn[aria-expanded="true"] .chev {
  transform: translateY(25%) rotate(225deg);
}
/* hover and keyboard focus: the border brightens; the card lifts only when motion is allowed */
.stage:hover,
.stage:has(.stage-btn:focus-visible) {
  border-color: var(--rule-strong);
}
.motion:not(.paused) .stage:hover,
.motion:not(.paused) .stage:has(.stage-btn:focus-visible) {
  translate: 0 calc(var(--line) * -1);
}
.stage.is-open {
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}
/* Request-path tabs: Repo Explainer and Lexmere. Without JS both panels show and the tabs hide. */
.path-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-4);
  border-bottom: var(--hair) solid var(--rule);
}
.path-tab {
  min-height: var(--tap);
  margin-bottom: calc(var(--hair) * -1);
  padding: 0 var(--s-2);
  border: 0;
  border-bottom: var(--line) solid transparent;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  cursor: pointer;
}
.path-tab:hover {
  color: var(--ink);
}
.path-tab[aria-selected="true"] {
  border-bottom-color: var(--link);
  color: var(--ink);
}
:root:not(.js) .path-tabs {
  display: none;
}
.js .path-panel.is-hidden {
  display: none;
}
:root:not(.js) .path-panel + .path-panel {
  margin-top: var(--s-6);
}
.stage-src {
  font-size: var(--t-xs);
  overflow-wrap: break-word;
}
.stage .stage-src {
  color: var(--muted);
}
.stage-src code {
  font-family: var(--mono);
}
.path-hint {
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--t-small);
}
:root:not(.js) .path-hint,
:root:not(.js) .stage-btn {
  display: none;
}
.drawer {
  min-width: 0;
  margin-top: var(--s-2);
  padding: var(--s-2);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface);
  cursor: auto;
}
.stage .drawer {
  position: relative;
  z-index: 1;
  margin-left: calc(var(--s-2) - var(--s-6));
}
/* A notch on the open drawer points at its card: under the row, home.js sets --notch-x to the
   open card's centre; when stacked, the drawer sits inside its card, under "Showing code". */
.drawer.open {
  position: relative;
}
.drawer.open::before {
  content: "";
  position: absolute;
  top: calc(var(--s-1) * -1);
  left: var(--notch-x, var(--s-4));
  width: var(--s-2);
  height: var(--s-2);
  margin-left: calc(var(--s-1) * -1);
  border-top: var(--hair) solid var(--link);
  border-left: var(--hair) solid var(--link);
  background: var(--surface);
  transform: rotate(45deg);
}
.drawers .drawer.open {
  border-color: var(--link);
}
.js .drawer:not(.open) {
  display: none;
}
.drawer-head {
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
}
.stage .drawer-head {
  display: none;
}
.drawer-note {
  margin-top: var(--s-1);
  color: var(--muted);
  font-size: var(--t-xs);
}
.excerpt {
  margin-top: var(--s-2);
}
.excerpt figcaption {
  color: var(--ink-2);
  font-size: var(--t-xs);
}
.excerpt figcaption code {
  font-family: var(--mono);
  color: var(--ink);
}
.code {
  margin-top: var(--s-1);
  padding: var(--s-2);
  overflow-x: auto;
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-1);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.7;
  tab-size: 2;
}
.code .line {
  white-space: pre;
}
.code {
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.code::-webkit-scrollbar {
  height: var(--s-1);
}
.code::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  background: var(--rule-strong);
}
@media (max-width: 640px) {
  .stage .drawer {
    padding: 0;
    border: 0;
    background: none;
  }
}
.code .line::before {
  content: attr(data-n);
  content: attr(data-n) / "";
  display: inline-block;
  width: 4ch;
  margin-right: 2ch;
  color: var(--code-ln);
  text-align: right;
  user-select: none;
}
.code .omit,
.tk-c {
  color: var(--code-c);
}
.tk-k {
  color: var(--code-k);
}
.tk-s {
  color: var(--code-s);
}
.tk-f {
  color: var(--code-f);
}
.tk-n {
  color: var(--code-n);
}
@media (min-width: 1100px) {
  .stages {
    grid-template-columns: repeat(6, 1fr);
    align-items: stretch;
  }
  .pipe-track {
    left: var(--s-4);
    right: var(--s-4);
    top: calc(var(--s-3) + var(--s-2) - 1px);
    bottom: auto;
    width: auto;
    height: var(--line);
  }
  .pipe-track .pulse {
    transform: translateX(-100%);
  }
  .pipe-track .pulse::after {
    left: auto;
    right: 0;
    top: 50%;
    bottom: auto;
    width: 56px;
    height: 6px;
    margin: -3px 0 0;
    background: linear-gradient(to right, transparent, var(--cyan));
  }
  .motion .pipeline.in-view .pulse {
    animation-name: lane-x;
  }
  .stage {
    padding: calc(var(--s-6) + var(--s-1)) var(--s-2) var(--s-2);
  }
  .stage .node {
    left: var(--s-2);
    top: var(--s-2);
  }
}
@keyframes lane-x {
  to {
    transform: translateX(100%);
  }
}
.path-caption {
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--t-xs);
}

/* Safeguards prose and table */
.safeguards {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-6);
}
@media (min-width: 960px) {
  .safeguards {
    grid-template-columns: 5fr 7fr;
    gap: var(--s-6);
  }
  /* beside the table: sticky under the header, released when the table ends */
  .safeguards-text {
    position: sticky;
    top: calc(var(--head) + var(--s-3));
    align-self: start;
  }
}
.safeguards h3 {
  font-size: var(--t-h3);
}
.safeguards-text p {
  margin-top: var(--s-2);
  color: var(--ink-2);
}
.trust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}
.trust-table caption {
  padding-bottom: var(--s-2);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.trust-table th,
.trust-table td {
  padding: var(--s-1) var(--s-2) var(--s-1) 0;
  border-bottom: var(--hair) solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.trust-table thead th {
  color: var(--muted);
  font-weight: 400;
}
.trust-table tbody tr {
  background: var(--surface);
}
.trust-table tbody th {
  padding-left: var(--s-2);
  color: var(--ink);
  font-weight: 400;
}
.trust-table td {
  color: var(--ink-2);
}

/* ---------- Ask this page ---------- */
.ask {
  margin-top: var(--s-6);
  padding: var(--s-3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface);
}
@media (min-width: 768px) {
  .ask {
    padding: var(--s-4);
  }
}
.ask h3 {
  font-size: var(--t-h3);
}
.ask-note {
  max-width: var(--measure);
  margin-top: var(--s-1);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.ask-form {
  display: grid;
  gap: var(--s-1) var(--s-2);
  margin-top: var(--s-3);
}
@media (min-width: 640px) {
  .ask-form {
    grid-template-columns: 1fr auto;
  }
  .ask-form label {
    grid-column: 1 / -1;
  }
}
.ask-form label {
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
}
.ask-form input {
  min-height: var(--tap);
  padding: 0 var(--s-2);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--ink);
  font: inherit;
}
.ask-form input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.ask-form input:focus-visible {
  border-color: var(--focus);
  outline-offset: 0;
}
/* Ask needs ask.js, so its form and suggestions show only when JavaScript runs. They are shown by
   the boot script's "js" class (set before the first paint), not revealed by ask.js after it loads,
   so nothing shifts on a reload that lands on this section (Pass 3, the hub search's CLS fix). */
html:not(.js) .ask-form,
html:not(.js) .suggest {
  display: none;
}
.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-2);
}
.suggest button {
  min-height: var(--s-5);
  padding: 0 var(--s-2);
  border: var(--hair) solid var(--rule);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}
.suggest button:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}
.ask-out:not(:empty) {
  margin-top: var(--s-3);
}
.answer {
  padding: var(--s-2) var(--s-3);
  border-left: var(--line) solid var(--link);
  background: var(--surface-2);
  border-radius: 0 var(--r-1) var(--r-1) 0;
}
.answer.refusal {
  border-left-color: var(--violet-ink);
}
.answer.nudge {
  border-left-color: var(--rule-strong);
}
.answer.fresh {
  animation: open-source var(--t-med) var(--ease-out);
}
.answer .q {
  color: var(--muted);
  font-size: var(--t-small);
}
.answer .a {
  margin-top: var(--s-1);
  color: var(--ink);
}
.answer .src {
  margin-top: var(--s-1);
  color: var(--ink-2);
  font-size: var(--t-small);
}

/* ---------- Principle ---------- */
/* ---------- Depth: faint static glow behind the hero, Architecture and the closing section ---------- */
.hero,
#architecture,
.contact {
  background-image: var(--dither), radial-gradient(ellipse 70% 55% at 50% 0%, var(--depth-glow), transparent 70%);
}
#architecture {
  background-image: var(--dither), radial-gradient(ellipse 60% 40% at 50% 12%, var(--depth-glow), transparent 70%);
}
.contact {
  background-image: var(--dither), radial-gradient(ellipse 60% 70% at 50% 60%, var(--depth-glow), transparent 70%);
}

/* ---------- Closing section: bookend ribbon and seal ---------- */
.contact {
  position: relative;
  overflow: hidden;
}
.bookend {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: var(--bookend-opacity);
  pointer-events: none;
}
.contact .wrap {
  position: relative;
}
.seal {
  position: relative;
  display: inline-block;
  width: 0.19em;
  height: 0.19em;
  margin-left: 0.05em;
  border-radius: 50%;
  background: var(--link);
}
.seal::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 115%;
  width: 0.34em;
  height: 0.08em;
  margin-left: -0.17em;
  border-radius: 50%;
  background: var(--seal-shadow);
  filter: blur(2px);
}
/* drops into place once when the section comes into view (home.js adds .drop); under reduced
   motion or Pause the dot is simply there */
.motion:not(.paused) .seal:not(.drop) {
  opacity: 0;
  transform: translateY(-0.6em);
}
.motion:not(.paused) .seal:not(.drop)::after {
  opacity: 0;
  transform: scaleX(0.4);
}
.motion .seal.drop {
  animation: seal-drop 640ms var(--ease-out) both;
}
.motion .seal.drop::after {
  animation: seal-shadow 640ms var(--ease-out) both;
}
@keyframes seal-drop {
  from {
    opacity: 0;
    transform: translateY(-0.6em);
  }
}
@keyframes seal-shadow {
  from {
    opacity: 0;
    transform: scaleX(0.4);
  }
}
.paused .seal,
.paused .seal::after {
  opacity: 1;
  transform: none;
  animation: none;
}

/* The pull quote's section: about 40% less vertical padding (128px → 80px, 64px → 40px) */
.section.principle-section {
  padding-block: calc(var(--section) * 5 / 8);
}
/* "Built with": a slow ticker of plain names. Screen readers get the hidden list instead.
   Under reduced motion it is a static, wrapped row; Pause freezes it; it runs only on screen. */
.built-with {
  margin-top: var(--s-4);
}
.ticker {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--t-small);
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
}
.ticker-track span::after {
  content: "·";
  content: "·" / "";
  padding-inline: var(--s-2);
  color: var(--ticker-dot);
}
/* moving: the row fades out at both edges */
.motion:not(.paused) .ticker {
  -webkit-mask-image: var(--ticker-fade);
  mask-image: var(--ticker-fade);
}
/* reduced motion or paused: a static, wrapped, centred row with no edge fade */
:root:not(.motion) .ticker,
.paused .ticker {
  white-space: normal;
}
:root:not(.motion) .ticker-track,
.paused .ticker-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-1) var(--s-3);
  transform: none;
  animation: none;
}
:root:not(.motion) .ticker-track span::after,
.paused .ticker-track span::after {
  content: none;
}
:root:not(.motion) .ticker .dup,
.paused .ticker .dup {
  display: none;
}
.motion .ticker.in-view .ticker-track {
  animation: ticker 48s linear infinite;
}
/* Pause stops the ticker outright (a static row, above), not just mid-scroll */
.motion.paused .ticker.in-view .ticker-track {
  animation: none;
}
@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}
.principle-section {
  background-image: var(--dither), radial-gradient(ellipse 60% 50% at 50% 45%, var(--depth-glow), transparent 70%);
}
.principle {
  text-align: center;
}
.principle .eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-eyebrow);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
}
.principle blockquote {
  margin-top: var(--s-2);
}
.principle blockquote p {
  font-size: var(--t-quote);
  font-weight: 600;
  line-height: var(--quote-leading);
  letter-spacing: var(--quote-track);
}
/* one sentence per line, and a sentence never breaks inside itself */
.principle .q-a,
.principle .q-b {
  display: block;
  white-space: nowrap;
}
.principle .q-a {
  color: var(--quote-dim);
}
.principle .q-b {
  color: var(--quote-bright);
}
.principle-link {
  margin-top: var(--s-2);
  font-size: var(--t-small);
}
.principle-link a {
  display: inline-block;
  padding-block: var(--s-1);
}

/* ---------- Notes ---------- */
.note-list {
  display: grid;
  gap: var(--s-3);
}
@media (min-width: 768px) {
  .note-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.note-list li {
  padding-top: var(--s-3);
  border-top: var(--hair) solid var(--rule-strong);
}
.note-list h3 {
  font-size: var(--t-h3);
}
.note-list h3 a {
  color: var(--ink);
}
.note-list p {
  margin-top: var(--s-1);
  color: var(--ink-2);
}
.note-list .meta {
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
}
.contact h2 {
  font-size: var(--t-h2);
}
.contact p {
  max-width: var(--measure);
  margin: var(--s-2) auto 0;
  color: var(--ink-2);
  font-size: var(--t-lede);
}
.contact .actions {
  justify-content: center;
  margin-top: var(--s-4);
}

/* ---------- Footer ---------- */
.site-foot {
  padding-block: var(--s-5);
  border-top: var(--hair) solid var(--rule);
  font-size: var(--t-small);
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}
.site-foot nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-2);
}
.site-foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink-2);
}
.site-foot nav a:hover {
  color: var(--ink);
}
.copy {
  margin-top: var(--s-2);
  color: var(--muted);
}
/* A static line written at build time from the Systems section and the links check.
   Not live monitoring, so the dot never pulses. */
.status-line {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-3);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: var(--t-xs);
}
.status-dot {
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--live);
}

/* ---------- Blueprint details (decorative, wide screens only) ---------- */
@media (min-width: 1024px) {
  #content {
    position: relative;
  }
  #content::before,
  #content::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--hair);
    background: var(--rail);
    pointer-events: none;
  }
  #content::before {
    left: max(var(--s-1), calc((100% - var(--max)) / 2 - var(--s-3)));
  }
  #content::after {
    right: max(var(--s-1), calc((100% - var(--max)) / 2 - var(--s-3)));
  }
  .section.marked {
    position: relative;
  }
  .section.marked::before,
  .section.marked::after {
    content: "+";
    content: "+" / "";
    position: absolute;
    top: calc(var(--cross-size) / -2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cross-size);
    height: var(--cross-size);
    color: var(--cross);
    font-family: var(--mono);
    font-size: var(--cross-size);
    line-height: 1;
    pointer-events: none;
  }
  .section.marked::before {
    left: calc(max(var(--s-1), calc((100% - var(--max)) / 2 - var(--s-3))) - var(--cross-size) / 2);
  }
  .section.marked::after {
    right: calc(max(var(--s-1), calc((100% - var(--max)) / 2 - var(--s-3))) - var(--cross-size) / 2);
  }
}

/* ---------- Command menu ---------- */
.palette {
  width: min(var(--palette-width), calc(100% - 2 * var(--s-2)));
  max-height: min(var(--palette-max), calc(var(--s-8) * 4));
  margin: var(--palette-top) auto auto;
  padding: 0;
  border: var(--hair) solid var(--palette-border);
  border-radius: var(--r-2);
  background: var(--palette-bg);
  -webkit-backdrop-filter: blur(var(--palette-blur));
  backdrop-filter: blur(var(--palette-blur));
  color: var(--ink);
  overflow: hidden;
}
.palette[open] {
  display: flex;
  flex-direction: column;
}
.palette::backdrop {
  background: var(--palette-scrim);
}
.palette-search {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-2);
  border-bottom: var(--hair) solid var(--palette-border);
}
.palette-search:focus-within {
  border-bottom-color: var(--focus);
}
.palette-search input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-body);
  outline: none;
}
.palette-search input::placeholder {
  color: var(--muted);
}
.palette-esc {
  flex: none;
  padding: 0 var(--s-1);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-1);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
}
.palette-list {
  overflow-y: auto;
  padding: var(--s-1);
  list-style: none;
}
.palette-list [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-1);
  cursor: pointer;
}
.palette-list [role="option"].is-active {
  background: var(--palette-active);
}
.palette-list [role="option"].is-active .opt-hint {
  color: var(--ink-2);
}
.opt-hint {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-none {
  padding: var(--s-2);
  color: var(--muted);
  font-size: var(--t-small);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-4);
  z-index: 70;
  max-width: calc(100% - 2 * var(--s-2));
  padding: var(--s-1) var(--s-2);
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--ink);
  font-size: var(--t-small);
  opacity: 0;
  transform: translate(-50%, var(--s-2));
  transition:
    opacity var(--t-med) ease,
    transform var(--t-med) var(--ease-out);
  pointer-events: none;
}
.toast:empty {
  display: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Scroll reveals (JS adds .rv only when motion is allowed) ---------- */
.rv {
  transition:
    opacity var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.rv-rise:not(.in) {
  opacity: 0;
  transform: translateY(var(--s-3));
}
.rv-settle:not(.in) {
  opacity: 0;
  transform: translateY(var(--s-1));
}
.rv-row:not(.in) {
  opacity: 0;
}
.rv-draw .pipe-track {
  transform-origin: left top;
  transition: transform var(--t-slow) var(--ease-in-out);
}
.rv-draw:not(.in) .pipe-track {
  transform: scaleY(0);
}
@media (min-width: 1100px) {
  .rv-draw:not(.in) .pipe-track {
    transform: scaleX(0);
  }
}

/* ---------- Motion off: reduced motion or "Pause motion" ---------- */
.paused *,
.paused *::before,
.paused *::after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ribbon {
    animation: none !important;
  }
}

/* ---------- Parallax: the ribbon drifts a little as the hero scrolls away ---------- */
@supports (animation-timeline: scroll()) {
  .motion:not(.paused) .ribbon {
    animation: drift linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }
}
@keyframes drift {
  to {
    transform: translateY(18%);
  }
}

/* ---------- Print: black on white, no motion or set-pieces ---------- */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-3: #ffffff;
    --ink: #000000;
    --ink-2: #222222;
    --muted: #444444;
    --link: #000000;
    --rule: #999999;
    --rule-strong: #666666;
    --scrim: #ffffff;
    --veil: #ffffff;
    --live: #000000;
  }
  html {
    color-scheme: light;
  }
  .site-head,
  .ribbon,
  .intro-cover,
  .skip-intro,
  .motion-toggle,
  .pipe-track,
  .ask,
  .skip {
    display: none !important;
  }
  .js .source {
    display: block;
  }
  .rv,
  .arrive {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
