/* ============================================================================
   DAYNOUGHT DESIGN SYSTEM  ·  v1  ·  brief §5.6
   Foundations + component system. Dark is the only theme.
   No web fonts, no third-party requests.
   ========================================================================== */

/* ---------- 1. TOKENS ---------------------------------------------------- */

:root {
  /* Base ramp — near-black */
  --ink-900: #0A0A0B;   /* page base            */
  --ink-850: #0D0D0F;   /* alternate band       */
  --ink-800: #121216;   /* card                 */
  --ink-750: #17171C;   /* raised card / inset  */

  /* Silver / graphite ramp — 5 steps */
  --silver-1: #F4F5F7;  /* near-white text            */
  --silver-2: #C8CCD2;  /* secondary text, mono values */
  --silver-3: #9AA0A8;  /* body muted   (7.4:1 on base) */
  --silver-4: #868C94;  /* small labels  (5.7:1 on base) */
  --silver-5: #3E434A;  /* borders and disabled only, never text */

  --white: #FFFFFF;

  /* Semantic — exactly two hues, per brief */
  --pass:  #3FB950;     /* PASS / IDENTICAL / ✓ */
  --amber: #D29922;     /* in-progress          */
  --pass-bg:  rgba(63, 185, 80, 0.10);
  --amber-bg: rgba(210, 153, 34, 0.10);

  /* Hairlines */
  --rule:   rgba(255, 255, 255, 0.10);
  --rule-2: rgba(255, 255, 255, 0.15);

  /* Type families */
  --font-display: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
               'Liberation Mono', 'Courier New', monospace;

  /* 8px spacing scale */
  --s1: 8px;   --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5: 40px;  --s6: 48px;  --s8: 64px;  --s10: 80px;
  --s12: 96px; --s16: 128px;

  /* Rhythm & grid */
  --section-y: clamp(64px, 9vw, 160px);
  --measure: 1200px;
  --gutter: clamp(20px, 4vw, 40px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --t-fast: 150ms;
  --t-base: 220ms;
}

/* ---------- 2. RESET & BASE --------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--silver-2);
  background: var(--ink-900);
  overflow-x: hidden;
}

/* Grain — one inline SVG, no network request */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.030;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

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

::selection { background: var(--silver-1); color: var(--ink-900); }

.container {
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 860px; }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--ink-850); border-block: 1px solid var(--rule); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  color: var(--ink-900);
  padding: 12px 20px;
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- 3. TYPOGRAPHY ------------------------------------------------ */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.03;
  color: var(--white);
  font-size: clamp(44px, 7vw, 96px);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-weight: 700;
}

h1 { font-size: clamp(34px, 5vw, 64px); }
h2 { font-size: clamp(27px, 3.4vw, 44px); }
h3 { font-size: clamp(19px, 1.6vw, 22px); letter-spacing: -0.01em; }
h4 { font-size: 17px; letter-spacing: 0; }

p { max-width: 68ch; }
.lede { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; color: var(--silver-2); }
.muted { color: var(--silver-3); }
.small { font-size: 14px; line-height: 1.55; }

/* The mono-as-truth motif: every number, hash, metric and command */
.mono, .num, code, kbd, samp, pre { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--silver-3);
}

/* ---------- 4. SECTION HEADER (numbered index motif) -------------------- */

.section-header { margin-bottom: var(--s6); }

.section-header__index {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.section-header__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--silver-4);
  letter-spacing: 0.1em;
}

.section-header__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--white);
  white-space: nowrap;
}

.section-header__index::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-header p { margin-top: var(--s2); color: var(--silver-3); }

/* ---------- 5. TAG / CHIP ----------------------------------------------- */

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 13px;
  white-space: nowrap;
}

/* ---------- 6. PROOF BADGE ---------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}

.badge--pass {
  color: var(--pass);
  background: var(--pass-bg);
  border-color: rgba(63, 185, 80, 0.30);
}

.badge--amber {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: rgba(210, 153, 34, 0.30);
}

.badge--neutral {
  color: var(--silver-2);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--rule);
}

.badge__mark { font-size: 12px; line-height: 1; }

/* ---------- 7. STAT TILE ------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

/* Fixed-column variants avoid orphaned tiles on the last row. */
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .stat-grid--3, .stat-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .stat-grid--3, .stat-grid--4 { grid-template-columns: 1fr; }
}

.stat-tile {
  background: var(--ink-850);
  padding: var(--s4) var(--s3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-tile__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  letter-spacing: -0.02em;
}

.stat-tile__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--silver-3);
}

