/* ============================================================================
   Athletes Edge Recovery Quiz — styles
   Dark theme only. Tokens mirror the signed-off handoff; a couple of faint
   text tokens are nudged to clear WCAG AA (noted with AA:).
   ============================================================================ */

:root {
  /* Surfaces */
  --bg: #0A0A0A;
  --surface: #141412;          /* cards, inputs */
  --surface-manual: #121210;   /* pitch block */

  /* Borders / lines */
  --border-card: #282824;
  --border-input: #2A2A26;
  --border-unsel: #3A3A34;     /* unselected ticks / checkbox */
  --hairline: #1F1F1C;
  --track: #1C1C1A;

  /* Text ramp */
  --ink: #F2F1ED;              /* primary */
  --secondary: #C9C9C2;
  --body: #A6A69E;
  --muted: #8B8B84;
  --legal: #7C7C74;            /* AA: was #57574F (~2.6:1); nudged to ~4.6:1 for essential microcopy */
  --faint: #57574F;            /* decorative only (never essential text) */
  --pending: #4E4E48;

  /* Accent */
  --accent: #F5A623;
  --accent-deep: #FF8A00;
  --accent-tint: rgba(245, 166, 35, 0.09);
  --focus: rgba(245, 166, 35, 0.6);

  /* Semantic */
  --error: #FF6B4A;
  --band-red: #FF5A36;
  --band-amber: #F5A623;
  --band-green: #4CC38A;
  --pillar-fill: #75756D;

  /* Shape */
  --r-card: 10px;
  --r-input: 8px;
  --r-bar: 4px;
  --r-manual: 12px;
  --r-pill: 999px;

  /* Motion */
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-out-quart: cubic-bezier(.25, 1, .5, 1);
  --dur-micro: 120ms;
  --dur-fast: 200ms;
  --dur-screen: 240ms;

  /* Layout */
  --col: 560px;
  --pad: 20px;

  /* Type */
  --display: 'Oswald', system-ui, sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

/* --- Reset / base --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(115deg,
    rgba(255, 255, 255, 0.014) 0, rgba(255, 255, 255, 0.014) 1px,
    transparent 1px, transparent 96px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { -webkit-tap-highlight-color: transparent; }
::placeholder { color: var(--pending); opacity: 1; }
button { font-family: inherit; }
a { color: var(--muted); text-decoration-color: #3A3A36; text-underline-offset: 3px; transition: color var(--dur-fast); }
a:hover { color: var(--accent); }

:where(button, a, input, [role="checkbox"]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.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;
}

/* --- App shell --- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; }
.shell {
  width: 100%; max-width: var(--col); min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; padding: 0 var(--pad);
  padding-bottom: env(safe-area-inset-bottom);
}

.hdr { display: flex; justify-content: center; padding: 24px 0 16px; }
.logo {
  font-family: var(--display); font-weight: 600; font-size: 13px;
  letter-spacing: .32em; text-indent: .32em; color: var(--ink);
}

/* --- Progress (quiz + gate) --- */
.progress { padding-top: 6px; }
.progress[hidden] { display: none; }
.progress__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress__label { font-family: var(--display); font-size: 12px; letter-spacing: .16em; color: var(--accent); font-weight: 600; }
.progress__diag { font-size: 10px; letter-spacing: .14em; color: var(--legal); font-weight: 500; }
.progress__track { height: 3px; background: var(--track); border-radius: 2px; overflow: hidden; }
.progress__fill {
  height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: transform var(--dur-fast) var(--ease-out-expo);
}

/* --- Screens --- */
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen[hidden] { display: none; }
/* Screen containers receive programmatic focus on transition (a11y); no visible ring on the container itself */
.screen:focus, .screen:focus-visible { outline: none; }

/* --- Shared utilities --- */
.eyebrow { margin: 0 0 16px; font-size: 11px; letter-spacing: .22em; color: var(--muted); font-weight: 500; }

.cta {
  width: 100%; padding: 18px; border: none; border-radius: var(--r-card);
  background: var(--accent); color: #0A0A0A;
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .14em;
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out-quart), transform var(--dur-micro) var(--ease-out-quart), opacity var(--dur-fast);
}
.cta:hover { background: var(--accent-deep); }
.cta:active { transform: scale(.985); }
.cta[disabled] { cursor: default; }

