/* ==========================================================================
   Reset, page shell, typography, texture
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, picture, svg, canvas { display: block; max-width: 100%; }
/* Component display rules must never win over the hidden attribute. */
[hidden] { display: none !important; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--gold-300); text-decoration-color: color-mix(in oklab, var(--gold-300) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

::selection { background: var(--gold-400); color: var(--ink-950); }

:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* --- display type ------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.03em;
  text-transform: uppercase;
  color: var(--bone-100);
}

.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-2xl);
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--bone-100);
}

.mono-label {
  font-size: var(--t-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-500);
}

.lede { color: var(--fg-dim); font-size: var(--t-md); line-height: 1.75; max-width: 56ch; }

.hl { color: var(--gold-300); }
.hl-go { color: var(--go-400); }
.dim { color: var(--bone-500); }

/* --- layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

.section { position: relative; padding-block: clamp(72px, 11vw, 140px); }
.section + .section { border-top: 1px solid var(--line); }

.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-3) var(--s-5); margin-bottom: var(--s-6); }
.section__num {
  font-size: var(--t-xs); letter-spacing: .2em; color: var(--gold-500);
  border: 1px solid var(--gold-700); border-radius: var(--r-1); padding: 2px 7px;
}
.section__sub { color: var(--bone-500); font-size: var(--t-sm); flex-basis: 100%; max-width: 60ch; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--gold-400); color: var(--ink-950); padding: 10px 16px; font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --- texture: grain and scanlines in a single fixed layer. Two separate
       full-screen overlays meant two composited layers repainted on scroll
       for no visual gain. --- */
.texture {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .05;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.35) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.35'/></svg>");
  background-size: auto, 140px 140px;
}
@media (prefers-reduced-motion: reduce) { .texture { opacity: .035; } }

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

/* Scroll reveals are opt-in: JS arms them, JS disarms them. If JS never runs
   — or throws — the content is simply there, which is the safe failure. */
.reveal { transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out); }
.reveal.is-armed { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) { .reveal.is-armed { opacity: 1; transform: none; } }
