/* Layout: centred hero lock-up → fanned hand of app screens → dark "bottom sheet" story → glass checklist → download footer */
:root {
  --red: #EF7070;
  --coral: #E96868;
  --red-deep: #D65A5A;
  --blush: #FFC1C1;
  --mist: #E0D4D4;
  --dusk: #B69A9A;
  --ink: #2D2D2D;
  --ink-2: #232323;
  --white: #FFFFFF;
  --on-red-2: rgba(255, 255, 255, 0.84);
  --on-ink-2: #CFC4C4;
  --lime: #D6FBA6;
  --teal: #6ED9C9;
  --butter: #F2EE9A;
  --glass: rgba(255, 255, 255, 0.14);
  --glass-line: rgba(255, 255, 255, 0.34);

  --font: "Quicksand", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  --track: 0.01em;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  --radius-lg: 28px;
  --radius-md: 20px;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: var(--track);
  color: var(--white);
  background: var(--red);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: var(--track);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; line-height: 1.6; }

a { color: inherit; }

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

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

/* ---------- Sticky corner controls (no bar) ---------- */
.corner {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  pointer-events: none;
}
.corner > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.375rem;
  padding: 12px 22px 12px 18px;
  border-radius: 999px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
}
.brand img { width: 15px; height: auto; }

.is-scrolled .brand {
  background: rgba(45, 45, 45, 0.28);
  border-color: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.corner-stores {
  display: flex;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}
.corner-stores.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

/* ---------- Hero ---------- */
.hero-zone {
  position: relative;
  overflow-x: clip;
  background:
    radial-gradient(60% 22% at 50% 9%, rgba(255, 193, 193, 0.55) 0%, rgba(255, 193, 193, 0) 70%),
    radial-gradient(55% 20% at 50% 42%, rgba(255, 193, 193, 0.35) 0%, rgba(255, 193, 193, 0) 70%),
    radial-gradient(40% 18% at 18% 78%, rgba(255, 193, 193, 0.45) 0%, rgba(255, 193, 193, 0) 70%),
    radial-gradient(40% 18% at 85% 88%, rgba(214, 90, 90, 0.7) 0%, rgba(214, 90, 90, 0) 70%),
    linear-gradient(180deg, var(--coral) 0%, var(--red) 40%, var(--red) 100%);
}
.hero {
  position: relative;
  padding-top: clamp(104px, 14vh, 140px);
}

.hero-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.app-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 30px rgba(140, 30, 30, 0.18);
}
.app-badge img { width: 34px; height: auto; }

.hero h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.hero h1 .wordmark {
  height: clamp(38px, 5.8vw, 60px);
  width: auto;
}
.hero h1 .sub {
  display: block;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 500;
  margin-top: 18px;
  color: var(--on-red-2);
}

.tagline {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600;
  margin-top: 6px;
}
.tagline .eq { color: var(--blush); }

.hero .lede {
  max-width: 46em;
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  color: var(--on-red-2);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  padding: 10px 18px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--ink);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(80, 10, 10, 0.18);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.store-btn:hover { transform: translateY(-2px); background: #1f1f1f; }
.store-btn svg { width: 22px; height: 22px; flex: none; }
.store-btn span { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.store-btn small { font-size: 0.7rem; color: var(--on-ink-2); }
.store-btn strong { font-size: 1.05rem; }

.store-btn--mini {
  min-width: 0;
  padding: 7px 14px 7px 11px;
  border-radius: 12px;
  gap: 8px;
}
.store-btn--mini svg { width: 18px; height: 18px; }
.store-btn--mini small { font-size: 0.62rem; }
.store-btn--mini strong { font-size: 0.9rem; }

/* ---------- Fanned hand of screens ---------- */
.hand {
  --cw: clamp(100px, 17vw, 220px);
  position: relative;
  height: calc(var(--cw) * 2.95);
  margin-top: clamp(24px, 4vw, 48px);
}

.hand::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  width: min(900px, 120vw);
  height: 70%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 193, 193, 0.5), rgba(255, 193, 193, 0));
  pointer-events: none;
}

