/* whealthfactory.com — the app's own world at page scale. Plum-black ground,
   gold and ember, Space Grotesk capitals, and the app's LOCK IN control as the
   one spectacle. The control's layers are the app's recipe
   (src/components/home/CommandDeck.tsx), scaled in em from its 66 px face. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-var-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* the app's tokens (src/index.css) */
  --bg: hsl(258 20% 1.8%);
  --card: hsl(258 16% 8%);
  --border: hsl(258 13% 21%);
  --fg: hsl(40 8% 94%);
  --muted: hsl(40 6% 72%);
  --gold: hsl(42 78% 54%);
  --gold-light: hsl(42 90% 70%);
  --gold-dark: hsl(42 60% 36%);
  --ember: hsl(18 95% 58%);
  --ember-light: hsl(24 100% 68%);
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(20px, 3vw, 44px);
  --spring: cubic-bezier(0.16, 1.2, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* the type scale: every section opens eyebrow → display → lede */
  --t-display: clamp(34px, 5.2vw, 96px);
  --t-display-2: clamp(28px, 3.6vw, 64px);
  --t-figure: clamp(64px, 8vw, 148px);
  --t-lede: clamp(17px, 1.3vw, 21px);
  --hairline: hsl(42 60% 36% / 0.45);
  --r-surface: 24px; --r-tile: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: var(--gold-dark) var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--gold);
}
::selection { background: var(--gold); color: hsl(20 85% 10%); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 6px; border-radius: 6px; }
p, h1, h2, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
.i { width: 1em; height: 1em; flex: none; }

.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 20; padding: 10px 14px; background: var(--gold); color: hsl(20 85% 10%); font: 700 14px/1 var(--display); border-radius: 10px; }
.skip:focus { top: 12px; }

/* ── Masthead: the app's header, sticky so the way back is always one tap.
   A solid plum, never a backdrop blur (the compositor re-filters everything
   under it on every scroll frame). */
