/* ==========================================================================
   kontest — base + components (web)
   Built on tokens.css. Encodes the app's UI system: hairline-bordered
   surfaces, 10px default radius, full-pill toggles, and the orange button as
   the single primary action. Restraint is the system: the accent appears only
   on the primary CTA and the moments that matter.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--accent-deep); }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul[role="list"] { list-style: none; padding: 0; }

/* Accessible focus + skip link */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--accent); color: var(--text-on-accent); font-weight: 600;
  padding: 10px 18px; border-radius: var(--r-md); z-index: 100; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.stack > * + * { margin-top: 1rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  padding: 6px 13px; border-radius: var(--r-pill);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--r-pill);
  background: var(--accent); flex: 0 0 auto;
}
.eyebrow--muted { color: var(--text-3); background: transparent; border-color: var(--line); }
.eyebrow--muted::before { background: var(--text-3); }

/* ---------- Typography scale (from the brand type scale) ---------- */
.display {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 7vw, 64px); line-height: 1.02; letter-spacing: -0.5px;
}
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 4.5vw, 40px); line-height: 1.08;
}
.stat {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(34px, 5vw, 48px); line-height: 1; letter-spacing: -0.5px;
}
.stat .unit { font-size: .45em; color: var(--text-2); font-weight: 600; margin-left: .2em; }
.card-heading { font-weight: 700; font-size: 22px; line-height: 1.2; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--text-2); max-width: 52ch; }
.body-2 { color: var(--text-2); }
.muted { color: var(--text-3); }
.accent-text {
  color: var(--accent-deep);
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.label {
  font-weight: 600; font-size: 13px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 86%, transparent),
      color-mix(in srgb, var(--bg-2) 80%, transparent));
  backdrop-filter: saturate(165%) blur(16px);
  -webkit-backdrop-filter: saturate(165%) blur(16px);
  border-bottom: 1px solid var(--line);
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: color-mix(in srgb, var(--line) 80%, var(--text) 8%);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 94%, transparent),
      color-mix(in srgb, var(--bg-2) 88%, transparent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4), 0 12px 30px -24px rgba(26, 20, 16, .45);
}
/* Three-column grid keeps the logo flush-left, links optically centered,
   and the CTA flush-right regardless of their widths. */
.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 24px; min-height: 72px;
}

/* Links spread out across the bar with a clean underline indicator. */
.nav__links {
  justify-self: center;
  display: flex; align-items: center; gap: clamp(30px, 4.5vw, 56px);
}
.nav__links a {
  position: relative;
  display: inline-flex; align-items: center;
  color: var(--text-2); font-weight: 500; font-size: 15px; letter-spacing: -0.1px;
  padding: 6px 2px;
  transition: color .18s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  border-radius: 2px; background: var(--grad-accent);
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(.55); }
.nav__links a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__cta { justify-self: end; display: flex; align-items: center; gap: 10px; }
.nav__toggle {
  justify-self: end; display: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 9px; border-radius: var(--r-sm); box-shadow: var(--shadow-card);
}

/* Wordmark — always lowercase, always closing on the orange period. */
.wordmark {
  justify-self: start;
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display);
  font-weight: 700; font-size: 24px; letter-spacing: -0.5px; color: var(--text);
  transition: opacity .18s var(--ease);
}
.wordmark:hover { opacity: .82; }
.wordmark .dot { color: var(--accent); }
.wordmark--ink { color: var(--bg); } /* for light fields only */

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 12px; --pad-x: 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 16px; line-height: 1;
  padding: var(--pad-y) var(--pad-x); border-radius: var(--r-md);
  border: 1px solid transparent; transition: transform .15s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--ink-2) 88%, white 4%),
    var(--ink));
  color: #fff;
  border-color: color-mix(in srgb, white 10%, transparent);
  box-shadow:
    0 1px 1px rgba(26, 20, 16, .18),
    0 8px 20px -10px rgba(26, 20, 16, .5);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--ink-2), color-mix(in srgb, var(--ink) 88%, black));
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(26, 20, 16, .22),
    0 14px 28px -10px rgba(26, 20, 16, .55);
}
.btn--primary:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(26, 20, 16, .2);
}
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-card); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text-3); }
.btn--lg { --pad-y: 15px; --pad-x: 28px; font-size: 17px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; pointer-events: none; }

/* Store badges — paired primary download action */
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-card);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.store-badge:hover { border-color: var(--text-3); transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.store-badge svg { flex: 0 0 auto; }
.store-badge .small { display: block; font-size: 11px; color: var(--text-3); line-height: 1.1; }
.store-badge .big { display: block; font-size: 17px; font-weight: 600; line-height: 1.1; }

/* ---------- Pills + badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; padding: 8px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2);
}
.pill .dot-led { width: 8px; height: 8px; border-radius: var(--r-pill); }
.pill--live { color: var(--live); border-color: color-mix(in srgb, var(--live) 35%, var(--line)); }
.pill--live .dot-led { background: var(--live); box-shadow: 0 0 8px var(--live); }
.pill--accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pill--cool { color: var(--cool); border-color: color-mix(in srgb, var(--cool) 35%, var(--line)); }

/* ---------- Surfaces / cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-card);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card--surface-2 { background: var(--surface-2); }
.feature-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; height: 100%;
  overflow: hidden;
}
/* per-card accent rail along the top edge */
.feature-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--ci, var(--accent)), transparent 78%);
  opacity: .5; transition: opacity .22s var(--ease);
}
/* soft corner glow in the card's accent colour */
.feature-card::after {
  content: ""; position: absolute; top: -38px; right: -38px; width: 120px; height: 120px;
  border-radius: 999px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ci, var(--accent)) 16%, transparent), transparent);
  opacity: 0; transition: opacity .22s var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-card-hover);
  border-color: color-mix(in srgb, var(--ci, var(--accent)) 34%, var(--line));
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover::after { opacity: 1; }
.feature-card .card-heading, .feature-card .body-2 { position: relative; }
.feature-card .icon {
  position: relative; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ci, var(--accent)) 13%, transparent);
  color: var(--ci, var(--accent));
  border: 1px solid color-mix(in srgb, var(--ci, var(--accent)) 24%, transparent);
  flex: 0 0 auto;
  transition: transform .22s var(--ease), background-color .22s var(--ease);
}
.feature-card:hover .icon {
  transform: scale(1.07);
  background: color-mix(in srgb, var(--ci, var(--accent)) 18%, transparent);
}
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.stat-card .label { margin-bottom: 8px; }
.delta-up { color: var(--live); font-weight: 600; font-size: 14px; }