.card {
  position: absolute;
  left: 50%;
  top: calc(var(--cw) * 0.42);
  width: var(--cw);
  margin-left: calc(var(--cw) / -2);
  padding: calc(var(--cw) * 0.035);
  border: 0;
  border-radius: calc(var(--cw) * 0.16);
  background: #161618;
  box-shadow:
    0 0 0 1.5px #A9B4C4,
    0 0 0 3px #5E6672,
    0 18px 40px rgba(90, 15, 15, 0.28),
    0 4px 10px rgba(90, 15, 15, 0.18);
  cursor: pointer;
  transform-origin: 50% 100%;
  transition:
    transform 0.55s cubic-bezier(0.22, 1.2, 0.36, 1),
    box-shadow 0.4s ease;
  /* Resting fan for no-JS: driven by --off set inline */
  transform:
    translateX(calc(var(--off) * var(--cw) * 0.6))
    translateY(calc(var(--off) * var(--off) * var(--cw) * 0.045))
    rotate(calc(var(--off) * 6deg));
  z-index: var(--z, 1);
  -webkit-tap-highlight-color: transparent;
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 832 / 1800;
  border-radius: calc(var(--cw) * 0.13);
  pointer-events: none;
  user-select: none;
}

.card.is-active {
  box-shadow:
    0 0 0 1.5px #C3CCD8,
    0 0 0 3px #6A7380,
    0 30px 60px rgba(90, 15, 15, 0.36),
    0 8px 18px rgba(90, 15, 15, 0.2);
}

.card:focus-visible { outline-offset: 6px; border-radius: calc(var(--cw) * 0.16); }

.hand-hint {
  text-align: center;
  font-size: 0.9rem;
  color: var(--on-red-2);
  padding-bottom: 28px;
}

/* ---------- Hooks ---------- */
.hooks {
  position: relative;
  padding-block: clamp(48px, 8vw, 96px);
}
.hooks .wrap { position: relative; z-index: 1; }

.hook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 235, 235, 0.16) 45%, rgba(70, 50, 50, 0.22) 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(44px) saturate(170%) brightness(1.02);
  backdrop-filter: blur(44px) saturate(170%) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15),
    0 20px 44px rgba(120, 20, 20, 0.18);
}

.hook {
  padding: 28px 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.hook-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red-deep);
}
.hook-icon svg { width: 24px; height: 24px; stroke-width: 1.15; }
.hook h3 { font-size: 1.3rem; }
.hook h3, .hook p { text-shadow: 0 1px 2px rgba(110, 20, 20, 0.28); }
.hook p { color: rgba(255, 255, 255, 0.95); }

/* ---------- Dark sheet (about + how it works) ---------- */
.sheet {
  position: relative;
  background: var(--ink);
  border-radius: 40px 40px 0 0;
  padding-block: 18px clamp(64px, 9vw, 112px);
  margin-top: -1px;
  box-shadow: 0 -18px 40px rgba(90, 15, 15, 0.18);
}
.sheet-grabber {
  width: 72px;
  height: 5px;
  border-radius: 3px;
  background: #6B6B6B;
  margin: 0 auto clamp(40px, 6vw, 72px);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.about-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.about h2, .how h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.12; }
.about h2 em, .how h2 em { font-style: normal; color: var(--red); }
.about-copy p { color: var(--on-ink-2); }
.about-copy .lead { color: var(--white); font-size: 1.15rem; }

.mech {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  gap: 12px;
}
.mech li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  color: var(--on-ink-2);
  line-height: 1.55;
}
.mech li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  transform: translateY(-1px);
}