.masthead {
  position: sticky; top: 0; z-index: 5;
  height: 92px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: hsl(258 20% 1.8% / 0.96);
  border-bottom: 1px solid var(--hairline);
}
.masthead-nav { display: flex; gap: 26px; margin-left: auto; font: 700 13px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; }
.masthead-nav a { color: var(--muted); padding: 8px 0; transition: color 0.25s ease; }
.masthead-nav a:hover { color: var(--gold); }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-icon { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 0 22px hsl(42 78% 54% / 0.28); }
.brand-name {
  white-space: nowrap;
  font: 700 26px/1 var(--display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 18px hsl(42 78% 54% / 0.35);
}
.masthead-cta { flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid hsl(42 78% 54% / 0.5); font: 700 13px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(77vh - 92px); min-height: calc(77svh - 92px);
  padding: 5.5vh var(--gutter) 3vh;
  display: flex; flex-direction: column; align-items: center;
  overflow: clip;
}
/* Around the control only (a full-hero canvas cost a 3000 px fill per frame),
   and above it, so the gold beads run down its front. */
.forge { position: absolute; left: -2em; right: -2em; top: -1.4em; bottom: -2.6em; width: calc(100% + 4em); height: calc(100% + 4em); pointer-events: none; z-index: 2; }
.hero > * { position: relative; z-index: 1; }

.hero-title {
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.26em;
  font: 700 min(7.2vw, 11.5vh, 124px)/0.95 var(--display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: hsl(36 30% 92%);
  text-shadow: 0 0.04em 0.3em hsl(18 95% 40% / 0.25);
}
.word { display: inline-block; overflow: hidden; padding: 0.04em 0 0.08em; margin: -0.04em 0 -0.08em; }
.word > span { display: inline-block; }

/* The control. Everything inside is sized in em from its own font-size, so
   one number scales the whole app recipe. */
.lockin-stage {
  --bw: min(64vw, 1000px, 100vh);
  --u: calc(var(--bw) / 10); /* the control's em, for children that set their own font-size */
  margin-top: 4.8vh;
  width: var(--bw);
  font-size: var(--u);
  perspective: 14em;
}
.lockin-glow {
  position: absolute; left: -12%; right: -12%; top: 18%; bottom: -60%;
  background:
    radial-gradient(56% 46% at 50% 42%, hsl(26 100% 50% / 0.5), transparent 70%),
    radial-gradient(40% 14% at 50% 86%, hsl(32 100% 56% / 0.55), transparent 75%);
  pointer-events: none;
}
.lockin {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  transform-style: preserve-3d;
  /* its own layer: the tilt then moves pixels instead of repainting blurred shadows */
  will-change: transform;
}
/* The key's body under the face: an ember slab, lit along its lip. */
.lockin-base {
  position: absolute; left: 0.04em; right: 0.04em; top: 0.3em; bottom: -0.52em;
  border-radius: 0.46em;
  background: linear-gradient(180deg, hsl(22 90% 46%) 0%, hsl(16 88% 34%) 45%, hsl(12 80% 20%) 100%);
  box-shadow:
    inset 0 -0.05em 0 hsl(28 100% 60% / 0.55),
    inset 0 0.18em 0.2em -0.1em hsl(30 100% 62% / 0.5),
    0 0.35em 0.9em -0.2em hsl(18 95% 45% / 0.65);
  transition: box-shadow 0.25s ease;
}
/* A molten rim between the face and the slab: the comp's second layer, lit
   from inside so the key reads as three stacked plates of hot metal. */
.lockin-rim {
  position: absolute; left: 0.02em; right: 0.02em; top: 0.12em; bottom: -0.24em;
  border-radius: 0.45em;
  background: linear-gradient(180deg, hsl(34 100% 62%) 0%, hsl(24 100% 52%) 55%, hsl(16 95% 42%) 100%);
  box-shadow: inset 0 -0.04em 0 hsl(44 100% 75% / 0.7), 0 0 0.5em hsl(28 100% 55% / 0.55);
}
.lockin-face {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 0.3em;
  min-height: 1.95em;
  padding: 0 0.62em 0 0.72em;
  border-radius: 0.44em;
  overflow: hidden;
  background: linear-gradient(160deg, hsl(46 96% 64%) 0%, hsl(38 92% 55%) 34%, hsl(24 94% 52%) 70%, hsl(16 90% 47%) 100%);
  box-shadow:
    inset 0 0.06em 0 hsl(48 100% 85% / 0.9),
    inset 0 -0.09em 0 hsl(18 80% 30% / 0.9),
    inset 0 -0.42em 0.66em -0.36em hsl(14 85% 30% / 0.75),
    0 0.03em 0 hsl(20 60% 18%),
    0 0 0.9em hsl(34 100% 55% / 0.45),
    0 0 2.4em hsl(24 100% 50% / 0.28);
  transition: transform 0.12s ease-out, filter 0.12s ease-out;
}
.lockin-label {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.28em;
  font: 700 1em/1 var(--display);
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: hsl(20 85% 10%);
  text-shadow: 0 0.03em 0 hsl(46 100% 75% / 0.6);
}
.icon-slot { position: relative; display: inline-grid; width: 0.9em; height: 0.9em; }
.icon-slot .i { grid-area: 1 / 1; width: 100%; height: 100%; stroke-width: 2.9; transition: opacity 0.3s, transform 0.4s var(--spring); }
.icon-slot .i-check { opacity: 0; transform: scale(0.6); }
.lockin-xp {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.1em;
  font: 700 0.42em/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: hsl(20 70% 16%);
}
.lockin-xp .i { width: 1.25em; height: 1.25em; stroke-width: 2.6; }

/* Idle gloss sweep and the cursor's specular. */
.lockin-gloss {
  position: absolute; top: 0; bottom: 0; left: 0; width: 33%;
  background: linear-gradient(90deg, transparent, hsl(48 100% 94% / 0.45), transparent);
  animation: gloss 5.2s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}
@keyframes gloss { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(360%); } }
/* A highlight blob moved by transform (site.js), never repainted. */
.lockin-spec {
  position: absolute; left: -15%; top: -80%; width: 50%; height: 260%; pointer-events: none;
  background: radial-gradient(closest-side, hsl(50 100% 96% / 0.22), transparent);
  opacity: 0; transition: opacity 0.4s ease;
  will-change: transform;
}
.hero:hover .lockin-spec { opacity: 1; }

/* The melt: the app's lava slab, parked below the face, floods up while the
   control is held. */
.melt { position: absolute; left: -0.18em; right: -0.18em; bottom: -0.18em; height: 132%; transform: translateY(104%); transition: transform 0.9s linear; pointer-events: none; }
.melt > span { position: absolute; left: 0; right: 0; }
.melt-heat-edge { top: -0.6em; height: 0.66em; background: linear-gradient(to top, hsl(20 94% 44% / 0.65), hsl(26 92% 48% / 0.28) 55%, transparent); }
.melt-body { top: 0.48em; bottom: 0; background: linear-gradient(to top, hsl(4 88% 34%) 0%, hsl(14 96% 46%) 26%, hsl(26 100% 54%) 56%, hsl(38 100% 60%) 100%); }
.melt-a {
  top: 0.48em; bottom: 0; filter: blur(0.045em);
  background-image:
    radial-gradient(0.9em 0.42em at 1.2em 0.66em, hsl(52 100% 86%) 14%, hsl(30 100% 56% / 0.8) 46%, transparent 72%),
    radial-gradient(1.15em 0.51em at 4em 1.33em, hsl(46 100% 74%) 12%, hsl(24 100% 52% / 0.75) 48%, transparent 72%),
    radial-gradient(0.78em 0.36em at 6.48em 0.78em, hsl(52 100% 82%) 16%, hsl(28 100% 55% / 0.8) 50%, transparent 72%),
    radial-gradient(1.03em 0.48em at 8.66em 1.51em, hsl(48 100% 78%) 13%, hsl(26 100% 54% / 0.8) 48%, transparent 72%),
    radial-gradient(1.27em 0.45em at 2.72em 2em, hsl(8 78% 34%) 55%, transparent 76%),
    radial-gradient(1.45em 0.51em at 7.57em 2.12em, hsl(6 72% 30%) 55%, transparent 76%);
  background-size: 10em 100%; background-repeat: repeat-x;
  animation: drift-l 8s linear infinite;
}
.melt-b {
  top: 0.48em; bottom: 0; filter: blur(0.076em); opacity: 0.7;
  background-image:
    radial-gradient(1.39em 0.6em at 2.12em 1.03em, hsl(30 100% 55% / 0.75), transparent 70%),
    radial-gradient(1.15em 0.51em at 5.75em 1.7em, hsl(16 100% 46% / 0.7), transparent 70%),
    radial-gradient(1.57em 0.66em at 9.1em 0.9em, hsl(33 100% 57% / 0.7), transparent 70%);
  background-size: 10.9em 100%; background-repeat: repeat-x;
  animation: drift-r 5.5s linear infinite;
}
.melt-crest {
  top: 0; height: 0.85em; filter: blur(0.015em);
  background-image:
    radial-gradient(1.03em 0.66em at 5% 100%, hsl(38 100% 60%), transparent 71%),
    radial-gradient(0.78em 0.48em at 19% 100%, hsl(32 100% 56%), transparent 71%),
    radial-gradient(1.2em 0.72em at 36% 100%, hsl(38 100% 60%), transparent 71%),
    radial-gradient(0.72em 0.42em at 52% 100%, hsl(30 100% 55%), transparent 71%),
    radial-gradient(1.09em 0.63em at 68% 100%, hsl(36 100% 58%), transparent 71%),
    radial-gradient(0.85em 0.51em at 83% 100%, hsl(32 100% 56%), transparent 71%),
    radial-gradient(0.97em 0.6em at 96% 100%, hsl(36 100% 59%), transparent 71%);
  background-size: 105% 100%;
  animation: crest 3.2s ease-in-out infinite;
}
.melt-line {
  top: 0.27em; height: 0.45em; filter: blur(0.15em);
  background-image:
    radial-gradient(1.33em 0.39em at 10% 60%, hsl(50 100% 86% / 0.95), transparent 70%),
    radial-gradient(1.7em 0.42em at 42% 55%, hsl(54 100% 90%), transparent 70%),
    radial-gradient(1.45em 0.39em at 76% 60%, hsl(50 100% 86% / 0.95), transparent 70%);
  animation: breathe 1.7s ease-in-out infinite;
}
@keyframes drift-l { to { background-position: -10em 0; } }
@keyframes drift-r { to { background-position: 10.9em 0; } }
@keyframes crest { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(0.09em); } }
@keyframes breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
/* Parked lava burns no frames: its loops run only while it shows, and the
   blurred layers are not even painted until the control is held. */
