/* ── AI READINESS QUIZ ──────────────────────
   Three full-screen beats on one page: the invitation, the quiz, the result.
   Each beat fills the viewport, so the footer never sits half-visible under
   a short card. */

.rq {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--sky-blue);
}

.rq .sky, .rq .clouds-front { position: absolute; inset: 0; z-index: 0; }
.rq .clouds-front { inset: -4% 0; z-index: 1; }
.rq::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 56, 92, 0.3), rgba(8, 56, 92, 0.06) 40%, rgba(8, 56, 92, 0.22));
  content: "";
  pointer-events: none;
}

.sky-stickers { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.sky-sticker {
  position: absolute;
  left: min(var(--x), calc(100% - var(--s) - 16px));
  top: min(var(--y), calc(100% - var(--s) - 16px));
  width: var(--s);
  height: auto;
  opacity: 0.88;
  rotate: var(--r);
  animation: sticker-float 9s var(--d, 0s) ease-in-out infinite;
  filter: drop-shadow(3px 4px 0 rgba(17, 17, 17, 0.26));
}
@keyframes sticker-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* ── PANELS ────────────────────────────────── */

.rq-panel {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(84px, 10vh, 112px) var(--gutter) clamp(40px, 5vh, 64px);
}
.rq-panel.is-leaving { animation: panel-out 0.3s var(--ease) both; }
.rq-panel.is-entering { animation: panel-in 0.52s var(--ease) both; }
@keyframes panel-out { to { opacity: 0; transform: translateY(-18px) scale(0.985); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(26px) scale(0.985); } }

/* ── 1. THE INVITATION ─────────────────────── */

.rq-inner {
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.1vh, 24px);
  width: min(1040px, 100%);
  text-align: center;
}

.rq-title {
  margin: 0;
  font-size: clamp(2.2rem, 1rem + 3.6vw, 4.3rem);
  line-height: 0.94;
  color: var(--title-yellow);
  text-wrap: balance;
}
.rq-lead {
  max-width: 44ch;
  font: 600 clamp(17px, 1.3vw, 20px)/1.5 var(--font-text);
  color: #07293d;
}

.fact {
  width: min(520px, 100%);
  padding: clamp(17px, 2.1vw, 24px) clamp(20px, 2.5vw, 30px) clamp(14px, 1.8vw, 19px);
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 7px 8px 0 var(--ink);
  rotate: -1.3deg;
}
.fact-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font: 900 clamp(52px, 6.4vw, 86px)/0.84 var(--font-display);
  font-stretch: 125%;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.fact-pct { color: var(--blob-orange); }
.fact-copy { margin-top: 10px; font: 500 clamp(15px, 1.2vw, 17px)/1.4 var(--font-text); }
.fact-copy strong { font-weight: 800; }
.fact-source {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 2px solid rgba(17, 17, 17, 0.14);
  font: 500 12px/1.45 var(--font-text);
  color: #4a4a4a;
  font-variant-numeric: tabular-nums;
}
.fact-source a { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; text-underline-offset: 2px; }
.fact-source .i { width: 1.1em; height: 1.1em; }

.rq-start { min-height: 62px; padding-inline: 34px; font-size: 18px; border-width: 4px; box-shadow: 0 6px 0 var(--ink); }
.rq-start:hover { box-shadow: 0 9px 0 var(--ink); }
.rq-start:active { box-shadow: 0 2px 0 var(--ink); }
.rq-micro { font: 600 13px/1.4 var(--font-text); color: #07293d; }

/* ── 2. THE QUIZ ───────────────────────────── */

.quiz-card {
  position: relative;
  z-index: 2;
  width: min(840px, 100%);
  padding: clamp(24px, 3vw, 44px) clamp(22px, 3vw, 46px) clamp(24px, 3vw, 38px);
  border: 5px solid var(--ink);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: 10px 11px 0 var(--ink);
}

.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quiz-kicker { font: 700 12.5px/1 var(--font-text); letter-spacing: 0.1em; text-transform: uppercase; color: #6b5a2c; }
.quiz-quit {
  border: 0;
  background: transparent;
  font: 700 12.5px/1 var(--font-text);
  color: #908a7b;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s var(--ease);
}
.quiz-quit:hover { color: var(--ink); }

.progress-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; margin-top: 14px; }
.pip {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #fff;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.pip.is-done { background: var(--title-yellow); }
.pip.is-now { background: var(--blob-orange); transform: scaleY(1.5); }

.quiz-body { position: relative; margin-top: clamp(22px, 2.8vw, 34px); transition: height 0.42s var(--ease); }
.quiz-body.is-measuring { overflow: hidden; }
.quiz-slide { transition: opacity 0.26s var(--ease), transform 0.34s var(--ease); }
.quiz-slide.is-out { opacity: 0; transform: translateX(var(--exit, -22px)); }
.quiz-slide.is-in { opacity: 0; transform: translateX(var(--enter, 22px)); }

.question-overline { font: 700 12.5px/1 var(--font-text); letter-spacing: 0.09em; text-transform: uppercase; color: var(--blob-orange); }
.question-title {
  max-width: 20ch;
  margin-top: 12px;
  font: 600 clamp(26px, 3vw, 42px)/1.1 var(--font-round);
  letter-spacing: -0.02em;
}
.question-title:focus, .result-title:focus { outline: none; }
.question-help { max-width: 48ch; margin-top: 11px; font: 500 15.5px/1.5 var(--font-text); color: #5c5648; }

.answer-options { display: grid; gap: 11px; margin-top: clamp(22px, 2.6vw, 30px); padding: 0; border: 0; }

.answer-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 22px 14px 16px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
              background-color 0.22s var(--ease), opacity 0.26s var(--ease);
}
.answer-option:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ink); }
.answer-option:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); transition-duration: 0.06s; }
.answer-option:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.answer-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* the pick: the row punches, the key chip flips, a ring snaps out, and the
   two rows you didn't choose fall back */
