/* Run4Fun marketing — single stylesheet */

:root {
  --bg: #0F172A;
  --bg-deep: #0A1020;
  --surface: #1E293B;
  --surface-2: #172033;
  --border: #334155;
  --text: #F1F5F9;
  --text-dim: #94A3B8;
  --accent: #06B6D4;
  --accent-hot: #22D3EE;
  --warn: #F59E0B;

  --max-w: 1100px;
  --gutter: 24px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-glow: 0 0 0 1px rgba(6,182,212,.18), 0 12px 40px -8px rgba(6,182,212,.25);

  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-med: 400ms cubic-bezier(.16,1,.3,1);

  --ff-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --ff-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  /* atmospheric layers: subtle hex grid + film grain */
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(6,182,212,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 0%, rgba(34,211,238,.04) 0%, transparent 50%);
}

::selection { background: var(--accent); color: var(--bg); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--accent-hot); }

img, svg, video { max-width: 100%; display: block; }

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- Layout helpers ---------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 112px 0;
  position: relative;
}
.section + .section { padding-top: 0; }
@media (max-width: 720px) {
  .section { padding: 72px 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(34px, 4.4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 18px;
}

.section-lead {
  color: var(--text-dim);
  font-size: clamp(17px, 1.5vw, 19px);
  max-width: 640px;
  margin: 0;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(15, 23, 42, 0.88);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.brand-line {
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a:not(.btn) {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links a.active {
  color: var(--text);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
@media (max-width: 640px) {
  .nav-links a:not(.btn):not(.cta-text) { display: none; }
}

.cta-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent) !important;
  font-weight: 600 !important;
  font-size: 15px;
}
.cta-text:hover { color: var(--accent-hot) !important; }

/* ---------------- Buttons & Play badge ---------------- */
.play-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  transition: transform var(--t-fast), filter var(--t-fast);
}
.play-badge img { width: 200px; height: 60px; }
.play-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.btn:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  color: var(--bg);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

/* ---------------- Hero ---------------- */
.hero {
  min-height: min(720px, calc(100svh - 96px));
  padding: clamp(52px, 8vh, 84px) 0 clamp(52px, 8vh, 80px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,16,32,.94) 0%, rgba(10,16,32,.78) 38%, rgba(10,16,32,.18) 72%, rgba(10,16,32,.38) 100%),
    linear-gradient(180deg, rgba(10,16,32,.18) 0%, rgba(10,16,32,.72) 100%);
  pointer-events: none;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
  z-index: -1;
}
.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-content {
  position: relative;
}
.hero-copy {
  max-width: 560px;
}
@media (max-width: 720px) {
  .hero {
    min-height: min(560px, calc(100svh - 96px));
    padding: 48px 0 44px;
    align-items: flex-end;
  }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(10,16,32,.22) 0%, rgba(10,16,32,.72) 42%, rgba(10,16,32,.96) 100%),
      linear-gradient(90deg, rgba(10,16,32,.7) 0%, rgba(10,16,32,.22) 100%);
  }
  .hero-image {
    object-position: center top;
  }
  .hero-copy {
    max-width: 460px;
  }
  .hero-cta {
    margin-bottom: 0;
  }
  .hero-meta {
    display: none;
  }
}

.hero-headline {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(42px, 5.3vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}
.hero-headline .accent { color: var(--accent); }

.hero-body {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 0 28px;
}
.hero-body strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hero-cta .play-badge {
  box-shadow: 0 10px 26px rgba(0,0,0,.35), 0 0 0 1px rgba(34,211,238,.2);
}
.hero-meta {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.video-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-glow);
  aspect-ratio: 4 / 3;
}
.video-frame::after {
  /* soft inner border */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(6,182,212,.25);
  pointer-events: none;
}
.video-frame video,
.video-frame .video-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(6,182,212,.18), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--bg-deep));
  color: var(--accent);
  font-family: var(--ff-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
}
.video-placeholder::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(6,182,212,.35);
  border-radius: calc(var(--radius-lg) - 8px);
}

/* ---------------- How It Works ---------------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
}
@media (max-width: 900px) {
  .how-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  display: flex;
  flex-direction: column;
}
.how-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6,182,212,.4);
  box-shadow: var(--shadow-1);
}
.how-card .video-frame {
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: 4 / 3;
}
.how-card .video-frame::after { border: 0; }
.how-card-body {
  padding: 24px;
}
.card-num {
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.card-num::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: 0.4;
}
.card-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.card-body {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------------- AI Coach ---------------- */
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .ai-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .ai-grid .video-frame { order: -1; }
}
.ai-body {
  color: var(--text-dim);
  font-size: clamp(16px, 1.4vw, 18px);
  max-width: 480px;
}
.ai-body strong { color: var(--text); font-weight: 600; }
/* The source render is square (480×480) and contains a speech bubble near
   the top of the canvas — keep the frame square so nothing gets cropped. */
.ai-video.video-frame { aspect-ratio: 1 / 1; }
.ai-video.video-frame video { object-fit: contain; background: var(--bg-deep); }

/* ---------------- Social Hook ---------------- */
.social-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 48px;
}
@media (max-width: 720px) {
  .social-grid { grid-template-columns: minmax(0, 1fr); }
}
.screenshot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, var(--surface-2), var(--bg-deep)),
    var(--surface);
}
.screenshot::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(6,182,212,.25);
  border-radius: calc(var(--radius) - 6px);
}
.screenshot-label {
  position: relative;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 16px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(6,182,212,.35);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ---------------- iOS Waitlist ---------------- */
.waitlist {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg-deep) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.waitlist-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
}
.waitlist-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 32px;
  width: 56px; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.waitlist-card .eyebrow { justify-content: center; }
