/* ==========================================================================
   Count the Thunder — Night Edition
   Editorial dark. Mobile-first. Read at 360px, one-handed, minimum brightness.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, weight + optical-size variable)
   One sans family carries headings and body. The optical-size axis is kept,
   so the same file renders a 60px heading and 17px body correctly. */
@font-face {
  font-family: "Sans";
  src: url("../fonts/sans.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sans";
  src: url("../fonts/sans-i.woff2") format("woff2");
  font-weight: 300 500;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* surface — a deep teal-black, the same night as RadarWrangler */
  --ink-950: #0a1618;
  --ink-900: #0f1e21;
  --ink-850: #13252a;
  --ink-800: #182d33;
  --ink-700: #213a41;

  /* text */
  --paper: #e9e6df;
  --paper-dim: #a3b7b8;
  --paper-faint: #7a9195;

  /* accent — gold owns the tool, the data, and every structural cue */
  --lamp: #e9b87a;
  --lamp-deep: #b98d50;
  --ember: #e28a6a;

  /* Teal is ambient only: the light in the room, never a highlight. It sits
     on the hero glow, the waveform and the section icons and nowhere else.
     Making it an accent read as instrumentation rather than comfort. */
  --teal: #5fd3c4;
  --teal-deep: #3d9c92;

  /* structure */
  --line: rgba(120, 190, 188, 0.16);
  --line-strong: rgba(120, 190, 188, 0.36);
  --glow: rgba(80, 200, 190, 0.11);

  /* type */
  --f-display: "Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* labels and figures use the same family as everything else; figures
     switch on tabular-nums so columns of numbers stay aligned */
  --f-label: "Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-micro: 0.688rem;
  --t-xs: 0.813rem;
  --t-sm: 0.938rem;
  --t-base: 1.063rem;
  --t-lg: 1.25rem;
  --t-xl: 1.438rem;
  --t-2xl: clamp(1.75rem, 7.5vw, 2.375rem);
  --t-3xl: clamp(2.125rem, 10vw, 3rem);

  /* space — 4px rhythm */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 2.75rem;
  --s8: 3.5rem;
  --s9: 5rem;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --measure: 35rem;
  --gutter: 1.375rem;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink-950);
  color: var(--paper);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--t-base);
  /* sans has a taller x-height than the serif it replaced, so it needs
     slightly less leading to read as calmly at the same size */
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

p {
  margin: 0 0 var(--s4);
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--paper);
}

a {
  color: var(--lamp);
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration: underline;
  text-decoration-color: rgba(233, 184, 122, 0.4);
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--lamp);
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 50;
  background: var(--lamp);
  color: var(--ink-950);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  font-family: var(--f-label);
  font-size: var(--t-xs);
  transition: top 0.2s ease;
}
.skip:focus {
  top: var(--s3);
}

/* ---------- Shared type utilities ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--f-label);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin: 0 0 var(--s3);
}
.eyebrow .ico {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--teal-deep);
}
.eyebrow .ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Headings get their presence from weight and negative tracking rather than
   from a contrasting family. Tracking tightens as size grows. */
h1,
h2,
h3 {
  font-family: var(--f-display);
  font-weight: 550;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: var(--t-3xl);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h2 {
  font-size: var(--t-2xl);
  line-height: 1.08;
  letter-spacing: -0.032em;
}
h3 {
  font-size: var(--t-xl);
  line-height: 1.22;
  letter-spacing: -0.022em;
}
h4 {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.45;
  margin: 0 0 var(--s2);
  letter-spacing: -0.008em;
}

.quiet {
  color: var(--paper-dim);
}

/* closing paragraph of a subsection — extra air above it */
.coda {
  margin-top: var(--s5);
}

.lead {
  font-size: var(--t-lg);
  line-height: 1.45;
  letter-spacing: -0.018em;
  color: var(--paper-dim);
  font-weight: 400;
}

/* ==========================================================================
   HERO — the instrument
   ========================================================================== */
.hero {
  position: relative;
  padding: calc(var(--s5) + env(safe-area-inset-top)) 0 var(--s4);
  isolation: isolate;
  overflow: hidden;
}

/* soft lamplight from above; pure CSS, no image */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% 0 auto 0;
  height: 70vh;
  background: radial-gradient(
    ellipse 60% 50% at 50% 0%,
    var(--glow),
    transparent 70%
  );
  z-index: -1;
  pointer-events: none;
}

