/* ============================================================
   Standard Longevity — visual system
   Palette: near-black · pearl-white · bioluminescent aqua (only accent)
   ============================================================ */
:root {
  --ink:        #05080a;   /* near-black */
  --ink-2:      #0a1013;
  --pearl:      #f4f7f6;   /* pearl white */
  --pearl-dim:  rgba(244,247,246,0.66);
  --pearl-faint:rgba(244,247,246,0.42);
  --aqua:       #58f2e6;   /* the only accent */
  --aqua-deep:  #17b8ad;
  --aqua-glow:  rgba(88,242,230,0.55);
  --hairline:   rgba(244,247,246,0.16);
  --hairline-2: rgba(244,247,246,0.28);
  --panel:      rgba(9,14,17,0.82);
  --panel-solid:rgba(6,10,12,0.86);
  --radius:     16px;
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:        360ms;
  --maxw:       760px;
  --font-display: "Bricolage Grotesque", "Times New Roman", serif;
  --font-body:    "Sora", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--pearl);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.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;
}
a { color: inherit; }

/* ---------- Persistent hero video ---------- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--ink); }
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 50% 12%, rgba(5,8,10,0.0) 0%, rgba(5,8,10,0.28) 60%, rgba(5,8,10,0.68) 100%),
    linear-gradient(180deg, rgba(5,8,10,0.28) 0%, rgba(5,8,10,0.08) 38%, rgba(5,8,10,0.5) 100%);
}
.hero-grain {
  position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.poster-only .hero-video { display: none; }
body.poster-only .stage {
  background: #05080a url("/media/poster.jpg?v=2") center/cover no-repeat;
}

/* ---------- Wordmark + rep entry ---------- */
.wordmark {
  position: fixed; top: max(20px, env(safe-area-inset-top)); left: max(22px, env(safe-area-inset-left));
  z-index: 6; text-decoration: none; color: var(--pearl);
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.14em;
  font-size: 13px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px;
}
.wordmark::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--aqua); box-shadow: 0 0 12px var(--aqua-glow);
  animation: pulse 3.2s var(--ease) infinite;
}
.wordmark img { height: 26px; width: auto; display: block; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.82); } }

.rep-entry {
  position: fixed; top: max(18px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right));
  z-index: 6; background: transparent; color: var(--pearl-dim);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 9px 16px; font-family: var(--font-body); font-size: 12.5px; letter-spacing: 0.04em;
  cursor: pointer; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  min-height: 40px;
}
.rep-entry:hover, .rep-entry:focus-visible { color: var(--pearl); border-color: var(--aqua); background: rgba(88,242,230,0.06); }

/* Dr. Schuster — peptide field-guide library (lead link, left of Rep portal) */
.drs-entry {
  right: calc(max(20px, env(safe-area-inset-right)) + 126px);
  color: var(--pearl); border-color: var(--aqua); background: rgba(88,242,230,0.05);
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.drs-entry::before { content: "▶"; font-size: 9px; color: var(--aqua); }
.drs-entry:hover, .drs-entry:focus-visible { background: rgba(88,242,230,0.12); border-color: var(--aqua); color: var(--pearl); }
@media (max-width: 560px) {
  .drs-entry { right: max(20px, env(safe-area-inset-right)); top: calc(max(18px, env(safe-area-inset-top)) + 48px); }
}

/* ---------- Experience layout ---------- */
.experience {
  position: relative; z-index: 4; min-height: 100dvh;
  display: grid; place-items: center;
  padding: clamp(84px, 12vh, 140px) clamp(20px, 5vw, 40px) clamp(96px, 14vh, 150px);
}
.panel {
  width: 100%; max-width: var(--maxw); text-align: center;
}

/* Reveal animation for panels */
/* No filter here on purpose: a residual filter:blur(0) keeps the element on a
   filtered compositing layer and softens all text permanently. Opacity +
   translate give the rise without that cost. */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* fill-mode `backwards` (not `both`): the from-state applies during the entrance
   delay, but nothing is held after the animation finishes. `both` would keep the
   end transform (translateY(0) => a non-none matrix), which promotes the element
   to its own GPU layer and re-rasterizes text without subpixel AA on 1x displays
   — the whole overlay renders soft. Reverting to no transform keeps text sharp. */
.reveal > * { animation: rise 520ms var(--ease) backwards; }
.reveal > *:nth-child(2) { animation-delay: 60ms; }
.reveal > *:nth-child(3) { animation-delay: 120ms; }
.reveal > *:nth-child(4) { animation-delay: 180ms; }
.reveal > *:nth-child(5) { animation-delay: 240ms; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--aqua); margin: 0 0 18px; font-weight: 500;
}
.headline {
  font-family: var(--font-display);
  font-weight: 600; line-height: 1.02; letter-spacing: -0.02em;
  font-size: clamp(2.1rem, 6vw, 3.9rem);
  margin: 0 0 16px; color: var(--pearl);
  text-shadow: 0 2px 30px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.5);
}
.support {
  font-size: clamp(0.98rem, 1.6vw, 1.18rem); line-height: 1.55;
  color: var(--pearl-dim); max-width: 46ch; margin: 0 auto 34px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.65);
}
.crumb {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px;
  font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pearl-faint);
}
.crumb .lit { color: var(--aqua); }
.crumb .sep { opacity: 0.5; }

