/* BIA Metabolic Quiz. Mobile-first (94% of takers are on a phone).
 * Tokens, type, .cta, .eyebrow, .field and footer mirror bia-guides and
 * bia-vsl so the quiz, the opt-in pages, and the VSL read as one funnel.
 * Keep them in sync by hand. */

:root {
  --ink: #241a36;
  --ink-soft: #5a4f70;
  --paper: #fbfaf7;
  --mist: #f1ebfb;
  --lavender: #aa77ff;
  --lavender-deep: #7a45d8;
  --line: #e4ddf0;
  --ok: #2f8f5b;
  --warn: #c98a1a;
  --hot: #c4452f;
  --max: 640px;
  --wide: 960px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3 {
  font-family: 'Archivo', system-ui, sans-serif;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); font-weight: 800; line-height: 1.18; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 4vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.h1-sub {
  display: block;
  margin-top: 0.3em;
  font-size: max(0.95rem, 0.62em);
  font-weight: 700;
  color: var(--lavender-deep);
}

/* Emphasized phrase: ink text, brand-purple underline (mirrors .h1-ul in bia-guides) */
.ul { text-decoration: underline; text-decoration-color: var(--lavender); text-decoration-thickness: 3px; text-underline-offset: 4px; font-weight: 700; color: var(--ink); }
.nowrap { white-space: nowrap; }

.logo-row { display: flex; justify-content: center; padding: 18px 20px 0; }
.logo { width: 44px; height: auto; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lavender-deep);
  margin: 0 0 14px;
}
.subhead { font-size: clamp(0.98rem, 2.2vw, 1.1rem); color: var(--ink-soft); font-weight: 500; margin: 0 auto 24px; max-width: 32em; }
.fineprint { font-size: 0.78rem; color: var(--ink-soft); }

.cta {
  display: inline-block;
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--lavender);
  border: none;
  border-radius: 999px;
  padding: 18px 40px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 56px;
}
.cta:hover { background: var(--lavender-deep); }
.cta:active { transform: scale(0.98); }
.cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cta[disabled] { opacity: 0.7; cursor: wait; transform: none; }
.cta.block { display: block; width: 100%; }
.ghost {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
}
.ghost:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* ---------- Landing (hook page) ---------- */
.hero {
  padding: 28px 20px 48px;
  text-align: center;
  max-width: var(--wide);
  margin: 0 auto;
}
.hero h1 { max-width: 18em; margin-left: auto; margin-right: auto; }
.hero .cta { margin-top: 4px; }
.hero .meta-line { margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Quiz shell ---------- */
.quiz {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px 40px;
}
.progress { margin: 8px 0 22px; }
.progress .bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--lavender); border-radius: 999px; transition: width 0.6s var(--ease-out); }
.start-eyebrow { text-align: center; margin: 14px 0 0; }

