/* ==========================================================================
   LongevityX — design system
   Static, dependency-free. No build step (workspace has no Node toolchain).
   ========================================================================== */

:root {
  /* Brand — grounded in the existing LongevityX palette, restated for a
     clinical-premium feel rather than the current funnel green. */
  --ink: #12141c;
  --ink-soft: #3d424f;
  --ink-mute: #6b7280;
  --bone: #faf8f4;
  --bone-2: #f2ede4;
  --white: #ffffff;
  --line: #e3ddd1;
  --primary: #0e7c5a;
  --primary-dk: #0a5c43;
  --primary-lt: #e6f2ed;
  --accent: #37ca37;   /* legacy brand green — accent only */
  --gold: #c9a227;
  --gold-lt: #f7f1dd;

  /* Type */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* Space & shape */
  --gut: 1.25rem;
  --maxw: 1120px;
  --maxw-narrow: 720px;
  --r: 10px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(18, 20, 28, .06), 0 8px 24px rgba(18, 20, 28, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary-dk); text-underline-offset: 3px; }
a:hover { color: var(--primary); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.narrow { max-width: var(--maxw-narrow); }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.section--bone2 { background: var(--bone-2); }
.section--ink { background: var(--ink); color: var(--bone); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--white); }
.section--ink a { color: var(--accent); }

/* ---------- header / nav ---------- */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--white); padding: .6rem 1rem; z-index: 100; border-radius: var(--r); }

.hdr { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.hdr__in { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--primary); }
.brand__sub { display: block; font-family: var(--sans); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 1.15rem; }
.nav a { font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--primary-dk); }
.nav a[aria-current="page"] { font-weight: 700; }

.nav__toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 940px) {
  .nav { position: fixed; inset: 68px 0 auto 0; background: var(--white); flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 0 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem var(--gut); border-bottom: 1px solid var(--bone-2); }
  .nav__toggle { display: block; }
  .hdr .btn--cta { display: none; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .9688rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--white); }
.btn--primary:hover { background: var(--primary-dk); color: var(--white); }
.btn--ghost { border-color: var(--primary); color: var(--primary-dk); background: transparent; }
.btn--ghost:hover { background: var(--primary-lt); }
.btn--light { background: var(--white); color: var(--ink); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #b8931f; color: var(--ink); }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.0625rem; }
.btn--wide { width: 100%; }
.btn--cta { padding: .6rem 1.1rem; font-size: .875rem; }

.ctarow { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn__note { font-size: .85rem; color: var(--ink-mute); }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--white), var(--bone)); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-dk); background: var(--primary-lt); padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1rem; }
.hero__lead { font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); color: var(--ink-soft); }
.hero__card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.5rem; }
.hero__card h3 { margin-top: 0; }

