:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5f6b7c;
  --line: #d9e1ea;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --blue: #1264a3;
  --blue-dark: #0b416f;
  --red: #b8292f;
  --green: #13795b;
  --yellow: #f5c044;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 1px; }

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a { text-decoration: none; }
nav a[aria-current="page"] {
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 5px;
}

main { min-height: 78vh; }

.home-hero, .state-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(42px, 7vw, 92px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.78)),
    repeating-linear-gradient(105deg, #e8edf3 0 22px, #f7f9fc 22px 44px);
}

.state-hero { grid-template-columns: minmax(0, 1fr) 320px; }

.test-hero {
  padding-block: clamp(28px, 4vw, 54px);
}

.test-hero h1 {
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
  letter-spacing: 0;
}

h2 { margin: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: 0; }
h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: 0; }

.hero-copy > p:not(.eyebrow), .state-hero p:not(.eyebrow), .combo-card p, .info-band p {
  color: var(--muted);
  line-height: 1.6;
}

.locator, .state-tools, .quick-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}

.locator {
  align-items: flex-start;
  max-width: 580px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.locator label, .state-tools label {
  width: 100%;
  font-size: 13px;
  font-weight: 800;
}

.locator div { display: flex; width: 100%; gap: 10px; }

select, button, .source-link {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font: inherit;
}

button, .source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}

button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #e7edf4;
  color: var(--muted);
  box-shadow: none;
}

.source-link.secondary {
  border-color: var(--line);
  background: white;
  color: var(--blue-dark);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 48%, #f8d85a 48% 52%, transparent 52%),
    linear-gradient(#56616f, #2d3541);
}

.road-sign {
  position: absolute;
  top: 34px;
  left: 34px;
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.28));
}

.mock-card {
  position: absolute;
  right: 26px;
  bottom: 44px;
  width: min(76%, 340px);
  padding: 20px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}

.mock-card span, .mock-card strong { display: block; }
.mock-card span { color: var(--muted); font-size: 13px; }
.mock-card strong { margin: 8px 0; font-size: 22px; }
.mock-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.score-ring {
  position: absolute;
  right: 26px;
  top: 26px;
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  border: 8px solid var(--green);
  border-radius: 999px;
  background: white;
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  padding: 12px;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.trust-badges span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: white;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.info-band, .chooser, .combo-list, .states-section, .exam-panel {
  padding: clamp(30px, 5vw, 64px) clamp(18px, 5vw, 72px);
}

.info-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  background: white;
  border-block: 1px solid var(--line);
}

.info-band article, .exam-summary, .combo-card, .state-card, .question-card, .result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.info-band article { padding: 22px; }

.card-cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 10px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.card-cta::after {
  content: "→";
  margin-left: 6px;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.state-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 12px;
  padding: 14px;
  text-decoration: none;
}

.state-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 6px;
  background: #eaf2f9;
  color: var(--blue-dark);
  font-weight: 900;
}

.state-card small { color: var(--muted); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.chooser .section-heading {
  align-items: flex-start;
  justify-content: flex-start;
}

.quick-controls {
  align-items: stretch;
}

.exam-summary {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.exam-summary strong { font-size: 28px; }
.exam-summary span { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }

.combo-list {
  display: grid;
  gap: 18px;
  padding-top: 0;
}

.combo-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px clamp(18px, 5vw, 72px) 0;
  background: var(--paper);
}

.combo-jump a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: white;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.combo-card {
  padding: 22px;
}

.combo-card summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 22px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.combo-card summary::-webkit-details-marker { display: none; }

.combo-card summary > strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--blue-dark);
  font-size: 13px;
}

.combo-card summary > strong::before {
  content: "▶";
  margin-right: 8px;
  font-size: 11px;
  line-height: 1;
  transition: transform .15s ease;
}

.combo-card[open] summary > strong::before {
  transform: rotate(90deg);
}

.combo-card[open] .test-grid {
  margin-top: 18px;
}

.rule-line { font-weight: 700; }

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.test-grid a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfd;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.exam-panel {
  padding-top: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 18px clamp(18px, 5vw, 72px) 0;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.exam-empty, .quiz-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: clamp(20px, 4vw, 34px);
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.progress {
  height: 12px;
  border-radius: 99px;
  background: #e7edf4;
  overflow: hidden;
}

.progress span { display: block; height: 100%; background: var(--green); }

.quiz-sticky-meta {
  position: sticky;
  top: 72px;
  z-index: 2;
  width: fit-content;
  margin: -8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .96);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .08);
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.question-image {
  display: block;
  width: min(100%, 360px);
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7fa;
}

