/* Base layer for v2: fonts, rendering, reset, type roles, focus, motion safety.
   Load order on every page: tokens.css → base.css → layout.css → page styles.
   Values come from tokens.css only. */

/* ── Fonts ──
   Inter variable, Latin subset (both axes kept: wght 100–900, opsz 14–32).
   The fallback is Arial tuned to Inter's metrics, so text doesn't jump when Inter arrives. */
@font-face {
  font-family: Inter;
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Shantell Sans";
  src: url("fonts/shantell-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.12%;
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;   /* iOS: don't inflate text in landscape */
  text-size-adjust: 100%;
  scrollbar-gutter: stable;         /* no sideways jump when a sheet locks scrolling */
  hanging-punctuation: first last;
  color-scheme: light;
}
body {
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text-body);
  font: var(--type-body);
  letter-spacing: var(--track-body);
  /* Rendering: grayscale antialiasing keeps light grey type crisp on macOS instead of heavy and colour-fringed. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;  /* kerning + ligatures */
  font-kerning: normal;
  font-optical-sizing: auto;           /* Inter picks its Display cut at large sizes */
  font-synthesis: none;                /* never fake bold or italic */
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
img, picture, video, svg, canvas { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; } /* the reset above must never un-hide things */
input, button, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; } /* :where keeps this weaker than any component class */
p, li, figcaption, dd { text-wrap: pretty; max-width: var(--measure); }
h1, h2, h3, h4 { text-wrap: balance; font: inherit; }
::selection { background: var(--bg-action); color: var(--text-on-action); }

/* The hotspot is the rounded tip in the cursor image's pixel coordinates. */
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  html { cursor: url("icons/navigation-cursor.svg") 5 2, auto; }
  :where(input, textarea, select, [contenteditable]) { cursor: auto; }
  button, :where(a[href], summary) { cursor: inherit; }
}

/* ── Type roles: the only four. Colour is set separately with a text token. ── */
.t-title { font: var(--type-title); letter-spacing: var(--track-title); color: var(--text-strong); }
.t-heading { font: var(--type-heading); letter-spacing: var(--track-heading); color: var(--text-strong); }
.t-body { font: var(--type-body); letter-spacing: var(--track-body); }
.t-label { font: var(--type-label); letter-spacing: var(--track-label); text-transform: uppercase; }
.t-hand { font-family: var(--font-hand); letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }

.c-strong { color: var(--text-strong); }
.c-body { color: var(--text-body); }
.c-muted { color: var(--text-muted); }
.c-faint { color: var(--text-faint); }

strong, b { font-weight: var(--weight-strong); color: var(--text-strong); }
em { font-style: normal; font-weight: var(--weight-emphasis); color: var(--text-strong); }

/* ── Keyboard focus uses the control's own surface or text. ── */
:focus { outline: none; }
a:focus-visible { text-decoration: underline; }
button:focus-visible { background: var(--bg-action); color: var(--text-on-action); }

@media (forced-colors: active) {
  button:focus-visible { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* ── Helpers ── */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--grid-margin); top: var(--px-8); z-index: 10; padding: var(--pad-chip); border-radius: var(--radius-pill); background: var(--bg-action); color: var(--text-on-action); transform: translateY(-200%); }
.skip-link:focus-visible { transform: none; }

/* ── Motion safety: every animation in the site has this off switch ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}
