
:root {
  --surface: #ffffff;
  --sunken: #edf1f7;
  --raised: #f3f6fb;
  --viz: #f7fafd;
  --ink: #16233f;
  --ink-body: #3d4c68;
  --muted: #48587a;
  --faint: #66738d;
  --line: #e2e8f2;
  --line-strong: #cbd6e6;
  --track: #e4eaf3;
  --grid: #d6dfec;
  --btc: #f7931a;
  --btc-ink: #b86400;
  --btc-wash: rgba(247,147,26,0.12);
  --on-phase: #ffffff;
  --p1: #16a34a; --p1-ink: #0b7a36; --p1-tint: #dcf3e4; --p1-wash: rgba(22,163,74,0.12);
  --p2: #2563eb; --p2-ink: #1d4ed8; --p2-tint: #dee9fc; --p2-wash: rgba(37,99,235,0.11);
  --p3: #d97706; --p3-ink: #96560a; --p3-tint: #fbeed8; --p3-wash: rgba(217,119,6,0.12);
  --p4: #dc2626; --p4-ink: #b91c1c; --p4-tint: #fbe1e1; --p4-wash: rgba(220,38,38,0.10);
  --p5: #7c3aed; --p5-ink: #6b21d4; --p5-tint: #ebe2fb; --p5-wash: rgba(124,58,237,0.11);
  --shadow-card: 0 1px 2px rgba(22,35,63,0.06), 0 10px 22px -8px rgba(22,35,63,0.16);
  --shadow-inset: 0 4px 14px rgba(22,35,63,0.08);
  --shadow-frame: 0 12px 60px rgba(22,35,63,0.14);
  --disc: #ffffff;

  /* One face for the whole page, per the Astra 4 display font. The three
     roles (display / running text / mono-style labels) now all resolve to
     it — kept as separate tokens so weight and letter-spacing per role
     stay adjustable without hunting through every rule. */
  --display: 'Outfit', system-ui, sans-serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --mono: 'Outfit', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #101726;
    --sunken: #0a0f1a;
    --raised: #18202f;
    --viz: #141c2b;
    --ink: #e8eef8;
    --ink-body: #c3cee0;
    --muted: #9daec8;
    --faint: #8294b0;
    --line: #26314a;
    --line-strong: #36445f;
    --track: #26314a;
    --grid: #2f3b56;
    --btc-ink: #ffab3d;
    --btc-wash: rgba(247,147,26,0.18);
    --on-phase: #101726;
    --p1: #34d17a; --p1-ink: #34d17a; --p1-tint: #14301f; --p1-wash: rgba(52,209,122,0.16);
    --p2: #5b91ff; --p2-ink: #5b91ff; --p2-tint: #15233f; --p2-wash: rgba(91,145,255,0.16);
    --p3: #f0a437; --p3-ink: #f0a437; --p3-tint: #33240c; --p3-wash: rgba(240,164,55,0.16);
    --p4: #ff6b6b; --p4-ink: #ff6b6b; --p4-tint: #3a1618; --p4-wash: rgba(255,107,107,0.16);
    --p5: #a482ff; --p5-ink: #a482ff; --p5-tint: #261a42; --p5-wash: rgba(164,130,255,0.16);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.40), 0 10px 22px -8px rgba(0,0,0,0.60);
    --shadow-inset: 0 4px 14px rgba(0,0,0,0.40);
    --shadow-frame: 0 12px 60px rgba(0,0,0,0.55);
    --disc: #101726;
  }
}