.answers button {
  justify-content: flex-start;
  min-height: 50px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(23, 32, 51, .04);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.test-hero h1 span {
  display: block;
}

.test-hero .test-context {
  font-size: 1em;
  line-height: 1.08;
}

.test-hero .test-title-break {
  color: var(--muted);
  font-size: .68em;
  line-height: 1.12;
}

.answers button:hover:not(:disabled),
.answers button:focus-visible {
  border-color: var(--blue);
  background: #f3f8fc;
  box-shadow: 0 4px 16px rgba(18, 100, 163, .12);
}

.answers button:active:not(:disabled) {
  transform: translateY(1px);
}

.answers button.correct { border-color: var(--green); background: #eef8f3; color: #0f513d; }
.answers button.wrong { border-color: var(--red); background: #fff1f1; color: #842029; }

.skeleton-line,
.skeleton-answer {
  border-radius: 999px;
  background: linear-gradient(90deg, #edf2f7 0%, #f8fafc 45%, #edf2f7 90%);
  background-size: 220% 100%;
  animation: shimmer 1.35s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 14px;
}

.skeleton-line.short { width: 150px; }
.skeleton-line.title { width: min(560px, 88%); height: 30px; margin-bottom: 26px; }

.skeleton-answer {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.feedback {
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--blue);
  background: #eef6fc;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.feedback::before {
  content: "Why: ";
  color: var(--blue-dark);
  font-weight: 900;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
}

.result-card { padding: 20px; }
.score-big { font-size: 58px; font-weight: 900; }

.topic-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 3fr minmax(86px, auto);
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.bar { height: 10px; border-radius: 99px; background: #e7edf4; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); }
.topic-row.needs-review .bar span { background: var(--red); }
.topic-row.strong-topic .bar span { background: var(--green); }

.review-plan, .missed-list {
  margin-top: 18px;
}

.review-plan article, .missed-list article {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.review-plan article:first-of-type, .missed-list article:first-of-type {
  border-top: 0;
}

.review-plan span, .missed-list span, .missed-list small {
  color: var(--muted);
}

.content-page {
  max-width: 900px;
  padding: clamp(38px, 7vw, 82px) clamp(18px, 5vw, 72px);
}

.content-page h1 {
  font-size: clamp(38px, 5vw, 60px);
}

.content-page .lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.content-page article {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.content-page article:first-of-type {
  margin-top: 28px;
}

.content-page p {
  color: var(--muted);
  line-height: 1.65;
}

footer {
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: white;
}

@media (max-width: 820px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .home-hero, .state-hero, .info-band, .results-grid { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
  .locator div, .quick-controls { flex-direction: column; align-items: stretch; }
  .hero-visual { display: none; }
  .combo-card summary { grid-template-columns: 1fr; }
  .combo-card summary > strong { justify-self: start; }
  .test-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .test-grid a { min-height: 48px; }
  .state-hero.test-hero {
    padding-block: 26px;
  }
  .state-hero.test-hero h1 {
    font-size: 30px;
    line-height: 1.06;
  }
  .state-hero.test-hero .exam-summary {
    display: none;
  }
  .topic-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header {
    gap: 12px;
    padding-block: 12px;
  }

  nav {
    width: 100%;
    gap: 10px;
    justify-content: space-between;
    font-size: 13px;
  }

  .home-hero {
    position: relative;
    padding-top: 34px;
  }

  .home-hero::after {
    content: "STOP";
    position: absolute;
    right: 18px;
    top: 24px;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 4px solid white;
    clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
    background: var(--red);
    color: white;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(23, 32, 51, .18);
  }

  .home-hero h1 {
    padding-right: 82px;
  }

  h1 { font-size: 38px; }

  .combo-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .combo-jump a {
    flex: 0 0 auto;
  }

  .combo-card {
    padding: 18px;
  }

  .combo-card summary {
    gap: 14px;
  }

  .state-hero.test-hero h1 {
    font-size: 26px;
  }

  .answers button {
    min-height: 0;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.35;
  }

  .quiz-top {
    display: grid;
    gap: 10px;
  }

  .quiz-sticky-meta {
    top: 116px;
  }
}