/* Grids */
.grid { display: grid; gap: clamp(16px, 2.5vw, 24px); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; }

/* ---------- App screenshot presentation ---------- */
/* Phone frame — for hero + showcase moments where the device sells the feel. */
.phone {
  position: relative; width: clamp(240px, 30vw, 300px); margin-inline: auto;
  border-radius: 42px; padding: 12px; background: linear-gradient(160deg, var(--ink-2), var(--ink));
  border: 1px solid rgba(20,16,12,.55); box-shadow: var(--shadow-soft);
}
.phone::after { /* notch */
  content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 6px; border-radius: var(--r-pill); background: rgba(0,0,0,.6);
}
.phone img { border-radius: 32px; width: 100%; }
.phone--glow::before {
  content: ""; position: absolute; inset: -16% -22%; z-index: -1;
  background: radial-gradient(closest-side, rgba(248,138,47,.22), transparent 72%);
  filter: blur(34px);
}
/* Clean container — for feature grids and dense sections, no device chrome. */
.shot {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-card);
}
.shot img { width: 100%; }

/* ---------- Footer (dark premium band) ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(248, 138, 47, .10), transparent 55%),
    var(--ink);
  color: rgba(255, 255, 255, .72);
}
.site-footer .container { position: relative; z-index: 1; }

/* main grid */
.footer-main { padding-block: clamp(48px, 6vw, 72px); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .45); margin-bottom: 14px; }
.footer-grid a { color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 2; transition: color .15s var(--ease); }
.footer-grid a:hover { color: #fff; }
.site-footer .wordmark { color: #fff; }
.site-footer .body-2 { color: rgba(255, 255, 255, .58); }

/* social icons */
.footer-social { display: flex; gap: 10px; margin-top: 22px; }
.footer-social a {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-pill); border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .78);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .15s var(--ease);
}
.footer-social a:hover { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-social svg { width: 18px; height: 18px; }

.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .5); font-size: 14px; }
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
.footer-status .dot-led { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--live); box-shadow: 0 0 8px var(--live); }

/* ---------- Hero (fit above the fold) ---------- */
/* Trim the default section rhythm and let the hero own the first screen. */
.hero { padding-block: clamp(24px, 4vh, 48px); overflow-x: clip; }
@media (min-width: 901px) {
  .hero {
    min-height: calc(100svh - 72px); /* header is 72px tall */
    display: flex;
    align-items: center;
  }
  .hero .container { width: 100%; }
  /* Cap the phone by viewport height so the device + text always clear the fold. */
  .hero .phone { width: fit-content; max-width: 280px; }
  .hero .phone img { max-height: calc(100svh - 210px); width: auto; }

  /* The device column gets depth so the phone can tilt in 3D space. */
  .hero .split > [data-reveal]:last-child { perspective: 1500px; perspective-origin: 60% 40%; }

  /* Entrance start state: pushed back, rotated, and offset to the right. */
  .js .hero .phone {
    opacity: 0;
    transform: rotateY(-24deg) rotateX(9deg) rotate(3deg) translateX(48px) scale(.92);
    transition: opacity .9s var(--ease), transform 1s var(--ease);
    will-change: transform, opacity;
  }
  /* Settled state: a confident resting tilt, then a slow ambient float. */
  .js .hero [data-reveal].is-visible .phone {
    opacity: 1;
    transform: rotateY(-13deg) rotateX(5deg) rotate(1.5deg);
    animation: phone-float 7s ease-in-out 1.1s infinite;
  }
  /* Lean toward the viewer on hover. */
  .js .hero [data-reveal].is-visible .phone:hover {
    transform: rotateY(-5deg) rotateX(2deg) rotate(0deg) translateY(-8px) scale(1.01);
    animation-play-state: paused;
  }
}

@keyframes phone-float {
  0%, 100% { transform: rotateY(-13deg) rotateX(5deg) rotate(1.5deg) translateY(0); }
  50%      { transform: rotateY(-13deg) rotateX(5deg) rotate(1.5deg) translateY(-14px); }
}

/* Respect reduced-motion: keep a subtle static tilt, drop all movement. */
@media (prefers-reduced-motion: reduce) {
  .js .hero .phone {
    opacity: 1; animation: none; transition: none;
    transform: rotateY(-10deg) rotateX(4deg) rotate(1deg);
  }
}

/* ---------- Hero kicker (replaces the eyebrow pill on the hero) ----------
   An editorial overline: a short accent rule + letterspaced label. Conveys
   "the competitive fitness app" without the templated pill chrome. */
.hero-kicker {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent-deep);
}
.hero-kicker__rule {
  width: 36px; height: 2px; border-radius: 2px; flex: 0 0 auto;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}

/* ---------- Hero spotlight stage ----------
   Stages the phone in a pool of light: a soft beam from above, a grounded
   contact shadow, and a few frosted data chips that pull real product
   moments out of the screenshot to fill the space and sell the device. */
.hero-stage { position: relative; display: flex; justify-content: center; }
.hero-stage__beam {
  position: absolute; left: 50%; top: -16%; width: 132%; height: 130%;
  transform: translateX(-50%); z-index: -2; pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%,
    transparent 157deg,
    rgba(248,138,47,.08) 173deg,
    rgba(255,244,231,.62) 180deg,
    rgba(248,138,47,.08) 187deg,
    transparent 203deg);
  filter: blur(7px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 90%);
          mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 90%);
}
.hero-stage__floor {
  position: absolute; left: 50%; bottom: -1%; width: 64%; height: 46px;
  transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0%, rgba(26,20,16,.20), transparent 72%);
  filter: blur(9px);
}

