/* ============================================================
   SMART RUNNER - Homepage (v3)
   One idea per screen: big type, black space, the product as hero.
   Builds on styles.css tokens and shared components.
   ============================================================ */

.home { background: #000; }
.home .nav { background: transparent; border-bottom: 1px solid transparent; }
.home .nav.nav-scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------
   Scaffolding
   ------------------------------------------------------------ */
.section-block {
  max-width: 1080px;
  margin: 0 auto;
  padding: 160px var(--space-lg);
}

.section-head { text-align: center; margin: 0 auto 72px; }

.section-title {
  max-width: 900px;
  margin: 0 auto 80px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--text-1);
  text-wrap: balance;
}
.section-head .section-title { margin-bottom: 0; }
.section-title--sm { font-size: clamp(32px, 4.4vw, 52px); margin-bottom: 48px; }

.section-title em,
.hero-title em,
.final-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-text);
  letter-spacing: -0.02em;
}

.quiet-links {
  margin-top: 56px;
  text-align: center;
  font-size: 17px;
  color: var(--text-3);
}
.quiet-links a { color: var(--accent-text); font-weight: 600; }
.quiet-links a:hover { text-decoration: underline; }

.stars { color: var(--run-race); letter-spacing: 2px; }

/* ------------------------------------------------------------
   Hero: centred copy, the phone rises upright beneath it
   ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 148px var(--space-lg) 0;
  text-align: center;
  overflow: hidden;
}

.hero-copy { max-width: 1120px; margin: 0 auto; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.6vw, 104px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: var(--text-1);
  text-wrap: balance;
}

.hero-sub {
  max-width: 560px;
  margin: 28px auto 0;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-2);
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  font-size: 15px;
  color: var(--text-3);
}
.hero-meta .rating { color: var(--text-2); }

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 88px;
  height: 640px;
  /* Phone runs off the bottom of the hero, Apple-style. */
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
          mask-image: linear-gradient(180deg, #000 72%, transparent);
}

.hero-glow {
  position: absolute;
  width: 900px;
  height: 600px;
  top: 0;
  left: 50%;
  margin-left: -450px;
  background: radial-gradient(closest-side, rgba(174, 255, 88, 0.16), transparent);
  filter: blur(20px);
}

.hero-visual .hero-phone { width: 340px; align-self: flex-start; margin-top: 12px; }

.hero-visual .hero-watch {
  position: absolute;
  width: 150px;
  left: calc(50% - 300px);
  top: 260px;
  transform: rotate(-4deg);
}

/* QR card, used in the final CTA on desktop */
.qr-card {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-3);
  text-align: left;
}
.qr-card img { width: 64px; height: 64px; padding: 4px; background: #fff; border-radius: 8px; }
@media (min-width: 901px) and (hover: hover) {
  .qr-card { display: flex; }
}

/* ------------------------------------------------------------
   Device frames (screenshots already include rounded corners)
   ------------------------------------------------------------ */
.device {
  --ex: 0.7;   /* side-wall direction: which way the device is turned */
  --ey: 0.45;
  position: relative;
  overflow: hidden;
  /* Uniform bezel that follows the screenshot's own corner radius, a lit
     rim, then a stacked metal side wall for thickness, then a contact shadow. */
  box-shadow:
    0 0 0 5px #0d0f15,
    0 0 0 6px rgba(255, 255, 255, 0.16),
    calc(var(--ex) * 1px) calc(var(--ey) * 1px) 0 5px rgb(74 78 92),
    calc(var(--ex) * 2px) calc(var(--ey) * 2px) 0 5px rgb(68 71 84),
    calc(var(--ex) * 3px) calc(var(--ey) * 3px) 0 5px rgb(61 64 77),
    calc(var(--ex) * 4px) calc(var(--ey) * 4px) 0 5px rgb(54 58 69),
    calc(var(--ex) * 5px) calc(var(--ey) * 5px) 0 5px rgb(48 51 62),
    calc(var(--ex) * 6px) calc(var(--ey) * 6px) 0 5px rgb(42 44 54),
    calc(var(--ex) * 7px) calc(var(--ey) * 7px) 0 5px rgb(35 38 46),
    calc(var(--ex) * 8px) calc(var(--ey) * 8px) 0 5px rgb(28 31 39),
    calc(var(--ex) * 9px) calc(var(--ey) * 9px) 0 5px rgb(22 24 31),
    calc(var(--ex) * 18px) calc(var(--ey) * 18px + 34px) 60px rgba(0, 0, 0, 0.6);
}

.device img { width: 100%; height: auto; display: block; }

/* iPhone screenshots: the screen's rounded corners are larger than the 165px device radius. */
.device--phone { border-radius: 16% / 7.4%; }

.device--watch { border-radius: 24% / 19.5%; }

/* ------------------------------------------------------------
   Statement: words light up as you scroll (see home-fx.js)
   ------------------------------------------------------------ */
.statement { padding: 200px var(--space-lg) 40px; }

.statement-text {
  max-width: 1000px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.8vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text-1);
  text-wrap: balance;
}
.statement-text em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-text);
}