.stat-tile__source {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--silver-4);
  margin-top: auto;
  padding-top: var(--s1);
}

.stat-tile__badge { margin-top: 2px; }

/* ---------- 8. HASH BLOCK ----------------------------------------------- */

.hash {
  background: var(--ink-750);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s2) var(--s3);
}

.hash__row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.hash__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--silver-4);
}

.hash__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--silver-1);
  word-break: break-all;
  flex: 1;
  min-width: 200px;
}

.hash__value[data-truncated='true'] .hash__rest { display: none; }

.hash__actions { display: flex; gap: var(--s1); }

.btn-icon {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--silver-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.btn-icon:hover { color: var(--white); border-color: var(--rule-2); }

/* Paired hashes with match indicator */
.hash-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s2);
  align-items: center;
}

.hash-pair__match {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--pass);
}

.hash-pair__match span {
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .hash-pair { grid-template-columns: 1fr; }
  .hash-pair__match { flex-direction: row; }
}

/* ---------- 9. CODE VIEWER ---------------------------------------------- */

.code-viewer {
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-850);
}

.code-viewer__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-800);
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-viewer__tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--silver-4);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 13px 20px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}

.code-viewer__tab:hover { color: var(--silver-2); }
.code-viewer__tab[aria-selected='true'] {
  color: var(--white);
  border-bottom-color: var(--silver-2);
  background: var(--ink-850);
}

.code-viewer__panel[hidden] { display: none; }

.code-viewer__caption {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--silver-3);
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.015);
}

.code-viewer__scroll { overflow-x: auto; max-height: 460px; overflow-y: auto; }

.code-viewer pre {
  display: flex;
  font-size: 13px;
  line-height: 1.7;
  padding: var(--s2) 0;
}

.code-viewer__gutter {
  flex: 0 0 auto;
  padding-inline: 16px 14px;
  text-align: right;
  color: var(--silver-4);
  user-select: none;
  border-right: 1px solid var(--rule);
}

.code-viewer__code {
  flex: 1;
  padding-inline: 18px;
  color: var(--silver-2);
  white-space: pre;
}

/* Prisma / code tokens — greyscale + one accent, no rainbow */
.tok-kw  { color: var(--white); font-weight: 700; }
.tok-typ { color: var(--silver-1); }
.tok-att { color: var(--silver-4); }
.tok-str { color: var(--pass); }
.tok-com { color: var(--silver-4); font-style: italic; }
.tok-num { color: var(--silver-1); }

/* ---------- 10. BRIEF DOCUMENT ------------------------------------------ */

.brief-doc {
  position: relative;
  max-width: 920px;          /* reads as a sheet, not a full-bleed panel */
  margin-inline: auto;
  background: #101013;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
              0 24px 60px rgba(0, 0, 0, 0.5);
}

.brief-doc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  flex-wrap: wrap;
  padding: 14px var(--s4);
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.02);
}

.brief-doc__title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--silver-3);
}

.brief-doc__body {
  padding: var(--s6) clamp(24px, 5vw, 64px);
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--silver-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.brief-doc__body p + p { margin-top: 1.4em; }

.brief-doc__foot {
  padding: 12px var(--s4);
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--silver-4);
}

/* ---------- 11. NUMBERED CALLOUT CARDS ---------------------------------- */

.callouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--s3);
  counter-reset: callout;
}

.callout {
  position: relative;
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s4) var(--s3) var(--s4) var(--s3);
  transition: border-color var(--t-base) var(--ease),
              transform var(--t-base) var(--ease);
}

.callout:hover { border-color: var(--rule-2); transform: translateY(-2px); }

.callout::before {
  counter-increment: callout;
  content: counter(callout, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--silver-4);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--s2);
}

.callout__in {
  font-size: 13.5px;
  color: var(--silver-3);
  line-height: 1.6;
  margin-bottom: 10px;
}

.callout__out {
  font-size: 15px;
  color: var(--white);
  line-height: 1.5;
  font-weight: 500;
}

.callout__arrow { color: var(--silver-4); font-family: var(--font-mono); }

/* ---------- 12. EXAMPLE CARD -------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s3);
}

.example-card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s3);
  transition: transform var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}

.example-card:hover {
  transform: translateY(-3px);
  border-color: var(--rule-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 18px 40px rgba(0, 0, 0, 0.45);
}

.example-card__title { font-size: 19px; }
.example-card__summary { font-size: 14px; color: var(--silver-3); }

.example-card__stats {
  display: flex;
  gap: var(--s3);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

.mini-stat { display: flex; flex-direction: column; gap: 3px; }
.mini-stat__v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--white);
}
.mini-stat__l {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--silver-4);
}

/* ---------- 13. TIMELINE RAIL ------------------------------------------- */

