:root {
  --bg: #edf4f8;
  --paper: #fff;
  --line: #bacbd7;
  --ink: #142a3b;
  --muted: #415c70;
  --highlight: #205d86;
  --action: #142a3b;
  --action-text: #fff;
  --selected: #dcecf8;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d171e;
  --paper: #172732;
  --line: #405969;
  --ink: #eef5fd;
  --muted: #bdccda;
  --highlight: #a9cef4;
  --action: #a9cef4;
  --action-text: #101d2a;
  --selected: #223e53;
}
.theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--ink); }
.theme-toggle:hover { background: var(--paper); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.theme-toggle .theme-moon, [data-theme="light"] .theme-toggle .theme-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-moon { display: block; }
.wordmark { font-family: Manrope, sans-serif; }
.wordmark small { display: block; font-family: "DM Sans", sans-serif; font-size: .75rem; letter-spacing: .045em; font-weight: 500; }
.button.dark { background: var(--action); color: var(--action-text); }
.button.dark:hover { box-shadow: 0 5px 16px #13365130; }
.eyebrow { color: var(--highlight); font-size: .83rem; letter-spacing: .08em; }
.footer { border-top: 1px solid var(--line); font-size: .88rem; }

.quiz-intro {
  display: grid;
  grid-template-areas: "heading" "copy" "preview";
  justify-items: center;
  gap: clamp(20px, 3vw, 36px);
  padding-block: clamp(16px, 3.5vw, 42px) clamp(38px, 7vw, 76px);
  text-align: center;
}
.intro-heading, .intro-copy { width: min(100%, 770px); }
.intro-heading { grid-area: heading; }
.intro-copy { grid-area: copy; }
.quiz-intro h1 {
  font-size: clamp(2.65rem, 5.65vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -.067em;
  line-height: 1.025;
  text-wrap: balance;
  margin-top: 12px;
}
.quiz-intro em { color: var(--highlight); font-style: normal; }
.intro-lede { font-size: clamp(1.07rem, 1.7vw, 1.24rem); color: var(--muted); max-width: 52ch; margin-inline: auto; }
#quiz-start { margin-top: 22px; }
@media (prefers-reduced-motion: no-preference) {
  :is(#quiz-start, #start-launch):not(:disabled, [hidden], :hover, :focus-visible) {
    animation: quiz-start-wiggle 3.2s .45s ease-in-out infinite;
  }
}
@keyframes quiz-start-wiggle {
  4% { transform: translateX(-9px) rotate(-2deg); }
  9% { transform: translateX(9px) rotate(2deg); }
  14% { transform: translateX(-7px) rotate(-1.5deg); }
  19% { transform: translateX(5px) rotate(1deg); }
  24%, 100% { transform: none; }
}
.intro-meta { margin-top: 13px; color: var(--muted); font-size: .9rem; }

.funnel-preview {
  grid-area: preview;
  position: relative;
  width: min(100%, 800px);
  padding: clamp(13px, 2.7vw, 29px);
  background: radial-gradient(ellipse at 12% 0%, #244767, #111f30 62%, #142b38);
  border: 1px solid #38556b;
  border-radius: 24px;
  color: #eaf4ff;
  box-shadow: 0 24px 55px #173a4725;
}
.funnel-preview figcaption {
  display: flex;
  justify-content: center;
  gap: .35rem 1.15rem;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: #c2d8ec;
  font-size: .89rem;
  font-weight: 700;
}
.preview-hint { color: #fff; }
.preview-start {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.funnel-preview:has(.preview-start:hover) { border-color: #81aacc; }
.funnel-preview:has(.preview-start:hover) .preview-hint { text-decoration: underline; text-underline-offset: 4px; }
.sample-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.sample-card { padding: clamp(12px, 2vw, 22px); border-radius: 13px; text-align: start; }
.sample-question { background: #203b52; border: 1px solid #4f7089; }
.sample-result { background: #ddecf8; color: #142a3b; box-shadow: 0 8px 27px #0003; }
.sample-label { display: block; font-size: .875rem; font-weight: 700; }
.sample-card h2 { margin-block: 7px 12px; font-size: clamp(1.2rem, 2.05vw, 1.63rem); font-weight: 800; line-height: 1.15; }
.sample-choice { margin-top: 7px; padding: 7px 9px; border: 1px solid #66849d; border-radius: 6px; font-size: .875rem; line-height: 1.35; display: flex; align-items: center; gap: 9px; }
.sample-choice::before { content: ""; width: 10px; height: 10px; border: 1px solid #a9cef4; border-radius: 50%; flex: none; }
.sample-choice:first-of-type { background: #355e80; }
.sample-choice:first-of-type::before { background: #a9cef4; }
.sample-result p { font-size: .92rem; line-height: 1.45; }
.sample-next { display: inline-flex; align-items: center; gap: 10px; background: #1c3c57; color: #fff; border-radius: 5px; padding: 6px 10px; font-size: .88rem; font-weight: 700; margin-top: 13px; }
.sample-connector { height: 2px; background: #a9cef4; position: relative; color: #a9cef4; }
.sample-connector::after { content: ""; position: absolute; top: -3px; right: 0; width: 6px; height: 6px; border-right: 2px solid; border-top: 2px solid; transform: rotate(45deg); }

[data-quiz-started] .site-header {
  position: absolute;
  top: 8px;
  right: max(18px, calc((100% - 1180px) / 2));
  width: auto;
  margin: 0;
  padding: 0;
}
[data-quiz-started] .site-header .wordmark, [data-quiz-started] .footer { display: none; }
.quiz-shell { width: min(100%, 690px); margin: auto; padding: clamp(28px, 10svh, 96px) 0 36px; }
[data-quiz-started] .quiz-shell { padding-top: clamp(58px, 10svh, 96px); }
.quiz-progress { margin-bottom: clamp(24px, 6svh, 46px); color: var(--muted); font-weight: 700; }
.progress-track { margin-top: 9px; height: 5px; background: var(--line); border-radius: 5px; }
.progress-track span { display: block; background: var(--highlight); width: 0; height: 100%; border-radius: inherit; transition: width .22s; }
.quiz-shell h2 { font-size: clamp(1.85rem, 5vw, 2.8rem); line-height: 1.12; margin-bottom: 22px; font-weight: 800; }
#answer-options { display: grid; gap: 9px; }
.answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 53px;
  padding: 11px 17px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  text-align: start;
  line-height: 1.4;
}
.answer::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.answer:active { border-color: var(--highlight); }
.answer.is-selected { border-color: var(--highlight); background: var(--selected); }
.quiz-controls { margin-top: 14px; }
.back-button { border: 0; background: transparent; color: var(--ink); min-height: 44px; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 580px) {
  .quiz-intro h1 { font-size: clamp(2.2rem, 8.2vw, 2.8rem); }
  .funnel-preview figcaption { column-gap: .6rem; font-size: .8125rem; }
  .sample-flow { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); gap: 5px; align-items: stretch; }
  .sample-card { padding: clamp(8px, 2.5vw, 14px); }
  .sample-card h2 { margin-block: 5px 8px; font-size: clamp(1rem, 3.5vw, 1.25rem); }
  .sample-label, .sample-choice, .sample-result p, .sample-next { font-size: .75rem; }
  .sample-choice { gap: 5px; padding: 5px 6px; }
  .sample-choice::before { width: 8px; height: 8px; }
  .sample-connector { align-self: center; }
  .sample-next { gap: 4px; margin-top: 8px; padding-inline: 6px; }
}
@media (max-height: 640px) {
  .quiz-shell { padding-top: 20px; }
  .quiz-progress { margin-bottom: 18px; }
}