/* Frosted floating chips, anchored around the device. */
.hero-float {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
          backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(26,20,16,.05), 0 22px 44px -26px rgba(26,20,16,.45);
}
.hero-float__body { display: flex; flex-direction: column; gap: 1px; }
.hero-float__label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3); line-height: 1.1;
}
.hero-float__value {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  line-height: 1; letter-spacing: -.3px; color: var(--text);
}
.hero-float__value--up { color: var(--live-deep); }
.hero-float__sub { font-size: .55em; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.hero-float__led {
  width: 9px; height: 9px; border-radius: var(--r-pill); flex: 0 0 auto;
  background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 22%, transparent);
}
.hero-float__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live-deep);
}
.hero-float__ico--flame { background: var(--accent-soft); color: var(--accent-deep); }

.hero-float--rank   { top: 9%;  left: -10%; }
.hero-float--stat   { bottom: 20%; right: -13%; }
.hero-float--streak { bottom: 4%; left: -7%; }

/* Independent ambient drift so the chips feel alive next to the floating phone. */
@media (min-width: 901px) {
  .js .hero [data-reveal].is-visible .hero-float {
    animation: float-chip 6.5s ease-in-out infinite;
  }
  .hero-float--stat   { animation-delay: -2.2s; }
  .hero-float--streak { animation-delay: -4.4s; }
}
@keyframes float-chip {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero [data-reveal].is-visible .hero-float { animation: none; }
}

/* On narrow screens drop the overhanging chips + beam to avoid clutter/overflow. */
@media (max-width: 900px) {
  .hero-float, .hero-stage__beam { display: none; }
}

/* ---------- Compete showcase stage ----------
   Stages the kontest screen tilted toward the viewer, then orbits it with the
   social proof that actually sells the feature: two friends trash-talking, the
   user's finishing place, and a live leaderboard card. Reuses the hero's
   frosted-chip and tilt language, scoped to .compete so the hero is untouched. */
.compete { overflow-x: clip; }
.compete-stage { position: relative; display: flex; justify-content: center; }
.compete-stage__floor {
  position: absolute; left: 50%; bottom: -2%; width: 64%; height: 46px;
  transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0%, rgba(26,20,16,.20), transparent 72%);
  filter: blur(9px);
}
.compete-phone { width: fit-content; max-width: 280px; margin-inline: auto; }

@media (min-width: 901px) {
  /* Give the device column depth so the phone can tilt in 3D. */
  .compete .split > [data-reveal]:last-child { perspective: 1500px; perspective-origin: 40% 40%; }
  /* Mirror the hero tilt to the opposite side, then a slow ambient float. */
  .js .compete .compete-phone {
    transform: rotateY(14deg) rotateX(5deg) rotate(-2deg);
    transition: transform 1s var(--ease);
    will-change: transform;
  }
  .js .compete [data-reveal].is-visible .compete-phone {
    animation: compete-phone-float 7.5s ease-in-out 1.1s infinite;
  }
  /* Lean toward the viewer on hover. */
  .js .compete [data-reveal].is-visible .compete-phone:hover {
    transform: rotateY(6deg) rotateX(2deg) rotate(0) translateY(-8px) scale(1.01);
    animation-play-state: paused;
  }
}
@keyframes compete-phone-float {
  0%, 100% { transform: rotateY(14deg) rotateX(5deg) rotate(-2deg) translateY(0); }
  50%      { transform: rotateY(14deg) rotateX(5deg) rotate(-2deg) translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .compete .compete-phone {
    animation: none; transition: none;
    transform: rotateY(10deg) rotateX(4deg) rotate(-1deg);
  }
}

/* Shared frosted card for every floating element around the device. */
.cf {
  position: absolute; z-index: 4;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
          backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(26,20,16,.05), 0 22px 44px -26px rgba(26,20,16,.45);
}

/* Friend chat bubbles. */
.cf--msg { display: flex; align-items: flex-end; gap: 9px; padding: 9px 11px; max-width: 232px; }
.cf__avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff;
}
.cf__avatar--a { background: var(--text); }
.cf__avatar--b { background: var(--grad-accent); }
.cf__bubble { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf__bubble--you { align-items: flex-end; text-align: right; }
.cf__who {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); line-height: 1;
}
.cf__text { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }

/* Finishing-place chips. */
.cf--rank { display: flex; align-items: center; gap: 9px; padding: 9px 13px; }
.cf__medal {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.cf__medal--gold { background: var(--grad-accent); box-shadow: var(--shadow-accent); }
.cf__ico-up {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live-deep);
}
.cf__rank-body { display: flex; flex-direction: column; gap: 1px; }
.cf__rank-place {
  font-family: var(--font-display); font-weight: 700; font-size: 21px;
  line-height: 1; letter-spacing: -.3px; color: var(--text);
}
.cf__rank-place--up { color: var(--live-deep); }
.cf__rank-label {
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); line-height: 1.1;
}

/* Floating leaderboard. */
.cf--board { width: 208px; padding: 12px 13px 11px; }
.cf-board__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.cf-board__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3);
}
.cf-board__live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--live-deep);
}
.cf-board__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cf-board__row {
  display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 9px;
}
.cf-board__row--you { background: var(--accent-soft); }
.cf-board__pos {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--text-3); text-align: center;
}
.cf-board__row--you .cf-board__pos { color: var(--accent-deep); }
.cf-board__name { font-size: 13px; font-weight: 600; color: var(--text); }
.cf-board__row--you .cf-board__name { color: var(--accent-deep); }
.cf-board__val {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--text-2); letter-spacing: -.2px;
}
.cf-board__row--you .cf-board__val { color: var(--accent-deep); }

/* Positions — anchored around the overhanging device. */
.cf--msg-a  { top: -6%;  left: -16%; }
.cf--msg-b  { top: 30%;  right: -18%; }
.cf--board  { bottom: 4%; left: -10%; }

