@font-face { font-family: 'Overused Grotesk'; src: url(../assets/fonts/overused-grotesk-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Overused Grotesk'; src: url(../assets/fonts/overused-grotesk-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Overused Grotesk'; src: url(../assets/fonts/overused-grotesk-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Overused Grotesk'; src: url(../assets/fonts/overused-grotesk-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

/* Values come from The SurfBoard design system. Nothing below this file uses raw colours. */
:root {
  --ocean: #005AE0;
  --deep: #0A4494;
  --abyss: #062D6E;
  --pale: #E0ECFF;
  --paper: #F5F5F7;
  --white: #FFFFFF;
  --ink: #0D0D1A;
  --soft: #555570;
  /* taste-skill-ignore: the owner asked for blue gradients; these are the only two on the site. */
  --tide: linear-gradient(180deg, var(--ocean) 0%, var(--deep) 58%, var(--abyss) 100%); /* taste-skill-ignore */
  --lit: linear-gradient(145deg, var(--ocean) 0%, var(--deep) 100%); /* taste-skill-ignore */

  --font-display: 'Overused Grotesk', system-ui, sans-serif;
  --font-text: var(--font-display);

  /* The whole page has five sizes. If two things feel close, they are the same size. */
  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.6rem + 3.8vw, 5rem);
  --step-display: clamp(3.25rem, min(16.5vw, 25svh), 14rem);

  /* One grid: everything starts on column 1 or column 7. */
  --margin: clamp(1.25rem, 3.4vw, 3rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 13vw, 12rem);
  --radius: 12px;
  --radius-large: 20px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-body)/1.62 var(--font-text); font-kerning: normal; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
button, input { font: inherit; color: inherit; }
:target { scroll-margin-top: 5rem; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
::selection { background: var(--abyss); color: var(--white); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The only three heading voices. */
.t-display { font: 700 var(--step-display)/1.02 var(--font-display); letter-spacing: -0.01em; }
.t-head { font: 600 var(--step-head)/1.16 var(--font-display); letter-spacing: -0.015em; }
.t-lead { font: 600 var(--step-lead)/1.32 var(--font-display); letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding-inline: var(--margin); }
.col-a { grid-column: 1 / span 6; }
.col-b { grid-column: 7 / -1; }
.col-all { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .col-a, .col-b { grid-column: 1 / -1; }
}

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.5rem; border-radius: var(--radius); font: 600 var(--step-body)/1 var(--font-display); text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button--bar { background: var(--ocean); color: var(--white); min-height: 44px; font-size: var(--step-small); padding: 0 1.125rem; }
.button--paper { background: var(--white); color: var(--ocean); }
@media (hover: hover) and (pointer: fine) {
  .button--bar:hover { background: var(--deep); }
  .button--paper:hover { background: var(--pale); }
}

/* Header ink follows whichever chapter sits under it. It shares the page grid. */
.bar { position: fixed; inset: 0 0 auto; z-index: 200; align-items: center; padding-block: 0.75rem; color: var(--bar-ink, var(--ink)); background: var(--bar-ground, transparent); transition: color 300ms ease, background-color 300ms ease; pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar__name { grid-column: 1 / span 6; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font: 600 var(--step-lead)/1 var(--font-display); letter-spacing: -0.02em; text-decoration: none; gap: 0.4em; }
/* Inline so it takes the header's ink: blue-ground chapters need it white, light ones dark. */
.bar__mark { width: 1em; height: 1em; flex: none; }
.bar__end { grid-column: 7 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bar__links { display: flex; gap: 1.5rem; font-size: var(--step-small); }
.bar__links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease; }
.bar__links a:hover { text-decoration-color: currentColor; }
.bar.is-on-ocean .button--bar { background: var(--white); color: var(--ocean); }
@media (max-width: 860px) {
  .bar__name { grid-column: 1 / span 5; }
  .bar__end { grid-column: 6 / -1; justify-content: flex-end; }
  .bar__links { display: none; }
}

/* Reveals come in three kinds, by what the thing is: headings rise out of a mask word by word,
   panels unmask upward, and running text settles. One identical fade on every block reads as a template. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] .word { display: inline-block; overflow: clip; padding: 0 0.04em 0.14em; margin: 0 -0.04em -0.14em; vertical-align: top; }
  .js [data-rise] .word > span { display: inline-block; transform: translateY(112%); transition: transform 1000ms var(--ease-expo); transition-delay: calc(var(--i) * 45ms); }
  .js [data-rise].is-in .word > span { transform: none; }

  .js [data-reveal=panel] { clip-path: inset(100% 0 0 0 round var(--radius-large)); transform: translateY(48px); transition: clip-path 1000ms var(--ease-expo), transform 1000ms var(--ease-expo); }
  .js [data-reveal=panel].is-in { clip-path: inset(0 0 0 0 round var(--radius-large)); transform: none; }

  .js [data-reveal=text] { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out) 120ms, transform 800ms var(--ease-expo) 120ms; }
  .js [data-reveal=text].is-in { opacity: 1; transform: none; }
}