.masthead {
  display: flex;
  align-items: center;
  gap: var(--s4);
  font-family: var(--f-label);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: var(--s3);
}
.masthead-name {
  flex: none;
}

/* Scrolling waveform. It is the page's only decorative motion, and it earns
   its place by saying what the tool measures: sound arriving over time.
   Under prefers-reduced-motion it stops and becomes a static trace. */
.wave {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 20px;
  overflow: hidden;
  /* fade both ends so the loop has no visible seam or hard stop */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 82%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 82%,
    transparent
  );
}
/* rendered 1:1 — no axis scaling, so the bars keep their drawn proportions.
   Three copies of a 420px pattern: after scrolling one pattern width there
   are still two left, so the strip cannot run dry on a wide screen. */
.wave-svg {
  display: block;
  width: 1260px;
  height: 20px;
}
.wave-svg rect {
  fill: var(--teal-deep);
}
.wave-svg rect.blip {
  fill: var(--teal);
}
.wave-scroll {
  animation: wave-scroll 18s linear infinite;
  will-change: transform;
}
@keyframes wave-scroll {
  from {
    transform: translateX(0);
  }
  to {
    /* exactly one pattern width — the loop has no seam */
    transform: translateX(-420px);
  }
}

h1 {
  margin-bottom: var(--s4);
  max-width: 12ch;
}

/* --- stage --- */
/* The stage carries the heaviest outline on the page — 2px — because it is
   the tool. Every other bordered block is 1px, so the hierarchy reads at a
   glance without anything else changing color. */
.stage {
  background: var(--ink-900);
  border: 2px solid var(--lamp-deep);
  border-radius: var(--r-lg);
  padding: var(--s5);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  transition: border-color 0.4s ease;
}

.tool-label {
  font-family: var(--f-label);
  font-weight: 500;
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  text-align: center;
  margin: 0 0 var(--s3);
}

/* two-step track */
.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.step {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.step::before {
  content: "";
  height: 2px;
  border-radius: 1px;
  background: var(--line-strong);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
}
.step span {
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-faint);
  transition: color 0.25s ease;
  font-weight: 500;
}
.step.on::before {
  background: var(--lamp);
}
.step.on span {
  color: var(--lamp);
}
/* Once the flash is logged, step one is spent. It goes grey rather than dim
   gold so that during the count there is exactly one gold thing in the
   stage — the step you are actually on. */
.step.done::before {
  background: var(--line-strong);
}
.step.done span {
  color: var(--paper-faint);
}

.prompt {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: -0.014em;
  text-align: center;
  margin: 0 0 var(--s4);
  /* reserves the tallest of the two prompts, so the button never moves
     between idle and listening */
  min-height: 2.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
  color: var(--paper);
}

/* the button */
.tap {
  display: block;
  width: 100%;
  min-height: 7.25rem;
  padding: var(--s5) var(--s4);
  background: var(--lamp);
  color: var(--ink-950);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.005em;
  line-height: 1.2;
  transition:
    background 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.3s ease;
  animation: nudge 3.6s ease-in-out infinite;
}
.tap:active {
  transform: scale(0.985);
}
.tap:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}
.tap-ico {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto var(--s3);
}
.tap-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes nudge {
  0%,
  90%,
  100% {
    box-shadow: 0 0 0 0 rgba(233, 184, 122, 0);
  }
  95% {
    box-shadow: 0 0 0 8px rgba(233, 184, 122, 0.12);
  }
}