/* Independent ambient drift, and a subtle lift on the leaderboard hover. */
@media (min-width: 901px) {
  .js .compete [data-reveal].is-visible .cf {
    animation: float-chip 6.8s ease-in-out infinite;
  }
  .cf--msg-b   { animation-delay: -1.6s; }
  .cf--board   { animation-delay: -3.2s; }
  .js .compete [data-reveal].is-visible .cf--board { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
  .js .compete [data-reveal].is-visible .cf--board:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 1px 2px rgba(26,20,16,.05), 0 30px 56px -24px rgba(26,20,16,.5);
    animation-play-state: paused;
  }
}
@media (prefers-reduced-motion: reduce) {
  .js .compete [data-reveal].is-visible .cf { animation: none; }
}

/* On narrow screens drop the overhanging chips to avoid clutter/overflow. */
@media (max-width: 900px) {
  .cf { display: none; }
}

/* ---------- AI coach stage ----------
   Reuses the hero's spotlight language — beam, contact shadow, a gently
   tilted device — but floats example chat prompts the user could ask Leo
   once they're inside the app, instead of product data chips. */
.coach-stage { position: relative; display: flex; justify-content: center; }
.coach-stage__beam {
  position: absolute; left: 50%; top: -16%; width: 132%; height: 130%;
  transform: translateX(-50%); z-index: -2; pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%,
    transparent 157deg,
    rgba(248,138,47,.08) 173deg,
    rgba(255,244,231,.55) 180deg,
    rgba(248,138,47,.08) 187deg,
    transparent 203deg);
  filter: blur(7px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 90%);
          mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 90%);
}
.coach-stage__floor {
  position: absolute; left: 50%; bottom: -1%; width: 64%; height: 46px;
  transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0%, rgba(26,20,16,.20), transparent 72%);
  filter: blur(9px);
}

