/* ==========================================================================
   base.css — fonts, design tokens, reset, typography, utilities
   Mobile-first. Every min-width layer lives in responsive.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — self-hosted variable woff2. Four files total.
   Newsreader carries display and italic; Hanken Grotesk carries body and UI.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/hankengrotesk-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: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/hankengrotesk-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: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/newsreader-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: 'Newsreader';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/newsreader-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;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Palette — these seven values and alpha derived from them. Nothing else. */
  --stillwater: #0e3b37;
  --stillwater-soft: #1b554f;
  --mineral: #e9e7df;
  --sandalwood: #b98a3c;
  --dusk: #6f6390;
  --ink: #16211e;
  --paper: #ffffff;

  /* rgb triplets, so alpha variants stay derived rather than invented */
  --stillwater-rgb: 14 59 55;
  --mineral-rgb: 233 231 223;
  --sandalwood-rgb: 185 138 60;
  --dusk-rgb: 111 99 144;
  --ink-rgb: 22 33 30;
  --paper-rgb: 255 255 255;

  /* Semantic surfaces */
  --bg: var(--mineral);
  --fg: var(--ink);
  --surface: var(--paper);
  --rule: rgb(var(--ink-rgb) / 0.12);
  --rule-strong: rgb(var(--ink-rgb) / 0.22);
  --muted: rgb(var(--ink-rgb) / 0.82);
  --accent: var(--sandalwood);
  /* Sandalwood at text sizes fails contrast on paper, so headings and eyebrows
     use this darkened amber instead. .on-dark swaps it back to sandalwood. */
  --accent-ink: #8a6526;

  /* Type */
  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Hanken Grotesk', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;

  /* Minimum lowered to 2rem: at 40px, "Discover yourself" was 326px wide
     against a 280px content box at 320px, so the intended three-line break
     collapsed into five. 32px keeps the break the copy was written for. */
  --fs-hero: clamp(2rem, 1.1rem + 4.4vw, 5.5rem);
  --fs-h2: clamp(2rem, 1.5rem + 2.2vw, 3.5rem);
  --fs-h3: clamp(1.5rem, 1.3rem + 0.85vw, 1.875rem);
  --fs-card: clamp(1.25rem, 1.14rem + 0.55vw, 1.5rem);
  --fs-lead: clamp(1.1875rem, 1.1rem + 0.45vw, 1.5rem);
  --fs-body: clamp(1.0625rem, 1.02rem + 0.25vw, 1.1875rem);
  --fs-small: 1.0625rem;
  --fs-eyebrow: 0.9375rem;
  /* Tuned so at least two words of the sliding strip stay visible at 320px. */
  --fs-strip: clamp(2.25rem, 0.5rem + 10vw, 11rem);

  --lh-display: 1.08;
  --lh-heading: 1.16;
  --lh-body: 1.65;

  /* Space */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 2.5rem;
  --sp-7: 3.5rem;
  --sp-8: 4.5rem;
  --sp-9: 6rem;

  --section-y: clamp(3.5rem, 2rem + 6vw, 7.5rem);
  --container: 1280px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --measure: 62ch;

  /* Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;
  --r-arch: 50% 50% var(--r-md) var(--r-md) / 34% 34% var(--r-md) var(--r-md);
  --r-lozenge: 46% 46% 46% 46% / 12% 12% 12% 12%;

  /* Motion — one curve, three durations. Nothing else, anywhere. */
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --t-micro: 0.4s;
  --t-std: 0.8s;
  --t-hero: 1.2s;

  /* Chrome */
  --header-h: 64px;
  --topbar-h: 0px;
  --z-header: 60;
  --z-drawer: 80;
  --z-overlay: 90;
  --z-cursor: 100;
}

/* Dark sections invert the semantic layer rather than restating colours. */
.on-dark {
  --bg: var(--stillwater);
  --fg: var(--mineral);
  --surface: var(--stillwater-soft);
  --rule: rgb(var(--mineral-rgb) / 0.18);
  --rule-strong: rgb(var(--mineral-rgb) / 0.32);
  --muted: rgb(var(--mineral-rgb) / 0.88);
  --accent-ink: var(--sandalwood);
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Safety net only — anything that actually overflows is fixed at source.
     `clip` rather than `hidden` because `hidden` makes <html> a scroll
     container, which fights both position: sticky and Lenis. */
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   Lenis. These four rules are required by the library; without them it fights
   the browser's own scrolling and the result feels worse than no Lenis at all.
   -------------------------------------------------------------------------- */

html.lenis,
html.lenis body {
  height: auto;
}

/* Native smooth scrolling and Lenis both animating the same scroll position
   is the classic cause of stuttering. Only one of them may drive it. */
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
  background-color: rgb(var(--ink-rgb) / 0.06);
}

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

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

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

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

table {
  border-collapse: collapse;
}

::selection {
  background: rgb(var(--sandalwood-rgb) / 0.28);
  color: var(--ink);
}

/* Anchored sections must not land under the sticky header. */
:target,
section[id],
main [id] {
  scroll-margin-top: calc(var(--header-h) + var(--topbar-h) + 1rem);
}

/* SplitText line wrappers — explicit block so a split never changes metrics. */
.split-line {
  display: block;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-display);
  letter-spacing: -0.028em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.022em;
}

/* Card and box headings carry the most weight — they are the labels people
   scan a grid by. */
h3,
h4 {
  font-weight: 600;
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-card);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.eyebrow--italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
}

.measure {
  max-width: var(--measure);
}

.measure-tight {
  max-width: 46ch;
}

.text-display {
  font-family: var(--font-display);
  font-weight: 300;
}

.text-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
}

.muted {
  color: var(--muted);
}

.u-hidden {
  display: none !important;
}

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

/* Skip link — first tab stop on every page. */
.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--stillwater);
  color: var(--mineral);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--t-micro) var(--ease);
}

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

/* --------------------------------------------------------------------------
   Focus — always visible, always sandalwood
   -------------------------------------------------------------------------- */

:focus {
  outline: none;
}

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

.on-dark :focus-visible {
  outline-color: var(--sandalwood);
}

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* --------------------------------------------------------------------------
   Motion guard.
   An inline script in <head> adds .js so pre-animation elements can be hidden
   without ever hiding content from a visitor whose JS or CDN failed: the same
   script removes .js again if the motion layer has not reported ready.
   -------------------------------------------------------------------------- */

/* :not([data-split]) keeps this in step with collectReveals() in motion.js,
   which skips split headings so their line animation is not fought by a
   second fade. Without the exclusion the CSS hid those headings and nothing
   ever brought them back — two headings on the home page were invisible at
   every breakpoint. */
.js [data-reveal],
.js [data-reveal-child] > *:not([data-split]) {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-reveal],
  .js [data-reveal-child] > * {
    opacity: 1;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
