/* ===========================================================================
   base.css — reset, fonts, document defaults, type ramp, focus, motion
   preferences, accessibility utilities. No component here, no literal
   colour or size: everything comes from tokens.css.
   =========================================================================== */

/* ---- fonts: Figtree, self-hosted, split by script so a Spanish/English
   session downloads ~20 KB. Fallback is Arial with metric overrides so the
   swap does not reflow (values tuned against Figtree's vertical metrics). */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("/static/p/ds/fonts/figtree-roman-latin.woff2") format("woff2");
  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: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("/static/p/ds/fonts/figtree-roman-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("/static/p/ds/fonts/figtree-italic-latin.woff2") format("woff2");
  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: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("/static/p/ds/fonts/figtree-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree Fallback"; src: local("Arial"), local("Helvetica");
  size-adjust: 103%; ascent-override: 94%; descent-override: 24%; line-gap-override: 0%; }

/* ---- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font: var(--t-body-w) var(--t-body-size) / var(--t-body-lh) var(--font-sans);
  letter-spacing: var(--t-body-ls);
  color: var(--text-1);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent-text); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-weight: var(--t-headline-w); overflow-wrap: anywhere; }
p, li, dd { overflow-wrap: anywhere; }
[hidden] { display: none !important; }   /* the single documented !important: `hidden` must win */
::selection { background: var(--accent-200); color: var(--accent-950); }

/* ---- type ramp: one class per role, the only sizes the app may use ------- */
.t-display  { font-size: var(--t-display-size);  line-height: var(--t-display-lh);  font-weight: var(--t-display-w);  letter-spacing: var(--t-display-ls); }
.t-title-1  { font-size: var(--t-title1-size);   line-height: var(--t-title1-lh);   font-weight: var(--t-title1-w);   letter-spacing: var(--t-title1-ls); }
.t-title-2  { font-size: var(--t-title2-size);   line-height: var(--t-title2-lh);   font-weight: var(--t-title2-w);   letter-spacing: var(--t-title2-ls); }
.t-title-3  { font-size: var(--t-title3-size);   line-height: var(--t-title3-lh);   font-weight: var(--t-title3-w);   letter-spacing: var(--t-title3-ls); }
.t-headline { font-size: var(--t-headline-size); line-height: var(--t-headline-lh); font-weight: var(--t-headline-w); letter-spacing: var(--t-headline-ls); }
.t-body     { font-size: var(--t-body-size);     line-height: var(--t-body-lh);     font-weight: var(--t-body-w);     letter-spacing: var(--t-body-ls); }
.t-subhead  { font-size: var(--t-subhead-size);  line-height: var(--t-subhead-lh);  font-weight: var(--t-subhead-w);  letter-spacing: var(--t-subhead-ls); }
.t-footnote { font-size: var(--t-footnote-size); line-height: var(--t-footnote-lh); font-weight: var(--t-footnote-w); letter-spacing: var(--t-footnote-ls); }
.t-caption  { font-size: var(--t-caption-size);  line-height: var(--t-caption-lh);  font-weight: var(--t-caption-w);  letter-spacing: var(--t-caption-ls); }
.t-caption.upper { text-transform: uppercase; letter-spacing: 0.08em; }   /* uppercase never at default tracking */
.t-2 { color: var(--text-2); } .t-3 { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums lining-nums; }          /* every count, price, time, date */
.prose { max-width: var(--measure); }
.strong { font-weight: 600; }

/* ---- focus: one ring, drawn from a token, visible on every surface ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: var(--radius-xs); }
.on-nav :focus-visible { outline-color: var(--accent-300); }

/* ---- icons: one family, one geometry, stroke scales with size --------------- */
.icon { display: inline-block; width: var(--icon-20); height: var(--icon-20); --icon-stroke: 1.6; stroke-width: var(--icon-stroke);
  fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; flex: none;
  vertical-align: -0.2em; }   /* inline-block, not the reset's block: an icon in a run of text must not break the line */                        /* optical: sits on the cap height next to text */
.icon.sm { width: var(--icon-16); height: var(--icon-16); --icon-stroke: 1.5; }
.icon.lg { width: var(--icon-24); height: var(--icon-24); --icon-stroke: 1.75; }

/* ---- accessibility utilities ---------------------------------------------- */
.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; left: var(--space-4); top: -100%; z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4); background: var(--surface-raised); color: var(--text-1);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-overlay); }
.skip-link:focus-visible { top: var(--space-4); }

/* ---- motion preferences ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 80ms !important; scroll-behavior: auto !important; }
  /* the second documented !important block: a user preference must beat every component rule */
}
@media (forced-colors: active) {
  .icon { forced-color-adjust: auto; }
  :focus-visible { outline: 2px solid Highlight; }
}
@media (prefers-contrast: more) {
  :root { --hairline: oklch(24% 0.012 70 / 0.24); --hairline-2: oklch(24% 0.012 70 / 0.34); --text-3: var(--text-2); }
}