/* A slight resting tilt + slow ambient float for the coach device. */
@media (min-width: 901px) {
  .coach-stage { perspective: 1500px; perspective-origin: 45% 40%; }
  .js .coach-phone {
    transform: rotateY(8deg) rotateX(4deg) rotate(-1.5deg);
    transition: transform 1s var(--ease);
    will-change: transform;
  }
  .js [data-reveal].is-visible .coach-phone {
    animation: coach-float 7s ease-in-out 1.1s infinite;
  }
  .js [data-reveal].is-visible .coach-phone:hover {
    transform: rotateY(3deg) rotateX(2deg) rotate(0deg) translateY(-8px) scale(1.01);
    animation-play-state: paused;
  }
}
@keyframes coach-float {
  0%, 100% { transform: rotateY(8deg) rotateX(4deg) rotate(-1.5deg) translateY(0); }
  50%      { transform: rotateY(8deg) rotateX(4deg) rotate(-1.5deg) translateY(-13px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .coach-phone {
    animation: none; transition: none;
    transform: rotateY(7deg) rotateX(3deg) rotate(-1deg);
  }
}

/* Frosted prompt bubbles — written the way you'd actually type to Leo. */
.coach-prompt {
  position: absolute; z-index: 4; max-width: 232px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 16px 16px 16px 5px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
          backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(26,20,16,.05), 0 22px 44px -26px rgba(26,20,16,.45);
}
.coach-prompt__spark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 auto; margin-top: 1px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.coach-prompt__text {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  line-height: 1.32; color: var(--text); letter-spacing: -.1px;
}
/* All overhang stays on the device side (left + over the phone) so chips
   never cross the column gap into the body copy on the right. */
.coach-prompt--a { top: 2%;    left: -12%; }
.coach-prompt--b { bottom: 7%; left: -13%; }
.coach-prompt--c { top: 33%;   right: 2%; }

@media (min-width: 901px) {
  .js [data-reveal].is-visible .coach-prompt {
    animation: float-chip 6.5s ease-in-out infinite;
  }
  .coach-prompt--b { animation-delay: -2.2s; }
  .coach-prompt--c { animation-delay: -4.4s; }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal].is-visible .coach-prompt { animation: none; }
}
@media (max-width: 900px) {
  .coach-prompt, .coach-stage__beam { display: none; }
}
/* Clip any chip overhang at the viewport edge instead of forcing a scrollbar. */
.coach-band { overflow-x: clip; }

/* ---------- Inline link CTA ----------
   A lighter-weight call to action than the boxed button: an accent label with
   a growing underline and an arrow that nudges forward on hover. */
.link-cta {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  letter-spacing: -.1px; color: var(--accent-deep);
  transition: color .18s var(--ease);
}
.link-cta__label {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.6px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: 3px; transition: background-size .28s var(--ease);
}
.link-cta__arrow { flex: 0 0 auto; transition: transform .2s var(--ease); }
.link-cta:hover { color: var(--accent); }
.link-cta:hover .link-cta__label { background-size: 100% 1.6px; }
.link-cta:hover .link-cta__arrow { transform: translateX(4px); }
.link-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* ---------- Atmosphere (used sparingly) ---------- */
.glow-field { position: relative; isolation: isolate; }
.glow-field::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(48% 60% at 82% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(40% 50% at 6% 8%, rgba(31,169,232,.06), transparent 60%);
  pointer-events: none;
}

/* Optional dark contrast band — warm ink, for a single premium moment. */
.section--dark {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: var(--text);
  border-block: 1px solid rgba(255,255,255,.06);
}
.section--dark .lead, .section--dark .body-2 { color: #C8C0B8; }
.section--dark .section-title, .section--dark .display, .section--dark .card-heading { color: #FBF8F4; }
.section--dark .card { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.09); box-shadow: none; }

/* ---------- Scroll reveal (progressive enhancement) ----------
   The hidden initial state is scoped to .js (added by main.js). Without JS the
   content is fully visible by default — the site never depends on script to be readable. */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero typewriter ----------
   The headline types itself out, then the supporting copy fades in.
   Reserve the two-line height so nothing jumps while typing. */
.hero-headline {
  min-height: 1.2em;          /* one line, no reserved gap */
  white-space: nowrap;        /* keep each phrase on a single line */
  font-size: clamp(26px, 4.6vw, 44px);
}
.hero-headline__caret {
  display: inline-block;
  width: 3px; height: 0.92em;
  margin-left: 0.05em; vertical-align: -0.08em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  opacity: 0; /* hidden until JS starts the animation */
}
.js .hero-headline.is-typing .hero-headline__caret { opacity: 1; }
.js .hero-headline.is-done .hero-headline__caret {
  opacity: 1; animation: caret-blink 1.05s steps(1, end) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .js .hero-headline.is-done .hero-headline__caret { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nav { display: flex; justify-content: space-between; align-items: center; }
  /* Top bar on mobile shows only the wordmark + toggle.
     Links and the Join Beta CTA live inside the full-screen overlay. */
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }

  /* Lock background scroll while the overlay is open. */
  body.nav-open { overflow: hidden; }

  /* ---- Full-screen overlay menu ----
     The whole nav becomes the menu surface so the links and the Join Beta CTA
     share one flowing column; the wordmark + close (X) sit pinned on top. */
  .nav[data-open="true"] {
    position: fixed; inset: 0; width: 100%;
    height: 100vh; height: 100dvh;
    z-index: 60; background: var(--bg);
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    padding: calc(72px + 20px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto;
    animation: navOverlayIn .24s var(--ease);
  }
  /* Keep the wordmark + close button in the top bar, above the menu items. */
  .nav[data-open="true"] .wordmark {
    position: absolute; top: 0; left: var(--gutter);
    height: 72px; display: inline-flex; align-items: center;
  }
  .nav[data-open="true"] .nav__toggle {
    position: absolute; top: 16px; right: var(--gutter); display: inline-flex;
  }
  .nav[data-open="true"] .nav__links {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    width: 100%; margin: 0; padding: 0;
  }
  .nav[data-open="true"] .nav__links a {
    width: 100%; font-family: var(--font-display);
    font-size: 28px; font-weight: 600; letter-spacing: -0.5px;
    color: var(--text);
    padding: 18px 4px; border-radius: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav[data-open="true"] .nav__links a::after { display: none; }

  /* Join Beta — pushed to the very bottom of the menu, the last thing seen. */
  .nav[data-open="true"] .nav__cta {
    display: flex; flex-direction: column;
    width: 100%; margin-top: auto; padding-top: 24px;
  }
  .nav[data-open="true"] .nav__cta .btn { width: 100%; --pad-y: 16px; }

  @keyframes navOverlayIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

  /* ---- Mobile footer: brand on top, links in a tight 2-column grid ---- */
  .footer-main { padding-block: clamp(40px, 11vw, 56px); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand .body-2 { max-width: 38ch; }

  /* Section columns: header sits a touch tighter, links become roomy
     tap rows separated by hairlines so the two columns read cleanly. */
  .footer-grid h4 { margin-bottom: 6px; }
  .footer-grid nav { display: flex; flex-direction: column; }
  .footer-grid nav br { display: none; }
  .footer-grid nav a {
    line-height: 1.5; padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  .footer-grid nav a:last-child { border-bottom: 0; }

  /* Slimmer copyright bar; status pill drops below the line, left-aligned. */
  .footer-bottom {
    margin-top: 36px; padding-top: 20px;
    flex-direction: column; align-items: flex-start; gap: 10px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Stat strip — interactive stat cards (home page)
   Animated count-up values, tinted icon, hover lift, filling accent bar.
   Each card sets its own tint via --si (set inline per card).
   ========================================================================== */
.statband { position: relative; overflow: hidden; isolation: isolate; }
.statband > .container { position: relative; z-index: 2; }

/* Drifting aurora — soft, tinted blobs in the brand + kontest-type colors that
   slowly move behind the cards. Subtle on purpose; the cards stay the focus. */
.statband::before {
  content: ""; position: absolute; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 52% at 12% 22%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(34% 48% at 80% 10%, color-mix(in srgb, var(--kt-weight) 22%, transparent), transparent 72%),
    radial-gradient(42% 56% at 88% 86%, color-mix(in srgb, var(--kt-steps) 22%, transparent), transparent 72%),
    radial-gradient(38% 52% at 24% 96%, color-mix(in srgb, var(--kt-distance) 20%, transparent), transparent 72%);
  filter: blur(46px); opacity: .72;
  animation: statband-drift 24s var(--ease) infinite alternate;
}
/* Faint dot grid for texture, fading toward the edges. */
.statband::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle at center, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.6px);
  background-size: 26px 26px; opacity: .5;
  -webkit-mask-image: radial-gradient(125% 100% at 50% 0%, #000 32%, transparent 82%);
  mask-image: radial-gradient(125% 100% at 50% 0%, #000 32%, transparent 82%);
}
@keyframes statband-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2.5%, 0) scale(1.09); }
  100% { transform: translate3d(-2.5%, 2%, 0) scale(1.05); }
}

.statband__note {
  margin: clamp(20px, 2.6vw, 30px) auto 0; max-width: 62ch;
  text-align: center; font-size: 14px; color: var(--text-3);
}
.statband__note strong { color: var(--text-2); font-weight: 600; }

.statband__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.6vw, 18px);
}
.statcard {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(18px, 2.2vw, 26px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}
.statcard::before {
  /* soft tint wash that warms up on hover */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--si) 12%, transparent), transparent 60%);
  opacity: .5; transition: opacity .24s var(--ease);
}
.statcard:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: color-mix(in srgb, var(--si) 40%, var(--line));
}
.statcard:hover::before { opacity: 1; }
.statcard > * { position: relative; z-index: 1; }

.statcard__icon {
  width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: var(--r-md);
  color: var(--si);
  background: color-mix(in srgb, var(--si) 14%, transparent);
  transition: transform .24s var(--ease);
}
.statcard:hover .statcard__icon { transform: scale(1.08) rotate(-3deg); }

.statcard__value { color: var(--text); display: inline-flex; align-items: baseline; }
.statcard__sub { font-size: .5em; font-weight: 600; color: var(--text-2); margin-left: .04em; }