.screen h2 { margin-bottom: 8px; }
[tabindex="-1"]:focus { outline: none; } /* programmatic focus for screen readers, no ring */
.screen .hint { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 18px; }
.options { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.opt:hover { border-color: var(--lavender); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(122, 69, 216, 0.10); }
/* The tap: the card settles in, the screen changes a beat later. */
.opt.picked { border-color: var(--lavender-deep); background: var(--mist); transform: scale(0.985); box-shadow: none; }
.opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.opt[aria-pressed="true"] { border-color: var(--lavender-deep); background: var(--mist); }
.opt.multi { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; }
.opt.multi .box { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 6px; }
.opt.multi[aria-pressed="true"] .box { background: var(--lavender-deep); border-color: var(--lavender-deep); }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.nav .cta { flex: 1; }

/* Interstitials */
.inter { text-align: center; padding: 10px 0; }
.inter h2 { margin-top: 6px; }
.inter h2 .num { color: var(--lavender-deep); }
.inter .body { color: var(--ink-soft); max-width: 30em; margin: 0 auto 22px; }
.quote-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.quote-list li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-align: left; }
.quote-list blockquote { margin: 0 0 8px; font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.35; }
.quote-list blockquote::before { content: "\201C"; color: var(--lavender); }
.quote-list blockquote::after { content: "\201D"; color: var(--lavender); }
.quote-list cite { font-style: normal; font-size: 0.88rem; font-weight: 700; color: var(--lavender-deep); }
/* Before/after prints: two large prints, the second overlapping the first a little, each tilted the other way. */
.ba-pair { display: flex; align-items: flex-start; max-width: 560px; margin: 12px auto 24px; padding: 0 6px; }
.ba-pair figure { margin: 0; text-align: center; width: 52%; flex: 0 0 52%; }
.ba-pair figure:last-child { margin-left: -4%; margin-top: 14px; position: relative; z-index: 1; }
.ba-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--mist); border: 6px solid #fff; border-radius: 6px; box-shadow: 0 16px 34px rgba(36, 26, 54, 0.2), 0 2px 6px rgba(36, 26, 54, 0.08); }
.ba-pair figure:first-child .ba-photo { transform: rotate(-3deg); }
.ba-pair figure:last-child .ba-photo { transform: rotate(2.5deg); }
.ba-pair figcaption { margin-top: 12px; font-size: 0.8rem; font-weight: 700; color: var(--lavender-deep); }
/* Pull quote: no box. Centred under the prints, the name runs on right after the closing mark. */
.pull-quote { max-width: 30em; margin: 0 auto 26px; text-align: center; font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.4; text-wrap: balance; }
.pull-quote q { quotes: "\201C" "\201D"; }
.pull-quote q::before, .pull-quote q::after { color: var(--lavender); }
.pull-quote cite { font-style: normal; font-size: 0.88rem; color: var(--lavender-deep); white-space: nowrap; }
.takes .pull-quote { text-align: left; max-width: none; margin: 0 0 18px; padding-left: 14px; border-left: 3px solid var(--lavender); font-size: 1.05rem; }

/* Text screen + capture */
textarea, .field input {
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
textarea:focus, .field input:focus { outline: none; border-color: var(--lavender); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input[aria-invalid="true"] { border-color: var(--hot); }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--hot); font-size: 0.85rem; margin: -4px 0 12px; }
.capture-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px 18px;
  box-shadow: 0 24px 48px rgba(36, 26, 54, 0.14), 0 3px 8px rgba(36, 26, 54, 0.06);
}
.capture-card .form-note { font-size: 0.8rem; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }
.capture-card .disclosure { font-size: 0.72rem; color: var(--ink-soft); text-align: center; margin: 8px 0 0; }

/* ---------- Result page ---------- */
.result { max-width: var(--max); margin: 0 auto; padding: 8px 20px 56px; }
.reveal { text-align: center; padding: 8px 0 22px; }
.reveal h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); margin-bottom: 14px; }
.reveal .definition { font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: clamp(1.1rem, 3.6vw, 1.3rem); line-height: 1.3; max-width: 24em; margin: 0 auto 16px; }
.reveal .tie { color: var(--lavender-deep); font-weight: 600; font-size: 0.95rem; max-width: 30em; margin: 0 auto 14px; }
.reveal .defining { color: var(--ink-soft); font-size: 0.85rem; margin: 10px auto 0; }
.reveal .stage { color: var(--ink-soft); max-width: 30em; margin: 14px auto 0; font-size: 0.95rem; }