.answer-option.is-picked { background: var(--title-yellow); animation: pick-pop 0.46s var(--ease); z-index: 1; }
@keyframes pick-pop {
  0% { transform: translateY(3px) scale(0.98); box-shadow: 0 1px 0 var(--ink); }
  38% { transform: translateY(-8px) scale(1.04); box-shadow: 0 11px 0 var(--ink); }
  72% { transform: translateY(1px) scale(0.993); box-shadow: 0 3px 0 var(--ink); }
  100% { transform: none; box-shadow: 0 4px 0 var(--ink); }
}
.answer-option.is-dimmed { opacity: 0.4; transform: scale(0.975); box-shadow: 0 2px 0 var(--ink); }
.answer-option.is-dimmed:hover { transform: scale(0.975); box-shadow: 0 2px 0 var(--ink); }

.answer-option::after {
  position: absolute;
  inset: -3px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  content: "";
  opacity: 0;
  pointer-events: none;
}
.answer-option.is-picked::after { animation: pick-ring 0.62s var(--ease); }
@keyframes pick-ring {
  0% { opacity: 0.85; scale: 1; }
  100% { opacity: 0; scale: 1.07; }
}

.answer-key {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: var(--card-blue);
  font: 800 17px/1 var(--font-text);
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease);
}
.answer-option.is-picked .answer-key {
  background: var(--ink);
  color: var(--title-yellow);
  animation: key-flip 0.46s var(--ease);
}
@keyframes key-flip { from { transform: rotateY(-180deg) scale(0.8); } }
.answer-text { font: 600 clamp(16px, 1.35vw, 18.5px)/1.3 var(--font-text); }

.quiz-slide .answer-option { animation: opt-in 0.44s var(--ease) both; animation-delay: calc(var(--i) * 58ms + 60ms); }
@keyframes opt-in { from { opacity: 0; transform: translateY(12px); } }

.quiz-controls { display: flex; align-items: center; gap: 14px; margin-top: clamp(20px, 2.4vw, 28px); }
.quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 4px;
  border: 0;
  background: transparent;
  font: 700 14px/1 var(--font-text);
  color: #5c5648;
  cursor: pointer;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}
