/* ===========================================================================
   HRV — front page (landing) styles
   ---------------------------------------------------------------------------
   Built directly on the app's visual language (see docs/design-analysis.md):
   same dark palette, same tokens, same card construction, same system font.
   The signature breathing circle from the session view is reused here as the
   hero — recreated as a self-contained CSS animation (no JS, no BLE) so the
   landing page is a single static template.
   =========================================================================== */

:root {
  --bg: #0e0f12;
  --bg-card: #181a1f;
  --bg-card-hover: #1f2229;
  --fg: #e8e9ec;
  --fg-muted: #8a8f99;
  --accent: #6fa8ff;
  --accent-strong: #4a8aff;
  --danger: #ff6b6b;
  --success: #5dd39e;
  --gold: #ffa84d;
  --gold-soft: #ffd089;
  --border: #2a2d35;
  --hero-size: min(340px, 64vmin);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* --- Accessibility helpers ------------------------------------------------ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: 0; left: 0; z-index: 1000;
  transform: translateY(-110%);
  padding: 10px 16px; background: var(--accent); color: #0c1119;
  font-weight: 600; border-radius: 0 0 8px 0;
  transition: transform 150ms ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ---- Buttons (mirrors app .btn / .btn-primary / .btn-secondary) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--bg-card-hover);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: #262932; border-color: #383b45; }
.btn-primary {
  background: var(--accent);
  color: #0c1119;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ===========================================================================
   NAV
   =========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  max-width: 960px;
  margin: 0 auto;
  background: rgba(14, 15, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5b8dff 0%, #3a6bd9 55%, #1f3f8a 100%);
  box-shadow: 0 0 14px rgba(91, 141, 255, 0.55);
}
.nav-links { display: inline-flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--fg-muted);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: color 120ms ease, background 120ms ease;
}
.nav-link:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }

/* ===========================================================================
   HERO
   =========================================================================== */
.hero {
  text-align: center;
  padding: 40px 24px 24px;
  max-width: 760px;
  margin: 0 auto;
}
.hero-stage {
  position: relative;
  width: var(--hero-size);
  height: var(--hero-size);
  margin: 8px auto 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.2;
}
/* The breath circle — same gradient + glow as the app's .pacer-circle, here
   animated on a slow ~11s resonance-paced loop. */
.hero-breath {
  width: var(--hero-size);
  height: var(--hero-size);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5b8dff 0%, #3a6bd9 55%, #1f3f8a 100%);
  box-shadow: 0 0 80px rgba(91, 141, 255, 0.4), inset 0 0 40px rgba(255, 255, 255, 0.1);
  transform: scale(0.18);
  animation: breathe 11s ease-in-out infinite;
}
@keyframes breathe {
  0%   { transform: scale(0.18); }
  45%  { transform: scale(1); }
  55%  { transform: scale(1); }
  100% { transform: scale(0.18); }
}
/* Inhale / exhale captions crossfade in sync with the breath. */
.hero-caption {
  position: absolute;
  bottom: -34px;
  left: 0; right: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
}
.hero-caption span { position: absolute; left: 0; right: 0; }
.cap-in  { animation: capIn 11s ease-in-out infinite; }
.cap-out { animation: capOut 11s ease-in-out infinite; }
@keyframes capIn  { 0%,48% { opacity: 1; } 52%,100% { opacity: 0; } }
@keyframes capOut { 0%,48% { opacity: 0; } 52%,100% { opacity: 1; } }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5.2vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.hero h1 .accent {
  background: linear-gradient(120deg, #6fa8ff, #5b8dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.sub {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg-muted);
}
.hero-cta { display: inline-flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-note {
  margin: 18px auto 0;
  max-width: 520px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.hero-note strong { color: var(--fg); font-weight: 600; }

/* Respect users who don't want motion — freeze the breath mid-inhale. */
@media (prefers-reduced-motion: reduce) {
  .hero-breath { animation: none; transform: scale(0.82); }
  .cap-in { opacity: 1; animation: none; }
  .cap-out { opacity: 0; animation: none; }
}

/* ===========================================================================
   SECTIONS
   =========================================================================== */
section.block { padding: 56px 0; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 8px;
  text-align: center;
}
.block h2 {
  margin: 0 auto 12px;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: center;
}
.block .lede {
  margin: 0 auto 36px;
  max-width: 600px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.55;
}

/* ---- Feature cards (mirrors app .card) ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.feature {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 120ms ease, background 120ms ease;
}
.feature:hover { border-color: #383b45; background: var(--bg-card-hover); }
.feature .ficon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(111, 168, 255, 0.12);
  border: 1px solid rgba(111, 168, 255, 0.3);
  font-size: 18px;
  margin-bottom: 14px;
}
.feature.gold .ficon {
  background: rgba(255, 168, 77, 0.1);
  border-color: rgba(255, 168, 77, 0.35);
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature p { margin: 0; color: var(--fg-muted); font-size: 14px; line-height: 1.55; }
.feature .pill {
  display: inline-block;
  margin-top: 12px;
  font-size: 10px;
  padding: 2px 7px;
  background: linear-gradient(135deg, #ffa84d, #ffc875);
  color: #1a1410;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ---- How it works ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.step {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.step-num {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.step p { margin: 0; color: var(--fg-muted); font-size: 14px; line-height: 1.55; }

/* ---- Science strip ---- */
.science {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}
.science p { margin: 0 auto; max-width: 640px; color: var(--fg-muted); line-height: 1.6; }
.science p strong { color: var(--fg); }
.science .cites {
  margin-top: 14px;
  font-size: 12px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Requirements card ---- */
.requirements {
  background: linear-gradient(180deg, var(--bg-card), rgba(255, 107, 107, 0.03));
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 640px;
  margin: 0 auto;
}
.requirements h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.requirements ul { margin: 0; padding-left: 18px; color: var(--fg-muted); line-height: 1.7; }
.requirements li strong { color: var(--fg); font-weight: 600; }
.requirements .warn { color: var(--danger); font-weight: 600; }

/* ---- Final CTA band ---- */
.cta-band {
  text-align: center;
  padding: 64px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: radial-gradient(120% 100% at 50% 0%, rgba(91, 141, 255, 0.08), transparent 60%);
}
.cta-band h2 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 36px); font-weight: 600; letter-spacing: -0.02em; }
.cta-band p { margin: 0 auto 26px; max-width: 480px; color: var(--fg-muted); font-size: 16px; }

/* ---- Footer ---- */
footer {
  padding: 32px 24px 48px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 13px;
}
footer .brand { justify-content: center; font-size: 15px; margin-bottom: 8px; }

@media (max-width: 600px) {
  .nav { padding: 14px 16px; }
  .wrap { padding: 0 16px; }
  section.block { padding: 44px 0; }
  .hero { padding: 24px 16px 8px; }
}