/* ------------------------------------------------------------
   Three steps: no boxes, just the thing and a line
   ------------------------------------------------------------ */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: center;
}

.step-visual {
  height: 340px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
          mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.step-visual .device--phone { width: 220px; }
.step-visual .step-watch { width: 190px; margin-top: 36px; }

.step h3 {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

.step p {
  max-width: 280px;
  margin: 10px auto 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-3);
  text-wrap: balance;
}

.pace-card {
  width: 250px;
  margin-top: 28px;
  padding: 18px;
  border-radius: 22px;
  background: #0e1017;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  text-align: left;
}
.pace-card-input,
.pace-card-vdot { display: flex; justify-content: space-between; align-items: baseline; color: var(--text-3); }
.pace-card-input strong { font-size: 20px; color: var(--text-1); }
.pace-card-vdot {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--action-fg);
  font-weight: 700;
}
.pace-card-vdot strong { font-size: 28px; letter-spacing: -0.02em; }
.pace-card-zones { display: grid; gap: 9px; }
.pace-card-zones li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.pace-card-zones i { width: 8px; height: 8px; border-radius: 50%; }
.pace-card-zones b { margin-left: auto; color: var(--text-1); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Features: one row per screen, alternating sides on desktop.
   ------------------------------------------------------------ */
.story { padding: 160px var(--space-lg) 0; }

.feature-rows { max-width: 1080px; margin: 0 auto; display: grid; gap: 140px; }

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
}
.feature-row:nth-child(even) .feature-media { order: 2; }

.feature-media { display: flex; justify-content: center; }
.feature-phone { width: min(300px, 26vw); }

.feature-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-1);
}
.feature-copy p { margin-top: 14px; max-width: 400px; font-size: 19px; line-height: 1.45; color: var(--text-2); }

/* ------------------------------------------------------------
   Why: four statements, no table
   ------------------------------------------------------------ */
.why-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 72px 80px;
  max-width: 880px;
  margin: 0 auto;
}
.why-grid strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-1);
}
.why-grid span {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text-3);
  text-wrap: pretty;
}

/* ------------------------------------------------------------
   One review, said big
   ------------------------------------------------------------ */
.big-quote { max-width: 920px; margin: 0 auto; text-align: center; }
.big-quote blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-1);
  text-wrap: balance;
}
.big-quote figcaption { margin-top: 32px; font-size: 16px; color: var(--text-3); }
.big-quote .stars { margin-right: 8px; }

/* ------------------------------------------------------------
   Free tools: a quiet row of links
   ------------------------------------------------------------ */
.tools-block { padding-top: 80px; }
.tool-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 40px;
  font-size: 20px;
  font-weight: 600;
}
.tool-links a { color: var(--accent-text); }
.tool-links a:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   Final CTA: black, big type, the phones fan out underneath
   ------------------------------------------------------------ */
.final-cta.cta-block {
  margin-top: 0;
  padding: 160px var(--space-lg);
  background: radial-gradient(60% 50% at 50% 100%, rgba(174, 255, 88, 0.12), transparent 70%), #000;
  border: 0;
}
.final-cta.cta-block::before { display: none; }

.final-cta-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.final-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text-1);
  text-wrap: balance;
}