.quiz-back:hover { color: var(--ink); transform: translateX(-3px); }
.quiz-hint { margin-left: auto; font: 600 12.5px/1 var(--font-text); color: #908a7b; }
.quiz-hint kbd {
  display: inline-block;
  min-width: 19px;
  padding: 3px 5px;
  border: 1.5px solid rgba(17, 17, 17, 0.3);
  border-radius: 5px;
  background: #fff;
  font: 700 11px/1 var(--font-text);
  text-align: center;
}

/* ── 3. THE RESULT ─────────────────────────── */

.quiz-result > * { animation: res-in 0.5s var(--ease) both; animation-delay: calc(var(--i) * 80ms); }
@keyframes res-in { from { opacity: 0; transform: translateY(14px); } }

.result-meter { display: flex; align-items: center; gap: clamp(16px, 2vw, 26px); }
.meter-dial { position: relative; flex: 0 0 112px; width: 112px; height: 112px; }
.meter-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.meter-dial circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.meter-track { stroke: #e7e2d2; }
.meter-value { stroke: var(--blob-orange); transition: stroke-dashoffset 1s var(--ease); }
.meter-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 30px/1 var(--font-text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.meter-num small { font-size: 13px; font-weight: 700; color: #767063; }

.result-overline {
  display: inline-block;
  padding: 8px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--title-yellow);
  font: 700 12.5px/1 var(--font-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.result-title { max-width: 13ch; margin-top: 11px; font-size: clamp(1.8rem, 2.5vw, 2.7rem); line-height: 0.95; }
.result-summary { max-width: 52ch; margin-top: 16px; font: 500 16px/1.5 var(--font-text); }

.recommendation {
  margin-top: clamp(18px, 2.2vw, 26px);
  padding: clamp(20px, 2.6vw, 30px);
  border: 3px solid var(--ink);
  border-radius: 26px;
  background: var(--card-blue);
  box-shadow: 5px 6px 0 var(--ink);
}
.recommendation-label { font: 700 12px/1 var(--font-text); letter-spacing: 0.1em; text-transform: uppercase; color: #1d4a63; }
.recommendation h3 { margin-top: 10px; font: 600 clamp(24px, 2.4vw, 32px)/1.1 var(--font-round); letter-spacing: -0.015em; }
.offer-price {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font: 800 14px/1 var(--font-text);
}
.offer-copy { max-width: 56ch; margin-top: 12px; font: 500 15px/1.5 var(--font-text); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.offer-link { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1.3 var(--font-text); text-underline-offset: 3px; }

.result-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.result-bottom p { max-width: 50ch; font: 500 13px/1.5 var(--font-text); color: #5c5648; }
.restart-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 17px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  font: 700 13px/1 var(--font-text);
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.restart-button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.restart-button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); transition-duration: 0.06s; }

.result-confetti { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.result-confetti img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 54px);
  height: auto;
  rotate: var(--r);
  animation: confetti-drop 0.72s var(--ease) both;
  animation-delay: calc(var(--i) * 90ms + 240ms);
  filter: drop-shadow(3px 4px 0 rgba(17, 17, 17, 0.2));
}
@keyframes confetti-drop {
  from { opacity: 0; translate: 0 -46px; rotate: calc(var(--r) - 40deg); }
}

/* ── CLOSING STRIP ─────────────────────────── */

.rq-ticker { position: relative; z-index: 2; inset: auto; }
.readiness-footer { position: relative; z-index: 2; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ── NARROW ────────────────────────────────── */

@media (max-width: 620px) {
  .rq-panel { padding: 88px var(--gutter) 56px; }
  .rq-inner { gap: 16px; }
  .rq-title { font-size: clamp(2rem, 8.8vw, 2.9rem); }
  .rq-lead { font-size: 16px; }
  .fact { padding: 18px 19px 15px; border-width: 3px; border-radius: 22px; box-shadow: 5px 6px 0 var(--ink); }
  .fact-number { font-size: 56px; }
  .fact-copy { font-size: 14.5px; }
  .fact-source { font-size: 11px; }
  .rq-start { min-height: 56px; padding-inline: 26px; font-size: 16px; border-width: 3px; }
  /* a phone has no open sky beside the content, so the stickers would sit on the words */
  .sky-stickers { display: none; }

  .quiz-card { padding: 22px 18px 20px; border-width: 3px; border-radius: 26px; box-shadow: 6px 7px 0 var(--ink); }
  .question-title { font-size: 24px; }
  .question-help { font-size: 14px; }
  .answer-option { min-height: 66px; gap: 12px; padding: 12px 15px 12px 12px; border-width: 2.5px; border-radius: 17px; }
  .answer-key { flex-basis: 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .answer-text { font-size: 15px; }
  .quiz-hint { display: none; }
  .result-meter { gap: 14px; }
  .meter-dial { flex-basis: 84px; width: 84px; height: 84px; }
  .meter-num { font-size: 23px; }
  .meter-num small { font-size: 11px; }
  .result-title { font-size: 1.8rem; }
  .result-summary { font-size: 15px; }
  .recommendation { border-radius: 20px; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions .btn { width: 100%; white-space: normal; }
  .result-bottom { align-items: flex-start; flex-direction: column; gap: 13px; }
  .rq-ticker .tick-item { gap: 10px; padding: 8px 18px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-body, .quiz-slide, .pip, .answer-option, .meter-value, .restart-button { transition: none; }
  .quiz-slide .answer-option, .quiz-result > *, .answer-option.is-picked,
  .answer-option.is-picked::after, .answer-option.is-picked .answer-key,
  .sky-sticker, .result-confetti img, .rq-ticker .ticker-run,
  .rq-panel.is-leaving, .rq-panel.is-entering { animation: none; }
}