/* listening: unmistakable flip */
.tap[data-state="listening"] {
  background: var(--paper);
  animation: none;
}
.stage.listening {
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe {
  0%,
  100% {
    border-color: var(--lamp-deep);
  }
  50% {
    border-color: var(--lamp);
  }
}

/* Sits on the tool, not four screens below it in the footer. The estimate is
   safety-critical and the page must not hand over a number without saying what
   it is not. */
.tap-disclaimer {
  margin: var(--s4) 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  line-height: 1.55;
  color: var(--paper-faint);
  text-align: center;
  text-wrap: pretty;
}
.tap-disclaimer a {
  color: var(--paper-dim);
  text-decoration-color: var(--line-strong);
}
.tap-disclaimer a:hover {
  color: var(--lamp);
}

.stage.has-reading .tap-caption {
  display: none;
}
.tap-caption {
  margin: var(--s3) 0 0;
  font-size: var(--t-xs);
  color: var(--paper-faint);
  text-align: center;
}

.ticker {
  font-family: var(--f-label);
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  color: var(--lamp);
  text-align: center;
  margin-top: var(--s2);
  min-height: 0;
}

/* --- readout --- */
.readout {
  display: none;
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  text-align: center;
}
.readout.on {
  display: block;
}

.dist {
  font-family: var(--f-label);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 18vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--lamp);
}
/* [hidden] must win over the display rule below, or the guard states show
   "about —" */
.dist .approx[hidden] {
  display: none;
}
/* mirrors .dist small below the numeral, so the readout is bracketed by two
   matching micro-labels rather than a lowercase word and a caps one */
.dist .approx {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: var(--s3);
}
.dist small {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-top: var(--s3);
  font-variant-numeric: tabular-nums;
  /* at 320px this runs to two lines; balance them so the seconds are not
     orphaned on a line of their own */
  line-height: 1.45;
  text-wrap: balance;
}

.verdict {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--t-lg);
  line-height: 1.42;
  letter-spacing: -0.014em;
  margin: var(--s4) auto 0;
  max-width: 24rem;
  text-wrap: pretty;
}
.verdict.warn {
  color: var(--ember);
  font-style: normal;
  font-weight: 400;
}

/* The tool asking to be put down. Deliberately not styled as an alert: it is
   the calmest thing in the stage, because it only appears when there is
   nothing to worry about. */
.enough {
  margin: var(--s4) auto 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  max-width: 24rem;
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--lamp);
  text-wrap: pretty;
}

.trend {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--s2);
  height: 46px;
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.trend span {
  width: 22px;
  border-radius: 2px;
  background: var(--lamp-deep);
  opacity: 0.45;
  transition: height 0.4s ease;
}
.trend span:last-child {
  background: var(--lamp);
  opacity: 1;
}
.trend-label {
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-top: var(--s2);
  font-weight: 500;
}

.reset {
  margin-top: var(--s4);
  background: none;
  border: none;
  color: var(--paper-dim);
  font-family: var(--f-label);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--s3) var(--s4);
  min-height: 44px;
  font-weight: 500;
}
.reset:hover {
  color: var(--paper);
}

/* ==========================================================================
   JUMP NAV
   ========================================================================== */
.jump {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  list-style: none;
  margin: 0;
  padding: 0 0 var(--s4);
}

/* what this is and who it is for — one sentence, above the four parts */
.mission {
  margin: 0 0 var(--s6);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.014em;
  color: var(--paper);
  text-align: center;
  /* balance rather than pretty: centred text reads better with even line
     lengths than with one short last line */
  text-wrap: balance;
}

.jump li {
  display: flex;
}
.jump a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s4);
  width: 100%;
  min-height: 5.5rem;
  padding: var(--s4);
  background: var(--ink-850);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--paper);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}
.jump a:hover,
.jump a:focus-visible {
  background: var(--ink-700);
}
.jump .idx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  color: var(--lamp);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.jump .idx .ico {
  width: 18px;
  height: 18px;
  color: var(--lamp-deep);
}
.jump .idx .ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.jump .lbl {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

/* ==========================================================================
   PARTS
   ========================================================================== */
.part {
  padding-top: var(--s9);
  scroll-margin-top: var(--s4);
}

/* A part break has to stop the page reading as one long scroll. The rule
   spans the measure; a short thick gold bar sits on it at the left. The two
   together read as a deliberate division rather than another hairline. */
.part-head {
  position: relative;
  padding-top: var(--s6);
  border-top: 2px solid var(--line-strong);
  margin-bottom: var(--s5);
}
.part-head::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 88px;
  height: 5px;
  border-radius: 3px;
  background: var(--lamp);
}
/* Client artwork: hand-drawn gold numerals. They are thin-stroked, so they
   carry a much higher opacity than the solid type they replaced — at 0.22 they
   disappeared entirely. Decorative only; the part is named in the kicker and
   the heading, so these are aria-hidden. */