/* ---------- Big primary choices ---------- */
.choices { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin: 0 auto; }
.choices.stack { grid-template-columns: 1fr; }
.choice {
  position: relative; text-align: left; cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 22px 22px 20px; color: var(--pearl);
  min-height: 108px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-family: inherit; overflow: hidden;
}
.choice::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent, 0 0 0 0 var(--aqua-glow);
  transition: box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.choice:hover, .choice:focus-visible {
  transform: translateY(-3px); border-color: var(--hairline-2); background: rgba(10,16,19,0.6);
  box-shadow: 0 18px 50px -24px rgba(0,0,0,0.7);
}
.choice:hover::after, .choice:focus-visible::after { box-shadow: inset 0 0 0 1px var(--aqua-glow), 0 0 34px -6px var(--aqua-glow); }
.choice[aria-pressed="true"] { border-color: var(--aqua); background: rgba(23,184,173,0.1); }
.choice .c-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 2.4vw, 1.5rem); letter-spacing: -0.01em; }
.choice .c-sub { font-size: 13px; color: var(--pearl-dim); line-height: 1.4; }
.choice .c-index { position: absolute; top: 16px; right: 18px; font-size: 11px; letter-spacing: 0.2em; color: var(--pearl-faint); }

/* Minor text actions under the primary choices */
.minor-actions { display: flex; gap: 26px; justify-content: center; margin-top: 26px; }
.text-action {
  background: none; border: none; color: var(--pearl-dim); cursor: pointer;
  font-family: inherit; font-size: 13.5px; letter-spacing: 0.02em; padding: 8px 4px;
  border-bottom: 1px solid transparent; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  min-height: 40px;
}
.text-action:hover, .text-action:focus-visible { color: var(--aqua); border-color: var(--aqua); }

/* ---------- Funnel option list (one question per screen) ---------- */
.qhead { margin-bottom: 26px; }
.options { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; }
.option {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 13px;
  padding: 17px 20px; color: var(--pearl); font-family: inherit; font-size: 1rem;
  min-height: 56px; transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}
.option:hover, .option:focus-visible { transform: translateY(-2px); border-color: var(--aqua); background: rgba(23,184,173,0.08); }
.option[aria-pressed="true"] { border-color: var(--aqua); background: rgba(23,184,173,0.14); }
.option .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--hairline-2); flex: none; transition: all 220ms var(--ease); }
.option[aria-pressed="true"] .dot, .option:hover .dot { border-color: var(--aqua); background: var(--aqua); box-shadow: 0 0 10px var(--aqua-glow); }

/* ---------- Suggestion chips (type-or-tap fields) ---------- */
.suggests { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggest {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hairline-2);
  background: transparent; color: var(--pearl-dim);
  font-family: var(--font-body); font-size: 13px; line-height: 1;
  cursor: pointer; transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}
.suggest:hover, .suggest:focus-visible { color: var(--pearl); border-color: var(--aqua); outline: none; }
.suggest[aria-pressed="true"] { color: var(--ink); background: var(--aqua); border-color: var(--aqua); }

/* ---------- Form fields ---------- */
.fields { display: grid; gap: 16px; max-width: 520px; margin: 0 auto; text-align: left; }
.fields.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.span2 { grid-column: 1 / -1; }
label.lbl { font-size: 12px; letter-spacing: 0.06em; color: var(--pearl-dim); text-transform: uppercase; }
.input, select.input {
  background: rgba(5,8,10,0.55); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 14px 15px; color: var(--pearl); font-family: inherit; font-size: 1rem; width: 100%;
  min-height: 52px; transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2358f2e6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.input:focus, select.input:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(88,242,230,0.16); }
