/* Ride Blocks marketing site
   Palette sourced directly from Sources/RideBlocksUI/ColorTheme.swift
   (Midnight Blue = dark default, Arctic Blue = light) so the site matches
   the app's real visual identity rather than an invented brand color. */

:root {
  /* Midnight Blue (dark, app default) */
  --bg: #0B0F14;
  --surface: #151B23;
  --surface-secondary: #202833;
  --primary: #0A84FF;
  --accent: #64D2FF;
  --text-primary: #F5F7FA;
  --text-secondary: #9CA8B7;
  --border: #2A3441;
  --success: #30D158;
  --warning: #FFD60A;
  --error: #FF453A;
  --on-primary: #FFFFFF;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .3);

  --header-height: 72px;
  --max-width: 1120px;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Arctic Blue (light, app default) */
    --bg: #F5F7FA;
    --surface: #FFFFFF;
    --surface-secondary: #E9EEF5;
    --primary: #007AFF;
    --accent: #5AC8FA;
    --text-primary: #111827;
    --text-secondary: #667085;
    --border: #D8DEE8;
    --success: #34C759;
    --warning: #FF9F0A;
    --error: #FF3B30;
    --shadow: 0 18px 50px rgba(28, 26, 23, .12);
    --shadow-sm: 0 8px 20px rgba(28, 26, 23, .08);
  }
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

section[id] { scroll-margin-top: var(--header-height); }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.kicker {
  display: block;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .12em;
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.16;
  text-align: center;
}

.section-intro {
  max-width: 720px;
  color: var(--text-secondary);
  margin-top: 14px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.02rem;
  text-align: center;
}

section { padding: 88px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; justify-content: center; }
/* Non-interactive state for a CTA whose destination doesn't exist yet. */
.btn-disabled {
  cursor: default;
  opacity: .78;
  box-shadow: none;
}
.btn-disabled:hover { transform: none; box-shadow: none; }

/* ---------- Header / nav ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .93rem;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
}

/* ---------- Hero ---------- */

