/*
 * stayfirm.app: the only stylesheet. Design v3, "Light Studio" (docs/DESIGN.md, "Design v3: Light
 * Studio", and design/directions/C-light-studio/SYSTEM.md), the same system as the app's default
 * appearance.
 *
 * - Light only. A cool daylight canvas (#F7F9FC to #EEF2F7 to #E8EDF4) with a white key light from
 *   the top, white surfaces with a navy hairline, every word in navy ink.
 * - On light, yellow is a fill, never ink: the primary button, the tape blade, progress and
 *   selection fills. Yellow-family words and small figures use amber (#7C5200, 6.1:1). Positions
 *   on a tape (needles, now-dots) are ink ringed white. A small yellow mark alone on light wears a
 *   navy rim.
 * - Archivo for headlines, standalone figures and short caps labels; Atkinson Hyperlegible Next for
 *   all running text, 15px minimum.
 * - Tokens mirror mobile/src/theme/palettes.ts (lightPalette) and
 *   design/directions/C-light-studio/tokens.json. Change them there first.
 *
 * Fonts are self-hosted copies of the Google Fonts files (see build.sh), so the site makes no
 * third-party requests: no cookies, no trackers, no font CDN. The CSP forbids inline styles, so
 * every style lives here.
 */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-400.woff") format("woff"), url("/assets/fonts/atkinson-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-600.woff") format("woff"), url("/assets/fonts/atkinson-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-700.woff") format("woff"), url("/assets/fonts/atkinson-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/*
 * Figures inside sentences use Archivo's digits too (SYSTEM.md, "Numerals rule": Atkinson draws a
 * slashed zero). These faces cover only 0-9 and are declared after the Atkinson faces, so the
 * browser takes digits from them and every other character from Atkinson. If a file is missing,
 * the digits simply stay in Atkinson.
 */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/archivo-digits-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/archivo-digits-600.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/archivo-digits-700.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-600.woff") format("woff"), url("/assets/fonts/archivo-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-700.woff") format("woff"), url("/assets/fonts/archivo-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-800.woff") format("woff"), url("/assets/fonts/archivo-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Grounds (lightPalette): a cool daylight canvas close to iOS's own grey, never cream */
  --canvas-top: #f7f9fc; /* backgroundTop */
  --canvas: #eef2f7; /* background */
  --canvas-bottom: #e8edf4; /* backgroundBottom */
  --surface: #ffffff; /* surface, surfaceMuted */
  --steel: #e3e9f1; /* surfaceInk: surface 2, the segmented track */
  --steel-deep: #d9e0ea; /* the bottom of a screen well, one step under steel */
  --line: rgba(15, 27, 51, 0.1); /* hairline */
  --line-strong: rgba(15, 27, 51, 0.18); /* hairlineStrong */
  --glass: rgba(15, 27, 51, 0.06); /* surfaceGlassStrong: round buttons, pills */
  --glass-strong: rgba(15, 27, 51, 0.1);

  /* Ink. Contrast on the canvas: 15.3:1, 8.2:1, 6.2:1; amber 6.1:1 */
  --text-1: #0f1b33; /* text */
  --text-2: #3b4862; /* textSecondary */
  --text-3: #4e5a72; /* textTertiary */
  --amber: #7c5200; /* accentText: yellow-family words and small figures, never a headline */

  /* The one accent: tape yellow, as a fill */
  --tape: #f7c744;
  --tape-press: #e8b42e;
  --on-tape: #0f1b33; /* textOnFita, 10.8:1 */
  --on-tape-2: #2b3650; /* textOnFitaSecondary, 7.6:1 */
  --tape-tick: rgba(15, 27, 51, 0.62); /* tickOnFita */
  --tape-edge: rgba(124, 82, 0, 0.3); /* tapeEdge: the amber edge of a yellow fill */
  --tape-rim: #0f1b33; /* tapeRim: Firmino's outline rule */
  --hook-hi: #c9d0da; /* the steel hook at the end of the tape blade */
  --hook-lo: #8e98a7;

  /* Light model */
  --key-light: rgba(255, 255, 255, 0.9);
  --glow-core: rgba(255, 255, 255, 0.95);
  --glow-mid: rgba(255, 255, 255, 0.5);
  --glow-clear: rgba(255, 255, 255, 0);

  /* Instruments */
  --tick: rgba(15, 27, 51, 0.78);
  --tick-minor: rgba(15, 27, 51, 0.5);
  --tick-muted: rgba(15, 27, 51, 0.28); /* tickOnMuted */
  --tick-base: rgba(15, 27, 51, 0.22);
  --tick-boundary: rgba(15, 27, 51, 0.45);
  --track: rgba(15, 27, 51, 0.12);
  --muted-bar: rgba(15, 27, 51, 0.1);
  --phase-1: rgba(15, 27, 51, 0.07);
  --phase-2: rgba(15, 27, 51, 0.11);
  --phase-3: rgba(15, 27, 51, 0.16);

  /* Semantic */
  --alerta: #b3342c; /* danger, 5.4:1 */
  --alerta-soft: rgba(179, 52, 44, 0.08);
  --selection: rgba(247, 199, 68, 0.6);

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --fs-foot: 0.9375rem; /* 15px: sources, doctor line, legal. The floor for running text. */
  --fs-label: 0.875rem; /* 14px caps labels (2 to 3 words) */
  --fs-micro: 0.8125rem; /* 13px ruler numerals and fact labels only */
  --fs-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); /* 17 to 19px */
  --fs-lead: clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem); /* 19 to 22px */
  --fs-h3: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem); /* 22 to 26px */
  --fs-h2: clamp(1.875rem, 1.45rem + 1.9vw, 3.125rem); /* 30 to 50px */
  --fs-h1: clamp(2.375rem, 1.6rem + 3.7vw, 4.5rem); /* 38 to 72px */
  --fs-value: clamp(2.125rem, 1.8rem + 1.2vw, 2.75rem); /* 34 to 44px */
  --fs-hero-num: clamp(6rem, 3.6rem + 10vw, 10.5rem); /* 96 to 168px */

  /* Space: 4-point grid */
  --gutter: 20px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s14: 56px;
  --s18: 72px;
  --s24: 96px;
  --touch: 48px;
  --measure: 68ch;
  --page: 1160px;

  /* Shape */
  --r-xs: 8px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* Elevation (tokens.json shadows.light): flat white with hairlines; warm shadows under yellow
     fills, navy shadows only under raised objects (the app screens, the contact card). */
  --shadow-cta: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(124, 82, 0, 0.3), 0 10px 22px -10px rgba(178, 124, 10, 0.55);
  --shadow-selected: inset 0 -1px 0 rgba(124, 82, 0, 0.3), 0 12px 24px -14px rgba(178, 124, 10, 0.55);
  --shadow-raised: 0 1px 2px rgba(15, 27, 51, 0.06), 0 22px 44px -22px rgba(15, 27, 51, 0.3);
  --shadow-screen: 0 0 0 1px rgba(15, 27, 51, 0.1), 0 2px 6px rgba(15, 27, 51, 0.06), 0 28px 48px -22px rgba(15, 27, 51, 0.34);
  --shadow-now: 0 0 0 3px #ffffff, 0 1px 5px 3px rgba(15, 27, 51, 0.22); /* nowDot / needleCap */
  --shadow-obj: drop-shadow(0 10px 14px rgba(15, 27, 51, 0.1));

  /* Motion (motion.ts) */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