.rail { position: relative; padding-left: 26px; }

.rail::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--rule);
}

.rail__item { position: relative; padding-bottom: var(--s4); }
.rail__item:last-child { padding-bottom: 0; }

.rail__item::before {
  content: '';
  position: absolute;
  left: -26px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-900);
  border: 1px solid var(--silver-3);
}

.rail__date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver-4);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- 14. SCREENS GALLERY + LIGHTBOX ------------------------------ */

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s3);
}

.screen {
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-800);
  padding: 0;
  text-align: left;
  width: 100%;
  transition: border-color var(--t-base) var(--ease),
              transform var(--t-base) var(--ease);
}

.screen:hover { border-color: var(--rule-2); transform: translateY(-2px); }
.screen__img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }

.screen__empty {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.02) 0 10px,
      transparent 10px 20px);
  color: var(--silver-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: var(--s2);
}

.screen__cap {
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--silver-3);
  border-top: 1px solid var(--rule);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 7, 0.94);
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.lightbox[hidden] { display: none; }
.lightbox img { max-height: 82vh; width: auto; border: 1px solid var(--rule-2); }
.lightbox__cap {
  margin-top: var(--s2);
  font-size: 13px;
  color: var(--silver-3);
  text-align: center;
}
.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  color: var(--silver-1);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
}

/* ---------- 15. PROVENANCE (certificate footer) ------------------------- */

.provenance {
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 40%),
    var(--ink-850);
  padding: var(--s6) var(--s4);
}

.provenance__head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.provenance__seal {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--silver-4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--silver-2);
}

.provenance__statement {
  font-size: 15px;
  color: var(--silver-2);
  margin-block: var(--s3);
  max-width: 70ch;
}

/* ---------- 16. BUTTONS -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 3px;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--ink-900);
  transition: background var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}

.btn:hover { background: transparent; color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--silver-1);
  border-color: var(--rule-2);
}

.btn--ghost:hover { background: var(--white); color: var(--ink-900); border-color: var(--white); }

/* ---------- 17. STAGING / PLACEHOLDER AFFORDANCES ----------------------- */
/* Removed at sign-off. Makes unapproved content impossible to mistake.     */

.staging-banner {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--amber-bg);
  border-bottom: 1px solid rgba(210, 153, 34, 0.4);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px var(--gutter);
  backdrop-filter: blur(8px);
}

[data-ph] {
  text-decoration: underline dashed rgba(210, 153, 34, 0.5);
  text-underline-offset: 4px;
}

/* ---------- 18. MOTION --------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 19. PRINT ---------------------------------------------------- */

@media print {
  :root { --ink-900: #fff; }
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before, .staging-banner, .lightbox, .btn, .site-nav { display: none !important; }
  h1, h2, h3, h4, .display, .stat-tile__value { color: #000; }
  .muted, .small, .stat-tile__label, .stat-tile__source { color: #444; }
  .brief-doc, .provenance, .callout, .stat-tile, .code-viewer {
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: none;
    break-inside: avoid;
  }
  .brief-doc__body, .code-viewer__code, .hash__value { color: #000; }
  .badge { border-color: #666; color: #000; background: none; }
  .section { padding-block: 18pt; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
}

/* ---------- 20. SITE CHROME (nav / footer) ------------------------------ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 14px var(--gutter);
  background: rgba(10, 10, 11, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-nav__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--white);
}

.site-nav__links { display: flex; gap: var(--s3); list-style: none; align-items: center; }

.site-nav__links a {
  font-size: 13.5px;
  color: var(--silver-3);
  transition: color var(--t-fast) var(--ease);
}

.site-nav__links a:hover { color: var(--white); }
.site-nav__links a[aria-current='page'] { color: var(--white); }

.site-nav__links a[aria-disabled='true'] {
  color: var(--silver-5);
  cursor: not-allowed;
}

@media (max-width: 880px) {
  .site-nav__links { display: none; }
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s6);
  margin-top: var(--section-y);
}

.site-footer__legal {
  font-size: 12.5px;
  color: var(--silver-4);
  line-height: 1.7;
}

/* ---------- 21. CASE FILE (example detail) ------------------------------ */

.case-header { padding-block: var(--s10) var(--s6); }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver-4);
  margin-bottom: var(--s4);
}

.breadcrumb a { color: var(--silver-3); }
.breadcrumb a:hover { color: var(--white); }

.case-header__title { margin-block: var(--s3) var(--s3); max-width: 20ch; }

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s5);
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}

.case-meta__item { display: flex; flex-direction: column; gap: 5px; }

.case-meta__k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-4);
}