.legal { margin: 16px 0 0; text-align: center; font-size: 11px; color: var(--legal); }

/* --- Intro --- */
.screen--intro { padding-top: 7vh; }
.intro__top { animation: fadeUp .4s var(--ease-out-quart) both; }
.intro__h1 {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(42px, 12vw, 58px); line-height: .98; letter-spacing: -.01em;
  color: var(--ink); text-wrap: balance;
}
.intro__h1 .accent { color: var(--accent); }
.intro__sub {
  margin: 20px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--body);
  max-width: 44ch; text-wrap: pretty;
}
.intro__bottom { margin-top: auto; padding-bottom: 22px; animation: fadeUp .4s .12s var(--ease-out-quart) both; }
.timepromise { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 14px; }
.timepromise__dot { width: 6px; height: 6px; background: var(--accent); animation: blink 1.6s infinite; }
.timepromise__text { font-size: 12px; letter-spacing: .18em; color: var(--ink); font-weight: 500; }

/* --- Question screen --- */
.screen--quiz { padding-top: 28px; }
.q { display: flex; flex-direction: column; }
.q__text {
  margin: 0 0 24px; font-family: var(--display); font-weight: 600;
  font-size: clamp(24px, 6.6vw, 30px); line-height: 1.14; letter-spacing: .01em;
  text-transform: uppercase; color: var(--ink); text-wrap: pretty;
}
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; min-height: 56px;
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--r-card);
  color: var(--ink); font-family: inherit; font-size: 15.5px; line-height: 1.4; cursor: pointer;
  transition: border-color var(--dur-micro), background var(--dur-micro), transform var(--dur-micro) var(--ease-out-quart);
}
.answer:active { transform: scale(.99); }
.answer.is-sel { background: var(--accent-tint); border-color: var(--accent); }
.answer__label { flex: 1; }
.answer__tick {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-unsel); background: transparent;
  transition: background var(--dur-micro), border-color var(--dur-micro);
}
.answer__tick svg { width: 12px; height: 12px; fill: none; stroke: #0A0A0A; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.answer__tick path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.answer.is-sel .answer__tick { background: var(--accent); border-color: var(--accent); animation: tickPop var(--dur-fast) var(--ease-out-quart); }
.answer.is-sel .answer__tick path { animation: tickDraw var(--dur-fast) 40ms var(--ease-out-quart) forwards; }

.q__backwrap { margin-top: 24px; }
.q__backwrap[hidden] { display: none; }
.backlink {
  background: none; border: none; padding: 8px 0; color: var(--muted);
  font-family: inherit; font-size: 13px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #3A3A36;
  transition: color var(--dur-fast);
}
.backlink:hover { color: var(--ink); }

/* --- Analysis interstitial --- */
.screen--analysis { align-items: center; justify-content: center; gap: 36px; padding-bottom: 9vh; }
.ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.ring__svg { transform: rotate(-90deg); }
.ring--analysis #analysis-arc { transition: stroke-dashoffset .55s var(--ease-out-quart); }
.ring__glow {
  position: absolute; inset: -18px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(245,166,35,.22), transparent 68%);
  animation: glowBreathe 2.4s var(--ease-out-quart) infinite;
}
.ring__pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); color: var(--accent); }
.ring__pct--analysis { font-size: 18px; }
.analines { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 13px; font-family: var(--mono); font-size: 13px; }
.analine { display: flex; gap: 10px; align-items: baseline; color: var(--pending); transition: color .2s; }
.analine__glyph { min-width: 14px; color: var(--border-unsel); }
.analine.is-active { color: var(--ink); }
.analine.is-active .analine__glyph { color: var(--accent); animation: blink 1s infinite; }
.analine.is-done { color: var(--muted); }
.analine.is-done .analine__glyph { color: var(--accent); }