.input::placeholder { color: var(--pearl-faint); }
.field-error { color: #ff9d8a; font-size: 12.5px; min-height: 1px; }
.input[aria-invalid="true"] { border-color: #ff7d63; }

/* Consent block */
.consent { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; text-align: left; }
.check {
  display: flex; gap: 13px; align-items: flex-start; cursor: pointer;
  font-size: 14px; line-height: 1.5; color: var(--pearl-dim);
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; padding: 15px 16px;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--hairline-2); flex: none; margin-top: 1px;
  display: grid; place-items: center; transition: all 200ms var(--ease);
}
.check input:checked + .box { background: var(--aqua); border-color: var(--aqua); box-shadow: 0 0 12px var(--aqua-glow); }
.check input:checked + .box::after { content: ""; width: 6px; height: 11px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(88,242,230,0.3); }
.check a { color: var(--aqua); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Buttons / nav ---------- */
.actions-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  font-family: inherit; font-size: 15px; letter-spacing: 0.01em; cursor: pointer;
  border-radius: 999px; padding: 15px 30px; min-height: 52px; border: 1px solid var(--hairline);
  background: transparent; color: var(--pearl); transition: all var(--dur) var(--ease);
}
.btn.primary {
  background: linear-gradient(180deg, rgba(88,242,230,0.16), rgba(23,184,173,0.1));
  border-color: var(--aqua); color: var(--pearl);
  box-shadow: 0 0 0 0 var(--aqua-glow);
}
.btn.primary:hover, .btn.primary:focus-visible { box-shadow: 0 0 30px -6px var(--aqua-glow); transform: translateY(-2px); background: linear-gradient(180deg, rgba(88,242,230,0.26), rgba(23,184,173,0.16)); }
.btn.ghost { color: var(--pearl-dim); }
.btn.ghost:hover, .btn.ghost:focus-visible { color: var(--pearl); border-color: var(--hairline-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn.back { padding: 12px 20px; min-height: 44px; font-size: 14px; }

/* Progress indicator */
.progress { height: 2px; width: min(520px, 80vw); margin: 0 auto 30px; background: var(--hairline); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); background: linear-gradient(90deg, var(--aqua-deep), var(--aqua)); box-shadow: 0 0 10px var(--aqua-glow); transition: transform 420ms var(--ease); }

/* ---------- Modal ---------- */
/* Default hidden. IMPORTANT: without this, `display: grid` here overrides the
   [hidden] attribute, leaving a transparent full-screen layer over the whole
   page that eats every click (all buttons appear dead). Only show when open. */
.modal-host { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 20px; }
.modal-host:not([hidden]) { display: grid; }
.modal-host::before { content: ""; position: absolute; inset: 0; background: rgba(3,5,6,0.86); animation: fade 240ms var(--ease); }
.modal {
  position: relative; z-index: 1; width: 100%; max-width: 480px;
  background: var(--panel-solid); border: 1px solid var(--hairline-2); border-radius: 20px;
  padding: 30px clamp(22px, 4vw, 34px); animation: rise 380ms var(--ease) backwards;
  max-height: 88dvh; overflow-y: auto;
}
.modal .close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--pearl-dim); font-size: 22px; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; }
.modal .close:hover, .modal .close:focus-visible { color: var(--pearl); background: rgba(244,247,246,0.08); }
.modal h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin: 0 0 6px; }
.modal p.sub { color: var(--pearl-dim); font-size: 14px; margin: 0 0 22px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Completion state */
.done-mark { width: 62px; height: 62px; margin: 0 auto 22px; border-radius: 50%; border: 1.5px solid var(--aqua); display: grid; place-items: center; box-shadow: 0 0 40px -8px var(--aqua-glow); }
.done-mark::after { content: ""; width: 15px; height: 26px; border: solid var(--aqua); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translateY(-2px); }
.fine-print { font-size: 12.5px; color: var(--pearl-faint); line-height: 1.55; max-width: 44ch; margin: 22px auto 0; }

/* Error / notice banner */
.notice { max-width: 520px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 11px; font-size: 13.5px; text-align: left; }
.notice.err { background: rgba(255,125,99,0.12); border: 1px solid rgba(255,125,99,0.4); color: #ffb6a6; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 4; padding: 26px clamp(20px,5vw,40px) max(26px, env(safe-area-inset-bottom));
  text-align: center; color: var(--pearl-faint);
}
.site-footer .disc { font-size: 11.5px; line-height: 1.6; max-width: 720px; margin: 0 auto 12px; }
.site-footer .flinks { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.site-footer .flinks a { font-size: 12px; color: var(--pearl-dim); text-decoration: none; }
.site-footer .flinks a:hover, .site-footer .flinks a:focus-visible { color: var(--aqua); }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .choices { grid-template-columns: 1fr; }
  .fields.two { grid-template-columns: 1fr; }
  .minor-actions { gap: 20px; }
  .headline { font-size: clamp(1.9rem, 9vw, 2.6rem); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .wordmark::before { animation: none; }
}