.case-meta__v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--silver-1);
}

.builds { display: flex; flex-wrap: wrap; gap: var(--s1); }

.stack { display: grid; gap: var(--s3); }
.stack--lg { gap: var(--s6); }

/* ============================================================================
   22. PAGE SYSTEM  ·  hero, pipeline, panels, tables, forms
   ========================================================================== */

/* ---------- Mobile nav ---------- */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  z-index: 120;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--white);
  margin: 5px 0;
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.nav-mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

@media (max-width: 880px) {
  .nav-mobile-toggle { display: block; }
  .site-nav__links.open {
    display: flex;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s4);
    background: rgba(10, 10, 11, 0.98);
    z-index: 110;
  }
  .site-nav__links.open a { font-size: 20px; color: var(--silver-1); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  padding-block: var(--s16) var(--s10);
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.55;
}

.hero__inner { position: relative; z-index: 1; max-width: 980px; }

.hero__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--s3);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver-3);
  margin-bottom: var(--s5);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
  display: inline-block;
}

.hero__headline {
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 17ch;
}

.hero__support {
  margin-top: var(--s4);
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.5;
  color: var(--silver-2);
  max-width: 56ch;
}

.hero__runs {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s6);
  padding: 10px 18px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 13px);
  color: var(--silver-2);
  letter-spacing: 0.08em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s6);
}

.hero__patent {
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--silver-4);
}

/* ---------- Two column split ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split__aside { position: sticky; top: 96px; }

@media (max-width: 900px) {
  .split, .split--even { grid-template-columns: 1fr; }
  .split__aside { position: static; }
}

/* ---------- Pipeline with zone boundary ---------- */
.zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-bottom: var(--s2);
}

.zone-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-4);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.zone-label b { color: var(--silver-2); font-weight: 700; }

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s2);
  position: relative;
}

.flow__seal {
  position: absolute;
  left: calc(50% - 0.5px);
  top: -14px; bottom: -14px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--rule-2) 12%, var(--rule-2) 88%, transparent);
}

.flow__seal span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ink-900);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--silver-3);
  white-space: nowrap;
}

.step {
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--silver-4);
  border-radius: 4px;
  padding: var(--s3) var(--s3) var(--s4);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.step:hover { transform: translateY(-3px); border-color: var(--rule-2); }
.step::after {
  content: attr(data-num);
  position: absolute;
  top: 10px; right: 14px;
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.05);
}
.step__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--silver-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: var(--s2);
}
.step h3 { font-size: 17px; margin-bottom: 8px; position: relative; }
.step p { font-size: 13.5px; line-height: 1.6; color: var(--silver-3); }

@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; }
  .flow__seal { display: none; }
  .zones { grid-template-columns: 1fr; }
}

/* ---------- Panels (property + proof) ---------- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s2);
}

.panel {
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s4) var(--s3);
  transition: border-color var(--t-base) var(--ease);
}
.panel:hover { border-color: var(--rule-2); }
.panel h3 { font-size: 17px; margin-bottom: 10px; }
.panel p { font-size: 14px; line-height: 1.65; color: var(--silver-3); }

.panel--seal { border-left: 2px solid var(--pass); }

/* ---------- Proof band ---------- */
.proof-band {
  background: var(--ink-850);
  border-block: 1px solid var(--rule);
  padding-block: var(--s10);
}

.proof-band__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
}

.counter { border-left: 1px solid var(--rule-2); padding-left: var(--s3); }
.counter__v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  letter-spacing: -0.02em;
}
.counter__l {
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--silver-3);
}

@media (max-width: 820px) { .proof-band__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .proof-band__grid { grid-template-columns: 1fr; } }

