/* ==========================================================================
   base.css — reset + base elements
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clip horizontal overflow from the off-canvas mobile menu (fixed elements
     are not clipped by body's overflow-x; the root element governs the viewport).
     Use `clip` (not `hidden`) so the root does NOT become a scroll container —
     that keeps the sticky header working. */
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  color: var(--color-paper);
  background: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* `clip` (not `hidden`) avoids making <body> a scroll container, which would
     trap position:sticky. Horizontal clipping is handled here and on <html>. */
  overflow-x: clip;
}

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

/* Inline icon sizing — without this an unsized <svg> defaults to ~176×150px
   and blows up buttons/links. Scales with the surrounding font-size. */
.icon { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: middle; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a { color: var(--color-teal); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--color-paper); }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 { line-height: var(--lh-snug); font-weight: 400; }

/* Headline / display type */
.display,
h1.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.kicker {
  font-family: var(--font-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: var(--fs-18);
  color: var(--color-teal);
  display: inline-block;
}

/* --- Accessibility ------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-teal);
  color: var(--color-ink);
  padding: var(--space-3) var(--space-5);
  font-weight: 700;
  z-index: 1000;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

.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;
}

/* --- Layout helpers ------------------------------------------------------ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-5); }
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-7); }
[hidden] { display: none !important; }

main { display: block; }

/* Alternating surfaces */
.surface-ink { background: var(--color-ink); color: var(--color-paper); }
.surface-ink-soft { background: var(--color-ink-soft); color: var(--color-paper); }
.surface-paper { background: var(--color-paper); color: var(--color-ink-on-paper); }
.surface-paper-dim { background: var(--color-paper-dim); color: var(--color-ink-on-paper); }

.surface-paper a, .surface-paper-dim a { color: var(--color-teal); }
.surface-paper a:hover, .surface-paper-dim a:hover { color: var(--color-ink-on-paper); }

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