.statcard__label { display: flex; align-items: center; gap: 8px; }
.statcard__live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--live);
}
.statcard__live .dot-led {
  width: 7px; height: 7px; border-radius: var(--r-pill);
  background: var(--live); box-shadow: 0 0 8px var(--live);
  animation: statled 1.8s var(--ease) infinite;
}
@keyframes statled { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.72); } }

.statcard__bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--si), color-mix(in srgb, var(--si) 45%, transparent));
}
.js .statcard__bar { transition: transform .9s var(--ease) .15s; }
.js .statcard.is-visible .statcard__bar { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .statcard, .statcard__icon, .statcard__bar { transition: none; }
  .statcard__live .dot-led { animation: none; }
  .statband::before { animation: none; }
  .js .statcard__bar { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .statband__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Forms — beta / waitlist capture. Built on tokens; hairline surfaces, the
   orange accent reserved for the single submit action and the active choice.
   ========================================================================== */
.form { display: grid; gap: 22px; }
.form__row { display: grid; gap: 22px; }
@media (min-width: 620px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }

.form__field { display: grid; gap: 8px; }
.form__label {
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-2);
}
.form__label .req { color: var(--accent-deep); margin-left: 2px; }
.form__hint { font-size: 13px; color: var(--text-3); }

.form__input {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.form__input::placeholder { color: var(--text-3); }
.form__input:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form__input { resize: vertical; min-height: 96px; line-height: 1.5; }

/* Choice cards — radios / checkboxes styled as selectable hairline tiles. */
.choice-grid { display: grid; gap: 12px; }
@media (min-width: 520px) { .choice-grid--2 { grid-template-columns: 1fr 1fr; } }

.choice {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.choice:hover { border-color: var(--text-3); }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice__mark {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.choice__mark--radio { border-radius: var(--r-pill); }
.choice__mark--check { border-radius: var(--r-sm); }
.choice__mark svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: opacity .15s var(--ease), transform .15s var(--ease); color: var(--text-on-accent); }
.choice__body { display: grid; gap: 2px; }
.choice__title { font-size: 15px; font-weight: 600; color: var(--text); }
.choice__sub { font-size: 13px; color: var(--text-3); }

.choice input:checked ~ .choice__mark { border-color: var(--accent); background: var(--accent); }
.choice input:checked ~ .choice__mark svg { opacity: 1; transform: scale(1); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.choice input:focus-visible ~ .choice__mark { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Submit + privacy note */
.form__submit { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.form__note { font-size: 13px; color: var(--text-3); max-width: 52ch; }
.form__note a { color: var(--accent-deep); }

.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* Status messages (success / error) shown after submit. */
.form-status { display: none; border-radius: var(--r-md); padding: 16px 18px; font-size: 15px; border: 1px solid var(--line); }
.form-status[data-show="true"] { display: block; }
.form-status--ok { background: color-mix(in srgb, var(--live) 10%, var(--surface)); border-color: color-mix(in srgb, var(--live) 35%, var(--line)); color: var(--live-deep); }
.form-status--err { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); color: var(--danger); }

/* Perk list for the beta page */
.perk { display: flex; gap: 14px; align-items: flex-start; }
.perk__ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center;
}
.perk__ico svg { width: 19px; height: 19px; }
.perk__body { display: grid; gap: 3px; }
.perk__title { font-size: 16px; font-weight: 700; color: var(--text); }
.perk__text { font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* Numbered "how the beta works" steps */
.betastep__num {
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--accent); line-height: 1;
}

/* ---------- Kontest types ---------- */
/* Five equal tiles that share the feature-card treatment (accent rail, corner
   glow, hover lift) but in a tighter, single-row rhythm. */
.kt-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: clamp(14px, 1.8vw, 20px);
}
.kt-card { gap: 12px; padding: clamp(18px, 2vw, 22px); }
.kt-card .icon { width: 42px; height: 42px; }
.kt-card .icon svg { width: 20px; height: 20px; }
.kt-card__name { font-size: 18px; }
.kt-card__desc { font-size: 14px; color: var(--text-2); }

/* Live-ranking caption beneath the grid */
.kt-note {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin-top: 28px;
  font-size: 14px; color: var(--text-2); text-align: center;
}

@media (max-width: 960px) {
  .kt-grid { grid-template-columns: repeat(2, 1fr); }
  .kt-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .kt-grid { grid-template-columns: 1fr; }
  .kt-grid > :last-child { grid-column: auto; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 14px; }

.faq__item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color .22s var(--ease), box-shadow .22s var(--ease);
}
/* per-item accent rail that grows in when opened */
.faq__item::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--ci, var(--accent));
  transform: scaleY(0); transform-origin: top;
  transition: transform .3s var(--ease);
}
.faq__item:hover {
  border-color: color-mix(in srgb, var(--ci, var(--accent)) 36%, var(--line));
  box-shadow: var(--shadow-card-hover);
}
.faq__item[open] {
  border-color: color-mix(in srgb, var(--ci, var(--accent)) 48%, var(--line));
}
.faq__item[open]::before { transform: scaleY(1); }

.faq__q {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 16px;
  padding: clamp(18px, 2.4vw, 22px) clamp(18px, 2.4vw, 24px);
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(16px, 1.9vw, 19px); line-height: 1.3;
  color: var(--text);
  transition: color .2s var(--ease);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__item:hover .faq__q,
.faq__item[open] .faq__q { color: var(--ci, var(--accent)); }

/* leading index number, editorial touch */
.faq__num {
  flex: 0 0 auto; font-family: var(--font-display); font-weight: 600;
  font-size: 13px; letter-spacing: .04em;
  color: var(--ci, var(--accent));
  opacity: .65; min-width: 2ch;
}

/* the +/× toggle indicator */
.faq__icon {
  position: relative; flex: 0 0 auto; margin-left: auto;
  width: 28px; height: 28px; border-radius: 999px;
  background: color-mix(in srgb, var(--ci, var(--accent)) 12%, transparent);
  color: var(--ci, var(--accent));
  transition: transform .3s var(--ease), background-color .22s var(--ease);
}
.faq__item[open] .faq__icon {
  transform: rotate(135deg);
  background: color-mix(in srgb, var(--ci, var(--accent)) 18%, transparent);
}
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  background: currentColor; border-radius: 2px;
  transform: translate(-50%, -50%);
}
.faq__icon::before { width: 12px; height: 2px; }
.faq__icon::after { width: 2px; height: 12px; }

.faq__a {
  margin: 0; color: var(--text-2);
  padding: 0 clamp(18px, 2.4vw, 24px) clamp(20px, 2.4vw, 22px);
  padding-left: calc(clamp(18px, 2.4vw, 24px) + 2ch + 16px);
}
.faq__item[open] .faq__a { animation: faqReveal .34s var(--ease); }
@keyframes faqReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* personal note from the founder */
.faq-founder {
  display: flex; align-items: flex-start; gap: 18px; margin-top: 22px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}
.faq-founder__avatar {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--text-on-accent); background: var(--grad-accent);
  box-shadow: var(--shadow-accent);
}
.faq-founder__note { margin: 2px 0 10px; color: var(--text); font-size: 15px; line-height: 1.6; }
.faq-founder__sig {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--accent-deep); text-decoration: none;
}
.faq-founder__sig:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .faq__num { display: none; }
  .faq__a { padding-left: clamp(18px, 2.4vw, 24px); }
}

