/* Kardiacs — marketing site
   Brand tokens lifted straight from the app's Assets.xcassets (dark-mode
   values): pulseTeal, sprintCoral, streakGold, kardiacCrimson, rideBackground,
   rideCard — so this reads as the same product as the phone app. */
:root {
  --bg: #15151a;
  --bg-elevated: #1a1a20;
  --card: #1e1e24;
  --card-alt: #2c2c34;
  --border: #3c3c46;
  --border-soft: rgba(255, 255, 255, 0.08);

  --text-primary: #faf6f1;
  --text-secondary: #9a9aa5;
  --text-tertiary: #6e6e78;

  --teal: #0e9594;
  --teal-light: #4fc3c1;
  --coral: #ff7a5c;
  --coral-light: #ff8f75;
  --gold: #f5a623;
  --gold-light: #ffbe4d;
  --crimson: #c0392b;
  --crimson-light: #d9594b;

  --action: var(--teal-light);
  --energy: var(--coral-light);
  --reward: var(--gold-light);

  /* "Ink" variants — used wherever an accent color sits as small text or an
     icon glyph on a pale tinted chip (eyebrow, check marks, feature icons)
     rather than as a solid button/gradient background. In dark mode these
     are identical to the bright "-light" hues already used everywhere; in
     light mode (see [data-theme="light"] below) they swap to genuinely dark
     shades so that text stays readable on a light page instead of washing
     out. Buttons and gradients intentionally keep using --teal/--teal-light
     etc. directly, unaffected by theme. */
  --teal-ink: var(--teal-light);
  --coral-ink: var(--coral-light);
  --gold-ink: var(--gold-light);
  --crimson-ink: var(--crimson-light);

  /* Translucent sticky-nav background — kept separate from --bg because it
     needs its own alpha for the backdrop-filter blur; swaps per theme below. */
  --nav-bg: rgba(21, 21, 26, 0.82);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", ui-rounded, "Segoe UI",
    Roboto, system-ui, sans-serif;

  --max-width: 1160px;

  color-scheme: dark;
}

/* ── Light theme ─────────────────────────────────────────────────────────
   Same brand hues (--teal, --coral, --gold, --crimson and their "-light"
   variants) stay constant across themes — only the page's own surface and
   text tokens flip, plus the four "-ink" tokens above swap to dark shades so
   accent text/icons keep working on a light page. Toggled via a `data-theme`
   attribute on <html> (see js/main.js); defaults to the OS's preference on
   first visit. */
html[data-theme="light"] {
  --bg: #faf6f1;
  --bg-elevated: #f1eae0;
  --card: #ffffff;
  --card-alt: #f3ece2;
  --border: #e5ded5;
  --border-soft: rgba(44, 44, 52, 0.08);

  --text-primary: #2c2c34;
  --text-secondary: #6b6258;
  --text-tertiary: #756b5f;

  --teal-ink: #062e2a;
  --coral-ink: #7a2e17;
  --gold-ink: #6b4207;
  --crimson-ink: #6a1f16;

  --nav-bg: rgba(250, 246, 241, 0.82);

  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}
::selection {
  background: var(--teal);
  color: white;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-ink);
  background: rgba(79, 195, 193, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: #06201f;
}
.btn-primary:hover {
  opacity: 0.92;
}
.btn-ghost {
  background: var(--card-alt);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: #34343d;
}
.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 13px 10px;
}
.btn-text:hover {
  color: var(--text-primary);
}
.btn-sm {
  padding: 9px 16px;
  font-size: 13.5px;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15.5px;
}
/* The app's own mark, served from the same file the tab icon uses — one
   drawing, generated once, rather than a letter in a box that has to be kept
   looking like it. The SVG carries its own background and corner radius. */
.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a.link {
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
}
.nav-links a.link:hover {
  color: var(--text-primary);
  background: var(--card-alt);
}
.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

/* ── Theme toggle ────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--card-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
}
.theme-toggle:hover {
  background: #34343d;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}
/* Dark mode (default): show a sun (click to switch to light). */
html:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: block;
}
/* Light mode: show a moon (click to switch to dark). */
html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}
html[data-theme="light"] .theme-toggle:hover {
  background: #e5ded5;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
  background: radial-gradient(760px 420px at 12% -10%, rgba(79, 195, 193, 0.16), transparent),
    radial-gradient(700px 420px at 100% 0%, rgba(255, 143, 117, 0.12), transparent);
}
.hero-inner {
  max-width: 720px;
}
.hero h1 {
  font-size: 52px;
  line-height: 1.08;
  margin: 20px 0 20px;
}
.hero p.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 32px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.hero-fineprint {
  font-size: 13px;
  color: var(--text-tertiary);
}
.hero-fineprint b {
  color: var(--text-secondary);
}

