/* ==========================================================================
   base — reset, type primitives, grain
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  background: var(--ink);
  color: var(--thread);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p, figure, dl, dd, table { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video, canvas, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--madder); outline-offset: 3px; }
::selection { background: var(--madder); color: var(--thread); }

/* ── type ──────────────────────────────────────────────────────────────── */

.meta {
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--thread-3);
}

.tnum { font-variant-numeric: tabular-nums; }
.sep { color: var(--madder); margin: 0 0.7em; }

.sp-line { display: block; overflow: hidden; }
.sp-w { display: inline-block; will-change: transform; }

/* Fraunces has an optical-size axis, so display settings want the larger
   optical cut — its text cut has thicker hairlines that go muddy when set
   this big. */
.display {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.015em;
}

/* ── grain ─────────────────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='170' height='170'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='170' height='170' filter='url(%23n)' opacity='0.45'/></svg>");
}

/* ── accessibility ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 0.6rem; left: 0.6rem;
  z-index: 500;
  padding: 0.6rem 1rem;
  background: var(--madder);
  color: var(--thread);
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translateY(-180%);
  transition: transform 0.3s var(--throw);
}

.skip:focus-visible { transform: translateY(0); }