.final-sub { margin-top: 24px; font-size: clamp(19px, 2vw, 24px); line-height: 1.4; color: var(--text-2); }
.final-actions { justify-content: center; }
.final-actions .qr-card { background: rgba(255, 255, 255, 0.03); }
.final-fine { margin-top: 24px; font-size: 13px; color: var(--text-3); }

.cta-fan {
  position: relative;
  z-index: 1;
  height: 460px;
  margin: 96px auto -160px;
  max-width: 1000px;
  pointer-events: none;
  /* Phones dissolve into the black instead of ending on a hard edge. */
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 92%);
          mask-image: linear-gradient(180deg, #000 45%, transparent 92%);
}
.fan-phone {
  position: absolute;
  left: 50%;
  top: 0;
  width: 200px;
  margin-left: -100px;
  z-index: calc(10 - var(--ak));
  transform: translateX(calc(var(--k) * 150px)) translateY(calc(var(--ak) * 26px)) rotate(calc(var(--k) * 4deg));
}

/* ------------------------------------------------------------
   FAQ
   ------------------------------------------------------------ */
.faq { max-width: 760px; margin: 0 auto; }

.faq details { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.faq details:first-child { border-top: 1px solid rgba(255, 255, 255, 0.1); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 26px 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-3);
  transition: transform 0.25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 6px; }
.faq details p {
  padding: 0 40px 28px 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-2);
  font-weight: 400;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .section-block { padding: 112px var(--space-md); }
  .section-title { margin-bottom: 56px; }

  .hero { padding: 112px var(--space-md) 0; }
  .hero-actions .btn { width: 100%; max-width: 400px; }
  .hero-visual { margin-top: 56px; height: 440px; }
  /* Fit inside the masked box so the glow fades out before its edges. */
  .hero-glow { width: 100%; height: 100%; left: 0; margin-left: 0; }
  .hero-visual .hero-phone { width: 250px; }
  .hero-visual .hero-watch { width: 108px; left: max(12px, calc(50% - 180px)); top: 190px; }

  .statement { padding: 120px var(--space-md) 24px; }

  .steps { grid-template-columns: 1fr; gap: 72px; max-width: 420px; margin: 0 auto; }
  .step-visual { height: 300px; }

  /* Features on phones: phone on top, caption underneath. */
  .story { padding: 112px var(--space-md) 0; }
  .feature-rows { gap: 96px; }
  .feature-row { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .feature-row:nth-child(even) .feature-media { order: 0; }
  .feature-phone { width: min(240px, 62vw); }
  .feature-copy h3 { font-size: 30px; }
  .feature-copy p { margin-left: auto; margin-right: auto; font-size: 17px; }

  .why-grid { grid-template-columns: 1fr; gap: 48px; text-align: center; }

  .tool-links { flex-direction: column; align-items: center; gap: 18px; font-size: 18px; }

  .final-cta.cta-block { padding: 120px var(--space-md); }
  .cta-fan { height: 320px; margin: 64px auto -120px; }
  .fan-phone { width: 140px; margin-left: -70px; transform: translateX(calc(var(--k) * 72px)) translateY(calc(var(--ak) * 18px)) rotate(calc(var(--k) * 4deg)); }
}

@media (max-width: 560px) {
  .faq summary { font-size: 17px; padding: 22px 0; }
  .faq details p { padding-right: 0; font-size: 16px; }
}

/* ============================================================
   Motion (only with JS and without prefers-reduced-motion;
   home-fx.js adds .fx to <html>). Calm: fades, and devices that
   move with scroll. Nothing follows the mouse.
   ============================================================ */
@keyframes fx-rise {
  from { opacity: 0; translate: 0 24px; }
}
@keyframes fx-fade {
  from { opacity: 0; }
}