.part-num {
  position: absolute;
  top: var(--s4);
  right: 0;
  height: 4.5rem;
  width: auto;
  opacity: 0.75;
  pointer-events: none;
  user-select: none;
}
.part-kicker {
  font-family: var(--f-label);
  font-weight: 500;
  font-size: var(--t-xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 var(--s3);
}
.part-head h2 {
  max-width: 11ch;
  position: relative;
}
.part-head .lead {
  margin: var(--s3) 0 0;
  max-width: 30ch;
}

/* subsections */
.sub {
  padding: var(--s7) 0 0;
  scroll-margin-top: var(--s4);
}
.sub > .eyebrow + h3 {
  margin-bottom: var(--s4);
}
.sub h3 {
  margin-bottom: var(--s4);
}

/* entry list — hairline rhythm, no boxes */
.entries {
  margin-top: var(--s4);
}
.entry {
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
}
.entry:last-child {
  padding-bottom: 0;
}
.entry p {
  margin: 0;
  color: var(--paper-dim);
  font-size: var(--t-sm);
}

/* ---------- 30-30 ---------- */
.thirty {
  margin-top: var(--s5);
  border-top: 1px solid var(--line-strong);
}
.thirty-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s4);
  align-items: start;
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--line);
}
.thirty-num {
  font-family: var(--f-label);
  font-variant-numeric: tabular-nums;
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--lamp);
}
.thirty-card b {
  display: block;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--t-sm);
  margin-bottom: var(--s2);
}
.thirty-card p {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--paper-dim);
}

/* ---------- numbers ---------- */
.rules {
  margin-top: var(--s4);
  border-top: 1px solid var(--line-strong);
}
.rule {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: var(--s4);
  align-items: baseline;
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}
.rule b {
  font-family: var(--f-label);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--lamp);
}
.rule span {
  font-size: var(--t-sm);
  color: var(--paper-dim);
}

/* ---------- big stat ---------- */
/* Stacked by default: at phone width a wide figure beside the copy
   squeezes the text into an unreadable ragged column. */
.bignum {
  display: block;
  background: var(--ink-900);
  border: 1px solid var(--lamp-deep);
  border-radius: var(--r-md);
  padding: var(--s5) var(--s4);
  margin: var(--s5) 0;
}
.bignum b {
  display: block;
  font-family: var(--f-label);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 2.125rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--lamp);
  white-space: nowrap;
  margin-bottom: var(--s3);
}
.bignum span {
  display: block;
  font-size: var(--t-sm);
  color: var(--paper-dim);
  line-height: 1.55;
}

/* ---------- watch / warning ---------- */
.tiers {
  margin-top: var(--s4);
  display: grid;
  gap: var(--s4);
}
.tier {
  padding: var(--s4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
}
.tier.now {
  border-color: var(--ember);
}
.tier .word {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: var(--s2);
  font-weight: 500;
}
.tier.now .word {
  color: var(--ember);
}
.tier h4 {
  font-family: var(--f-display);
  font-weight: 550;
  font-size: var(--t-lg);
  margin-bottom: var(--s3);
  letter-spacing: -0.024em;
}
.tier p {
  font-size: var(--t-sm);
  color: var(--paper-dim);
  margin-bottom: var(--s3);
}

/* ---------- diagrams ---------- */
.figure {
  margin-top: var(--s5);
}
.figure .art {
  width: 100%;
  background: var(--ink-900);
  border-radius: var(--r-md);
  overflow: hidden;
}
.figure .art svg,
.figure .art img {
  width: 100%;
  height: auto;
  display: block;
}
.fig-step {
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lamp-deep);
  margin: var(--s4) 0 var(--s2);
  font-weight: 500;
}
.fig-cap {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--paper-dim);
}

