/* ==========================================================================
   Base — reset, typography, atmosphere
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  font-variation-settings: "wdth" 100, "wght" 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

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

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

/* --- Headings ---------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: -0.006em;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: var(--t-xxl); }
h3 { font-size: var(--t-lg); }

p { margin: 0; text-wrap: pretty; }

/* Editorial line breaks — dropped on narrow screens so headings can reflow */
.br-lg { display: none; }
@media (min-width: 48rem) { .br-lg { display: inline; } }

/* Secondary words trimmed where the top bar runs out of room */
.hide-sm { display: none; }
@media (min-width: 34rem) { .hide-sm { display: inline; } }

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

/* --- Micro label (mono, the "spec sheet" voice) ------------------------ */

.micro {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin: 0;
}
.micro--signal {
  display: inline-block;
  width: fit-content;
  background: var(--signal);
  color: var(--signal-ink);
  padding: 0.4em 0.7em 0.32em;
}
.micro--ink  { color: var(--ink-soft); }

.lede {
  font-size: var(--t-lede);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* --- Atmosphere: film grain over the whole page ------------------------ */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* --- Atmosphere: the road centre-line running down the page ------------ */

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(var(--gutter) * 0.42);
  width: 2px;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(
    to bottom,
    var(--rule-strong) 0 28px,
    transparent 28px 52px
  );
  background-size: 2px 52px;
  opacity: 0.85;
  /* #000 here is a mask stencil, not a colour — it never paints. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

@media (max-width: 60rem) { .rail { display: none; } }

/* --- Accessibility ----------------------------------------------------- */

.visually-hidden {
  position: absolute;
  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;
  top: -100%;
  left: var(--gutter);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--signal);
  color: var(--signal-ink);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.skip-link:focus { top: 0.75rem; }

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