/* ============================================================
   QUAD™ — base.css
   Reset, typography, layout primitives. Mobile-first.
   Fonts are loaded via <link> tags in each page head:
     Zodiak            — Fontshare
     Archivo (wdth)    — Google Fonts (Expanded via font-stretch)
     Spline Sans Mono  — Google Fonts
   ============================================================ */

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Visible keyboard focus — never remove, only style */
:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

::selection {
  background: var(--pine);
  color: var(--chalk);
}

/* ---------- Typography primitives ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
}

.display--hero     { font-size: var(--text-hero); }
.display--title    { font-size: var(--text-title); }
.display--subtitle { font-size: var(--text-subtitle); }

.eyebrow {
  font-family: var(--font-sans);
  font-stretch: var(--stretch-expanded);
  font-weight: 600;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.02em;
}

.small {
  font-size: var(--text-small);
}

/* Headline grammar: each display line sits in an overflow mask,
   JS raises .headline-line from below (Obys pattern).
   <h1 data-headline>
     <span class="headline-mask"><span class="headline-line">…</span></span>
   </h1>                                                          */
.headline-mask {
  display: block;
  overflow: hidden;
  /* The mask clips to the line box, and --leading-display (0.95) makes
     that box shorter than Zodiak's glyphs — so descenders (p, y, g) were
     being cut off on every display headline. Pad the mask to contain
     them and pull the same amount back with a negative margin, so the
     leading between stacked lines is unchanged. */
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}

.headline-line {
  display: block;
  will-change: transform;
}

/* ---------- Layout primitives ---------- */

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

.section {
  padding-block: var(--space-7);
}

@media (min-width: 48em) {
  .section {
    padding-block: var(--space-8);
  }
}

.grid {
  display: grid;
  gap: var(--gutter);
}

/* Screen-reader only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-nav) + 1);
  background: var(--ink);
  color: var(--chalk);
  padding: var(--space-2) var(--space-3);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Media primitive ----------
   Every media slot — real <img>/<video> AND .redbox — carries .media.
   All animation code targets .media (or its .media-frame wrapper),
   so swapping redbox → real asset needs zero animation changes.  */

.media {
  display: block;
  width: 100%;
  aspect-ratio: var(--ratio, 4 / 5);   /* set per-slot; prevents layout shift */
  object-fit: cover;
}

/* Clipping frame for the reveal grammar: the frame clips, the media scales */
.media-frame {
  overflow: hidden;
  position: relative;
}

/* Full-bleed background variant: fills its positioned parent,
   ignores aspect-ratio (used for the hero video layer) */
.media--cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* ---------- Reduced motion ---------- */

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