:root[data-theme="dark"] {
  --surface: #101726;
  --sunken: #0a0f1a;
  --raised: #18202f;
  --viz: #141c2b;
  --ink: #e8eef8;
  --ink-body: #c3cee0;
  --muted: #9daec8;
  --faint: #8294b0;
  --line: #26314a;
  --line-strong: #36445f;
  --track: #26314a;
  --grid: #2f3b56;
  --btc-ink: #ffab3d;
  --btc-wash: rgba(247,147,26,0.18);
  --on-phase: #101726;
  --p1: #34d17a; --p1-ink: #34d17a; --p1-tint: #14301f; --p1-wash: rgba(52,209,122,0.16);
  --p2: #5b91ff; --p2-ink: #5b91ff; --p2-tint: #15233f; --p2-wash: rgba(91,145,255,0.16);
  --p3: #f0a437; --p3-ink: #f0a437; --p3-tint: #33240c; --p3-wash: rgba(240,164,55,0.16);
  --p4: #ff6b6b; --p4-ink: #ff6b6b; --p4-tint: #3a1618; --p4-wash: rgba(255,107,107,0.16);
  --p5: #a482ff; --p5-ink: #a482ff; --p5-tint: #261a42; --p5-wash: rgba(164,130,255,0.16);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.40), 0 10px 22px -8px rgba(0,0,0,0.60);
  --shadow-inset: 0 4px 14px rgba(0,0,0,0.40);
  --shadow-frame: 0 12px 60px rgba(0,0,0,0.55);
  --disc: #101726;
}

* { box-sizing: border-box; }

/* Below 900px the frame is a fixed-height phone/tablet card, so html/body
   are pinned to the viewport height. At 900px+ the page is a normal
   scrolling document with vertical padding around it (see .frame's 900px
   rule) — pinning the height there would clip that bottom padding to
   nothing whenever the content is taller than the window. */
html, body { height: 100%; }
@media (min-width: 900px) {
  html, body { height: auto; min-height: 100%; }
}