/* --- Lead gate --- */
.screen--gate { padding-top: 28px; padding-bottom: 28px; }
.gate__head { animation: fadeUp .35s var(--ease-out-quart) both; }
.gate__h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(32px, 9vw, 42px); line-height: 1; color: var(--ink); }
.gate__h2 .accent { color: var(--accent); }
.gate__sub { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: var(--body); }
.gate__form { animation: fadeUp .35s .1s var(--ease-out-quart) both; }
.field { display: block; margin-top: 18px; }
.field:first-of-type { margin-top: 24px; }
.field__label { display: block; font-size: 11px; letter-spacing: .16em; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.field__input {
  width: 100%; background: var(--surface); border: 1px solid var(--border-input); border-radius: var(--r-input);
  padding: 16px; font-size: 16px; color: var(--ink); font-family: inherit; outline: none;
  transition: border-color var(--dur-micro);
}
.field__input:focus { border-color: var(--accent); }
.field__input.is-invalid { border-color: var(--error); }
.field__err { margin: 7px 0 0; font-size: 12.5px; color: var(--error); }
.field__err[hidden] { display: none; }
.emailhint { display: block; margin: 7px 0 0; padding: 0; background: none; border: none; font-family: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.emailhint[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: 12px; margin-top: 24px; align-items: flex-start; }
.consent__box {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; border: 1px solid var(--border-unsel);
  background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center;
  transition: background var(--dur-micro), border-color var(--dur-micro);
}
.consent__box svg { width: 13px; height: 13px; fill: none; stroke: #0A0A0A; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.consent__box[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.consent__box[aria-checked="true"] svg { opacity: 1; animation: tickPop var(--dur-fast) var(--ease-out-quart); }
.consent__copy { margin: 0; font-size: 13px; line-height: 1.5; color: var(--body); }
.gate__age { margin: 12px 0 0; font-size: 11px; color: var(--legal); }
#gate-cta { margin-top: 24px; }
.cta.is-working { opacity: .65; position: relative; overflow: hidden; }
.cta.is-working::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: sheen 1.1s var(--ease-out-quart) infinite;
}

/* --- Results --- */
.screen--results { padding-top: 8px; padding-bottom: 96px; display: block; }
.res-hero { text-align: center; padding: 24px 0 6px; background: radial-gradient(circle at 50% 32%, rgba(245,166,35,.07), transparent 62%); animation: fadeUp .4s var(--ease-out-quart) both; }
.ring--score { width: 184px; height: 184px; margin: 0 auto; }
.ring--score .arc-fg { transition: none; filter: drop-shadow(0 0 5px rgba(245,166,35,.0)); }
.score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; }
.score-num__val { font-family: var(--display); font-weight: 700; font-size: 58px; line-height: 1; color: var(--ink); }
.score-num__max { font-size: 14px; color: var(--faint); align-self: flex-end; padding-bottom: 14px; }
.bandchip { display: inline-flex; margin-top: 20px; padding: 7px 15px; border: 1px solid; border-radius: var(--r-pill); font-size: 11px; letter-spacing: .18em; font-weight: 600; opacity: 0; transform: translateY(6px); }
.bandchip.is-in { opacity: 1; transform: none; transition: opacity .4s var(--ease-out-quart), transform .4s var(--ease-out-quart); }
.verdict-name { margin: 8px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(36px, 10vw, 46px); line-height: 1; color: var(--accent); }
.verdict-name.is-wipe { clip-path: inset(0 100% 0 0); }
.verdict-name.is-wipe.is-in { clip-path: inset(0 0 0 0); transition: clip-path .5s var(--ease-out-expo); }
.diagnosis { margin: 14px auto 0; font-size: 15.5px; line-height: 1.55; color: var(--secondary); max-width: 38ch; text-wrap: pretty; }

.res-section { margin-top: 40px; }
.res-section--breakdown { margin-top: 34px; }
.section-head { margin: 0; font-size: 11px; letter-spacing: .22em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 12px; }
.section-head::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

.pillar { margin-top: 17px; }
.pillar__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.pillar__label { font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--body); }
.pillar__right { display: flex; gap: 9px; align-items: baseline; }
.pillar__tag { font-size: 10px; letter-spacing: .14em; color: var(--accent-deep); font-weight: 600; opacity: 0; }
.pillar__tag.is-in { opacity: 1; transition: opacity .3s var(--ease-out-quart); }
.pillar__score { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
.pillar__track { height: 8px; background: var(--track); border-radius: var(--r-bar); overflow: hidden; }
.pillar__fill { height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); border-radius: var(--r-bar); background: var(--pillar-fill); }
.pillar.is-weak .pillar__label { color: var(--ink); }
.pillar.is-weak .pillar__score { color: var(--accent-deep); }
.pillar.is-weak .pillar__fill { background: linear-gradient(90deg, #FF6B2E, #F5A623); }
.pillar__next { margin: 17px 0 0; font-size: 13px; color: var(--muted); }

.fix-intro { margin: 16px 0 0; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.fix-freq { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--accent); }
.tip { display: flex; gap: 14px; margin-top: 19px; }
.tip__n { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--accent); min-width: 26px; }
.tip__text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--secondary); text-wrap: pretty; }