@media (max-width: 379px) {
  :root {
    --gutter: 16px;
  }
}

/* ------------------------------------------------------------------ base */

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

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s8);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-1);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Daylight from above: a white key light over the cool canvas. */
  background:
    radial-gradient(120% 40rem at 50% -10rem, var(--key-light), transparent 72%) no-repeat,
    linear-gradient(180deg, var(--canvas-top) 0, var(--canvas) 46rem) no-repeat,
    var(--canvas);
  overflow-x: hidden;
  overflow-x: clip;
}

::selection {
  background: var(--selection);
  color: var(--text-1);
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(15, 27, 51, 0.4);
  transition: text-decoration-color 0.16s var(--ease-out);
}

a:hover {
  text-decoration-color: var(--amber);
}

/* Ink focus ring with a white cut, readable on the canvas, white and yellow (yellow alone is 1.4:1). */
:focus-visible {
  outline: 3px solid var(--text-1);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #ffffff;
}

strong,
b {
  font-weight: 700;
}

.num {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Keeps "GLP-1" on one line: browsers may break a line after a hyphen. */
.nb {
  white-space: nowrap;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 30;
  padding: var(--s3) var(--s5);
  background: var(--tape);
  color: var(--on-tape);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-cta);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--s3);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* Small caps label above a headline (Archivo, 2 to 3 words), ink 2 as in the app. */
.eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* The yellow-family eyebrow becomes amber on light (accentText). */
.eyebrow--tape {
  color: var(--amber);
}

.source {
  font-size: var(--fs-foot);
  line-height: 1.45;
  color: var(--text-3);
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ header */

.masthead {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--touch);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-1);
}

.wordmark svg {
  width: 36px;
  height: 36px;
  flex: none;
  filter: drop-shadow(0 4px 6px rgba(15, 27, 51, 0.14));
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding-inline: var(--s3);
  border-radius: var(--r-pill);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: background-color 0.16s var(--ease-out), color 0.16s var(--ease-out);
}

.nav a:hover {
  color: var(--text-1);
  background: var(--glass);
}

.nav a[aria-current="page"] {
  color: var(--text-1);
}

.nav .lang {
  margin-left: var(--s2);
  padding-inline: var(--s4);
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.nav .lang:hover {
  background: var(--surface);
  border-color: var(--tick-boundary);
}

.nav .nav-optional {
  display: none;
}

@media (min-width: 760px) {
  .nav .nav-optional {
    display: inline-flex;
  }
}

/* Narrow phones: the wordmark, Support and the language switch stay on one line; below that
   the nav wraps under the wordmark instead of scrolling the page sideways. */
@media (max-width: 419px) {
  .masthead {
    flex-wrap: wrap;
    gap: 0 var(--s2);
  }

  .wordmark {
    gap: var(--s2);
    letter-spacing: 0.2em;
  }

  .wordmark svg {
    width: 32px;
    height: 32px;
  }

  .nav {
    gap: 0;
    margin-left: auto;
  }

  .nav a {
    padding-inline: var(--s2);
  }

  .nav .lang {
    padding-inline: var(--s3);
    margin-left: var(--s1);
  }
}

/* A quiet offer to switch language, shown by site.js only to browsers set to Portuguese. */
.lang-hint {
  position: relative;
  z-index: 6;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.lang-hint .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  padding-block: var(--s2);
  font-size: var(--fs-foot);
  color: var(--text-2);
}

.lang-hint a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--text-1);
}

.lang-hint button {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--glass);
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
}

.lang-hint button:hover {
  color: var(--text-1);
  background: var(--glass-strong);
}

