/* VitalCalc — Vital Green dark theme */
:root {
  --bg: #0b0f11;
  --bg-2: #0e1316;
  --surface: #131a1d;
  --surface-2: #182226;
  --reading: #141c1f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eaf1ed;
  --text-soft: #c9d4ce;
  --muted: #93a39b;
  --accent: #00ff88;
  --accent-ink: #00170c;
  --accent-text: #4ef0a2;
  --accent-dim: rgba(0, 255, 136, 0.1);
  --accent-line: rgba(0, 255, 136, 0.25);
  --warn: #facc15;
  --bad: #f87171;
  --good: #4ade80;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font-head: "Outfit", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1140px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; color: #fff; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 17, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-dim); border: 1px solid var(--accent-line); display: grid; place-items: center; color: var(--accent); }
.logo span.tld { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-soft); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,0.05); }
.nav .nav-cta { background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-left: 6px; }
.nav .nav-cta:hover { background: #3dffa3; color: var(--accent-ink); }
.menu-btn { display: none; background: none; border: 1px solid var(--border-strong); color: #fff; border-radius: 8px; padding: 7px 10px; font: inherit; cursor: pointer; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .nav-cta { margin: 6px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 11px; font-weight: 700; font-family: var(--font-body); font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 rgba(0,255,136,0); }
.btn-primary:hover { background: #3dffa3; color: var(--accent-ink); box-shadow: 0 8px 28px rgba(0,255,136,0.25); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent-line); color: #fff; }
.btn-block { width: 100%; }
.btn:active { transform: translateY(1px); }

/* Hero */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px; background: radial-gradient(closest-side, rgba(0,255,136,0.13), transparent); pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-dim); border: 1px solid var(--accent-line); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 1.2rem; color: var(--text-soft); max-width: 58ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px; color: var(--muted); font-size: 0.95rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 8px; }
.trust-row svg { color: var(--accent); }

/* Sections */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.band { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
a.card:hover { border-color: var(--accent-line); background: var(--surface-2); transform: translateY(-2px); color: inherit; }
.card .icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-dim); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; font-size: 0.97rem; }
.card .go { display: inline-block; margin-top: 14px; color: var(--accent-text); font-weight: 600; font-size: 0.95rem; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

/* Breadcrumb */
.crumbs { font-size: 0.9rem; color: var(--muted); padding: 22px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.crumbs span { margin: 0 6px; opacity: .5; }

/* Calculator page */
.page-head { padding: 22px 0 28px; }
.page-head .lede { color: var(--text-soft); font-size: 1.12rem; max-width: 62ch; margin: 0; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
@media (max-width: 520px) { .calc-card { padding: 18px; } }
.field { margin-bottom: 20px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.field .hint { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.input, select.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-strong); color: #fff;
  border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; font-size: 1.05rem;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .row-2 { grid-template-columns: 1fr; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 11px; border: 1px solid var(--border); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 10px 6px; border-radius: 8px; cursor: pointer; color: var(--text-soft); font-weight: 600; font-size: 0.95rem; user-select: none; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg.wrap-5 { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); }
.seg.wrap-10 { grid-auto-flow: row; grid-template-columns: repeat(10, 1fr); }
@media (max-width: 520px) { .seg.wrap-10 { grid-template-columns: repeat(5, 1fr); } .seg label { font-size: 0.88rem; padding: 9px 2px; } }
.seg-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
.form-error { color: var(--bad); font-size: 0.92rem; margin: -6px 0 12px; display: none; }
.form-error.show { display: block; }

/* Results */
.result { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 24px; display: none; }
.result.show { display: block; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.big-num { text-align: center; padding: 8px 0 18px; }
.big-num .k { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.big-num .v { font-family: var(--font-head); font-size: clamp(3.4rem, 10vw, 4.8rem); font-weight: 750; line-height: 1.05; color: var(--accent); text-shadow: 0 0 40px rgba(0,255,136,0.25); }
.big-num .v small { font-size: 0.4em; color: var(--muted); font-weight: 500; }
.pills { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 0.88rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-soft); }
.pill.good { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-dim); }
.pill.mid { color: var(--warn); border-color: rgba(250,204,21,.3); background: rgba(250,204,21,.08); }
.pill.bad { color: var(--bad); border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.08); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 14px; }
.stat .k { color: var(--muted); font-size: 0.85rem; }
.stat .v { font-family: var(--font-head); font-size: 1.5rem; font-weight: 650; color: #fff; }
.stat .v small { font-size: 0.6em; color: var(--muted); font-weight: 500; }
.zone-list { display: grid; gap: 8px; margin: 14px 0; }
.zone { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; }
.zone .bar { width: 10px; height: 34px; border-radius: 4px; }
.zone strong { display: block; }
.zone .sub { color: var(--muted); font-size: 0.88rem; }
.zone .bpm { font-family: var(--font-head); font-weight: 650; font-size: 1.1rem; white-space: nowrap; }
.insights { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 16px; }
.insights h3 { font-size: 1.05rem; }
.insights ul { margin: 0; padding-left: 1.1em; color: var(--text-soft); }
.insights li { margin-bottom: 6px; }
.bar-track { height: 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin: 6px 0 16px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #00c46a, var(--accent)); border-radius: 99px; width: 0; transition: width .8s ease; }

/* Sidebar */
.side { display: grid; gap: 16px; position: sticky; top: 84px; }
@media (max-width: 960px) { .side { position: static; } }
.side .card h3 { font-size: 1.02rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-soft); text-decoration: none; font-size: 0.97rem; }
.side li:last-child a { border-bottom: 0; }
.side li a:hover { color: var(--accent-text); }

/* Offer / affiliate */
.offer { margin-top: 22px; border: 1px solid var(--accent-line); background: linear-gradient(160deg, rgba(0,255,136,0.07), rgba(0,255,136,0.01)); border-radius: 16px; padding: 22px; }
.offer .k { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.offer h3 { margin: 6px 0 8px; }
.offer p { color: var(--text-soft); }
.offer .fine { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
.book { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 0.97rem; }

/* Ad slots — framed so ads sit neatly on the dark theme */
.ad-slot { margin: 32px 0; padding: 10px; background: #f4f6f5; border-radius: 12px; min-height: 0; }
.ad-slot:empty { display: none; }
.ad-label { display: block; text-align: center; font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Long-form prose */
.prose-panel { background: var(--reading); border: 1px solid var(--border); border-radius: 18px; padding: clamp(22px, 4vw, 44px); margin-top: 36px; }
.prose { max-width: 70ch; font-size: 1.08rem; line-height: 1.75; color: var(--text-soft); }
.prose h2 { margin-top: 1.8em; font-size: 1.55rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5em; font-size: 1.2rem; }
.prose strong { color: #fff; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0 1.6em; font-size: 0.98rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: #fff; font-family: var(--font-head); font-weight: 600; background: rgba(255,255,255,0.03); }
.prose code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 5px; font-size: 0.92em; }
.prose .formula { display: block; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 0.95rem; color: #fff; overflow-x: auto; margin: 1em 0 1.3em; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; color: #fff; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 10px 0 0; }
.note { border: 1px solid var(--border); background: var(--bg-2); border-radius: 12px; padding: 16px 18px; color: var(--muted); font-size: 0.95rem; margin-top: 28px; }
.note strong { color: var(--text-soft); }

/* Articles */
.article-head { padding: 26px 0 8px; max-width: 760px; }
.article-head .meta { color: var(--muted); font-size: 0.95rem; display: flex; gap: 14px; flex-wrap: wrap; }
.article-body { max-width: 760px; }
.article-body .prose-panel { margin-top: 20px; }
.article-card .meta { color: var(--muted); font-size: 0.88rem; margin-top: 12px; }
.related { margin-top: 36px; }

/* Forms (contact, email capture) */
.form-card { max-width: 620px; }
textarea.input { min-height: 150px; resize: vertical; }
.success { display: none; border: 1px solid var(--accent-line); background: var(--accent-dim); color: var(--accent-text); border-radius: 12px; padding: 16px; margin-top: 14px; }
.success.show { display: block; }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: var(--bg-2); padding: 48px 0 30px; color: var(--muted); font-size: 0.95rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); }
.foot-legal { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.85rem; line-height: 1.6; }

/* Funnel (/start) */
.funnel { max-width: 720px; margin: 0 auto; padding: 40px 0 20px; }
.funnel-head { text-align: center; margin-bottom: 26px; }
.funnel-head h1 { max-width: none; font-size: clamp(2rem, 6vw, 2.9rem); }
.funnel-head h1 em { font-style: normal; color: var(--accent); }
.funnel-head p { color: var(--text-soft); font-size: 1.12rem; }
.funnel-top { display: flex; justify-content: center; padding: 22px 0 0; }

/* Vascular age widget */
#vcw-btn { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 18px; font: 700 0.92rem var(--font-body); cursor: pointer; box-shadow: 0 0 22px rgba(0,255,136,0.4), 0 6px 20px rgba(0,0,0,0.5); }
#vcw-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); animation: vcwdot 1.4s ease-in-out infinite; }
@keyframes vcwdot { 50% { opacity: .35; transform: scale(.7); } }
#vcw-panel { position: fixed; right: 20px; bottom: 76px; z-index: 61; width: 330px; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); overflow: auto; background: #10171a; border: 1px solid var(--accent-line); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.7); padding: 18px; display: none; }
#vcw-panel.open { display: block; animation: rise .25s ease; }
#vcw-panel .vcw-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#vcw-panel .vcw-top strong { font-family: var(--font-head); color: var(--accent); letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; }
#vcw-panel .x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
#vcw-panel h3 { font-size: 1.1rem; margin-bottom: 4px; }
#vcw-panel .sub { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
#vcw-panel .field { margin-bottom: 12px; }
#vcw-panel .field label { font-size: .85rem; }
#vcw-panel .input { padding: 10px 12px; font-size: 1rem; }
#vcw-panel .fine { font-size: .78rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
@media (max-width: 520px) { #vcw-btn { right: 14px; bottom: 14px; padding: 11px 15px; } #vcw-panel { right: 16px; bottom: 70px; } }
@media print { .site-header, .site-footer, #vcw-btn, #vcw-panel, .ad-slot { display: none !important; } }

/* Homepage hero — matches the original VitalCalc headline style */
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4rem); line-height: 1.08; letter-spacing: -0.02em; max-width: 17ch; margin-bottom: 0.45em; }
.hero h1 em { color: #5ee6a0; }
.hero .lede { font-family: var(--font-head); font-weight: 400; font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.65; color: #a9b7b0; max-width: 54ch; }

/* Greener box outlines */
:root { --box-line: rgba(0, 255, 136, 0.22); --box-line-hover: rgba(0, 255, 136, 0.5); }
.card, .calc-card, .prose-panel, .note, .insights, .stat, .zone, .offer { border-color: var(--box-line); }
a.card:hover { border-color: var(--box-line-hover); }
.input, select.input { border-color: rgba(0, 255, 136, 0.2); }