/* ---------- kit ---------- */
.kit-feature {
  display: block;
  background: var(--ink-900);
  border: 1px solid var(--lamp-deep);
  border-radius: var(--r-md);
  padding: var(--s5) var(--s4);
  margin: var(--s5) 0 var(--s3);
}
.kit-feature .kit-art {
  width: 52px;
  height: 52px;
  color: var(--lamp);
  margin-bottom: var(--s4);
}
.kit-feature .tagline {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lamp-deep);
  margin-bottom: var(--s2);
  font-weight: 500;
}
.kit-feature h4 {
  font-family: var(--f-display);
  font-weight: 550;
  font-size: var(--t-lg);
  letter-spacing: -0.024em;
  margin-bottom: var(--s3);
}
.kit-feature p {
  font-size: var(--t-sm);
  color: var(--paper-dim);
  margin: 0;
}

.kit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}
.kit-card {
  background: var(--ink-900);
  border-radius: var(--r-md);
  padding: var(--s4);
}
.kit-card .kit-art {
  width: 30px;
  height: 30px;
  color: var(--lamp-deep);
  margin-bottom: var(--s3);
}
.kit-art svg {
  width: 100%;
  height: 100%;
  display: block;
}
.kit-card h4 {
  font-size: var(--t-xs);
  margin-bottom: var(--s1);
}
.kit-card p {
  margin: 0;
  font-size: var(--t-xs);
  line-height: 1.5;
  color: var(--paper-faint);
}

/* ---------- NWS links ---------- */
.links {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s5);
}
.linkbtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 56px;
  padding: var(--s3) var(--s4);
  background: var(--ink-900);
  /* transparent by default so the promoted row is not 2px taller */
  border: 1px solid transparent;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--paper);
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}
.linkbtn:hover,
.linkbtn:focus-visible {
  background: var(--ink-700);
}
.linkbtn.primary {
  background: var(--ink-850);
  border-color: var(--lamp-deep);
}
.linkbtn b {
  display: block;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.35;
}
.linkbtn .meta {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  color: var(--paper-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.linkbtn .arrow {
  flex: none;
  color: var(--lamp);
  font-family: var(--f-label);
  font-size: 1rem;
}

/* ==========================================================================
   PLAN
   ========================================================================== */
.planhead {
  display: none;
}

.storage-note {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  background: var(--ink-900);
  border-radius: var(--r-md);
  padding: var(--s4);
  margin: var(--s4) 0 var(--s6);
  font-size: var(--t-xs);
  color: var(--paper-dim);
  line-height: 1.6;
}
.storage-note .ico {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--lamp-deep);
  margin-top: 2px;
}
.storage-note .ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.storage-note p {
  margin: 0;
}

.household {
  margin-bottom: var(--s5);
}

.fld-label,
.plan h4 {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 var(--s2);
}

.fld {
  display: block;
  width: 100%;
  min-height: 48px;
  background: rgba(150, 172, 188, 0.11);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--paper);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--t-sm);
  padding: var(--s3);
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}
.fld::placeholder {
  color: var(--paper-faint);
  font-style: italic;
  opacity: 0.8;
}
.fld:focus {
  outline: none;
  border-color: var(--lamp);
  background: rgba(233, 184, 122, 0.07);
  box-shadow: 0 0 0 3px rgba(233, 184, 122, 0.12);
}
/* .fld:focus removes the outline in favour of the gold border + ring, which
   is a fine pointer affordance — but keyboard users must still get a real
   focus ring, and the :focus rule would otherwise out-specify the global
   :focus-visible one. */
.fld:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 2px;
}
.fld.filled {
  border-color: var(--lamp-deep);
  background: rgba(233, 184, 122, 0.05);
}

.plan {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.plan li {
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--line);
}
.pair {
  display: grid;
  gap: var(--s3);
}
.pair label {
  display: block;
}
.pair label > span {
  display: block;
  font-family: var(--f-label);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: var(--s1);
  font-weight: 500;
}
.hint {
  margin: var(--s3) 0 0;
  font-size: var(--t-xs);
  color: var(--paper-faint);
  line-height: 1.55;
}
.hint em {
  font-style: normal;
  color: var(--paper-dim);
  font-weight: 600;
}