/* ------------------------------------------------------------------ light and objects */

/* The daylight pool behind Firmino: white light, never a warm haze (it lifts his yellow edge). */
.glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--glow-core) 0%, var(--glow-mid) 48%, var(--glow-clear) 100%);
}

/* Retired with Light Studio (the canvas has no grain); kept hidden for older markup. */
.grain {
  display: none;
}

/* Firmino: a lit object on the daylight pool. The renders carry their own floor shadow. */
.firmino {
  position: relative;
  isolation: isolate;
  margin: 0;
}

.firmino img,
.firmino .mark-fallback {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: var(--shadow-obj);
}

.mark-fallback {
  display: none;
}

.is-missing img {
  display: none;
}

.is-missing .mark-fallback {
  display: block;
  padding: 16%;
}

.is-missing .mark-fallback svg {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .firmino picture,
  .firmino .mark-fallback {
    animation: float 3.6s ease-in-out infinite;
  }

  .hero .firmino {
    animation: arrive 0.9s var(--ease-spring) 0.2s both;
  }

  .hero .glow {
    animation: glow-in 0.6s var(--ease-out) both;
  }

  .hero__copy > * {
    animation: rise 0.6s var(--ease-out) both;
  }

  .hero__copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero__copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero__copy > :nth-child(n + 4) {
    animation-delay: 0.24s;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes glow-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ the tape (fita métrica) */

/*
 * The signature, as the app's welcome draws it on light: a real yellow blade pulled out across the
 * page, ink ticks printed along its top edge (inch, half, quarter and eighth), inch numerals in
 * Archivo, an amber bottom edge, a warm shadow under it, and the steel hook at its end. Positions
 * on it are ink. Full bleed on the left; the hook ends it on the right.
 */
.tape {
  --inch: 64px;
  --blade: 44px;
  position: relative;
  z-index: 1;
  height: var(--blade);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw + 30px);
  border-radius: 0 3px 3px 0;
  background:
    repeating-linear-gradient(90deg, var(--tape-tick) 0 1.5px, transparent 1.5px var(--inch)) 0 0 / 100% 17px no-repeat,
    repeating-linear-gradient(90deg, var(--tape-tick) 0 1px, transparent 1px calc(var(--inch) / 2)) 0 0 / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--tape-tick) 0 1px, transparent 1px calc(var(--inch) / 4)) 0 0 / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, var(--tick-muted) 0 1px, transparent 1px calc(var(--inch) / 8)) 0 0 / 100% 5px no-repeat,
    var(--tape);
  box-shadow: inset 0 -1.5px 0 var(--tape-edge), inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 22px -14px rgba(178, 124, 10, 0.55);
}

/* The steel hook that ends the blade. */
.tape::after {
  content: "";
  position: absolute;
  top: -7px;
  bottom: -7px;
  right: -7px;
  width: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--hook-lo), var(--hook-hi) 45%, var(--hook-lo));
  box-shadow: 0 1px 2px rgba(15, 27, 51, 0.25);
}

.tape::before {
  content: none;
}

.tape__nums {
  position: absolute;
  inset: auto 0 6px 0;
  display: flex;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--on-tape);
  white-space: nowrap;
}

.tape__nums span {
  flex: none;
  width: var(--inch);
  transform: translateX(-50%);
  text-align: center;
}

.tape__nums span:first-child {
  margin-left: var(--inch);
}

@media (min-width: 900px) {
  .tape {
    --inch: 72px;
    --blade: 50px;
  }

  .tape__nums {
    font-size: 1rem;
    bottom: 7px;
  }
}

/* ------------------------------------------------------------------ buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 60px;
  padding-inline: var(--s8);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--tape);
  color: var(--on-tape);
  box-shadow: var(--shadow-cta);
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 0.16s var(--ease-spring), background-color 0.16s var(--ease-out);
}

.button:hover {
  background: var(--tape-press);
}

.button:active {
  transform: scale(0.98);
}

/* The quiet button: the app's steel-tint glass with ink text. */
.button--quiet {
  background: var(--glass);
  color: var(--text-1);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button--quiet:hover {
  background: var(--glass-strong);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font-weight: 700;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
}

/* The App Store badge placeholder: a white tile, not a button, until Apple's badge replaces it. */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  padding: var(--s2) var(--s6);
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  line-height: 1.15;
  text-decoration: none;
}

.store-badge small {
  font-size: var(--fs-foot);
  color: var(--text-2);
}

.store-badge strong {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cta-note {
  font-size: var(--fs-foot);
  color: var(--text-3);
}

/* The doctor line: every section that names the medication carries it. A rule on its left, as the
   app sets its quiet notes ("Rest is part of training too."). */
.doctor {
  padding-left: var(--s4);
  border-left: 2px solid var(--line-strong);
  font-size: var(--fs-foot);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-1);
  max-width: 44rem;
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--s2);
  padding-bottom: var(--s12);
}

/*
 * Phones: Firmino stands on the tape at the top, the copy follows (the app's welcome).
 * Wide screens: the copy on the left, Firmino on the right, both above the full-width tape.
 * The tape sits inside the grid and breaks out to the left edge of the window.
 */
.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: end;
}

.hero__copy {
  order: 3;
  display: grid;
  gap: var(--s5);
  padding-top: var(--s8);
}

.hero h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 15ch;
  color: var(--text-2);
}

/* The headline's mark line is ink and its lead ink 2, as on the app's welcome (amber is never a
   headline on light). */
.hl {
  display: block;
  color: var(--text-1);
}

.hero__lede {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
  max-width: 36ch;
}