/* ---------- utility ---------- */
.stack > * + * { margin-top: 1rem; }
.lede { font-size: 1.125rem; color: var(--ink-soft); }
.muted { color: var(--ink-mute); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.todo { background: var(--gold-lt); border-left: 3px solid var(--gold); padding: .6rem .85rem; font-size: .875rem; color: #6a5714; border-radius: 0 var(--r) var(--r) 0; }
.todo::before { content: "TODO (founder): "; font-weight: 700; }
.rule { height: 1px; background: var(--line); border: 0; margin: 2.5rem 0; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; background: var(--bone-2); color: var(--ink-soft); }
.pill--best { background: var(--gold); color: var(--ink); }
.pill--new { background: var(--primary); color: var(--white); }

/* ---------- grids & cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; }
.card--feature { border: 2px solid var(--primary); position: relative; }
.card--dark { background: #1b1e29; border-color: #262a37; color: var(--bone); }
.card--dark h3, .card--dark h4 { color: var(--white); }
.card h3 { margin-top: 0; }
.card ul { margin: 0 0 1.25rem; padding-left: 1.1rem; }
.card li { margin-bottom: .45rem; }
.card__price { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1; margin: .5rem 0 .25rem; }
.card__price small { font-family: var(--sans); font-size: .8125rem; font-weight: 600; color: var(--ink-mute); display: block; margin-top: .35rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.pricing { width: 100%; border-collapse: collapse; background: var(--white); font-size: .9375rem; min-width: 680px; }
table.pricing th, table.pricing td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.pricing thead th { background: var(--ink); color: var(--white); font-family: var(--sans); font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; }
table.pricing tbody tr:nth-child(even) { background: var(--bone); }
table.pricing td:first-child { font-weight: 600; }
table.pricing .price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- steps ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: s; position: relative; padding-left: 3.25rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primary); color: var(--white); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- quotes ---------- */
.quote { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 0 var(--r) var(--r) 0; padding: 1.25rem 1.35rem; }
.quote p { font-family: var(--serif); font-size: 1.0625rem; font-style: italic; margin-bottom: .75rem; }
.quote cite { font-style: normal; font-weight: 700; font-size: .875rem; }
.quote cite span { display: block; font-weight: 500; color: var(--ink-mute); font-size: .8125rem; }

/* ---------- forms ---------- */
.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.75rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.field .req { color: #b3261e; }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bone);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--primary-lt); border-color: var(--primary); background: var(--white); }
.field__hint { font-size: .8125rem; color: var(--ink-mute); margin-top: .3rem; }
.field--check { display: flex; gap: .6rem; align-items: flex-start; }
.field--check input { width: auto; margin-top: .3rem; }
.field--check label { font-weight: 400; font-size: .8375rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.form-msg { display: none; border-radius: var(--r); padding: .9rem 1rem; margin-bottom: 1.25rem; font-size: .9375rem; }
.form-msg.is-error { display: block; background: #fdecea; border: 1px solid #f3c2bd; color: #8c1d18; }
.form-msg.is-ok { display: block; background: var(--primary-lt); border: 1px solid #a9d6c5; color: var(--primary-dk); }
.is-invalid { border-color: #b3261e !important; background: #fff7f6 !important; }
.price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .75rem 0; border-bottom: 1px dashed var(--line); }
.price-line:last-of-type { border-bottom: 0; }
.price-line strong { font-variant-numeric: tabular-nums; }

/* ---------- callout ---------- */
.callout { background: var(--primary-lt); border: 1px solid #a9d6c5; border-radius: var(--r); padding: 1.1rem 1.25rem; }
.callout--gold { background: var(--gold-lt); border-color: #e6d9a8; }
.callout--dark { background: #1b1e29; border-color: #262a37; color: var(--bone); }

/* ---------- faq ---------- */
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .6rem; }
.faq summary { cursor: pointer; padding: .95rem 1.1rem; font-weight: 600; list-style: none; position: relative; padding-right: 2.5rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--primary); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 1.1rem 1.1rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
.ftr { background: var(--ink); color: #c3c8d4; padding: 3rem 0 2rem; font-size: .9375rem; }
.ftr a { color: var(--bone); }
.ftr__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .ftr__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .ftr__grid { grid-template-columns: 1fr; } }
.ftr h4 { color: var(--white); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; margin-bottom: .85rem; }
.ftr ul { list-style: none; margin: 0; padding: 0; }
.ftr li { margin-bottom: .5rem; }
.ftr__base { border-top: 1px solid #2b303d; margin-top: 2.5rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; font-size: .8125rem; color: #8d94a3; }

/* ---------- sticky mobile CTA ---------- */
.stickycta { display: none; }
@media (max-width: 720px) {
  .stickycta { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--white); border-top: 1px solid var(--line); padding: .6rem var(--gut); box-shadow: 0 -4px 18px rgba(18,20,28,.08); }
  body { padding-bottom: 74px; }
}

@media print { .hdr, .ftr, .stickycta, .ctarow { display: none; } body { background: #fff; } }