/* ── Free-to-use strip ───────────────────────────────────────────────── */
.strip {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  padding: 16px 0;
}
.strip .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-secondary);
}
.strip b {
  color: var(--text-primary);
}
.strip .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

/* ── Sections ────────────────────────────────────────────────────────── */
section {
  padding: 88px 0;
}
.section-head {
  max-width: 620px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-head h2 {
  font-size: 34px;
  margin: 14px 0 12px;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ── Feature grid ────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
}
.feature-card h3 {
  font-size: 16.5px;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13.75px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Screenshot showcase ─────────────────────────────────────────────── */
.show-row {
  display: flex;
  align-items: center;
  gap: 64px;
  margin-bottom: 96px;
}
.show-row:last-child {
  margin-bottom: 0;
}
.show-row.reverse {
  flex-direction: row-reverse;
}
.show-media {
  flex: 0 0 44%;
  display: flex;
  gap: 16px;
}
.show-media:not(.two-up) {
  justify-content: center;
}
.show-media.two-up .show-shot {
  flex: 1 1 0;
  min-width: 0;
}
.show-media:not(.two-up) .show-shot {
  max-width: 320px;
}
.show-shot {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.5);
  background: var(--card);
}
.show-shot img {
  width: 100%;
  display: block;
}
/* The Apple Watch shots are small and near-square, so a row of five reads
   better than the phone layout's one-or-two tall portraits. */
.show-media.watch-strip {
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.show-media.watch-strip .watch-shot {
  flex: 0 0 calc(33.333% - 8px);
  border-radius: 14px;
}
.show-text {
  flex: 1 1 0;
  min-width: 0;
}
.show-text .eyebrow {
  margin-bottom: 4px;
}
.show-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 14px 0 14px;
}
.show-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 460px;
}

@media (max-width: 900px) {
  .show-row,
  .show-row.reverse {
    flex-direction: column;
    gap: 24px;
    margin-bottom: 64px;
  }
  .show-media {
    flex: none;
    width: 100%;
  }
  .show-media:not(.two-up) .show-shot {
    max-width: 280px;
  }
  .show-media.watch-strip .watch-shot {
    max-width: none;
    flex-basis: calc(33.333% - 8px);
  }
  .show-title {
    font-size: 24px;
  }
  .show-desc {
    max-width: none;
  }
}
@media (max-width: 520px) {
  .show-media.two-up {
    gap: 10px;
  }
}

/* ── Steps ───────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  position: relative;
  padding: 8px 8px 8px 0;
}
.step-num {
  font-size: 13px;
  font-weight: 800;
  color: #06201f;
  background: var(--teal-light);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.step h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.step p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Platforms ───────────────────────────────────────────────────────── */
.platform-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.platform-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  font-size: 14px;
  font-weight: 600;
}
.platform-pill.platform-soon {
  border-style: dashed;
  color: var(--text-secondary);
}
.soon-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gold-ink);
}

/* ── About ───────────────────────────────────────────────────────────── */
.about-card {
  display: flex;
  gap: 32px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 820px;
  margin: 0 auto;
}
.about-avatar {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: #06201f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
}
.about-body {
  min-width: 0;
}
.about-name {
  font-size: 19px;
  font-weight: 800;
}
.about-role {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 4px 0 18px;
}
.about-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}
.about-body p:last-child {
  margin-bottom: 0;
}
.about-body a {
  color: var(--teal-ink);
  font-weight: 600;
}

@media (max-width: 640px) {
  .about-card {
    flex-direction: column;
    padding: 28px;
    gap: 18px;
  }
}

/* ── CTA banner ──────────────────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, rgba(14, 149, 148, 0.16), rgba(255, 143, 117, 0.1));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
}
.cta-banner h2 {
  font-size: 30px;
  margin-bottom: 14px;
}
.cta-banner p {
  color: var(--text-secondary);
  font-size: 15.5px;
  max-width: 480px;
  margin: 0 auto 28px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-soft);
  padding: 52px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  font-size: 13.75px;
  color: var(--text-secondary);
  padding: 6px 0;
}
.footer-col a:hover {
  color: var(--text-primary);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
  padding-top: 24px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ── Reveal-on-scroll ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .feature-grid,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .nav-links,
  .nav-cta .btn-ghost {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 36px;
  }
  .feature-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