.hero__aside {
  font-size: var(--fs-body);
  color: var(--text-2);
  max-width: 40ch;
}

.hero__foot {
  display: grid;
  gap: var(--s3);
}

/* Firmino's soles sit at 87% of the render's height: the figure reaches into the blade so his feet
   stand on its top edge, his baked shadow falling on the tape. */
.hero__figure {
  --fig: min(62vw, 270px);
  order: 1;
  z-index: 2;
  justify-self: center;
  width: var(--fig);
  margin-top: calc(var(--fig) * -0.1);
  margin-bottom: calc(var(--fig) * -0.129 - 5px);
}

.hero__figure .glow {
  inset: -14% -40% 4%;
}

.hero__grid > .tape {
  order: 2;
}

@media (min-width: 900px) {
  .hero {
    padding-top: var(--s6);
    padding-bottom: var(--s18);
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    column-gap: var(--s8);
  }

  .hero__copy {
    order: 0;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding-block: var(--s6) var(--s14);
  }

  .hero__figure {
    --fig: clamp(340px, 36vw, 520px);
    order: 0;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-top: 0;
    margin-right: -2%;
  }

  .hero__grid > .tape {
    order: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-right: -24px;
  }
}

/* The pen page's v1 markup (tape after the grid): the tape runs under the hero from edge to edge. */
.tape--hero {
  margin-left: 0;
  margin-right: 0;
}

.tape--hero::after {
  content: none;
}

/* The key facts under the hero: one white card divided by hairlines. */
.facts {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--s12);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.fact {
  display: grid;
  gap: var(--s2);
  align-content: start;
  padding: var(--s5) var(--s4) var(--s5) var(--s5);
}

.fact:nth-child(even) {
  border-left: 1px solid var(--line);
}

.fact:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.fact dt {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s2);
  font-family: var(--font-display);
  font-size: var(--fs-value);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-1);
}

.fact dd small {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-2);
}

@media (min-width: 900px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fact {
    padding: var(--s6) var(--s6) var(--s6);
  }

  .fact + .fact {
    border-left: 1px solid var(--line);
  }

  .fact:nth-child(n + 3) {
    border-top: 0;
  }
}

/* ------------------------------------------------------------------ sections */

.section {
  position: relative;
  isolation: isolate;
  padding-block: clamp(var(--s18), 10vw, 136px);
  border-top: 1px solid var(--line);
}

/* A band lit from above: a pool of daylight at the top of the section. ("white" is the v1 name,
   kept for the pen page.) */
.section--white::before,
.section--lit::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 36rem;
  pointer-events: none;
  background: radial-gradient(70% 100% at 50% 0, rgba(255, 255, 255, 0.85), transparent 70%);
}

/* A white sheet band (the v2 "ink" band, inverted for light). Cards inside it turn steel. */
.section--ink {
  background: var(--surface);
}

.section__head {
  display: grid;
  gap: var(--s4);
  max-width: 46rem;
  margin-bottom: var(--s12);
}

.section__head h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.section__head p {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
}

.section__head .eyebrow {
  font-size: var(--fs-label);
  line-height: 1.2;
}

.calm {
  font-family: var(--font-text);
  font-size: var(--fs-lead);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-1);
  max-width: 30ch;
}

.section-link {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s8);
  margin-top: var(--s10);
  font-weight: 700;
}

.section-link a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
}

.study-note {
  font-size: var(--fs-foot);
  color: var(--text-3);
}

/* Why it matters: one number, one split tape bar, its source. */
.why {
  display: grid;
  gap: var(--s10);
}

.why__number {
  position: relative;
  isolation: isolate;
}

.why__number .glow {
  width: 30rem;
  height: 30rem;
  left: -9rem;
  top: -10rem;
}

/* The app's HeroFigure: on light the 38% is amber (accentText), the one amber headline figure. */
.hero-num {
  font-family: var(--font-display);
  font-size: var(--fs-hero-num);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.06em;
  color: var(--amber);
  font-variant-numeric: tabular-nums lining-nums;
}

.hero-num small {
  font-size: 0.5em;
  letter-spacing: -0.04em;
  margin-left: 0.04em;
}

.why__number h2 {
  margin-top: var(--s6);
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.why__body {
  display: grid;
  gap: var(--s6);
  align-content: start;
}

.why__lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
}

/* The split bar and its legend, mounted on a white card like an instrument. */
.why__body figure {
  padding: var(--s5);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

@media (min-width: 900px) {
  .why {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s18);
    align-items: start;
  }

  .why__number {
    position: sticky;
    top: var(--s10);
  }
}

/* Split tape bar: a share of a whole. The lean part is literally yellow tape; the rest is steel. */
.split-bar {
  display: flex;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}

.split-bar > span {
  position: relative;
  display: block;
}

.split-bar::before {
  content: none;
}

.split-bar__fat {
  flex: 62 1 0;
  background: var(--steel);
  --tk: var(--tick-muted);
}

.split-bar__lean {
  flex: 38 1 0;
  background: var(--tape);
  box-shadow: inset 1.5px 0 0 var(--tick-boundary), inset 0 -1.5px 0 var(--tape-edge);
  --tk: var(--tape-tick);
}

.split-bar__fat::before,
.split-bar__lean::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 20px;
  background:
    repeating-linear-gradient(90deg, var(--tk) 0 1px, transparent 1px 8px) 4px 0 / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--tk) 0 1.5px, transparent 1.5px 40px) 4px 0 / 100% 18px no-repeat;
}

