/* ==========================================================================
   FORTHWAY — Base
   Reset, document defaults, typography, accessibility floor.
   ========================================================================== */

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

* { margin: 0; }

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

/* If the visitor has asked for less motion, honour it at the document level
   too — otherwise anchor links still fling the page around. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ground);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Locked while the intro sequence runs, released by js/modules/preloader.js.
   Scoped to [data-enhanced] so a no-JS visitor is never left unable to
   scroll a page whose overlay will never be dismissed. */
html[data-enhanced='true'][data-loading='true'] {
  overflow: hidden;
  height: 100vh;
}

img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select { font: inherit; color: inherit; }

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Headings ------------------------------------------------------------
   Display face is Archivo pushed to an expanded width axis. Tight tracking
   and tight leading — signage, not prose. */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: var(--step-7); }
h2 { font-size: var(--step-5); }
h3 { font-size: var(--step-2); font-variation-settings: 'wdth' 100; }
h4 { font-size: var(--step-1); font-variation-settings: 'wdth' 100; }

p { text-wrap: pretty; }

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

/* --- Utility type -------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.eyebrow--amber { color: var(--amber); }
.eyebrow--cyan  { color: var(--cyan); }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--fog);
  max-width: var(--measure);
}

.body-text {
  color: var(--fog);
  max-width: var(--measure);
}

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

/* Accent for a single word inside a heading. Used sparingly — once or twice
   on the whole page. */
.accent { color: var(--amber); }
.accent-cyan { color: var(--cyan); }

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

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

.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: 999;
  padding: var(--space-2xs) var(--space-s);
  background: var(--amber);
  color: var(--ground);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform var(--dur-ui) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

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

/* --- Selection --- */
::selection {
  background: var(--amber);
  color: var(--ground);
}