.progress {
  margin-top: var(--s5);
}
.progress-bar {
  height: 3px;
  background: rgba(150, 172, 188, 0.14);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lamp);
  border-radius: 2px;
  transition: width 0.35s ease;
}
.progress-text {
  margin: var(--s3) 0 0;
  font-family: var(--f-label);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.progress-text.done {
  color: var(--lamp);
}

.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s5);
}
.btn {
  min-height: 48px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--paper-dim);
  font-family: var(--f-label);
  /* tightened so the three plan buttons sit on one line at phone width;
     they still wrap gracefully below ~360px */
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: var(--s3);
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
  font-weight: 500;
}
.btn:hover {
  border-color: var(--lamp-deep);
  color: var(--paper);
}
.btn.solid {
  background: var(--ink-800);
  border-color: var(--lamp-deep);
  color: var(--paper);
}
.btn.solid:hover {
  border-color: var(--lamp);
}
.btn.solid:hover {
  background: var(--ink-700);
}
.btn.danger:hover {
  border-color: var(--ember);
  color: var(--ember);
}

/* ==========================================================================
   ABOUT / FOOTER
   ========================================================================== */
.about .sig {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 450;
  font-size: var(--t-lg);
  letter-spacing: -0.014em;
  color: var(--paper-dim);
  margin-top: var(--s5);
}

.install-note {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--paper-faint);
  line-height: 1.6;
}
.install-note .ico {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--lamp-deep);
  margin-top: 2px;
}
.install-note .ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.install-note p {
  margin: 0;
}

/* feedback line — a plain mailto, no form, nothing collected */
.feedback {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding-bottom: var(--s5);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--paper-dim);
  line-height: 1.6;
}
.feedback .ico {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--lamp-deep);
  margin-top: 1px;
}
.feedback .ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.feedback a {
  color: var(--lamp);
  white-space: nowrap;
}

footer {
  margin-top: var(--s7);
  padding: var(--s6) 0 calc(var(--s8) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-strong);
  color: var(--paper-faint);
  font-size: var(--t-xs);
  line-height: 1.65;
}
footer p {
  margin-bottom: var(--s4);
}
.legal-links {
  margin-top: var(--s5);
}
.legal-links a {
  color: var(--paper-dim);
}

footer a {
  color: var(--paper-dim);
  text-decoration-color: var(--line-strong);
}
footer a:hover {
  color: var(--lamp);
}

/* ==========================================================================
   LEGAL PAGES (terms)
   ========================================================================== */