body {
  margin: 0;
  background: var(--sunken);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the frame ---------- */

.frame {
  width: 100%;
  max-width: 432px;
  margin: 0 auto;
  min-height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

@media (min-width: 500px) {
  body { padding-block: 32px; }
  .frame {
    min-height: 0;
    border-radius: 34px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-frame);
  }
  /* The header and the docked nav are the only things that meet the frame's
     rounded edge, so they carry the rounding themselves — the frame can't
     clip with overflow while the nav is docked out of the flow. */
  .head { border-radius: 34px 34px 0 0; }
}

@media (min-width: 900px) {
  body { padding-block: 40px 56px; }
  .frame {
    max-width: 1080px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
}

@media (min-width: 1240px) {
  .frame { max-width: 1180px; }
}

/* Large computer screens: the page widens up to 1600 px (Jean-Marc, 17 Nov 2026), with a side
   margin so it never touches the window's edges; the compass grows with it (see .wheel-wrap). */
@media (min-width: 1480px) {
  .frame { max-width: min(1600px, calc(100vw - 96px)); }
}

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

.head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
}

.wordmark {
  flex-grow: 1;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

@media (min-width: 900px) {
  .head { padding: 0 0 20px; }
}

/* ---------- main ---------- */

html { scroll-behavior: smooth; }

.scroll {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

@media (min-width: 900px) {
  .scroll {
    overflow: visible;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Stretch (not start): the two columns share the row's full height, so the shorter
       one's last card (below) can grow to close the gap instead of leaving empty space
       under a shorter box. Full-width (.span-all) rows are unaffected — each is alone
       in its own row, so stretching it to "the row's height" is a no-op. */
    align-items: stretch;
    column-gap: 28px;
    row-gap: 18px;
  }
  /* The column's last card absorbs any leftover height so its bottom edge lines up
     with the bottom of the taller card next to it, in whichever column that is. */
  .col > *:last-child { flex-grow: 1; }
  .span-all { grid-column: 1 / -1; }
}

@media (min-width: 1240px) {
  .scroll { column-gap: 36px; }
}

@media (min-width: 1480px) {
  .scroll { column-gap: 44px; row-gap: 22px; }
}

.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Below 900px the columns collapse into one flow via display:contents, so both columns'
   cards simply follow DOM order (left column, then right column, then nav/promo/footer).
   The nav also leaves that flow entirely at this width (fixed to the bottom of the
   viewport, a thumb-reach bar), so its exact position in the flow doesn't matter. */
@media (max-width: 899.98px) {
  .col { display: contents; }
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    margin: 0 auto;
  }
  /* Clears the fixed bar's own height (~70px) plus its safe-area padding,
     plus real breathing room, so the last card (.foot) never sits under it. */
  .scroll {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 24px);
  }
}

/* Phone: the frame fills the window, so the fixed bar spans it edge to edge. */
@media (max-width: 499.98px) {
  .nav { max-width: none; }
}

/* Tablet: the frame floats as a centred card with room below it (body's
   32px padding-block), so the fixed bar sits on that same margin rather
   than the window edge, and matches the card's width and rounded corner. */
@media (min-width: 500px) and (max-width: 899.98px) {
  .nav {
    max-width: 432px;
    bottom: 32px;
    border-radius: 0 0 34px 34px;
  }
  /* The bar floats 32px above the frame's own bottom edge here, so the
     scroll area needs that extra clearance on top of the bar's height. */
  .scroll { padding-bottom: calc(70px + 32px + 24px); }
}

/* ---------- type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.28em;
  color: var(--faint);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}

.lede { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); max-width: 62ch; }
.body { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-body); max-width: 68ch; }
.lead { margin: 0; font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--ink); max-width: 62ch; }
.caption { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); max-width: 72ch; }
.data { font-family: var(--mono); font-size: 11px; line-height: 1.3; letter-spacing: 0.06em; color: var(--faint); }
.label { font-family: var(--mono); font-size: 10px; line-height: 1.2; letter-spacing: 0.16em; color: var(--faint); }

.intro { display: flex; flex-direction: column; gap: 4px; }

/* ---------- cards ---------- */

.card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.card--flush { padding: 0; overflow: hidden; }
.card--wheel { padding: 20px 18px 22px; }

/* ---------- wheel ---------- */

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

@media (min-width: 900px) { .wheel-wrap { max-width: 380px; } }
@media (min-width: 1480px) { .wheel-wrap { max-width: 460px; } }

.wheel-wrap svg { width: 100%; height: 100%; display: block; }

.wheel-caption { margin-top: 10px; text-align: center; }

.wheel-name {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* ---------- chips ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  flex: 1 1 64px;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.chip[aria-pressed="true"] {
  color: var(--on-phase);
  font-weight: 700;
  border-color: transparent;
}

/* ---------- phase card ---------- */

.phase-head {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: background 200ms ease;
}

.phase-head-row { display: flex; align-items: center; gap: 10px; }

.phase-name {
  flex-grow: 1;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--on-phase);
  text-wrap: balance;
}

.phase-num {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--on-phase);
  opacity: 0.34;
}

.tag {
  align-self: flex-start;
  border-radius: 99px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.22);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.22em;
  color: var(--on-phase);
}

.phase-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; }

/* On wide screens this card is stretched to match its neighbour's height. The spare room is
   shared out evenly between every block and both edges, so nothing bunches up and no single
   gap looks like a hole. With no spare room (phone) this changes nothing. */
.card--flush { display: flex; flex-direction: column; }
.phase-body .caption:empty { display: none; }
.phase-body { justify-content: space-evenly; }

.metrics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }

.cell { padding: 11px; border-radius: 13px; transition: background 200ms ease; }
.cell-value { margin-top: 5px; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--ink); }

/* ---------- signals (only the halving cards use .signal/.well now) ---------- */

.signal { display: flex; flex-direction: column; gap: 13px; }

.well { padding: 13px; border-radius: 15px; background: var(--viz); }
.well svg { display: block; width: 100%; }

/* ---------- footnote ---------- */

.foot {
  padding: 16px;
  border-radius: 18px;
  background: var(--raised);
  border: 1px solid var(--line);
}

.foot--alert {
  border: 2px solid var(--p4);
  text-align: center;
}

.foot--alert .caption {
  color: var(--p4-ink);
  font-weight: 700;
  max-width: none;
}