/* Pitch block */
.pitch { margin-top: 40px; border: 1px solid #2A2A24; border-radius: var(--r-manual); padding: 22px; background: var(--surface-manual); }
.pitch__eyebrow { margin: 0; font-size: 10.5px; letter-spacing: .2em; color: var(--accent); font-weight: 600; }
.pitch__frame { margin: 12px 0 0; font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.24; text-transform: uppercase; color: var(--ink); text-wrap: pretty; }
.pitch__cover { margin: 18px 0 0; border-radius: 8px; overflow: hidden; }
.pitch__cover img { display: block; width: 100%; height: auto; }
.cover-fallback { aspect-ratio: 3 / 4; max-width: 190px; margin: 0 auto; border: 1px solid var(--accent); border-radius: 8px; background: linear-gradient(160deg, #171512, #0C0B0A); display: flex; flex-direction: column; justify-content: space-between; padding: 18px 16px; text-align: left; }
.cover-fallback__brand { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .28em; color: var(--body); }
.cover-fallback__rule { height: 2px; width: 34px; background: var(--accent); }
.cover-fallback__title { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.02; text-transform: uppercase; color: var(--ink); }
.cover-fallback__foot { font-size: 9.5px; letter-spacing: .16em; color: var(--accent); }
.pitch__hook { margin: 18px 0 0; font-size: 14px; line-height: 1.6; color: var(--secondary); text-wrap: pretty; }
.pitch__bullets { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pitch__bullet { display: flex; gap: 11px; font-size: 13.5px; line-height: 1.45; color: var(--body); }
.pitch__bullet::before { content: ''; flex: 0 0 7px; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.pitch__buy { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 0; }
.pitch__price { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--ink); }
.pitch__pricenote { font-size: 12px; color: var(--muted); }
.pitch__cta { margin-top: 16px; text-decoration: none; display: block; text-align: center; }
.pitch__cta[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.res-trust { margin: 36px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--muted); }
.res-medical { margin: 10px 0 0; text-align: center; font-size: 11px; color: var(--legal); }

/* Sticky pitch CTA */
.stickycta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 11, 10, .92); border-top: 1px solid var(--border-card);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transform: translateY(110%); transition: transform .35s var(--ease-out-expo);
}
.stickycta.is-in { transform: none; }
.stickycta[hidden] { display: none; }
.stickycta__meta { flex: 1; min-width: 0; }
.stickycta__title { font-family: var(--display); font-weight: 600; font-size: 13px; text-transform: uppercase; color: var(--ink); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stickycta__price { font-size: 12px; color: var(--muted); }
.stickycta__btn {
  flex: 0 0 auto; padding: 13px 18px; border-radius: var(--r-card); background: var(--accent); color: #0A0A0A;
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .1em; text-decoration: none;
  transition: background var(--dur-fast);
}
.stickycta__btn:hover { background: var(--accent-deep); color: #0A0A0A; }

/* --- Keyframes --- */
@keyframes tickPop { from { transform: scale(.5); } 60% { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes tickDraw { to { stroke-dashoffset: 0; } }
@keyframes glowBreathe { 0%, 100% { opacity: .5; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes sheen { to { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes screenIn { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

/* --- Reduced motion: kill all motion, keep content visible --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