.hero { padding: 76px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.hero h1 span { color: var(--accent); }
.hero .lede {
  margin: 20px auto 0;
  max-width: 600px;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--text-secondary);
}
.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.fine-print {
  margin-top: 14px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.hero-visual {
  margin: 64px auto 0;
  max-width: 1100px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .hero-visual { flex-direction: column; align-items: center; }
}

/* Mac app screenshot (image ships with its own window chrome) */
.mac-shot {
  width: 645px;
  max-width: 100%;
}
.mac-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Traffic-light dots (used by the overlay-section window chrome) */
.mac-dot { width: 10px; height: 10px; border-radius: 50%; }
.mac-dot--red { background: #FF5F57; }
.mac-dot--yellow { background: #FEBC2E; }
.mac-dot--green { background: #28C840; }

/* iPhone — real device-frame image (its own bezel, transparent background, no shadow) */
.phone-device {
  width: 220px;
  max-width: 100%;
}
.phone-device img {
  display: block;
  width: 100%;
  height: auto;
}

/* Apple Watch — real device-frame image (its own bezel, transparent background, no shadow) */
.watch-device {
  width: 150px;
  max-width: 100%;
}
.watch-device img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Generic blocks / timeline motif ---------- */

.timeline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 34px;
}
.timeline--sm { height: 18px; }
.block {
  flex: 0 0 var(--block-width, auto);
  height: var(--block-height, 100%);
  background: var(--primary);
  border-radius: 4px;
  transform-origin: left center;
}

/* Zone colors — the app's exact SharedTimelineHelpers.swift ramp,
   Color(hue: 0.14·(1 − norm), saturation: 0.92, brightness: 0.96),
   converted from HSB to sRGB (yellow-green easy → red hard). */
.block[data-zone="warmup"],
.block[data-zone="cooldown"] { background: rgb(245, 166, 20); }
.block[data-zone="recovery"] { background: rgb(245, 178, 20); }
.block[data-zone="endurance"] { background: rgb(245, 142, 20); }
.block[data-zone="tempo"] { background: rgb(245, 98, 20); }
.block[data-zone="subThreshold"] { background: rgb(245, 81, 20); }
.block[data-zone="threshold"] { background: rgb(245, 56, 20); }
.block[data-zone="vo2"] { background: rgb(245, 20, 20); }

.timeline-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: .82rem;
  color: var(--text-secondary);
}

/* ---------- Reveal / scroll animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.hero [data-reveal-eager] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.hero.is-loaded [data-reveal-eager] { opacity: 1; transform: none; }
.hero [data-reveal-eager]:nth-child(1) { transition-delay: 0ms; }
.hero [data-reveal-eager]:nth-child(2) { transition-delay: 80ms; }
.hero [data-reveal-eager]:nth-child(3) { transition-delay: 160ms; }

.timeline.is-visible .block {
  animation: blockGrow .5s ease forwards;
}
.timeline .block:nth-child(1) { animation-delay: 0ms; }
.timeline .block:nth-child(2) { animation-delay: 60ms; }
.timeline .block:nth-child(3) { animation-delay: 120ms; }
.timeline .block:nth-child(4) { animation-delay: 180ms; }
.timeline .block:nth-child(5) { animation-delay: 240ms; }
.timeline .block:nth-child(6) { animation-delay: 300ms; }
@keyframes blockGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .hero [data-reveal-eager] { opacity: 1; transform: none; transition: none; }
  .timeline .block { animation: none !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

noscript [data-reveal], noscript .hero [data-reveal-eager] {
  opacity: 1;
  transform: none;
}

/* ---------- Grid / cards ---------- */

.grid { display: grid; gap: 20px; margin-top: 44px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}
.card__icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 { font-size: 1.06rem; letter-spacing: -.01em; margin-bottom: 8px; }
.card p { font-size: .93rem; color: var(--text-secondary); }
.card p a { color: var(--primary); text-decoration: underline; }

/* ---------- Section 3: fit your life ---------- */

.formula {
  margin-top: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.formula__chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  min-width: 160px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.formula__chip .label { font-size: .76rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.formula__chip .value { font-size: 1.3rem; font-weight: 700; margin-top: 6px; }
.formula__op { font-size: 1.5rem; color: var(--text-secondary); font-weight: 300; }
.formula__result {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--on-primary);
  border-radius: var(--radius-md);
  padding: 18px 26px;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

/* ---------- Section 4: how it works ---------- */

.steps {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.step__num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  margin-bottom: 14px;
}
.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: .88rem; color: var(--text-secondary); }
/* ---------- Section 5: workout purpose ---------- */

.timeline-examples {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.timeline-example__title { font-size: .92rem; font-weight: 600; margin-bottom: 10px; }

.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 32px;
}
.zone-legend__item { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-secondary); }
.zone-legend__swatch { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Section 6: missed workout ---------- */

.week-compare {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 760px) { .week-compare { grid-template-columns: 1fr; } }
.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.week-card__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin-bottom: 14px; }
.week-day {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.week-day:last-child { border-bottom: none; }
.week-day .tag {
  font-size: .74rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
}
.week-day .tag--workout { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--accent); }
.week-day .tag--missed { background: color-mix(in srgb, var(--error) 22%, transparent); color: var(--error); text-decoration: line-through; }
.week-day .tag--adapted { background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.week-arrow {
  font-size: 1.6rem;
  color: var(--text-secondary);
  text-align: center;
}
@media (max-width: 760px) { .week-arrow { transform: rotate(90deg); } }

/* ---------- Section 7: overlay / pip ---------- */

.overlay-pip-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) { .overlay-pip-grid { grid-template-columns: 1fr; } }

.mac-window {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.mac-window__titlebar {
  display: flex; gap: 7px;
  padding: 12px 16px;
  background: var(--surface-secondary);
}
.mac-window__body { position: relative; aspect-ratio: 16 / 10; }

.abstract-video-placeholder {
  position: absolute; inset: 0;
  background-image: url("assets/overlay-video-still.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.abstract-video-placeholder--phone { position: absolute; inset: 0; }

.overlay-shot {
  position: absolute;
  top: 0; right: 0;
  width: 31.5%;
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45));
  opacity: 0;
  transform: translateY(-8px) scale(.96);
  transition: opacity .5s ease .25s, transform .5s ease .25s;
}
.overlay-pip-grid.is-visible .overlay-shot { opacity: .9; transform: none; }
.overlay-pip-grid.is-visible .pip-shot { opacity: 1; transform: none; }

.phone-frame {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 19.5 / 9;
  margin: 0 auto;
  border-radius: 34px;
  border: 6px solid var(--surface-secondary);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.phone-frame__screen { position: absolute; inset: 0; }

.pip-shot {
  position: absolute;
  top: 8px; right: 8px;
  width: 29.4%;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .45));
  opacity: 0;
  transform: translateY(-6px) scale(.96);
  transition: opacity .5s ease .4s, transform .5s ease .4s;
}

.overlay-pip-copy p { color: var(--text-secondary); margin-top: 14px; }
.platform-badges { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.platform-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
}

/* ---------- Section 8: progress ---------- */

/* Progress dashboard screenshot (image ships with its own window chrome;
   transparent outside its rounded corners, so drop-shadow follows that shape). */
.progress-shot {
  margin-top: 48px;
}
.progress-shot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 56px rgba(0, 0, 0, .5));
}

/* ---------- Final CTA ---------- */

.final-cta { text-align: center; }
.final-cta img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 24px; box-shadow: var(--shadow-sm); }
.final-cta h2 { max-width: 560px; margin: 0 auto; }
.final-cta .section-intro { margin-left: auto; margin-right: auto; }
.final-cta .hero-ctas { margin-top: 30px; }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; margin: 44px auto 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  font-size: .98rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-left: 12px;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p {
  padding: 0 0 18px;
  color: var(--text-secondary);
  font-size: .92rem;
  max-width: 640px;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: .84rem;
}
footer a { color: var(--text-secondary); text-decoration: underline; }
footer a:hover { color: var(--text-primary); }

/* ---------- Legal pages (privacy) ---------- */

.legal { padding-top: calc(var(--header-height) + 56px); }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin: 0 0 12px; }
.legal .updated { color: var(--text-secondary); font-size: .88rem; margin: 0 0 40px; }
.legal h2 {
  text-align: left;
  font-size: 1.3rem;
  margin: 44px 0 12px;
}
.legal p { color: var(--text-secondary); margin: 0 0 16px; }
.legal a { color: var(--primary); text-decoration: underline; }
.legal ul {
  list-style: disc;
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--text-secondary);
}
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text-primary); }
.legal .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 0 0 32px;
}
.legal .callout p:last-child { margin-bottom: 0; }