.split-legend {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: var(--s3);
  font-size: var(--fs-body);
  line-height: 1.3;
  color: var(--text-2);
}

.split-legend span:last-child {
  color: var(--text-1);
  text-align: right;
}

.split-legend b {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.split-caption {
  margin-bottom: var(--s3);
  font-size: var(--fs-foot);
  color: var(--text-2);
}

/* Checks: the app's Choice check, a yellow tick on a navy disc. */
.checklist {
  list-style: none;
  padding: 0;
  display: grid;
}

.checklist li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--s3);
  align-items: start;
  padding-block: var(--s4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
}

.checklist li:last-child {
  border-bottom: 1px solid var(--line);
}

.checklist svg {
  width: 26px;
  height: 26px;
  padding: 5px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--text-1);
  color: var(--tape);
}

.protect {
  display: grid;
  gap: var(--s4);
}

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

.protect__note {
  color: var(--text-2);
}

/* Lean mass bar on the pen page (v1 markup): same look as the split tape bar. */
.measure-list {
  display: grid;
  gap: var(--s10);
  max-width: 52rem;
}

.measure__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s3);
}

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

.measure__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-value);
  line-height: 1;
  color: var(--amber);
}

.measure__bar {
  display: flex;
  flex-direction: row-reverse;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background-color: var(--steel);
  background-image:
    repeating-linear-gradient(90deg, var(--tick-muted) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, var(--tick-muted) 0 1.5px, transparent 1.5px 40px);
  background-size: 100% 9px, 100% 18px;
  background-repeat: no-repeat;
}

.measure__lean {
  flex: none;
  background-color: var(--tape);
  background-image:
    repeating-linear-gradient(90deg, var(--tape-tick) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, var(--tape-tick) 0 1.5px, transparent 1.5px 40px);
  background-size: 100% 9px, 100% 18px;
  background-repeat: no-repeat;
  box-shadow: inset 1.5px 0 0 var(--tick-boundary), inset 0 -1.5px 0 var(--tape-edge);
}

.measure__lean--38 {
  width: 38%;
}

.measure__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s6);
  margin-block: var(--s3) var(--s4);
  font-size: var(--fs-body);
  color: var(--text-2);
}

.measure__legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.measure__legend span::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--steel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.measure__legend span.lean {
  color: var(--text-1);
}

/* A small yellow mark alone on light wears a navy rim (Firmino's outline rule). */
.measure__legend span.lean::before {
  background: var(--tape);
  box-shadow: inset 0 0 0 1.5px var(--tape-rim);
}

/* ------------------------------------------------------------------ app screens */

/*
 * Real screens of the app (assets/img/screens, made by tools/make-screens.py from light-mode
 * simulator captures, status bar cut off). A screen is an object: the iPhone's display corner, a
 * navy hairline and a soft navy shadow. In a well it rises from the bottom edge, which hides the
 * strip under the tab bar and the bottom corners.
 */
.screen {
  --w: 248px;
  position: relative;
  width: var(--w);
  max-width: 100%;
  margin: 0;
  border-radius: calc(var(--w) * 0.135);
  overflow: hidden;
  background: var(--canvas);
  box-shadow: var(--shadow-screen);
}

.screen img {
  width: 100%;
}

/* The well a screen stands in: steel lit from the top, inset from its card like the app's stage. */
.well {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--s4);
  padding: var(--s8) var(--s4) 0;
  border-radius: calc(var(--r-lg) - 6px);
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 0, rgba(255, 255, 255, 0.9), transparent 70%),
    linear-gradient(180deg, var(--steel) 0%, var(--steel-deep) 100%);
}

.well .screen {
  margin-bottom: calc(var(--w) * -0.065);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* How it works: one card per pillar, the words on white and the app below them. */
.features {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0 var(--s4);
}

.feature {
  display: grid;
  grid-template-rows: auto 1fr;
  margin-bottom: var(--s4);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.feature__text {
  display: grid;
  gap: var(--s3);
  align-content: start;
  padding: var(--s6) var(--s6) var(--s6);
}

.feature__text h3 {
  font-size: var(--fs-h3);
  line-height: 1.15;
}

.feature__text p {
  color: var(--text-2);
}

.feature__text .source {
  margin-top: var(--s1);
  color: var(--text-3);
}

.feature .well {
  margin: 0 6px 6px;
}

/* Each card spans two rows of the list (its words, its screen), so across a row the screens start
   on one line however long each card's words are. */
@supports (grid-template-rows: subgrid) {
  .feature {
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .feature--plain {
    grid-row: span 1;
    grid-template-rows: auto;
  }
}

/* The pillar icon: ink on a steel-tint disc, like the app's "What you'll need" icons. */
.pillar__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--s1);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-1);
}

.pillar__icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

/* A pillar with no screen: one wide white card, icon beside the words on wide screens. */
.feature--plain {
  grid-template-rows: auto;
}

@media (min-width: 720px) {
  .feature__text {
    padding: var(--s8) var(--s8) var(--s6);
  }

  .features--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features--2 .feature--plain {
    grid-column: 1 / -1;
  }

  .feature--plain .feature__text {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: var(--s5);
    padding-bottom: var(--s8);
  }

  .feature--plain .pillar__icon {
    grid-row: 1 / span 3;
  }
}

/* Tablets: one card per row, the words beside the screen instead of above a wide, empty well. */
@media (min-width: 720px) and (max-width: 1039px) {
  .features--3 .feature:not(.feature--plain) {
    grid-row: auto;
    grid-template-rows: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  }

  .features--3 .feature:not(.feature--plain) .feature__text {
    padding-bottom: var(--s8);
  }

  .features--3 .feature:not(.feature--plain) .well {
    margin: 6px 6px 6px 0;
  }
}

