/* HRV — Health Records Vault */
:root {
  --primary: #2b6cb0;
  --primary-deep: #1f4f85;
  --primary-soft: #e8f0fa;
  --accent: #38a169;
  --accent-soft: #e3f3eb;
  --warn: #c2410c;
  --warn-soft: #fdecdf;

  --ink: oklch(22% 0.03 250);
  --ink-2: oklch(38% 0.025 250);
  --ink-3: oklch(55% 0.02 250);
  --ink-4: oklch(72% 0.015 250);
  --line: oklch(90% 0.008 250);
  --line-2: oklch(94% 0.006 250);
  --bg: oklch(98.8% 0.004 90);
  --bg-2: oklch(96.5% 0.006 240);
  --paper: #ffffff;

  --radius: 14px;
  --radius-sm: 8px;

  --f-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;

  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ——————————— Utility ——————————— */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 600; }
h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 600; letter-spacing: -0.025em; }
h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; color: var(--ink-2); text-wrap: pretty; }

/* ——————————— Nav ——————————— */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
.logo-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--primary); color: white;
  border-radius: 7px;
  font-family: var(--f-mono);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 1px 2px rgba(43,108,176,0.3);
}
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav-links { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 140ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 1px 2px rgba(31,79,133,0.4), 0 4px 14px -4px rgba(43,108,176,0.5);
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-4); }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* ——————————— Hero ——————————— */
.hero {
  position: relative;
  padding-top: clamp(48px, 7vw, 96px);
  padding-bottom: clamp(48px, 6vw, 80px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 .accent { color: var(--primary); font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.hero-sub {
  margin-top: 20px;
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 50ch;
  color: var(--ink-2);
}
.hero-cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 32px;
  display: flex; gap: 24px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 12px;
  color: var(--ink-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ECG line behind hero */
.ecg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}
.ecg svg { width: 100%; height: 100%; }
.ecg path {
  stroke: var(--primary);
  stroke-width: 1.2;
  fill: none;
  opacity: 0.18;
  stroke-dasharray: 6000;
  stroke-dashoffset: 6000;
  animation: drawEcg 6s ease-out forwards;
}
@keyframes drawEcg {
  to { stroke-dashoffset: 0; }
}

/* Hero device mockup */
.device {
  position: relative;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 white inset,
    0 30px 60px -30px rgba(31,79,133,0.25),
    0 12px 24px -12px rgba(31,79,133,0.18);
  overflow: hidden;
}
.device-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(to bottom, oklch(98% 0.004 250), oklch(96% 0.006 250));
}
.device-bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: oklch(88% 0.01 60);
}
.device-bar i:nth-child(1) { background: oklch(80% 0.13 30); }
.device-bar i:nth-child(2) { background: oklch(86% 0.13 80); }
.device-bar i:nth-child(3) { background: oklch(80% 0.14 150); }
.device-bar .url {
  margin-left: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Dashboard inside device */
.dash {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 420px;
  font-size: 12px;
}
.dash-side {
  border-right: 1px solid var(--line-2);
  padding: 16px 12px;
  background: oklch(99% 0.003 250);
}
.dash-side .who {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.dash-side .who.active { background: var(--primary-soft); }
.dash-side .who .av {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: white;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  font-family: var(--f-mono);
}
.dash-side .who .av.green { background: var(--accent); }
.dash-side .who .av.gray { background: oklch(60% 0.02 250); }
.dash-side .who .nm { font-size: 12px; font-weight: 500; }
.dash-side .who .rl { font-size: 10px; color: var(--ink-3); font-family: var(--f-mono); }
.dash-side hr { border: none; border-top: 1px solid var(--line-2); margin: 12px 0; }
.dash-side .nav-i {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  color: var(--ink-2);
  border-radius: 6px;
  font-size: 11px;
}
.dash-side .nav-i.active { color: var(--ink); font-weight: 500; }
.dash-side .nav-i svg { width: 13px; height: 13px; }

.dash-main { padding: 18px; }
.dash-main h4 {
  font-size: 14px; margin-bottom: 4px;
}
.dash-main .subtle { color: var(--ink-3); font-size: 11px; margin-bottom: 16px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi {
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
}
.kpi .lbl { font-family: var(--f-mono); font-size: 9px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi .val { font-size: 18px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 10px; font-family: var(--f-mono); margin-top: 2px; }
.kpi .delta.up { color: var(--warn); }
.kpi .delta.dn { color: var(--accent); }
.kpi.warn { background: var(--warn-soft); border-color: oklch(85% 0.07 50); }
.kpi.ok { background: var(--accent-soft); border-color: oklch(85% 0.06 145); }

/* Trend chart */
.trend {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper);
}
.trend-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.trend-head .ttl { font-size: 12px; font-weight: 500; }
.trend-head .rng { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }
.trend svg { width: 100%; height: 90px; }

/* ——————————— Section base ——————————— */
section { padding-block: clamp(64px, 8vw, 112px); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head h2 { max-width: 22ch; }
.section-head .lede { max-width: 44ch; color: var(--ink-2); }

/* ——————————— Problem ——————————— */
.problems {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
}
@media (max-width: 820px) { .problems { grid-template-columns: 1fr; } }
.problem {
  background: var(--paper);
  padding: 32px 28px;
}
.problem .num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.problem .gly {
  margin: 16px 0 20px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.problem .gly svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.5; }
.problem h3 { margin-bottom: 8px; }
.problem p { font-size: 14px; }

/* ——————————— Features ——————————— */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 920px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: all 200ms ease;
}
.feature:hover {
  border-color: var(--ink-4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -18px rgba(31,79,133,0.18);
}
.feature.hero-feature {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: white;
  grid-column: span 1;
  border-color: transparent;
}
.feature.hero-feature p, .feature.hero-feature .ftag { color: rgba(255,255,255,0.78); }
@media (min-width: 920px) {
  .feature.hero-feature { grid-row: span 2; padding: 32px; }
}
.feature .ftag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.feature .gly {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  margin: 14px 0 18px;
}
.feature .gly svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 1.5; }
.feature.hero-feature .gly { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.feature.hero-feature .gly svg { stroke: white; }
.feature h3 { margin-bottom: 8px; }
.feature p { font-size: 14px; }

.feature .preview {
  margin-top: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.9);
}
.feature .preview .row { display: flex; justify-content: space-between; padding: 4px 0; }
.feature .preview .row + .row { border-top: 1px dashed rgba(255,255,255,0.15); }
.feature .preview .v { color: white; }
.feature .preview .v.warn { color: oklch(88% 0.13 60); }

/* ——————————— How it works ——————————— */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  padding: 32px 28px 32px 0;
  position: relative;
  border-top: 1px solid var(--line);
}
.step::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 40px;
  height: 1px;
  background: var(--primary);
}
.step .step-num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
.step h3 { margin-bottom: 10px; max-width: 16ch; }
.step p { font-size: 14px; max-width: 32ch; }
.step .visual {
  margin-top: 20px;
  height: 100px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ——————————— Lab card preview ——————————— */
.lab-section {
  background: var(--bg-2);
  border-block: 1px solid var(--line-2);
}
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 920px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-card {
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow:
    0 1px 0 white inset,
    0 30px 60px -30px rgba(31,79,133,0.18);
}
.lab-card-head {
  padding: 20px 24px;
  background: var(--warn-soft);
  border-bottom: 1px solid oklch(88% 0.07 50);
  display: flex; justify-content: space-between; align-items: start; gap: 16px;
}
.lab-tag {
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 8px;
  background: var(--warn); color: white;
  border-radius: 4px;
}
.lab-name { font-size: 13px; font-family: var(--f-mono); color: var(--ink-3); margin-bottom: 4px; }
.lab-card-head h3 { font-size: 22px; }
.lab-val {
  font-family: var(--f-mono);
  font-size: 36px;
  font-weight: 600;
  color: var(--warn);
  letter-spacing: -0.02em;
  text-align: right;
  line-height: 1;
}
.lab-val .unit { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.lab-range {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  margin-top: 4px;
}
.lab-card-body { padding: 24px; }
.lab-row { padding: 16px 0; border-top: 1px solid var(--line-2); }
.lab-row:first-child { border-top: 0; padding-top: 0; }
.lab-row .lbl {
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.lab-row .lbl::before {
  content: ""; width: 4px; height: 4px;
  background: var(--primary); border-radius: 50%;
}
.lab-row p { font-size: 14px; color: var(--ink); }
.lab-row .chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: oklch(38% 0.1 145);
  border-radius: 999px;
  font-family: var(--f-mono);
}

/* ——————————— Trust ——————————— */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 920px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .trust-grid { grid-template-columns: 1fr; } }
.trust {
  background: var(--paper);
  padding: 28px 24px;
}
.trust .num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.trust h3 { font-size: 17px; margin-bottom: 8px; max-width: 18ch; }
.trust p { font-size: 13px; }
.trust .labs {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.trust .labs span {
  font-family: var(--f-mono); font-size: 10px;
  padding: 3px 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-2);
}

/* ——————————— Testimonial ——————————— */
.quote-section { background: var(--ink); color: oklch(98% 0.005 250); }
.quote-wrap {
  max-width: 880px; margin: 0 auto;
  text-align: center;
}
.quote-mark {
  font-family: var(--f-serif);
  font-size: 80px;
  line-height: 0.5;
  color: var(--primary);
  margin-bottom: 24px;
  font-style: italic;
}
.quote {
  font-family: var(--f-serif);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.quote-meta {
  margin-top: 32px;
  display: inline-flex; align-items: center; gap: 14px;
}
.quote-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  font-family: var(--f-mono); font-weight: 600; font-size: 14px;
  color: white;
}
.quote-name { text-align: left; }
.quote-name .n { font-size: 14px; font-weight: 500; }
.quote-name .l { font-size: 12px; color: oklch(70% 0.02 250); font-family: var(--f-mono); }

/* ——————————— Final CTA ——————————— */
.cta-final {
  position: relative;
  text-align: center;
  background:
    radial-gradient(ellipse at top, oklch(96% 0.02 240), transparent 60%),
    var(--bg);
}
.cta-final h2 { max-width: 18ch; margin: 0 auto 16px; }
.cta-final p { max-width: 38ch; margin: 0 auto 28px; }
.cta-fine {
  margin-top: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ——————————— Footer ——————————— */
footer {
  border-top: 1px solid var(--line-2);
  padding: 40px 0 32px;
  font-size: 13px;
  color: var(--ink-3);
}
.foot-grid {
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.foot-l { display: flex; flex-direction: column; gap: 8px; max-width: 32ch; }
.foot-l .tag { font-size: 13px; color: var(--ink-2); }
.foot-r { display: flex; gap: 32px; }
.foot-r a:hover { color: var(--ink); }
.foot-bot {
  margin-top: 32px;
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 11px;
  flex-wrap: wrap; gap: 8px;
}

/* ——————————— Reveal ——————————— */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* density modes */
body[data-density="compact"] section { padding-block: clamp(48px, 6vw, 80px); }
body[data-density="airy"] section { padding-block: clamp(80px, 10vw, 140px); }

body[data-ecg="off"] .ecg { display: none; }