/* This card spans the full width on web (.span-all), so its phone-sized
   text reads as tiny against all that room — scale both lines up there. */
@media (min-width: 900px) {
  .foot--alert { padding: 20px 24px; }
  .foot--alert .caption { font-size: 16px; }
  .foot--alert .data { font-size: 12px; }
}

/* ---------- nav ---------- */

.nav {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 9px 12px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* Wide screens (≥900px) drop the nav bar entirely — the two-column layout already shows
   everything it would jump to, so it has nothing left to do there. It stays exactly as-is
   below 900px, where it's still the thumb-reach bar for phone and tablet. */
@media (min-width: 900px) {
  .nav { display: none; }
}

.navlink {
  flex-grow: 1;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms ease;
  border-radius: 99px;
}

.navlink:hover { color: var(--ink); }
.navlink[aria-current="page"] { color: var(--btc-ink); }
.navlink[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }

/* Section anchors clear the sticky header (and, on phone, the docked nav)
   so a jump never leaves the target hidden underneath either bar. */
#sec-now, #sec-phases, #sec-history {
  scroll-margin-top: calc(64px + env(safe-area-inset-top, 0px));
}
@media (max-width: 899.98px) {
  #sec-now, #sec-phases, #sec-history {
    scroll-margin-bottom: 90px;
  }
}

/* The PHASES button lands on the phase chips + guide card, just below the compass. */
#chips { scroll-margin-top: calc(var(--banner-h, 0px) + 16px); }

.navicon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 26px;
  border-radius: 99px;
}

.navlink[aria-current="page"] .navicon {
  background: var(--btc-wash);
  box-shadow: inset 0 0 0 1px rgba(247,147,26,0.45);
}

.navlabel {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* ---------- focus ---------- */

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- motion ---------- */

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-settle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes needle-spin-in { from { transform: rotate(0deg); } to { transform: rotate(var(--needle-end, 0deg)); } }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes gauge { from { stroke-dashoffset: 251.3; } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }

.spin-mark { animation: spin-settle 1.1s cubic-bezier(0.45, 0, 0.2, 1) both; transform-origin: 50% 50%; }
.mark-needle-spin {
  transform-origin: 50% 50%;
  animation: spin-settle 1.1s cubic-bezier(0.45, 0, 0.2, 1) both;
}
.breathe { animation: breathe 3.6s ease-in-out infinite; }
.gauge-arc { animation: gauge 900ms ease forwards; }
.ping { animation: ping 2s ease-out infinite; transform-origin: 178px 44px; }
.enter { animation: fadeup 350ms ease both; }

@media (prefers-reduced-motion: reduce) {
  .spin-mark, .mark-needle-spin, .breathe, .gauge-arc, .ping, .enter {
    animation: none !important;
  }
}


/* =====================================================================
   Production additions — everything below is new relative to the design
   artifact; the tokens above are unchanged.
   ===================================================================== */

/* Development / mock banner: must be impossible to miss (spec §26). */
.mock-banner {
  position: sticky; top: 0; z-index: 30;
  background: #b91c1c; color: #fff;
  text-align: center; padding: 7px 12px;
  font-family: var(--mono); font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: 0.1em;
}

/* Skip link + visually hidden helper for screen-reader text. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 40;
  background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* The phase the model currently reads gets a dot on its chip, so colour is never the only cue. */
.chip--now::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 99px; background: currentColor; vertical-align: middle;
}

.wheel-sub { margin-top: 5px; }
.wheel-name { text-wrap: balance; }

/* Notices: acute stress, load errors, out-of-date data. */
.notice {
  padding: 12px 14px; border-radius: 14px;
  background: var(--p4-tint); color: var(--p4-ink); border: 1px solid var(--p4);
  font-size: 12.5px; line-height: 1.5; font-weight: 600;
}
.notice--info { background: var(--raised); color: var(--ink-body); border-color: var(--line-strong); font-weight: 500; }