@media (min-width: 1040px) {
  .features--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .features--3 .feature--plain {
    grid-column: 1 / -1;
  }

  .features--3 .screen {
    --w: 236px;
  }
}

/* v2 pillar cards (the pen page): white cards with a hairline. */
.pillars {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s3);
}

.pillar {
  display: grid;
  gap: var(--s3);
  align-content: start;
  padding: var(--s6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.pillar h3 {
  font-size: var(--fs-h3);
  line-height: 1.15;
}

.pillar p {
  color: var(--text-2);
}

.pillar .source {
  margin-top: var(--s1);
  color: var(--text-3);
}

@media (min-width: 720px) {
  .pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pillar {
    padding: var(--s8);
  }
}

@media (min-width: 1040px) {
  .pillars--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Value: the trainer's price as a measured figure, then the honest sentence and its source. */
.value {
  display: grid;
  gap: var(--s5);
  margin-top: 0;
  padding: var(--s6);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.value__figure {
  display: grid;
  gap: var(--s2);
  align-content: start;
}

.value__figure strong {
  font-family: var(--font-display);
  font-size: var(--fs-value);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  color: var(--text-1);
}

.value__figure small {
  font-size: var(--fs-foot);
  color: var(--text-2);
}

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

.value__body {
  display: grid;
  gap: var(--s3);
  max-width: 46rem;
}

.value__body p {
  color: var(--text-2);
}

.value .source {
  color: var(--text-3);
}

@media (min-width: 880px) {
  .value {
    grid-template-columns: minmax(14rem, auto) minmax(0, 1fr);
    gap: var(--s12);
    padding: var(--s10);
  }
}

/* ------------------------------------------------------------------ the 12-week plan */

.plan {
  display: grid;
  gap: var(--s8);
}

.plan__main {
  display: grid;
  gap: var(--s8);
  align-content: start;
}

.plan__main .section__head {
  margin-bottom: 0;
}

.plan__app {
  margin: 0;
}

.plan__app .well {
  padding-top: var(--s10);
}

.plan__app .screen {
  --w: 264px;
}

@media (min-width: 960px) {
  .plan--app {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: var(--s18);
    align-items: start;
  }

  .plan__app {
    position: sticky;
    top: var(--s10);
  }
}

.weeks {
  display: grid;
  gap: var(--s3);
}

.weeks__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  font-size: var(--fs-foot);
  color: var(--text-2);
}

/* 12 week cells in 3 phases whose steel deepens as intensity rises; an ink start needle with a
   white-ringed cap ("positions are ink"). */
.plan__tape {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.plan__tape li {
  list-style: none;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 0 var(--s2) 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.8125rem, 0.7rem + 0.5vw, 1.0625rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
  background-color: var(--phase-1);
  background-image: linear-gradient(to right, var(--tick-minor) 0 1px, transparent 1px);
  background-size: 100% 16px;
  background-repeat: no-repeat;
}

.plan__tape li:nth-child(n + 3) {
  background-color: var(--phase-2);
}

.plan__tape li:nth-child(n + 9) {
  background-color: var(--phase-3);
}

.plan__tape li.is-phase-start {
  background-image: linear-gradient(to right, var(--tick-boundary) 0 2px, transparent 2px);
  background-size: 100% 100%;
}

.plan__tape li:first-child {
  padding-left: 14px;
  background-image: none;
  border-radius: 9px 0 0 9px;
}

.plan__tape li:last-child {
  border-radius: 0 9px 9px 0;
}

.plan__tape li.is-light {
  background-color: var(--phase-2);
}

.plan__tape::before {
  /* the start needle at week 1 */
  content: "";
  position: absolute;
  left: 4px;
  top: -6px;
  bottom: -6px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--text-1);
  z-index: 1;
}

.plan__tape::after {
  /* its cap: an ink dot ringed white */
  content: "";
  position: absolute;
  left: 0;
  top: -10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-1);
  box-shadow: var(--shadow-now);
  z-index: 2;
}

.plan__phases {
  list-style: none;
  padding: 0;
  display: grid;
}

.phase {
  display: grid;
  align-content: start;
  grid-template-columns: 96px 1fr;
  gap: var(--s5);
  padding-block: var(--s5);
  border-top: 1px solid var(--line);
}

.phase:last-child {
  border-bottom: 1px solid var(--line);
}

.phase__weeks {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.phase__weeks small {
  display: block;
  margin-top: var(--s2);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.phase h3 {
  font-size: var(--fs-h3);
  margin-bottom: var(--s1);
}

.phase p {
  color: var(--text-2);
}

/* Three phases side by side only when the plan has the full width (no screen beside it). */
@media (min-width: 880px) {
  .plan:not(.plan--app) .plan__phases {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s8);
  }

  .plan:not(.plan--app) .phase {
    grid-template-columns: 1fr;
    gap: var(--s3);
    padding-block: var(--s6) 0;
  }

  .plan:not(.plan--app) .phase:last-child {
    border-bottom: 0;
  }
}

.plan__after {
  display: grid;
  gap: var(--s3);
  padding: var(--s6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

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

.plan__after p {
  color: var(--text-2);
}

/* ------------------------------------------------------------------ after a GLP-1 */

.after {
  display: grid;
  gap: var(--s6);
  max-width: 50rem;
}

.after .section__head {
  margin-bottom: 0;
}

.after p {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
}

.after .doctor,
.after .source,
.after .study-note {
  font-size: var(--fs-foot);
}

.after .doctor {
  color: var(--text-1);
}

.after .source,
.after .study-note {
  color: var(--text-3);
}

.after .button {
  justify-self: start;
}

/* ------------------------------------------------------------------ privacy promises */

.promises {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s8);
}

.promise {
  display: grid;
  align-content: start;
  gap: var(--s2);
  padding-top: var(--s5);
  border-top: 2px solid var(--text-1);
}

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

.promise p {
  color: var(--text-2);
}

@media (min-width: 880px) {
  .promises {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ------------------------------------------------------------------ responsibility and credits */

.scope {
  display: grid;
  gap: var(--s10);
}

@media (min-width: 880px) {
  .scope {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--s18);
  }
}

.prose {
  display: grid;
  gap: var(--s5);
  max-width: var(--measure);
}

.prose p {
  color: var(--text-2);
}

.prose .section__head {
  margin-bottom: var(--s2);
}

.credits {
  display: grid;
  align-self: start;
  align-content: start;
  gap: var(--s5);
  padding: var(--s6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.credits h3 {
  font-size: 1.25rem;
}

.credits dl {
  display: grid;
  gap: var(--s4);
}

.credits dt {
  font-size: var(--fs-foot);
  color: var(--text-2);
}

.credits dd {
  margin: 0;
  font-weight: 700;
}

.credits dd small {
  display: block;
  font-size: var(--fs-foot);
  font-weight: 400;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ final call */

.final {
  position: relative;
  display: grid;
  gap: var(--s5);
  justify-items: center;
  text-align: center;
}

.final__figure {
  width: min(62vw, 280px);
  margin-bottom: calc(-1 * var(--s6));
}

.final__figure .glow {
  inset: -18% -30% -4%;
}

.final h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.final p {
  color: var(--text-2);
  max-width: 44ch;
}

/* The final call with the first two quiz screens beside it. */
.final--app {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  text-align: left;
  gap: var(--s10);
}

.final__text {
  display: grid;
  gap: var(--s5);
  justify-items: start;
}

.final__app {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.final__app .well {
  align-items: flex-end;
  gap: var(--s4);
  padding-top: var(--s12);
  border-radius: var(--r-lg);
}

/* Two screens side by side: each takes half the well on a phone. They stand on the well's bottom
   edge without the rising crop, so the welcome keeps the whole tape. */
.final__app .screen {
  --w: min(calc((100vw - 2 * var(--gutter) - 48px) / 2), 236px);
  flex: 0 1 var(--w);
  min-width: 0;
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .final--app {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: var(--s18);
  }

  .final__app .well {
    gap: var(--s6);
    padding-inline: var(--s8);
  }
}

/* ------------------------------------------------------------------ footer */

.footer {
  padding-block: var(--s12) var(--s18);
  background: var(--steel);
  border-top: 1px solid var(--line);
  font-size: var(--fs-foot);
}

.footer__grid {
  display: grid;
  gap: var(--s8);
}

.footer .wordmark svg {
  width: 32px;
  height: 32px;
}

.footer__links {
  list-style: none;
  padding: 0;
  display: grid;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--text-1);
}

.footer__meta {
  display: grid;
  gap: var(--s2);
  color: var(--text-3);
  max-width: 52ch;
}

.footer__tagline {
  margin-top: var(--s3);
  color: var(--text-2);
  max-width: 34ch;
}

@media (min-width: 880px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr 1.4fr;
    align-items: start;
  }
}

/* ------------------------------------------------------------------ documents (legal, support) */

/* Reading progress as a strip of tape: yellow fill, ink ticks, the amber edge. */
.read-tape {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 7px;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(var(--read, 0));
  background-color: var(--tape);
  background-image: linear-gradient(to right, var(--tape-tick) 0 1px, transparent 1px);
  background-size: 12px 55%;
  background-repeat: repeat-x;
  box-shadow: inset 0 -1px 0 var(--tape-edge), 0 4px 10px -4px rgba(178, 124, 10, 0.5);
}

.doc-hero {
  padding-block: var(--s10) var(--s12);
}

.doc-hero .wrap {
  display: grid;
  gap: var(--s4);
}

.doc-hero h1 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.doc-hero p {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-2);
  max-width: 46ch;
}

.doc-hero .doc-meta {
  font-size: var(--fs-foot);
  color: var(--text-3);
}

.doc-hero .emergency p {
  font-size: var(--fs-body);
  color: var(--text-1);
  max-width: none;
}

.summary {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s4);
  padding: var(--s6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 52rem;
}

.summary h2 {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.summary ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s3);
}

.summary li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s3);
  color: var(--text-1);
}

.summary li::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 0.3em;
  border-radius: 50%;
  border: 1.5px solid var(--tick-minor);
  background: radial-gradient(circle, var(--text-1) 0 2.5px, transparent 3px);
}

.doc-layout {
  display: grid;
  gap: var(--s10);
  padding-bottom: var(--s24);
}

.toc {
  align-self: start;
  font-size: var(--fs-foot);
}

.toc details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding-inline: var(--s5);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}

.toc details[open] summary::after {
  transform: translateY(3px) rotate(-135deg);
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0 var(--s5) var(--s4);
  display: grid;
}

.toc li {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  align-items: center;
  counter-increment: toc;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--s1);
  line-height: 1.35;
  color: var(--text-2);
  text-decoration-color: transparent;
}