.melt-a, .melt-b, .melt-crest, .melt-line { animation-play-state: paused; }
.melt { visibility: hidden; }
.lockin.is-holding .melt, .lockin.is-cooling .melt { visibility: visible; }
.lockin-heat { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 130% at 50% 100%, hsl(30 100% 60% / 0.55), transparent 70%); opacity: 0; transition: opacity 0.2s ease-out; }

/* Held: the face sinks into the base, the lava rises, the glow blooms. */
.lockin.is-holding .lockin-face { transform: translateY(0.17em); filter: brightness(1.05); }
.lockin.is-holding .melt { transform: translateY(6%); }
.lockin.is-holding .melt > span, .lockin.is-cooling .melt > span { animation-play-state: running; }
.lockin.is-holding .lockin-heat { opacity: 1; }
.lockin.is-holding .lockin-base { box-shadow: 0 0.4em 1.4em -0.2em hsl(20 100% 50% / 0.9), 0 0 2em -0.3em hsl(30 100% 55% / 0.55); }
.lockin.is-locked .icon-slot .i-flame { opacity: 0; transform: scale(0.6); }
.lockin.is-locked .icon-slot .i-check { opacity: 1; transform: scale(1); }
.lockin.is-cooling .melt { transition-duration: 1.6s; transition-timing-function: var(--ease-out); }

