/* ==========================================================================
   Base — reset, typography, layout primitives, accessibility helpers.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem; /* keeps anchored headings clear of the sticky header */
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-stretch: var(--stretch-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p, li, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 750;
  font-stretch: var(--stretch-display);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); line-height: var(--leading-tight); }
h2 { font-size: var(--step-4); line-height: 1.05; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { text-wrap: pretty; }

/* ---------- Links ---------- */
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.prose a:not(.btn), a.link {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--signal);
  transition: text-decoration-thickness var(--dur-1);
}
.prose a:not(.btn):hover, a.link:hover { text-decoration-thickness: 2px; }

/* ---------- Focus: always visible for keyboard users ---------- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--signal); color: var(--signal-ink); }

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-section); }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: grid;
  gap: var(--space-4);
  max-width: 48rem;
  margin-bottom: var(--space-7);
}
.section-head p { font-size: var(--step-1); color: var(--ink-3); max-width: 38rem; }

/* Mono "eyebrow" label that introduces each section, e.g. "02 — The Roster". */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--signal);
}

.accent { color: var(--signal); }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  border-radius: var(--radius-md);
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Scroll reveal ----------
   Content is visible by default; the hidden starting state only applies once
   JS has confirmed it can reveal it (html.js) and motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
    transition-delay: calc(var(--reveal-i, 0) * 70ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