.legal .wrap {
  padding-top: calc(var(--s6) + env(safe-area-inset-top));
  padding-bottom: calc(var(--s9) + env(safe-area-inset-bottom));
}
.legal h1 {
  font-size: var(--t-2xl);
  margin-bottom: var(--s2);
  max-width: none;
}
.legal h2 {
  font-size: var(--t-xl);
  margin: var(--s7) 0 var(--s3);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  max-width: none;
}
.legal h3 {
  font-size: var(--t-lg);
  margin: var(--s5) 0 var(--s2);
}
.legal p {
  font-size: var(--t-sm);
  margin-bottom: var(--s4);
  color: var(--paper-dim);
}
.legal p strong,
.legal strong {
  color: var(--paper);
}
.legal .lead {
  font-size: var(--t-base);
  color: var(--paper);
  margin-bottom: var(--s5);
}
.legal-date {
  font-size: var(--t-xs) !important;
  color: var(--paper-faint) !important;
  margin-bottom: var(--s5) !important;
}
.legal-back {
  font-size: var(--t-xs) !important;
  margin-bottom: var(--s5);
}
.legal-foot {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
.legal code {
  font-size: 0.95em;
  color: var(--paper);
  background: var(--ink-900);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ==========================================================================
   BREAKPOINTS
   ========================================================================== */
@media screen and (min-width: 34rem) {
  :root {
    --t-base: 1.125rem;
    --gutter: 2rem;
  }
  .jump {
    grid-template-columns: repeat(4, 1fr);
  }
  .jump .lbl {
    font-size: 1rem;
  }
  .part-num {
    height: 5.5rem;
  }
  .stage {
    padding: var(--s6) var(--s5);
  }
  .part-num {
    font-size: 6rem;
  }
  .kit-grid {
    gap: var(--s4);
  }
}

/* ---- Wide screens ----
   Still one column. The layout does not change; the reading column is
   simply sized for a screen at arm's length rather than a phone held
   close, and gets more air between sections. */
@media screen and (min-width: 60rem) {
  :root {
    --measure: 41rem;
    --t-base: 1.188rem;
    --t-sm: 1.031rem;
    --t-lg: 1.375rem;
    --t-xl: 1.625rem;
    --t-2xl: 3rem;
    --t-3xl: 3.75rem;
    --s7: 3.25rem;
    --s8: 4.5rem;
  }

  body {
    line-height: 1.7;
  }

  .hero {
    padding-top: var(--s9);
    padding-bottom: var(--s8);
  }

  /* the phone-width clamps stop earning their keep out here — they only
     force awkward breaks next to empty space */
  h1,
  .part-head h2 {
    max-width: none;
  }
  h1 {
    max-width: 16ch;
  }
  .part-head .lead {
    max-width: 38ch;
  }

  .part-num {
    height: 7.5rem;
    top: var(--s3);
  }
  .part-head::before {
    width: 128px;
    height: 6px;
  }

  .stage {
    padding: var(--s7) var(--s7) var(--s6);
  }
  .prompt {
    font-size: var(--t-xl);
  }
  .tap {
    min-height: 9rem;
  }

  .thirty-num {
    font-size: 3.25rem;
  }
  .rule {
    grid-template-columns: 5.5rem 1fr;
  }
  .rule b {
    font-size: 1.5rem;
  }

  /* the figure is the widest thing on the page and can take the room */
  .bignum {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s5);
    align-items: center;
    padding: var(--s5);
  }
  .bignum b {
    margin-bottom: 0;
    font-size: 2.5rem;
  }

  .kit-feature .kit-art {
    width: 60px;
    height: 60px;
  }
  .kit-card .kit-art {
    width: 34px;
    height: 34px;
  }
  .kit-card h4 {
    font-size: var(--t-sm);
  }
  .kit-card p {
    font-size: var(--t-xs);
  }

  .linkbtn {
    min-height: 64px;
    padding: var(--s4) var(--s5);
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* the waveform stops but stays — a static trace still reads as a rule */
  .wave-scroll {
    transform: none !important;
  }
}

/* ==========================================================================
   PRINT — the plan alone, one page
   ========================================================================== */
.printfoot {
  display: none;
}

@media print {
  :root {
    --paper: #000;
    --paper-dim: #333;
    --paper-faint: #555;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.4;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }

  .hero,
  nav,
  .mission,
  .part-head,
  footer,
  .no-print,
  .install-note,
  .skip {
    display: none !important;
  }
  .part,
  .sub {
    display: none;
    padding: 0;
  }

  #ready,
  #plan {
    display: block !important;
    padding: 0;
  }
  #plan > .eyebrow,
  #plan > h3 {
    display: none;
  }

  .planhead {
    display: block;
    font-family: var(--f-display);
    font-size: 20pt;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    color: #000;
  }

  .household {
    margin-bottom: 0.5rem;
  }
  .fld-label,
  .plan h4 {
    color: #444;
    font-size: 7.5pt;
    letter-spacing: 0.1em;
    margin-bottom: 0.1rem;
  }
  .fld,
  .fld.filled,
  .fld:focus {
    min-height: 0;
    color: #000;
    background: #fff;
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    font-size: 11pt;
    padding: 0.05rem 0;
    box-shadow: none;
  }
  .fld::placeholder {
    color: transparent;
  }
  .plan {
    border-top: none;
  }
  .plan li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .pair {
    gap: 0.25rem;
  }
  .pair label > span {
    color: #666;
    font-size: 7pt;
  }

  .printfoot {
    display: block;
    margin-top: 0.8rem;
    font-size: 8.5pt;
    color: #555;
  }
}