.toc a:hover {
  color: var(--text-1);
  text-decoration-color: rgba(15, 27, 51, 0.4);
}

.toc a[aria-current="true"] {
  color: var(--text-1);
  font-weight: 700;
  text-decoration-color: var(--text-1);
}

@media (min-width: 1040px) {
  .doc-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: var(--s18);
  }

  .toc {
    position: sticky;
    top: var(--s8);
    max-height: calc(100vh - 64px);
    overflow: auto;
  }

  .toc details {
    border: 0;
    background: transparent;
  }

  .toc summary {
    padding-inline: 0;
    pointer-events: none;
  }

  .toc summary::after {
    display: none;
  }

  .toc ol {
    padding: 0;
  }
}

.doc {
  max-width: var(--measure);
  display: grid;
  gap: var(--s5);
  color: var(--text-2);
}

.doc > section {
  display: grid;
  gap: var(--s4);
  padding-top: var(--s8);
  scroll-margin-top: var(--s6);
}

.doc > section + section {
  border-top: 1px solid var(--line);
  margin-top: var(--s6);
}

.doc > section:first-child {
  padding-top: 0;
}

.doc h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  scroll-margin-top: var(--s6);
}

.doc h3 {
  font-size: var(--fs-h3);
  margin-top: var(--s3);
  color: var(--text-1);
  scroll-margin-top: var(--s6);
}