/* Intro */
.fx .hero-title .w {
  display: inline-block;
  animation: fx-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(100ms + var(--wi) * 60ms);
}
.fx .hero-sub { animation: fx-rise 1s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.fx .hero-actions { animation: fx-rise 1s 0.62s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.fx .hero-meta { animation: fx-rise 1s 0.74s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.fx .hero-visual { animation: fx-fade 1.4s 0.5s ease-out both; }

/* Hero: the phone starts tipped back and rises upright as you scroll in.
   --rise (0..1) comes from home-fx.js. */
.fx .hero { --rise: 0; }
.fx .hero-visual .hero-phone,
.fx .hero-visual .hero-watch { will-change: transform; }
.fx .hero-visual .hero-phone {
  transform:
    perspective(1800px)
    translateY(calc((1 - var(--rise)) * 40px))
    rotateX(calc((1 - var(--rise)) * 26deg))
    scale(calc(0.94 + var(--rise) * 0.06));
  --ex: 0;
  --ey: 0.6;
}
.fx .hero-visual .hero-watch {
  transform:
    perspective(1800px)
    translateY(calc((1 - var(--rise)) * 90px))
    rotateX(calc((1 - var(--rise)) * 18deg))
    rotateZ(-4deg);
  --ex: 0.5;
  --ey: 0.5;
}

/* A soft specular highlight that drifts with scroll: reads as glass. */
.glare { display: none; }
.fx .glare {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.09) 48%,
    rgba(255, 255, 255, 0.02) 56%,
    transparent 62%
  );
  mix-blend-mode: screen;
}

/* Statement words */
.fx .statement-text .sw { color: rgba(255, 255, 255, 0.14); transition: color 0.35s ease; }
.fx .statement-text .sw.lit { color: var(--text-1); }
.fx .statement-text em .sw.lit { color: var(--accent-text); }

/* Features: each phone arrives turned away and settles upright, facing
   its caption. --p (0..1) per row comes from home-fx.js. */
.fx .feature-row { --p: 0; --side: -1; }
.fx .feature-row:nth-child(even) { --side: 1; }
.fx .feature-phone {
  will-change: transform;
  transform:
    perspective(1800px)
    translateY(calc((1 - var(--p)) * 80px))
    rotateY(calc((1 - var(--p)) * var(--side) * 28deg))
    rotateX(calc((1 - var(--p)) * 12deg))
    scale(calc(0.9 + var(--p) * 0.1));
  opacity: calc(0.25 + var(--p) * 0.75);
  --ex: calc(var(--side) * -0.4);
  --ey: 0.4;
}
@media (max-width: 900px) {
  .fx .feature-row { --side: -1; }
  .fx .feature-row:nth-child(even) { --side: 1; }
  .fx .feature-phone {
    transform:
      perspective(1400px)
      translateY(calc((1 - var(--p)) * 60px))
      rotateY(calc((1 - var(--p)) * var(--side) * 18deg))
      rotateX(calc((1 - var(--p)) * 14deg))
      scale(calc(0.9 + var(--p) * 0.1));
  }
}

/* Fan: phones start stacked and low, spread into a 3D arc. */
.fx .cta-fan { --f: 0; perspective: 1800px; }
.fx .fan-phone {
  filter: brightness(calc(1 - var(--ak) * var(--f) * 0.22));
  --ex: calc(var(--k) * 0.5);
  --ey: 0.4;
  transform:
    translateX(calc(var(--k) * var(--f) * 170px))
    translateY(calc((1 - var(--f)) * 160px + var(--ak) * var(--f) * 34px))
    translateZ(calc(var(--ak) * var(--f) * -140px))
    rotateY(calc(var(--k) * var(--f) * -22deg))
    rotateZ(calc(var(--k) * var(--f) * 3deg));
}
@media (max-width: 900px) {
  .fx .fan-phone {
    transform:
      translateX(calc(var(--k) * var(--f) * 74px))
      translateY(calc((1 - var(--f)) * 110px + var(--ak) * var(--f) * 20px))
      translateZ(calc(var(--ak) * var(--f) * -90px))
      rotateY(calc(var(--k) * var(--f) * -22deg));
  }
}

/* Reveal on scroll: a slow fade up. */
.fx [data-reveal] {
  opacity: 0;
  translate: 0 32px;
  transition:
    opacity 1.1s cubic-bezier(0.2, 0.7, 0.2, 1),
    translate 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 110ms);
}
.fx [data-reveal].in { opacity: 1; translate: 0 0; }