/* ---------- Data table ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; }

.data-table { width: 100%; border-collapse: collapse; min-width: 520px; }

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--ink-800);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-2);
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule-2);
}

.data-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-850);
  font-size: 15px;
  color: var(--silver-1);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--ink-800); }

.data-table .score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  text-align: right;
  white-space: nowrap;
}
.data-table .score em { font-style: normal; font-size: 12px; color: var(--silver-4); }
.row-note { display: block; margin-top: 5px; font-size: 12.5px; color: var(--silver-4); }

/* ---------- Honesty notes ---------- */
.note {
  border-left: 2px solid var(--rule-2);
  padding: 2px 0 2px var(--s3);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--silver-2);
  max-width: 78ch;
}
.note + .note { margin-top: var(--s3); }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.feature {
  background: var(--ink-850);
  padding: var(--s4) var(--s3);
  transition: background var(--t-base) var(--ease);
}
.feature:hover { background: var(--ink-800); }
.feature h3 { font-size: 16px; margin-bottom: 10px; }
.feature p { font-size: 13.5px; line-height: 1.65; color: var(--silver-3); }

@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Demo steps ---------- */
.steps { display: grid; gap: var(--s2); }
.step-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--rule);
}
.step-row:last-child { border-bottom: 1px solid var(--rule); }
.step-row__n {
  width: 34px; height: 34px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--silver-1);
}
.step-row h3 { font-size: 16px; margin-bottom: 6px; }
.step-row p { font-size: 14.5px; line-height: 1.6; color: var(--silver-3); }

.eliminates {
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s3);
}
.eliminates h3 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--silver-3);
  margin-bottom: var(--s2);
}
.eliminates li {
  list-style: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--silver-3);
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}
.eliminates li:first-of-type { border-top: none; }
.eliminates li b { color: var(--silver-1); font-weight: 700; }

/* ---------- Statement banner ---------- */
.statement {
  margin-top: var(--s5);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 60%), var(--ink-850);
  padding: var(--s5) var(--s4);
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--silver-1);
  text-align: center;
  max-width: none;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s4);
}
.form-card h3 { font-size: 18px; margin-bottom: 8px; }
.form-card > p { font-size: 14px; color: var(--silver-3); margin-bottom: var(--s3); }

.form { display: grid; gap: var(--s2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver-3);
  margin-bottom: 8px;
}

.field input, .field select, .field textarea {
  width: 100%;
  background: var(--ink-900);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 12px 14px;
  color: var(--silver-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--t-fast) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--silver-2);
}
.field input::placeholder, .field textarea::placeholder { color: var(--silver-4); }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239AA0A8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field select option { background: var(--ink-800); color: var(--silver-1); }

.form .btn { justify-self: start; }
.form-status { font-size: 13.5px; color: var(--silver-2); min-height: 20px; }

/* ---------- Contact meta ---------- */
.contact-meta { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.7vw, 18px);
  color: var(--white);
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 2px;
  margin-bottom: var(--s3);
}
.contact-email:hover { border-bottom-color: var(--white); }
.contact-founder { font-size: 15px; color: var(--silver-1); margin-bottom: 4px; }
.contact-bio { font-size: 14px; color: var(--silver-3); }

/* ---------- Source line ---------- */
.source {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--silver-4);
  margin-top: 10px;
}
.caption { font-size: 12.5px; color: var(--silver-4); margin-top: var(--s3); }

/* ---------- Footer ---------- */
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s3);
  flex-wrap: wrap;
}
.site-footer__tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver-2);
  margin-bottom: 10px;
}
.site-footer__links { display: flex; gap: var(--s3); }
.site-footer__links a { font-size: 13px; color: var(--silver-3); }
.site-footer__links a:hover { color: var(--white); }

/* Long textual stat values (e.g. "a quarter of the engineering week") */
.stat-tile__value--text {
  font-size: clamp(17px, 1.9vw, 23px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}

.site-nav__mark img { height: 22px; width: auto; }

/* ---------- Stat grid variants + prose labels --------------------------- */
.stat-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .stat-grid--2 { grid-template-columns: 1fr; } }

/* Where the label is a sentence rather than a short caption. */
.stat-grid--prose .stat-tile__label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--silver-2);
}

/* ---------- Replay proof card ------------------------------------------- */
.runs-card {
  background: var(--ink-800);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  padding: var(--s3);
  font-family: var(--font-mono);
}

.runs-card-title {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--silver-3);
  margin-bottom: var(--s2);
}

.runs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--silver-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.runs-row:last-of-type { border-bottom: none; }
.runs-row .run-id { color: var(--white); font-weight: 700; }
.runs-row .run-result { color: var(--pass); }

.runs-card-footer {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--silver-2);
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
}

/* The seal marker must sit above the step cards. */
.flow__seal { z-index: 3; }
.flow__seal span { z-index: 4; }