/* The area strip: four areas, one lit. A visual of which one to work on first, not a score. */
.strip { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.strip li { border-radius: 12px; padding: 12px 6px 10px; display: grid; gap: 4px; justify-items: center; align-content: center; text-align: center; border: 2px solid var(--line); background: #fff; min-height: 58px; }
.strip .area { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.01em; }
.strip .tag { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.2; }
.strip .hit { background: var(--lavender-deep); border-color: var(--lavender-deep); color: #fff; box-shadow: 0 12px 28px rgba(122, 69, 216, 0.28); transform: translateY(-2px); }
.strip .hit .tag { color: #fff; }
.strip .second { border-color: var(--lavender); background: var(--mist); }
.strip .second .tag { color: var(--lavender-deep); }
.strip .later { background: var(--mist); border-color: var(--line); }   /* flagged, after the first one */
.strip .later .tag { color: var(--lavender-deep); }
.strip .clear { color: var(--ink-soft); background: #fff; }           /* in range: holding */
@media (max-width: 380px) { .strip { grid-template-columns: repeat(2, 1fr); } }

/* Sections: a small label, then copy set as copy */
.block { padding: 30px 0; border-top: 1px solid var(--line); }
.label { font-size: 0.86rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lavender-deep); margin: 0 0 12px; }
.punch { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; font-size: clamp(1.2rem, 4.2vw, 1.5rem); line-height: 1.25; margin: 0 0 10px; text-wrap: balance; }
.support { color: var(--ink-soft); margin: 0; font-size: 1rem; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.answers li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1rem; }
.answers li::before { content: "\201C"; color: var(--lavender); }
.answers li::after { content: "\201D"; color: var(--lavender); }
.tried { margin: 14px 0 0; font-weight: 600; }
.calls { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: call; }
.calls li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.calls li::before { counter-increment: call; content: counter(call); width: 30px; height: 30px; border-radius: 50%; background: var(--mist); color: var(--lavender-deep); display: inline-grid; place-items: center; font-size: 0.85rem; }
.takes .punch { font-size: clamp(1.1rem, 3.8vw, 1.3rem); }
.takes .intro { margin: 0 0 16px; }

/* Desktop: the copy sections read small at 640px wide, so the type steps up */
@media (min-width: 768px) {
  .result { max-width: 680px; }
  .block { padding: 36px 0; }
  .punch { font-size: 1.7rem; }
  .takes .punch { font-size: 1.45rem; }
  .support { font-size: 1.1rem; }
  .answers li { font-size: 1.05rem; }
  .calls li { font-size: 1.15rem; }
  .label { font-size: 0.92rem; }
  .strip .area { font-size: 0.9rem; }
  .strip .tag { font-size: 0.68rem; }
}

/* The destination */
/* The destination card sits on the deep plum ink (white on it is about
   15:1) with the brand lavender saved for the button. */
/* Option B: the destination card on the lavender mist with ink text (about
   14:1) and a lavender border, so it reads as the page's one framed object
   and the standard purple button carries the color. */
.cta-block { margin: 26px -20px 0; padding: 34px 24px 30px; background: var(--mist); border: 2px solid var(--lavender); color: var(--ink); text-align: center; border-radius: 22px; box-shadow: 0 18px 40px rgba(122, 69, 216, 0.12); }
.cta-block h2 { color: var(--ink); margin-bottom: 12px; }
.cta-block .bridge { font-family: 'Archivo', system-ui, sans-serif; font-weight: 700; font-size: 1.1rem; line-height: 1.4; margin: 0 auto 22px; max-width: 24em; color: var(--ink); }
.cta-invert { background: var(--lavender); color: #fff; position: relative; }
/* A soft ring pulses out of the button every few seconds: a pull, not a wave. */
.cta-invert::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 3px solid var(--lavender); opacity: 0; pointer-events: none; animation: pulse-ring 3s ease-out 1s infinite; }
@keyframes pulse-ring {
  0% { transform: scale(0.94); opacity: 0.75; }
  55% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
/* The card lifts in the first time it scrolls into view (visible at rest; the class only adds the motion). */
.cta-block.enter { animation: lift-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes lift-in {
  from { transform: translateY(18px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
.cta-invert:hover { background: var(--lavender-deep); }
.interest { margin: 18px 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.interest a { color: var(--lavender-deep); font-weight: 700; }
.retake { text-align: center; margin-top: 18px; }

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.sticky-cta .cta { display: block; width: 100%; }
@media (min-width: 768px) { .sticky-cta { display: none; } }

.recover { max-width: var(--max); margin: 0 auto; padding: 40px 20px; text-align: center; }
.recover p { color: var(--ink-soft); max-width: 30em; margin: 0 auto 22px; }

footer {
  padding: 32px 20px 110px; /* clears the sticky bar on phones */
  max-width: var(--max);
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
footer a { color: var(--ink-soft); }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Motion ----------
   Every screen breathes in the same way: the heading rises, the answers
   follow one after another, the button last. The interstitial cascades
   the same way with the prints popping in. All of it is off under
   prefers-reduced-motion (rule below). Timing mirrors what reads well on
   a phone: 0.4 to 0.6s, a quint ease-out, 50ms between answers. */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes pop-lift { from { opacity: 0; transform: scale(0.97) translateY(-2px); } to { opacity: 1; transform: scale(1) translateY(-2px); } }

.screen > .eyebrow, .screen > h2, .screen > .hint { animation: rise 0.55s var(--ease-out) both; }
.screen > .hint { animation-delay: 0.06s; }
.options > li { animation: fade-up 0.4s var(--ease-out) both; }
.options > li:nth-child(1) { animation-delay: 0.08s; }
.options > li:nth-child(2) { animation-delay: 0.13s; }
.options > li:nth-child(3) { animation-delay: 0.18s; }
.options > li:nth-child(4) { animation-delay: 0.23s; }
.options > li:nth-child(5) { animation-delay: 0.28s; }
.options > li:nth-child(6) { animation-delay: 0.33s; }
.options > li:nth-child(7) { animation-delay: 0.38s; }
.options > li:nth-child(8) { animation-delay: 0.43s; }
.options > li:nth-child(9) { animation-delay: 0.48s; }
.screen > .nav { animation: rise 0.55s var(--ease-out) 0.3s both; }

/* Interstitial cascade */
.inter > .eyebrow, .inter > h2 { animation: rise 0.55s var(--ease-out) both; }
.inter > .body { animation: rise 0.55s var(--ease-out) 0.1s both; }
.inter .ba-pair { animation: rise 0.55s var(--ease-out) 0.2s both; }
.inter .ba-pair figure:first-child { animation: pop 0.6s var(--ease-out) 0.3s both; }
.inter .ba-pair figure:last-child { animation: pop 0.6s var(--ease-out) 0.45s both; }
.inter .pull-quote { animation: rise 0.55s var(--ease-out) 0.6s both; }
.inter > .cta { animation: rise 0.55s var(--ease-out) 0.75s both; }
.inter > .nav { animation-delay: 0.85s; }

/* Capture card settles in; the fields follow */
.capture-card { animation: pop 0.5s var(--ease-out) both; }
.capture-card .field:nth-of-type(1) { animation: fade-up 0.4s var(--ease-out) 0.15s both; }
.capture-card .field:nth-of-type(2) { animation: fade-up 0.4s var(--ease-out) 0.22s both; }
.capture-card .cta { animation: fade-up 0.4s var(--ease-out) 0.3s both; }

/* Result reveal */
.reveal > .eyebrow, .reveal > h1 { animation: rise 0.55s var(--ease-out) both; }
.reveal > .definition, .reveal > .tie { animation: rise 0.55s var(--ease-out) 0.1s both; }
.reveal .strip li { animation: pop 0.5s var(--ease-out) both; }
.reveal .strip li.hit { animation-name: pop-lift; } /* keeps the lit tile's lift after the pop ends */
.reveal .strip li:nth-child(1) { animation-delay: 0.25s; }
.reveal .strip li:nth-child(2) { animation-delay: 0.32s; }
.reveal .strip li:nth-child(3) { animation-delay: 0.39s; }
.reveal .strip li:nth-child(4) { animation-delay: 0.46s; }
.reveal > .defining, .reveal > .stage { animation: rise 0.55s var(--ease-out) 0.55s both; }
.result > .block { animation: rise 0.55s var(--ease-out) 0.7s both; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