.waitlist-form {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.waitlist-form input[type="email"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--text);
  font: inherit;
  padding: 14px 18px;
  border-radius: 999px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.waitlist-form input[type="email"]:focus-visible {
  border-color: var(--accent-hot);
  box-shadow: 0 0 0 3px rgba(34,211,238,.25);
  outline: none;
}
.waitlist-form input[type="email"]::placeholder { color: var(--text-dim); }
@media (max-width: 540px) {
  .waitlist-form { flex-direction: column; }
}

.waitlist-success {
  display: none;
  margin-top: 24px;
  color: var(--accent-hot);
  font-weight: 600;
  font-family: var(--ff-display);
  font-size: 17px;
}
.waitlist-success.visible { display: block; }

/* ---------------- FAQ ---------------- */
.faq-list {
  margin-top: 48px;
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.faq-item[open] { border-color: rgba(6,182,212,.4); }
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
  transition: transform var(--t-fast);
  line-height: 1;
}
.faq-item[open] > summary::after { content: "−"; transform: rotate(0); }
.faq-item-body {
  padding: 0 24px 24px;
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 720px;
}

/* ---------------- Closing CTA ---------------- */
.closing {
  text-align: center;
  padding: 128px 0;
  position: relative;
}
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6,182,212,.08) 0%, transparent 60%);
  pointer-events: none;
}
.closing-line {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 36px;
  position: relative;
}
.closing-meta {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
  color: var(--text-dim);
  font-size: 14px;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: var(--text-dim);
}
.footer-links a:hover { color: var(--accent); }

/* ---------------- Reveal animation ----------------
   The hidden start state only applies when JS is available
   (the inline boot script adds .js-enabled). Without JS,
   everything is visible — no FOUC, no stuck invisible content. */
.js-enabled .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-med), transform var(--t-med);
  will-change: opacity, transform;
}
.js-enabled .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Hero entrance — pure CSS animation, runs on page load.
   Independent of JS / IntersectionObserver so the hero is never
   invisibly stuck waiting for the observer to fire. */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero-in {
  animation: heroIn 600ms cubic-bezier(.16,1,.3,1) both;
}
.hero-in--1 { animation-delay: 60ms; }
.hero-in--2 { animation-delay: 180ms; }
.hero-in--3 { animation-delay: 300ms; }
.hero-in--4 { animation-delay: 440ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-in {
    animation: none !important;
  }
  .btn, .play-badge, .how-card { transition: none !important; }
}

/* ---------------- Legal pages ---------------- */
.legal-main {
  padding: 64px 0 96px;
}
.legal-main h1 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.legal-main p { color: var(--text-dim); max-width: 720px; }
.legal-main .placeholder {
  margin-top: 32px;
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.legal-main .placeholder strong { color: var(--accent); }

/* Long-form legal content (Terms of Service, Privacy Policy). */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
  /* Override .container's auto-centering width — we want a narrower reading column. */
}
.legal-content .legal-meta {
  margin: 0 0 28px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.legal-content .lede {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--text);
  margin: 0 0 40px;
  padding: 20px 22px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: none;
}
/* Inline warning callout — irreversibility, consent withdrawal limits, etc.
   Uses the warn amber accent so it visually separates from the lede's cyan. */
.legal-content .legal-callout {
  margin: 8px 0 14px;
  padding: 16px 20px;
  color: var(--text);
  background: var(--surface);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.6;
  max-width: none;
}
.legal-content .legal-callout strong { color: var(--warn); }
.legal-content section {
  margin: 0 0 36px;
  scroll-margin-top: 96px; /* keeps anchored headings clear of the sticky header */
}
.legal-content section:target h2 {
  /* subtle highlight when the URL points at a specific clause */
  color: var(--accent);
}
.legal-content h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(20px, 2vw, 24px);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--text);
}
.legal-content h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 24px 0 8px;
  color: var(--accent);
}
.legal-content h3:first-of-type {
  margin-top: 16px;
}
.legal-content p {
  margin: 0 0 14px;
  color: var(--text-dim);
  max-width: none;
  line-height: 1.65;
}
.legal-content p strong { color: var(--text); font-weight: 600; }
.legal-content em { color: var(--text); font-style: normal; font-weight: 500; }
.legal-content ul {
  margin: 4px 0 18px;
  padding-left: 22px;
  color: var(--text-dim);
}
.legal-content li {
  margin: 6px 0;
  line-height: 1.6;
}
.legal-content li::marker { color: var(--accent); }
.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(6,182,212,.45);
  text-underline-offset: 2px;
}
.legal-content a:hover { color: var(--accent-hot); text-decoration-color: currentColor; }

/* Tables inside legal content (Privacy Policy: processors, retention). */
.legal-content .legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal-content .legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  color: var(--text);
}
.legal-content .legal-table th,
.legal-content .legal-table td {
  text-align: left;
  padding: 12px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.legal-content .legal-table thead th {
  background: var(--surface-2);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom-color: var(--border);
}
.legal-content .legal-table tbody tr:last-child th,
.legal-content .legal-table tbody tr:last-child td {
  border-bottom: 0;
}
.legal-content .legal-table tbody td {
  color: var(--text-dim);
  line-height: 1.55;
}
.legal-content .legal-table tbody td:first-child {
  color: var(--text);
  font-weight: 500;
}
/* Retention table has two columns with similar weight — give them a fair split.
   Processors table has three columns and falls back to auto layout. */
.legal-content .legal-table tbody tr td:first-child:nth-last-child(2) { width: 60%; }
@media (max-width: 540px) {
  .legal-content .legal-table th,
  .legal-content .legal-table td { padding: 10px 12px; font-size: 13.5px; }
}
