:root {
  --bg: #f6efe2;
  --surface: rgba(255, 251, 244, 0.84);
  --surface-strong: #fffaf1;
  --ink: #10233a;
  --ink-soft: #40556d;
  --accent: #d8653e;
  --accent-dark: #9d4323;
  --gold: #d4a85d;
  --sage: #6d8567;
  --line: rgba(16, 35, 58, 0.12);
  --success: #1e7c5b;
  --danger: #b44937;
  --shadow: 0 24px 60px rgba(16, 35, 58, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(212, 168, 93, 0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(216, 101, 62, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f1e5 0%, #efe6d7 100%);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a.button-link {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -50px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 1000;
}

.skip-link:focus {
  top: 12px;
}

.noscript {
  max-width: 720px;
  margin: 48px auto;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(246, 239, 226, 0.74);
  border-bottom: 1px solid rgba(16, 35, 58, 0.08);
}

.topbar-inner,
.section-inner,
.footer-inner {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ink), #20486f);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 24px rgba(16, 35, 58, 0.18);
}

.brand-mark::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 3px solid rgba(255, 250, 241, 0.9);
  border-top-color: var(--gold);
  transform: rotate(45deg);
}

.brand-copy strong,
.footer-brand strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.brand-copy span,
.footer-brand span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link,
.lang-link,
.button-link,
.mode-button,
.pill-button,
.next-button,
.review-button {
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
}

.nav-link.active,
.nav-link:hover {
  background: rgba(16, 35, 58, 0.08);
  color: var(--ink);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lang-link {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border-color: rgba(16, 35, 58, 0.1);
  box-shadow: 0 10px 20px rgba(16, 35, 58, 0.06);
}

.lang-link:hover,
.button-link:hover,
.mode-button:hover,
.pill-button:hover,
.next-button:hover,
.review-button:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: clip;
  padding: 32px 0 80px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(16, 35, 58, 0.9), rgba(16, 35, 58, 0.78)),
    linear-gradient(145deg, rgba(216, 101, 62, 0.26), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400'%3E%3Cpath d='M0 330c112-76 190-105 273-100 83 5 164 43 327 137V400H0z' fill='%23d4a85d' fill-opacity='.16'/%3E%3Cpath d='M244 0l28 98h84L280 0z' fill='%23d8653e' fill-opacity='.35'/%3E%3Cpath d='M425 70l0 124' stroke='%23f3e7d0' stroke-width='14' stroke-linecap='round'/%3E%3Cpath d='M425 194a42 42 0 1 1 0-84a42 42 0 0 1 0 84Z' fill='none' stroke='%23f3e7d0' stroke-width='14'/%3E%3C/svg%3E") center/cover;
}

.hero-inner {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  position: relative;
  min-height: calc(100svh - 132px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 40px;
  align-items: end;
}

.hero-copy {
  color: #f8f1e5;
  padding: 48px 0 32px;
  animation: rise 0.7s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.hero h1,
.section-title,
.result-score,
.question-title {
  font-family: "Fraunces", serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 0.92;
  margin: 20px 0 18px;
  max-width: 10ch;
}

.hero p {
  max-width: 54ch;
  font-size: 1.08rem;
  line-height: 1.72;
  color: rgba(248, 241, 229, 0.82);
}

.hero-actions,
.resource-actions,
.panel-actions,
.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
}

.button-link.primary,
.next-button,
.review-button {
  background: linear-gradient(135deg, var(--accent), #ea8f63);
  color: #fff7ef;
  box-shadow: 0 18px 28px rgba(216, 101, 62, 0.22);
}

.button-link.secondary,
.mode-button,
.pill-button {
  background: rgba(255, 255, 255, 0.1);
  color: #f8f1e5;
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.hero-fact {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-fact strong {
  display: block;
  font-size: 1.7rem;
}

.hero-fact span {
  display: block;
  margin-top: 6px;
  color: rgba(248, 241, 229, 0.76);
}

.hero-visual {
  align-self: center;
  min-height: 540px;
  position: relative;
  animation: drift 12s ease-in-out infinite alternate;
}

.hero-road {
  position: absolute;
  inset: 10% 0 0 15%;
  border-radius: 36px;
  background:
    radial-gradient(circle at 20% 22%, rgba(216, 101, 62, 0.45), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #20486f, #132d49);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-road::before {
  content: "";
  position: absolute;
  inset: auto 12% 0 34%;
  height: 100%;
  background:
    linear-gradient(180deg, transparent 0 10%, rgba(247, 235, 205, 0.9) 10% 15%, transparent 15% 25%, rgba(247, 235, 205, 0.9) 25% 30%, transparent 30% 40%, rgba(247, 235, 205, 0.9) 40% 45%, transparent 45% 55%, rgba(247, 235, 205, 0.9) 55% 60%, transparent 60% 70%, rgba(247, 235, 205, 0.9) 70% 75%, transparent 75%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
}

.hero-road::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 24%, rgba(212, 168, 93, 0.35), transparent 16%),
    radial-gradient(circle at 22% 66%, rgba(109, 133, 103, 0.25), transparent 14%);
}

.hero-sign {
  position: absolute;
  right: 12%;
  top: 18%;
  width: 148px;
  aspect-ratio: 1;
  border-radius: 28px;
  background: linear-gradient(135deg, #fff6ea, #f7e8cf);
  box-shadow: 0 26px 36px rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  transform: rotate(9deg);
}

.hero-sign::before {
  content: "";
  width: 74px;
  height: 74px;
  border-radius: 22px;
  border: 10px solid var(--accent);
  transform: rotate(45deg);
}

.hero-caption {
  position: absolute;
  left: 6%;
  bottom: 10%;
  max-width: 280px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(248, 241, 229, 0.94);
  color: var(--ink);
  box-shadow: 0 22px 32px rgba(0, 0, 0, 0.12);
}

.hero-caption strong {
  display: block;
  margin-bottom: 8px;
}

.section {
  padding: 84px 0;
}

.section.compact {
  padding-top: 48px;
}

.section-inner {
  position: relative;
}

.section-title {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.98;
  margin: 0 0 16px;
  max-width: 12ch;
}

.section-lead {
  max-width: 60ch;
  line-height: 1.8;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.proof-band {
  margin-top: -28px;
  position: relative;
  z-index: 2;
}

.proof-grid,
.stats-grid,
.topic-grid,
.resource-grid,
.about-grid,
.review-list {
  display: grid;
  gap: 18px;
}

.proof-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.proof-card,
.stat-card,
.topic-card,
.resource-card,
.about-card,
.quiz-shell,
.result-panel,
.review-item {
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 35, 58, 0.08);
  box-shadow: var(--shadow);
}

.proof-card,
.topic-card,
.resource-card,
.about-card,
.stat-card {
  padding: 26px;
}

.proof-card h3,
.topic-card h3,
.resource-card h3,
.about-card h3,
.result-panel h3,
.review-item h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.proof-card p,
.topic-card p,
.resource-card p,
.about-card p,
.stat-card p,
.result-panel p,
.review-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.proof-link,
.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--accent-dark);
  font-weight: 700;
}

.proof-link::after,
.resource-link::after {
  content: "->";
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar-stack {
  display: grid;
  gap: 18px;
}

.practice-intro,
.quiz-shell,
.result-panel {
  padding: 28px;
}

.mode-stack,
.pill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mode-button,
.pill-button {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface-strong);
  border-color: rgba(16, 35, 58, 0.08);
  color: var(--ink);
}

.mode-button.active,
.pill-button.active {
  background: var(--ink);
  color: #fff;
}

.note {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 8px;
}

.quiz-shell {
  min-height: 620px;
}

.quiz-shell.empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.progress-meta,
.citation,
.result-meta,
.small-label {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(16, 35, 58, 0.08);
  overflow: hidden;
  margin: 16px 0 28px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.28s ease;
}

.question-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: 1.06;
  margin: 10px 0 14px;
}

.question-subtitle {
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer-button {
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(16, 35, 58, 0.08);
  background: #fffaf2;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.answer-button:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 35, 58, 0.18);
}

.answer-button.correct {
  background: rgba(30, 124, 91, 0.1);
  border-color: rgba(30, 124, 91, 0.3);
}

.answer-button.incorrect {
  background: rgba(180, 73, 55, 0.1);
  border-color: rgba(180, 73, 55, 0.26);
}

.answer-button.disabled {
  cursor: default;
}

.feedback {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 20px;
  background: #fff8ee;
  border: 1px solid rgba(16, 35, 58, 0.08);
}

.feedback.correct {
  border-color: rgba(30, 124, 91, 0.25);
}

.feedback.incorrect {
  border-color: rgba(180, 73, 55, 0.22);
}

.feedback h3 {
  margin: 0 0 10px;
}

.feedback p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.feedback .citation {
  display: block;
  margin-bottom: 18px;
}

.feedback.is-hidden,
.result-panel.is-hidden,
.review-panel.is-hidden {
  display: none;
}

.panel-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.next-button,
.review-button {
  min-height: 50px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
}

.result-panel {
  margin-top: 20px;
}

.result-score {
  font-size: clamp(3.2rem, 6vw, 5rem);
  line-height: 0.92;
  margin: 12px 0 8px;
}

.scoreline {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.scoreline strong.success {
  color: var(--success);
}

.scoreline strong.danger {
  color: var(--danger);
}

.result-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 24px;
}

.result-stat {
  padding: 16px;
  border-radius: 18px;
  background: #fff9ef;
}

.result-stat strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

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

.review-item {
  padding: 20px;
}

.review-answer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(16, 35, 58, 0.08);
}

.resource-grid,
.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer {
  padding: 52px 0 64px;
  border-top: 1px solid rgba(16, 35, 58, 0.08);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.footer-note {
  max-width: 50ch;
  color: var(--ink-soft);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--accent-dark);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  max-width: 36ch;
}

.empty-state p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.button-link.tertiary {
  background: rgba(16, 35, 58, 0.08);
  color: var(--ink);
  border-color: rgba(16, 35, 58, 0.12);
}

.button-link[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.section-grid-gap {
  margin-top: 28px;
}

.section-actions {
  margin-top: 24px;
}

.focus-grid,
.faq-grid {
  display: grid;
  gap: 18px;
}

.focus-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.focus-card,
.faq-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 35, 58, 0.08);
  box-shadow: var(--shadow);
  padding: 24px;
}

.focus-card-top,
.question-topline,
.focus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focus-card h3,
.faq-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.focus-card p,
.faq-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.focus-meta,
.result-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.mastery-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mastery-pill.fresh {
  background: rgba(16, 35, 58, 0.08);
  color: var(--ink-soft);
}

.mastery-pill.needsWork {
  background: rgba(180, 73, 55, 0.14);
  color: var(--danger);
}

.mastery-pill.improving {
  background: rgba(212, 168, 93, 0.2);
  color: #93631b;
}

.mastery-pill.ready {
  background: rgba(30, 124, 91, 0.14);
  color: var(--success);
}

.practice-title {
  max-width: 11ch;
  margin-top: 12px;
}

.practice-stats-grid {
  grid-template-columns: 1fr;
}

.focus-list {
  display: grid;
  gap: 12px;
}

.focus-row strong {
  display: block;
  margin-bottom: 4px;
}

.focus-row span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.result-highlight {
  margin: 4px 0 24px;
}

.result-highlight strong {
  color: var(--ink);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-12px);
  }
}

@media (max-width: 980px) {
  .hero-inner,
  .practice-grid,
  .proof-grid,
  .focus-grid,
  .faq-grid,
  .resource-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    min-height: auto;
  }

  .hero-visual {
    min-height: 420px;
  }

  .topbar-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 12px 0 18px;
  }

  .hero {
    padding-top: 18px;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-facts,
  .stats-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 66px 0;
  }

  .quiz-shell,
  .practice-intro,
  .result-panel {
    padding: 22px;
  }
}