/* Example stat pair, styled like the app's overview cards */
.stat-stack { display: grid; gap: 14px; min-width: 0; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  background: var(--ink-2);
  border-radius: var(--radius-md);
  padding: 18px 18px 20px;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat.target { border-color: var(--lime); }
.stat-label { font-size: 0.9rem; color: var(--on-ink-2); }
.stat-num {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat.target .stat-num { color: var(--lime); }
.stat-note { font-size: 0.78rem; color: var(--on-ink-2); }
.stat-caption { font-size: 0.8rem; color: #9C9292; text-align: right; }

.chat {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(0, 0, 0, 0.25);
}
.chat-avatar img { width: 18px; height: auto; }
.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--red);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 6px;
  padding: 18px 20px;
  color: #6E1717;
  font-size: 1.02rem;
  line-height: 1.5;
}
.chat-bubble b { color: var(--white); font-weight: 700; }
.chat-bubble .hl { color: var(--lime); font-weight: 700; }

/* How it works */
.how {
  margin-top: clamp(72px, 10vw, 128px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.how-head { display: flex; flex-direction: column; gap: 14px; max-width: 40em; }
.how-head p { color: var(--on-ink-2); }

.session {
  background: var(--ink-2);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(239, 112, 112, 0.35);
  box-shadow: 0 0 30px rgba(239, 112, 112, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.session-title { color: var(--lime); font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 500; }

.strip-scroll { overflow-x: auto; }
.strip {
  display: flex;
  min-width: 640px;
  height: 44px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2A2A2A;
}
.strip span { display: grid; place-items: center; position: relative; }
.strip span:first-of-type { border-radius: 8px 0 0 8px; }
.strip span:last-of-type { border-radius: 0 8px 8px 0; }
.strip-scroll { padding-block: 8px; overflow-y: hidden; }
.seg-intro { background: var(--red); flex: 3; }
.seg-wu, .seg-cd { background: var(--teal); flex: 5; }
.seg-beat { background: var(--lime); flex: 5; }
.seg-free { background: var(--butter); flex: 3; }

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.legend-item {
  border: 1px solid rgba(239, 112, 112, 0.55);
  border-radius: 16px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}
.legend-item svg { width: 22px; height: 22px; color: var(--lime); margin-top: 1px; }
.legend-item h3 { font-size: 1rem; color: var(--lime); margin-bottom: 4px; }
.legend-item p { font-size: 0.92rem; color: var(--on-ink-2); line-height: 1.5; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--ink-2);
  border-radius: var(--radius-md);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.steps li::before {
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.steps h3 { font-size: 1.1rem; }
.steps p { color: var(--on-ink-2); font-size: 0.95rem; }

.pull {
  margin-top: clamp(40px, 6vw, 64px);
  text-align: center;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}
.pull span { color: var(--red); }

/* ---------- Included ---------- */
.included {
  background:
    radial-gradient(50% 60% at 80% 20%, rgba(255, 193, 193, 0.45), rgba(255, 193, 193, 0) 70%),
    linear-gradient(180deg, var(--coral), var(--red));
  padding-block: clamp(56px, 8vw, 104px);
}
.included-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.included h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.12; }
.included-intro { display: flex; flex-direction: column; gap: 14px; }
.included-intro p { color: var(--on-red-2); }
.included .eyebrow { color: var(--white); opacity: 0.85; }

.checklist {
  list-style: none;
  margin: 0;
  padding: clamp(22px, 3vw, 34px);
  display: grid;
  gap: 16px;
}
.checklist li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  line-height: 1.5;
}
.tick {
  width: 28px;
  height: 28px;
  color: var(--white);
  display: grid;
  place-items: center;
}
.tick svg { width: 26px; height: 26px; }

/* ---------- Download / footer ---------- */
.download {
  background: var(--ink);
  padding-block: clamp(64px, 9vw, 112px) 28px;
}
.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.download h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.download .lede { color: var(--on-ink-2); max-width: 30em; }
.download .store-btn { background: var(--red); border-color: rgba(255, 255, 255, 0.2); box-shadow: none; }
.download .store-btn:hover { background: var(--coral); }
.download .store-btn small { color: rgba(255, 255, 255, 0.85); }

.strava {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.strava img { width: 116px; height: auto; }
.strava p { font-size: 0.82rem; color: #9C9292; max-width: 34em; }

.footer {
  margin-top: clamp(56px, 8vw, 88px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 24px;
  font-size: 0.88rem;
  color: #A89E9E;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hook-grid { grid-template-columns: minmax(0, 1fr); }
  .about, .included-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .legend { grid-template-columns: minmax(0, 1fr); }
  .brand span { display: none; }
  .brand { padding: 13px 15px; }
  .store-btn--mini { padding: 6px 10px 6px 8px; }
  .store-btn--mini small { display: none; }
  .sheet { border-radius: 28px 28px 0 0; }
  .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .store-btn, .corner-stores { transition: none; }
}

/* Frosted grain over glass */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Line break in the hero sentence on wide screens only */
@media (max-width: 760px) { .br-wide { display: none; } }

/* ---------- Example plan: message then cards ---------- */
.chat-col { position: relative; min-width: 0; }
.typing {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 18px 18px 18px 6px;
  background: var(--red);
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 0 100%;
  pointer-events: none;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  animation: typing-dot 1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Hidden start state only applies once JS has armed the sequence */
.anim-armed .chat-avatar,
.anim-armed .chat-bubble { opacity: 0; transform: scale(0.4) translateY(12px); }
.anim-armed .chat-bubble { transform-origin: 0 100%; }
.anim-armed .stat,
.anim-armed .stat-caption { opacity: 0; transform: translateY(26px) scale(0.94); }

.anim-armed.is-typing .typing { opacity: 1; transform: none; transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.anim-armed.is-typing .chat-avatar { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

.anim-armed.is-sent .typing { opacity: 0; transform: scale(0.6); transition: opacity 0.15s ease, transform 0.15s ease; }
.anim-armed.is-sent .chat-avatar,
.anim-armed.is-sent .chat-bubble { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

.anim-armed.is-cards .stat,
.anim-armed.is-cards .stat-caption { opacity: 1; transform: none; transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1); }
.anim-armed.is-cards .stat:nth-child(2) { transition-delay: 0.22s; }
.anim-armed.is-cards .stat-caption { transition-delay: 0.5s; }

.stat.target.glow { animation: target-glow 1.2s ease-out 1; }
@keyframes target-glow {
  0% { box-shadow: 0 0 0 0 rgba(214, 251, 166, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(214, 251, 166, 0); }
}

/* Back to top */
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--white);
  transition: background-color 0.2s ease;
}
.to-top:hover { background: rgba(255, 255, 255, 0.08); }
.to-top svg { width: 16px; height: 16px; }
.footer { align-items: center; }
.footer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

@media (prefers-reduced-motion: reduce) {
  .typing span, .stat.target.glow { animation: none; }
}

/* ---------- Beat pulse: soft rings at 164 steps per minute ---------- */
.app-badge--pulse { position: relative; --beat: 0.6s; }
.app-badge--pulse::before,
.app-badge--pulse::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  animation: beat-ring calc(var(--beat) * 2) cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.app-badge--pulse::after { animation-delay: var(--beat); }
@keyframes beat-ring {
  0% { transform: scale(1); opacity: 0.45; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- Session playhead ---------- */
.strip { position: relative; }
.strip span { transition: opacity 0.25s ease, filter 0.25s ease; }
.strip.is-playing span { opacity: 0.45; }
.strip.is-playing span.is-live { opacity: 1; }
.strip.is-playing .seg-beat.is-live {
  z-index: 1;
  border-radius: 0;
  animation: beat-pulse calc(60s / 100) cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
@keyframes beat-pulse {
  0% { transform: scale(1.12); box-shadow: 0 0 0 0 rgba(214, 251, 166, 0.5); }
  60% { transform: scale(1); box-shadow: 0 0 0 8px rgba(214, 251, 166, 0); }
  100% { transform: scale(1); }
}
.playhead { z-index: 2; }
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  margin-left: -1.5px;
  background: var(--white);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.strip.is-playing .playhead { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .app-badge--pulse::before, .app-badge--pulse::after { animation: none; }
  .playhead { display: none; }
}

/* Deal-in start state (JS only, so the fan still shows without scripts) */
@media (prefers-reduced-motion: no-preference) {
  html.js .card { transform: translateY(40px) scale(0.9); }
}

/* ---------- Official store badges (do not recolour or alter) ---------- */
.store-row { gap: 14px; }
.badge-link {
  display: inline-block;
  border-radius: 10px;
  transition: transform 0.2s ease;
}
.badge-link:hover { transform: translateY(-2px); }
.badge-link img { height: 48px; width: auto; }
.badge-link--mini img { height: 40px; }
.corner-stores { gap: 10px; }
@media (max-width: 640px) {
  .badge-link img { height: 44px; }
  .badge-link--mini img { height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .badge-link { transition: none; } }

/* Sticky header fade: appears once scrolling starts */
.corner::before {
  content: "";
  position: absolute;
  inset: calc(-1 * env(safe-area-inset-top, 0px)) 0 -28px 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(35, 32, 32, 0.6) 0%, rgba(35, 32, 32, 0.26) 55%, rgba(35, 32, 32, 0) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.corner.show-fade::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .corner::before { transition: none; } }

/* ---------- Mobile spacing and larger phone fan ---------- */
@media (max-width: 640px) {
  :root { --gutter: 24px; }

  .hand {
    --cw: clamp(124px, 34vw, 168px);
    margin-top: 48px;
    margin-bottom: 24px;
  }

  .hooks { padding-block: 56px 72px; }
  .hook-grid { gap: 24px; }

  .sheet { padding-block: 18px 88px; }
  .sheet-grabber { margin-bottom: 64px; }
  .about { gap: 56px; }
  .about-copy { gap: 22px; }
  .stat-stack { gap: 18px; }
  .stat-pair { gap: 12px; }

  .how { margin-top: 104px; gap: 36px; }
  .how-head { gap: 18px; }
  .session { gap: 22px; }
  .legend { gap: 16px; }
  .steps { gap: 18px; }
  .pull { margin-top: 64px; }

  .included { padding-block: 88px; }
  .included-grid { gap: 44px; }
  .included-intro { gap: 18px; }
  .checklist { padding: 28px 24px; gap: 22px; }

  .download { padding-block: 88px 28px; }
  .download-inner { gap: 22px; }
}

/* Slightly more air above About Cade on larger screens too */
@media (min-width: 641px) {
  .sheet-grabber { margin-bottom: clamp(56px, 7vw, 88px); }
}

/* Mobile-only line breaks */
.br-mobile { display: none; }
@media (max-width: 640px) { .br-mobile { display: inline; } }

/* ---------- Hero load sequence: icon, wordmark, tagline, intro, badges, phones ---------- */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-fade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes hand-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-lockup > * { animation: hero-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
  /* 1: icon, wordmark and tagline together */
  html.js .hero-lockup > .app-badge,
  html.js .hero-lockup > h1,
  html.js .hero-lockup > .tagline { animation: hero-fade 1.4s cubic-bezier(0.25, 0.8, 0.35, 1) 0.1s both; }
  /* 2: intro sentence */
  html.js .hero-lockup > .lede { animation: hero-fade 1.4s cubic-bezier(0.25, 0.8, 0.35, 1) 0.45s both; }
  /* 3: store badges */
  html.js .hero-lockup > .store-row { animation-delay: 0.75s; }
  /* 4: phones fade in, then deal out */
  html.js .hand { animation: hand-in 0.6s ease 1s both; }
}

/* ---------- Legal pages (privacy policy) ---------- */
.page-legal { background: var(--ink); }
.legal {
  padding-block: clamp(120px, 16vw, 168px) clamp(64px, 9vw, 104px);
}
.legal-inner {
  max-width: 46rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }
.legal-meta { color: #9C9292; font-size: 0.92rem; }
.legal-intro { color: var(--on-ink-2); font-size: 1.08rem; }

.toc {
  margin-top: 18px;
  background: var(--ink-2);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.toc p { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.toc ol {
  margin: 0;
  padding-left: 1.3em;
  columns: 2 14rem;
  column-gap: 32px;
  color: #9C9292;
}
.toc li { padding-block: 4px; break-inside: avoid; }
.toc a { color: var(--on-ink-2); text-decoration: none; }
.toc a:hover { color: var(--white); }

.legal section {
  padding-top: 36px;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 96px;
}
.legal h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.legal section p, .legal section li { color: var(--on-ink-2); line-height: 1.7; }
.legal section ul { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.legal section li::marker { color: var(--red); }
.legal strong { color: var(--white); font-weight: 700; }
.legal a.inline { color: var(--white); text-decoration-color: var(--red); text-underline-offset: 3px; }

.legal-footer { background: var(--ink); padding-bottom: 28px; }
.legal-footer .footer { margin-top: 0; }
.nav-current { color: var(--white); }

/* More breathing room around the hero wordmark */
.hero h1 { margin-block: 10px 6px; }

/* Back link on legal pages */
.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  margin-bottom: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background-color 0.2s ease;
}
.back-link:hover { background: rgba(255, 255, 255, 0.08); }
.back-link svg { width: 16px; height: 16px; }

/* Delete account page */
.legal-callout {
  background: rgba(239, 112, 112, 0.14);
  border: 1px solid rgba(239, 112, 112, 0.45);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  color: var(--white);
  line-height: 1.7;
}
.subject {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}
.mail-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.mail-btn:hover { background: var(--coral); }
.mail-btn svg { width: 18px; height: 18px; }

/* Download section icon: neutral shadow on all screens */
.download .app-badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 30px rgba(0, 0, 0, 0.32), 0 0 28px rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  /* Larger top-left mark, circular frame when scrolled */
  .brand {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .brand img { width: 18px; }

  /* Smaller icon above "Improve your running with Cade" */
  .download .app-badge { width: 77px; height: 77px; }
  .download .app-badge img { width: 27px; }
}

/* Desktop: top-left mark and wordmark 20% larger */
@media (min-width: 641px) {
  .brand { font-size: 1.65rem; gap: 12px; }
  .brand img { width: 18px; }
}