/* The drop signal (LTV Guard's compass v5.2): the banner is red at « High Risk », orange otherwise. */
.notice--drop { font-size: 14px; text-align: center; }
.notice--mixed { background: var(--p3-tint); color: var(--p3-ink); border-color: var(--p3); }
/* Under the phase: a display state's text (in place of the name) and the orange signal line. */
.wheel-state { margin-top: 6px; font-family: var(--display); font-size: 15px; line-height: 1.3; font-weight: 700; text-wrap: balance; }
.wheel-signal { margin-top: 6px; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--p3-ink); text-wrap: balance; }

/* Halving card */
.prog-track { height: 9px; border-radius: 99px; background: var(--track); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; background: var(--btc); transition: width 500ms ease; }
.halving-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.halving-pct { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1; }

/* History */
.hist { display: flex; flex-direction: column; gap: 14px; }
.hist svg { display: block; width: 100%; height: auto; }

.halvings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.halving-cell { padding: 10px 8px; border-radius: 12px; background: var(--viz); text-align: center; }
.halving-cell .year { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.halving-cell .sub { font-size: 10.5px; line-height: 1.35; color: var(--muted); }
@media (max-width: 380px) { .halvings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tagline { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--ink); text-wrap: balance; }

/* Footer */
.foot a { color: var(--btc-ink); font-weight: 600; }
.foot-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
.foot--alert .foot-links a { color: var(--p4-ink); }
.foot--alert .caption + .caption { margin-top: 8px; }

/* Static pages (methodology, privacy) */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h1 { font-size: 22px; }
.prose h2 { margin-top: 10px; font-size: 16px; }
.prose p, .prose li { font-size: 13.5px; line-height: 1.65; color: var(--ink-body); max-width: 68ch; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose a { color: var(--btc-ink); font-weight: 600; }
.back-link { font-size: 12.5px; font-weight: 600; color: var(--btc-ink); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-body); }
.prose th { color: var(--ink); font-weight: 700; }

@media (min-width: 900px) {
  .page-main { max-width: 760px; margin: 0 auto; }
}

.hist-label { paint-order: stroke; stroke: var(--viz); stroke-width: 3px; stroke-linejoin: round; }

/* LTV Guard promotion — sits above the disclaimer, styled apart from the analysis cards. */
.promo {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; align-items: center;
  padding: 20px; border-radius: 22px;
  border: 1.5px solid var(--btc);
  background: linear-gradient(135deg, var(--btc-wash) 0%, var(--p2-wash) 100%), var(--surface);
  box-shadow: var(--shadow-card);
}
.promo-icon {
  width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffb347, var(--btc)); color: #1b1200;
  box-shadow: 0 6px 16px rgba(247, 147, 26, 0.35);
}
.promo-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.promo-eyebrow { color: var(--btc-ink); font-weight: 700; }
.promo-title { font-size: 22px; line-height: 1.15; font-weight: 900; letter-spacing: 0.01em; }
.promo-body { margin: 2px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-body); max-width: 60ch; }
.promo-note { margin: 4px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.promo-cta {
  grid-column: 1 / -1; justify-self: stretch;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 99px;
  background: var(--btc); color: #1b1200; text-decoration: none;
  font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(247, 147, 26, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
a.promo-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(247, 147, 26, 0.45); }
a.promo-cta:active { transform: translateY(0); }
.promo-cta--soon { background: var(--track); color: var(--muted); box-shadow: none; cursor: default; }
@media (min-width: 900px) {
  .promo { grid-template-columns: auto 1fr auto; padding: 24px 28px; }
  .promo-cta { grid-column: auto; justify-self: end; white-space: nowrap; }
}

/* History chart: readable, not stretched across a wide desktop. */
.hist .well { display: flex; justify-content: center; }
.hist svg { max-width: 640px; }
@media (prefers-reduced-motion: reduce) { .promo-cta { transition: none; } a.promo-cta:hover { transform: none; } }

/* LTV Guard logo replaces the generic shield tile. */
.promo-logo { width: 72px; height: 72px; flex-shrink: 0; display: block; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(22, 35, 63, 0.25)); }

/* ---------- soft shadow under every card ---------- */
.foot { box-shadow: var(--shadow-card); }

/* ---------- scroll reveal (phone + tablet) ----------
   Cards rise from below as they enter the viewport. Progressive enhancement: the hidden
   state only exists when JS has switched `js-reveal` on (never with reduced motion), and an
   element already on screen at load is revealed immediately, so nothing is parked hidden. */
@media (max-width: 899.98px) {
  .js-reveal .reveal { opacity: 0; transform: translateY(32px); }
  .js-reveal .reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity 560ms ease-out, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* ---------- polish pass ---------- */

/* Five phase chips stay on one row down to 320px instead of orphaning the last one. */
@media (max-width: 400px) {
  .chips { gap: 6px; flex-wrap: nowrap; }
  .chip { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 12px; }
}

/* Long unbroken strings never push a card wider than the screen. */
.card, .promo, .foot, .notice { overflow-wrap: anywhere; }
.card--flush { overflow: hidden; }

/* Numbers that change (halving, metric values) keep steady widths. */
.halving-pct, .cell-value { font-variant-numeric: tabular-nums; }

/* Text selection and tap feedback that match the brand. */
::selection { background: var(--btc-wash); color: var(--ink); }
a, button { -webkit-tap-highlight-color: transparent; }

/* Browser surfaces themed from the palette: form/scrollbar chrome follows the theme,
   scrollbars are quiet, links underline with room, and pressed states answer touch. */
:root { color-scheme: light; accent-color: var(--btc); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.chip:active, .icon-btn:active, .navlink:active { transform: scale(0.97); }
.chip, .icon-btn, .navlink { transition-property: background, color, border-color, transform; }
@media (prefers-reduced-motion: reduce) { .chip:active, .icon-btn:active, .navlink:active { transform: none; } }
/* LTV Guard button: same corner radius as the other buttons (chips), and a "coming soon"
   state that stays clearly visible in both themes instead of blending into the card. */
.promo-cta { border-radius: 12px; }
.promo-cta--soon {
  background: var(--btc-wash); color: var(--btc-ink);
  border: 1.5px solid var(--btc); box-shadow: none; cursor: default;
}

/* LTV Guard card: green, no orange. */
.promo {
  border-color: var(--p1);
  background: linear-gradient(135deg, var(--p1-wash) 0%, transparent 72%), var(--surface);
}
.promo-eyebrow { color: var(--p1-ink); }
.promo-cta { background: var(--p1); color: #06240f; box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35); }
a.promo-cta:hover { box-shadow: 0 10px 24px rgba(22, 163, 74, 0.45); }
.promo-cta--soon { background: var(--p1-wash); color: var(--p1-ink); border: 1.5px solid var(--p1); box-shadow: none; }

/* ---------- live BTC price ticker (real data, direct client fetch — not part of the mock engine) ---------- */
.btc-ticker {
  margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-align: center;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-family: var(--mono);
  /* Matches .wheel-name — the "PHASE N · NAME" text under the compass — so the live
     price reads at the same weight on the page instead of like a footnote. */
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-body);
  font-variant-numeric: tabular-nums;
}
.btc-ticker-dot {
  width: 9px; height: 9px; border-radius: 99px; flex-shrink: 0;
  background: var(--faint);
}
.btc-ticker.is-live .btc-ticker-dot { background: var(--p1); animation: btc-pulse 2s ease-in-out infinite; }
.btc-ticker.is-down .btc-ticker-dot { background: var(--p4); animation: btc-pulse 2s ease-in-out infinite; }
.btc-ticker.is-error { color: var(--faint); }
@keyframes btc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .btc-ticker-dot { animation: none !important; } }
.btc-time { font-weight: 500; color: var(--faint); }
.btc-up { color: var(--p1-ink); }
.btc-down { color: var(--p4-ink); }