/* ==========================================================================
   Final CTA — the one premium dark moment. Warm ink field, a slow orange
   aurora, a podium motif that "wins," and store badges tuned for dark.
   ========================================================================== */
.cta-final {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 130% at 50% -20%, var(--ink-2), var(--ink) 70%);
  color: #FBF8F4;
  border-block: 1px solid rgba(255,255,255,.06);
  padding-block: clamp(80px, 11vw, 148px);
}
/* Slow-drifting orange aurora + a cool counterglow */
.cta-final__aura {
  position: absolute; inset: -20% -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 46% at 22% 18%, rgba(248,138,47,.30), transparent 60%),
    radial-gradient(34% 42% at 82% 28%, rgba(215,90,7,.26), transparent 62%),
    radial-gradient(40% 50% at 60% 96%, rgba(31,169,232,.12), transparent 64%);
  filter: blur(8px);
  animation: cta-drift 22s ease-in-out infinite alternate;
}
@keyframes cta-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
/* Faint vertical "leaderboard" grid lines */
.cta-final__grid {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 64px 100%;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 78%);
          mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 78%);
}
@media (prefers-reduced-motion: reduce) { .cta-final__aura { animation: none; } }

.cta-final .container { position: relative; text-align: center; max-width: 820px; }
.cta-final .eyebrow {
  color: #FFD9B3;
  background: rgba(248,138,47,.14);
  border-color: rgba(248,138,47,.42);
}
.cta-final .eyebrow::before { background: var(--accent); box-shadow: 0 0 10px rgba(248,138,47,.9); }
.cta-final .hero-kicker { color: #FFD9B3; }
.cta-final .hero-kicker__rule { background: linear-gradient(90deg, #FFD9B3, var(--accent)); }
.cta-final .display { color: #FBF8F4; }
.cta-final .accent-text {
  background: linear-gradient(100deg, #FFB166, var(--accent) 55%, var(--accent-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cta-final .lead { color: #D9D0C7; margin-inline: auto; }

/* Podium motif — three risers, the middle (you) crowned and tallest */
.cta-final__podium {
  display: flex; align-items: flex-end; justify-content: center; gap: 12px;
  height: 92px; margin: 6px auto 4px;
}
.cta-final__bar {
  width: 56px; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.12); border-bottom: none;
  position: relative;
  transform: scaleY(0); transform-origin: bottom;
  animation: cta-rise .7s var(--ease, cubic-bezier(.2,.8,.2,1)) forwards;
}
.cta-final__bar span {
  position: absolute; top: 8px; left: 0; right: 0; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #FBF8F4;
}
.cta-final__bar--silver { height: 58px; animation-delay: .05s; }
.cta-final__bar--gold {
  height: 92px; width: 64px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 -8px 36px rgba(248,138,47,.45);
  animation-delay: .22s;
}
.cta-final__bar--gold span { color: var(--text-on-accent); }
.cta-final__bar--bronze { height: 40px; animation-delay: 0s; }
.cta-final__crown {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  color: #FFD9B3; filter: drop-shadow(0 2px 6px rgba(248,138,47,.6));
  opacity: 0; animation: cta-pop .4s ease .85s forwards;
}
@keyframes cta-rise { to { transform: scaleY(1); } }
@keyframes cta-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.6); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .cta-final__bar { transform: none; animation: none; }
  .cta-final__crown { opacity: 1; animation: none; }
}

/* Store badges, dark variant */
.cta-final .store-badge {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.16);
  color: #FBF8F4;
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.cta-final .store-badge:hover {
  border-color: var(--accent);
  background: rgba(255,255,255,.09);
  box-shadow: 0 8px 30px rgba(248,138,47,.22);
}
.cta-final .store-badge .small { color: #B8AFA6; }

/* Trust row */
.cta-trust {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 22px; margin-top: 26px;
  font-size: 14px; color: #C8C0B8;
}
.cta-trust span { display: inline-flex; align-items: center; gap: 7px; }
.cta-trust svg { color: var(--accent); flex: 0 0 auto; }
.cta-trust .sep { width: 4px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.25); padding: 0; }
@media (max-width: 520px) { .cta-trust .sep { display: none; } }

/* ==========================================================================
   Mobile device staging (home page)
   Bring the desktop treatment to small screens: tilt the phones in 3D and
   float the data/chat chips around them. Chips are re-positioned for the
   centered single-column layout and kept fully on-canvas (sections clip the
   horizontal overflow). Reduced-motion is honored in the guard block below.
   ========================================================================== */
@media (max-width: 900px) {

  /* Give each stage depth so the device can tilt, and trim the phone a touch
     so the floating chips have room to breathe around it. */
  .hero-stage, .coach-stage, .compete-stage { perspective: 1400px; }
  .hero .phone, .coach-phone, .compete-phone { width: min(64vw, 235px); max-width: 235px; }

  /* Re-show the beams + every floating chip that desktop hides on mobile. */
  .hero-stage__beam, .coach-stage__beam { display: block; }
  .hero-float { display: flex; }
  .coach-prompt { display: flex; }
  .cf { display: block; }
  .cf--msg { display: flex; }

  /* --- Hero phone: resting tilt + ambient float --- */
  .js .hero .phone {
    transform: rotateY(-13deg) rotateX(5deg) rotate(1.5deg);
    transition: transform 1s var(--ease);
    will-change: transform;
  }
  .js .hero [data-reveal].is-visible .phone {
    animation: phone-float 7s ease-in-out 1.1s infinite;
  }
  .js .hero [data-reveal].is-visible .hero-float {
    animation: float-chip 6.5s ease-in-out infinite;
  }
  .hero-float--stat   { animation-delay: -2.2s; }
  .hero-float--streak { animation-delay: -4.4s; }

  /* --- Coach phone: resting tilt + ambient float --- */
  .js .coach-phone {
    transform: rotateY(8deg) rotateX(4deg) rotate(-1.5deg);
    transition: transform 1s var(--ease);
    will-change: transform;
  }
  .js [data-reveal].is-visible .coach-phone {
    animation: coach-float 7s ease-in-out 1.1s infinite;
  }
  .js [data-reveal].is-visible .coach-prompt {
    animation: float-chip 6.5s ease-in-out infinite;
  }
  .coach-prompt--b { animation-delay: -2.2s; }
  .coach-prompt--c { animation-delay: -4.4s; }

  /* --- Compete phone: resting tilt + ambient float --- */
  .js .compete .compete-phone {
    transform: rotateY(14deg) rotateX(5deg) rotate(-2deg);
    transition: transform 1s var(--ease);
    will-change: transform;
  }
  .js .compete [data-reveal].is-visible .compete-phone {
    animation: compete-phone-float 7.5s ease-in-out 1.1s infinite;
  }
  .js .compete [data-reveal].is-visible .cf {
    animation: float-chip 6.8s ease-in-out infinite;
  }
  .cf--msg-b { animation-delay: -1.6s; }
  .cf--board { animation-delay: -3.2s; }

  /* Keep chips compact and anchored to the canvas edges so they straddle the
     phone without running off-screen. Vertical positions stay within the
     phone's height so nothing is clipped top/bottom. */
  .hero-float, .coach-prompt, .cf--msg { max-width: min(62vw, 215px); }

  .hero-float--rank   { top: 3%;    left: 1%;  right: auto; bottom: auto; }
  .hero-float--stat   { top: 40%;   right: 1%; left: auto;  bottom: auto; }
  .hero-float--streak { bottom: 5%; left: 3%;  right: auto; top: auto; }

  .coach-prompt--a { top: 1%;    left: 0;  right: auto; bottom: auto; }
  .coach-prompt--c { top: 38%;   right: 0; left: auto;  bottom: auto; }
  .coach-prompt--b { bottom: 3%; left: 0;  right: auto; top: auto; }

  .cf--msg-a { top: 1%;    left: 0;  right: auto; bottom: auto; }
  .cf--msg-b { top: 36%;   right: 0; left: auto;  bottom: auto; }
  .cf--board { bottom: 3%; left: 1%; right: auto; top: auto; }
}

/* Reduced-motion guard — re-asserted after the mobile block above so it wins:
   static resting tilt, no floating, on every device + chip. */
@media (prefers-reduced-motion: reduce) {
  .js .hero .phone { animation: none; transform: rotateY(-10deg) rotateX(4deg) rotate(1deg); }
  .js .coach-phone { animation: none; transform: rotateY(7deg) rotateX(3deg) rotate(-1deg); }
  .js .compete .compete-phone { animation: none; transform: rotateY(10deg) rotateX(4deg) rotate(-1deg); }
  .js .hero [data-reveal].is-visible .phone,
  .js [data-reveal].is-visible .coach-phone,
  .js .compete [data-reveal].is-visible .compete-phone { animation: none; }
  .hero-float, .coach-prompt, .cf { animation: none; }
}

/* ==========================================================================
   Mobile: feature screenshot pairs read like the standalone phone bands.
   The Community (activity feed + network), Progress (stats + PRs) and
   how-it-works grids show two full app screens side by side. Two-up, those
   screens shrink until the in-app text is unreadable. On mobile/tablet we
   stack them into one centered column and wrap each in the same phone frame
   used by the single-image bands, so each screen reads big as you scroll.
   Scoped to grids that actually contain .shot screenshots, so the pricing
   and join-beta card grids are untouched.
   ========================================================================== */
@media (max-width: 900px) {
  /* Lay the two screens out as an overlapping, staggered pair — one tucked
     behind the other at a slight tilt — instead of two identical frames
     stacked nose to tail. Reads as a deliberate composition while keeping
     each screen large enough that the in-app text stays legible. */
  .grid--2:has(.shot) {
    display: block; position: relative;
    width: 100%; max-width: 340px; margin-inline: auto;
    padding-block: 14px 22px;
  }

  .grid--2 .shot {
    width: 60%;
    position: relative;
    margin: 0;
    padding: 11px;
    border: 1px solid rgba(20, 16, 12, .55);
    border-radius: 40px;
    background: linear-gradient(160deg, var(--ink-2), var(--ink));
    box-shadow: var(--shadow-soft);
    overflow: visible;
  }
  .grid--2 .shot img { border-radius: 30px; display: block; }
  .grid--2 .shot::after { /* notch, matching .phone */
    content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 38%; height: 5px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .6);
  }
  /* Front screen: left, lifted, tilted slightly counter-clockwise. */
  .grid--2 .shot:first-child {
    margin-left: 0; z-index: 2; transform: rotate(-3deg);
  }
  /* Back screen: pushed right and up so it overlaps, opposite tilt. */
  .grid--2 .shot:last-child {
    margin-left: 40%; margin-top: -30%; z-index: 1; transform: rotate(3deg);
  }
}