.lockin-hint {
  position: absolute; left: 0; right: 0; top: calc(100% + 1.6 * var(--u)); /* below the drips */
  text-align: center;
  font: 700 max(11px, 0.16em)/1 var(--display);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(40 6% 72% / 0.8);
  transition: opacity 0.4s ease;
}
.lockin-stage.used .lockin-hint { opacity: 0; }

.hero-sub {
  margin-top: clamp(64px, 12vh, 140px);
  font-size: clamp(17px, 1.45vw, 23px);
  color: hsl(40 8% 88%);
  text-align: center; text-wrap: balance;
}
.hero-xp {
  margin-top: 0.7em;
  display: flex; gap: 0.6em; justify-content: center;
  font: 700 clamp(15px, 1.35vw, 21px)/1 var(--display);
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.hero-xp .dot { color: var(--gold-dark); }
.hero-invite {
  margin-top: 1.2em;
  font-size: clamp(15px, 1.2vw, 18px);
  color: hsl(40 8% 78%);
  text-align: center; text-wrap: balance;
}
.hero-invite .invite-code {
  font: 700 1em/1 var(--display);
  letter-spacing: 0.02em;
  color: var(--gold);
  user-select: all; -webkit-user-select: all;
}

/* Entrance: the words slam in, the control rises, the day follows. Plain CSS
   from the first paint — it used to wait for GSAP, so a slow connection saw an
   empty plum page for a second or two. site.js adds only what needs a script
   (the spark burst, the count-up), timed from the same first paint. */
.motion .word > span { animation: slam 1.1s var(--ease-out) 0.1s both; }
.motion .word:nth-child(2) > span { animation-delay: 0.19s; }
.motion .word:nth-child(3) > span { animation-delay: 0.28s; }
@keyframes slam { from { transform: translateY(110%); } to { transform: none; } }
.motion .lockin-stage { animation: rise 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(80px) scale(0.9); } to { opacity: 1; transform: none; } }
.motion .lockin-glow { animation: fade 1.2s ease-out 0.9s both; }
.motion .hero-sub { animation: fade 1s ease-out 1.1s both; }
.motion .hero-xp { animation: fade 1s ease-out 1.2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Sections ───────────────────────────────────────────── */
section:not(.hero) {
  padding: clamp(110px, 14vh, 190px) var(--gutter);
  /* off-screen sections cost no layout; the sizes keep the scrollbar honest */
  content-visibility: auto; contain-intrinsic-size: auto 900px;
}
section:not(.hero) + section, .company { border-top: 1px solid var(--hairline); }
.eyebrow { font: 700 12.5px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.eyebrow + .display { margin-top: 22px; }
.display {
  font: 700 var(--t-display)/0.98 var(--display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  max-width: 14ch;
}
.display-2 { font-size: var(--t-display-2); letter-spacing: -0.02em; max-width: 18ch; }
.lede { margin-top: 24px; max-width: 46ch; font-size: var(--t-lede); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.lede-2 { margin-top: 14px; color: hsl(40 6% 58%); font-size: calc(var(--t-lede) * 0.88); }
.figure { font: 700 var(--t-figure)/0.9 var(--display); letter-spacing: -0.04em; color: var(--gold); font-variant-numeric: tabular-nums; }
.figure small { font-size: 0.34em; letter-spacing: -0.01em; color: var(--muted); margin-left: 0.08em; }
/* The app's surface-card: plum on a gold wash, hairline, inner light, soft drop. */
.surface {
  border-radius: var(--r-surface);
  background: radial-gradient(120% 70% at 0% 0%, hsl(42 78% 54% / 0.06), transparent 60%), linear-gradient(135deg, hsl(255 14% 8%), hsl(255 14% 5%));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 hsl(40 20% 90% / 0.04), 0 24px 60px -30px hsl(0 0% 0% / 0.9);
}
/* Two-column sections: copy on one side, the app's surface on the other. */
.score, .coach, .inside { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(40px, 6vw, 110px); align-items: center; }
.coach { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
.inside { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.inside-copy { order: 2; }

/* Reveals: one verb. A group waits for the viewport (site.js adds .in), then
   its lines rise and fade in sequence. Without .motion the final state is the
   only state, so reduced motion and a blocked script both see the page. */
.motion [data-reveal-group]:not(.in) .line-bar i { transform: scaleX(0); }
.motion [data-reveal-group]:not(.in) .line-n, .motion [data-reveal-group]:not(.in) .sheet-total,
.motion [data-reveal-group]:not(.in) .brief-line, .motion [data-reveal-group]:not(.in) .rating-num { opacity: 0; transform: translateY(12px); }
.motion [data-reveal-group]:not(.in) .days li { opacity: 0; transform: scale(0.6); }

/* The day score: the app's check-in summary at page scale. */
.sheet { padding: clamp(22px, 2.6vw, 36px) clamp(22px, 2.8vw, 40px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.sheet-head .eyebrow, .brief-head .eyebrow, .sheet-tag, .brief-tier { white-space: nowrap; }
.sheet-tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: hsl(174 60% 45% / 0.12); color: hsl(174 70% 62%); font: 700 12px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.sheet-tag .i { width: 13px; height: 13px; }
.lines { margin-top: 26px; display: grid; gap: 14px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k n" "d n" "bar bar"; align-items: baseline; column-gap: 16px; row-gap: 6px; }
.line-k { grid-area: k; display: inline-flex; align-items: center; gap: 7px; font: 700 15px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg); }
.line-k .i { width: 15px; height: 15px; color: hsl(174 70% 62%); }
.line-d { grid-area: d; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line-n { grid-area: n; font: 700 clamp(22px, 2vw, 28px)/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: calc(var(--i) * 70ms + 0.5s); }
.line-n small { font-size: 0.55em; color: var(--muted); font-weight: 700; }
.line-bar { grid-area: bar; height: 6px; border-radius: 999px; background: hsl(258 13% 21% / 0.9); overflow: hidden; }
/* filled by transform only; the ember tip is the one live colour */
.line-bar i { display: block; height: 100%; border-radius: inherit; transform-origin: 0 50%; transform: scaleX(var(--p)); background: linear-gradient(90deg, var(--gold-dark), var(--gold) 70%, var(--ember-light)); transition: transform 0.9s var(--ease-out); transition-delay: calc(var(--i) * 70ms); }
.sheet-total { margin-top: 28px; padding-top: 22px; border-top: 1px solid hsl(258 13% 21% / 0.8); display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: 1s; }
.sheet-total .figure { font-size: clamp(48px, 5vw, 84px); }
.sheet-note { font-size: 14px; color: var(--muted); max-width: 22ch; text-wrap: pretty; }

/* The streak: a flame that grows with the count. */
.streak-stage {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(32px, 6vw, 96px); align-items: center;
  grid-template-areas: "flame copy" "count copy";
}
.streak-flame {
  grid-area: flame; position: relative; justify-self: center;
  width: clamp(160px, 20vw, 300px); aspect-ratio: 1;
  display: grid; place-items: center;
  color: var(--ember);
  transform-origin: 50% 80%;
  /* grows with the count once the section arrives (site.js adds .in) */
  transform: scale(1.25);
  transition: transform 2s var(--ease-out);
}
.motion .streak:not(.in) .streak-flame { transform: scale(0.7); }
/* alive while on screen: a CSS flicker, paused off-screen (.live from site.js) */
.flame-art { position: relative; width: 80%; height: 80%; overflow: visible; transform-origin: 50% 100%; animation: flicker 0.9s ease-in-out infinite alternate; animation-play-state: paused; will-change: transform; }
.streak.live .flame-art { animation-play-state: running; }
@keyframes flicker { from { transform: none; } to { transform: scaleY(1.05) skewX(2.5deg); } }
.flame-core { transform-box: view-box; }
.streak-halo { position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(closest-side, hsl(24 100% 55% / 0.45), hsl(20 100% 50% / 0.12) 55%, transparent); transform: scale(1.3); transition: transform 2s var(--ease-out), opacity 2s var(--ease-out); }
.motion .streak:not(.in) .streak-halo { opacity: 0.3; transform: scale(0.8); }
.streak-count {
  grid-area: count; justify-self: center;
  display: flex; align-items: baseline; gap: 0.2em;
  font: 700 clamp(64px, 8vw, 128px)/1 var(--display);
  letter-spacing: -0.03em; color: var(--ember-light);
  font-variant-numeric: tabular-nums;
}
.streak-unit { font-size: 0.32em; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.streak-copy { grid-area: copy; }

/* The board: 28 days as squares, the rating as one figure. */
.rating { max-width: 1240px; margin: 0 auto; }
.rating-strip { margin-top: clamp(40px, 5vh, 64px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px clamp(32px, 5vw, 80px); }
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: clamp(5px, 0.7vw, 10px); max-width: 720px; }
.days li { aspect-ratio: 1; border-radius: 5px; background: var(--gold); box-shadow: inset 0 1px 0 hsl(46 100% 80% / 0.5); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); transition-delay: calc(var(--i) * 28ms); }
.days li.miss { background: hsl(258 13% 14%); box-shadow: inset 0 0 0 1px hsl(258 13% 24%); }
.rating-num { display: grid; gap: 8px; justify-items: start; transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: 0.9s; }
.rating-note { font-size: 14px; color: var(--muted); }
.status { margin-top: clamp(80px, 11vh, 150px); }
.tiers { margin-top: 48px; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.tier {
  --step: min(6.5vw, 96px);
  margin-left: calc(var(--step) * var(--i, 0));
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.3em 0.75em 0.3em 0.6em;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 7%, transparent);
  box-shadow: 0 0 1.2em color-mix(in srgb, var(--c) 22%, transparent);
  font: 700 clamp(22px, 2.6vw, 40px)/1 var(--display);
  letter-spacing: -0.01em; text-transform: uppercase;
  color: var(--c);
  white-space: nowrap;
}
.tier::before { content: ""; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0.6em var(--c); }
.tier:nth-child(2) { --i: 1; } .tier:nth-child(3) { --i: 2; } .tier:nth-child(4) { --i: 3; }
.tier:nth-child(5) { --i: 4; } .tier:nth-child(6) { --i: 5; } .tier:nth-child(7) { --i: 6; }
/* The climb: the tiers light one by one once the ladder arrives (.in from
   site.js). Opacity alone — a filter transition re-rasters the glow on every
   frame, which is what stuttered on phones. */
.tier { transition: opacity 0.55s var(--ease-out); transition-delay: calc(var(--i, 0) * 130ms); }
.motion .tiers:not(.in) .tier { opacity: 0.2; }

/* The coach: the morning brief at page scale. Three lines, no typing. */
.brief { padding: clamp(24px, 2.8vw, 40px) clamp(24px, 3vw, 44px); }
.brief-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.brief-tier { padding: 6px 10px; border-radius: 999px; border: 1px solid hsl(210 90% 60% / 0.5); color: hsl(210 90% 68%); font: 700 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.brief-line { margin-top: 22px; padding-left: 22px; border-left: 2px solid var(--gold-dark); font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; color: var(--fg); text-wrap: pretty; transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: calc(var(--i) * 160ms); }
.brief-line .brief-t { display: block; margin-bottom: 4px; font: 700 12.5px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }

/* Inside: the app's action rows, one grouped surface with hairlines. */
.rows { margin: 0; max-width: 760px; }
.row { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.row + .row { border-top: 1px solid hsl(258 13% 21% / 0.7); }
.row-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: var(--r-tile); background: hsl(42 78% 54% / 0.1); color: var(--gold); font-size: 28px; }
.row-copy { display: grid; gap: 4px; }
.row-copy b { font: 700 20px/1.1 var(--display); letter-spacing: -0.01em; text-transform: uppercase; }
.row-copy span { color: var(--muted); font-size: 16px; line-height: 1.45; }

/* Arrival: the price, said plainly, and the questions people ask. */
.arrival { text-align: center; }
.arrival .display, .arrival .lede { margin-left: auto; margin-right: auto; }
.faq { margin: clamp(56px, 8vh, 96px) auto 0; max-width: 760px; text-align: left; }
.faq details + details { border-top: 1px solid hsl(258 13% 21% / 0.7); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; font: 700 17px/1.25 var(--display); letter-spacing: -0.005em; color: var(--fg); transition: color 0.25s ease; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--gold); }
/* the plus: two strokes, one turns — transform only */
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--gold), var(--gold)) center / 14px 2px no-repeat, linear-gradient(var(--gold), var(--gold)) center / 2px 14px no-repeat; transition: transform 0.35s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: -6px 0 0; padding: 0 24px 22px; max-width: 60ch; color: var(--muted); font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.arrival-badge {
  margin-top: 44px; display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.9em 1.5em;
  border-radius: 999px;
  border: 1.5px solid hsl(42 78% 54% / 0.6);
  background: hsl(42 78% 54% / 0.07);
  font: 700 clamp(15px, 1.3vw, 19px)/1 var(--display);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold);
}
.arrival-badge .i { color: var(--ember); font-size: 1.2em; stroke-width: 2.6; }

/* The company. */
.company {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 40px;
  padding: 56px var(--gutter) calc(48px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
.company-name { color: var(--fg); font-weight: 600; margin-bottom: 4px; }
.company-id a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--gold-dark); text-underline-offset: 4px; }
.company-links { display: flex; gap: 26px; align-self: start; font: 700 13px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.company-links a { color: var(--fg); transition: color 0.3s ease; }
.company-links a:hover, .company-id a:hover { color: var(--gold); }
.company-fine { grid-column: 1 / -1; font-size: 12.5px; color: hsl(40 6% 62%); }

/* ── Narrow: phones and upright tablets ─────────────────── */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .masthead { height: 64px; gap: 12px; }
  .brand { gap: 10px; }
  .brand-icon { width: 36px; height: 36px; border-radius: 9px; }
  .brand-name { font-size: 17px; }
  .masthead-nav, .masthead-cta { display: none; }
  .hero { min-height: 0; padding-top: 7vh; }
  .hero-title { font-size: min(13.5vw, 88px); line-height: 0.98; }
  .lockin-stage { --bw: min(90vw, 620px); margin-top: 5vh; }
  .hero-sub { margin-top: 72px; }
  .score, .coach, .inside { grid-template-columns: 1fr; row-gap: 40px; }
  .inside-copy { order: 0; }
  .display { max-width: 12ch; }
  .streak-stage { grid-template-columns: 1fr; grid-template-areas: "flame" "count" "copy"; row-gap: 12px; }
  .streak-copy { margin-top: 32px; }
  .rating-strip { grid-template-columns: 1fr; }
  .days { grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 360px; }
  .tier { --step: 4.5vw; font-size: 22px; }
  .line-d { font-size: 13px; }
  .faq summary { padding: 18px 18px; font-size: 16px; }
  .faq details p { padding: 0 18px 20px; }
  .company { grid-template-columns: 1fr; }
  .company-links { flex-wrap: wrap; gap: 16px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .forge { display: none; }
}