.doc strong {
  color: var(--text-1);
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
  display: grid;
  gap: var(--s3);
}

.doc li::marker {
  color: var(--text-3);
}

.doc .note {
  padding: var(--s5) var(--s6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.doc address {
  font-style: normal;
}

/* Credits on the disclaimer pages (mobile/src/content/professionals.ts). */
.credits-list {
  display: grid;
  gap: var(--s3);
}

.credits-list > div {
  padding: var(--s4) var(--s5);
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.credits-list dt {
  font-size: var(--fs-foot);
  color: var(--text-3);
}

.credits-list dd {
  font-weight: 700;
  color: var(--text-1);
}

/* Sources list: our plain description, then the short source line. */
.sources {
  list-style: none;
  padding: 0 !important;
  gap: 0 !important;
}

.sources li {
  display: grid;
  gap: var(--s1);
  padding-block: var(--s3);
  border-top: 1px solid var(--line);
}

.sources li:last-child {
  border-bottom: 1px solid var(--line);
}

.sources .src-title {
  color: var(--text-1);
  font-weight: 600;
}

.sources .src-detail {
  font-size: var(--fs-foot);
  color: var(--text-3);
}

/* Support FAQ: native details on white cards, motion only answers the tap. */
.faq {
  display: grid;
  gap: var(--s2);
}

.faq details {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.faq summary {
  position: relative;
  display: block;
  min-height: 68px;
  padding: var(--s5) calc(var(--s5) + 42px) var(--s5) var(--s5);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.35;
  color: var(--text-1);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: var(--s5);
  top: 50%;
  margin-top: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--tick-minor);
  background:
    linear-gradient(var(--text-1), var(--text-1)) center / 10px 2px no-repeat,
    linear-gradient(var(--text-1), var(--text-1)) center / 2px 10px no-repeat;
  transition: transform 0.3s var(--ease-spring);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary:hover {
  background: var(--glass);
}

.faq .answer {
  display: grid;
  gap: var(--s3);
  padding: 0 var(--s5) var(--s6);
  color: var(--text-2);
}

.faq .answer ol,
.faq .answer ul {
  padding-left: 1.3em;
  display: grid;
  gap: var(--s2);
}

.contact-card {
  position: relative;
  display: grid;
  gap: var(--s3);
  padding: var(--s8);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-raised);
  max-width: 44rem;
}

.contact-card h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
}

.contact-card p {
  color: var(--text-2);
}

.contact-card .email {
  justify-self: start;
  margin-top: var(--s2);
  overflow-wrap: anywhere;
}

.emergency {
  display: grid;
  gap: var(--s2);
  padding: var(--s5) var(--s6);
  border-radius: var(--r-md);
  background: var(--alerta-soft);
  border: 1.5px solid var(--alerta);
  max-width: 52rem;
}

.emergency strong {
  font-size: var(--fs-body);
  color: var(--text-1);
}

/* ------------------------------------------------------------------ 404 */

.center-page {
  position: relative;
  isolation: isolate;
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: var(--s6);
  padding-block: var(--s12) var(--s18);
}

.center-page h1 {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  max-width: 18ch;
}

.center-page p {
  color: var(--text-2);
}

.center-page .choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.lost-figure {
  width: min(56vw, 220px);
}

.lost-figure .glow {
  inset: -24% -30%;
}

.lost-alt {
  display: grid;
  gap: var(--s4);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ pen page (v1 markup, unpublished) */

.after .doctor {
  max-width: 44rem;
}

.split {
  display: grid;
  gap: var(--s10);
}

@media (min-width: 880px) {
  .split {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--s18);
    align-items: start;
  }

  .split .section__head {
    margin-bottom: 0;
    position: sticky;
    top: var(--s8);
  }
}

/* ------------------------------------------------------------------ print */

@media print {
  .masthead nav,
  .read-tape,
  .toc,
  .skip-link,
  .lang-hint,
  .footer,
  .grain,
  .glow {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }

  .doc,
  .doc h2,
  .doc h3,
  .doc strong,
  .doc-hero p,
  .summary,
  .summary li,
  .sources .src-title,
  .sources .src-detail {
    color: #000 !important;
  }

  .summary {
    background: none;
    border-color: #999;
  }

  .doc-layout {
    display: block;
  }
}
