:root {
  --bg: #f7f3ee;
  --surface: rgba(255, 252, 248, 0.86);
  --surface-strong: #fff9f2;
  --text: #11203b;
  --muted: #556277;
  --primary: #0a2f6b;
  --primary-strong: #071f48;
  --accent: #c8102e;
  --accent-soft: #f4d5db;
  --line: rgba(17, 32, 59, 0.12);
  --success: #1a7f4b;
  --danger: #b24b3f;
  --shadow: 0 28px 60px rgba(17, 32, 59, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.16), transparent 26%),
    radial-gradient(circle at left 10% bottom 15%, rgba(10, 47, 107, 0.13), transparent 24%),
    linear-gradient(180deg, #f2ede6 0%, #f7f3ee 32%, #fcfaf7 100%);
}

body::before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(200, 16, 46, 0.045) 0%, transparent 22%),
    linear-gradient(45deg, rgba(10, 47, 107, 0.045) 0%, transparent 22%),
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 34px 34px, 34px 34px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 65%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #fff7ef;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: var(--shadow);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong,
.hero h1,
.section-heading h2,
.quiz-stage h3,
.contact-section h2 {
  font-family: "Fraunces", serif;
}

.brand-copy small,
.top-nav a,
.eyebrow,
.console-label,
.panel-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  gap: 18px;
}

.top-nav a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: stretch;
  padding: 28px 0 40px;
}

.hero-copy,
.hero-panel,
.info-card,
.quiz-console,
.lab-sidebar,
.contact-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
}

.hero-panel,
.lab-sidebar {
  overflow: hidden;
}

.eyebrow,
.console-label,
.panel-label {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.95;
}

.lead {
  max-width: 58ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.quiz-actions,
.contact-section {
  display: flex;
  gap: 14px;
  align-items: center;
}

.hero-actions {
  margin-top: 28px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button-primary {
  color: #fff8f0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 18px 38px rgba(10, 47, 107, 0.22);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line);
}

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

.hero-metrics article,
.stats-grid article {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.hero-metrics strong,
.stats-grid strong {
  font-size: 1.2rem;
}

.hero-panel {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(10, 47, 107, 0.96), rgba(7, 31, 72, 0.96)),
    rgba(17, 32, 59, 0.92);
  color: #f9f3ea;
}

.panel-glow {
  position: absolute;
  top: -80px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 213, 219, 0.28), transparent 60%);
}

.prep-list {
  margin: 14px 0 0;
  padding-left: 20px;
  line-height: 1.8;
}

.confidence-card,
.sidebar-panel,
.mode-card,
.question-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

.confidence-card {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 18px;
  color: #fdf8f2;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.curriculum,
.study-library,
.quiz-lab {
  padding: 26px 0 18px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
}

.section-copy {
  max-width: 62ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.curriculum-grid,
.mode-grid {
  display: grid;
  gap: 16px;
}

.curriculum-grid {
  grid-template-columns: repeat(4, 1fr);
}

.info-card {
  padding: 24px;
}

.info-card h3,
.mode-card h3,
.question-card h3,
.result-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.info-card p,
.mode-card p,
.sidebar-panel p,
.result-card p,
.question-explanation p,
.study-plan p,
.empty-state p,
.contact-section p {
  color: var(--muted);
  line-height: 1.7;
}

.mode-grid {
  grid-template-columns: repeat(4, 1fr);
}

.library-layout {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 18px;
}

.module-nav,
.module-stage {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.module-nav {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
}

.module-button {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.module-button:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 95, 85, 0.3);
}

.module-button.active {
  border-color: rgba(15, 95, 85, 0.48);
  background: rgba(15, 95, 85, 0.08);
}

.module-button strong {
  font-size: 1rem;
}

.module-button span {
  color: var(--muted);
  line-height: 1.5;
}

.module-stage {
  padding: 24px;
}

.module-hero {
  display: grid;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.module-hero h3 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.module-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.module-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
}

.module-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.module-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.module-footer {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  grid-template-columns: 1fr 1fr;
}

.memory-card,
.recap-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.memory-card {
  color: #fbf6ef;
  background: linear-gradient(135deg, rgba(16, 53, 96, 0.94), rgba(10, 67, 61, 0.94));
}

.recap-card {
  background: rgba(255, 255, 255, 0.6);
}

.memory-card p,
.recap-card p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.mode-card {
  padding: 22px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 95, 85, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.mode-card.active {
  border-color: rgba(10, 47, 107, 0.48);
  box-shadow: 0 12px 34px rgba(10, 47, 107, 0.12);
}

.mode-meta {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(15, 95, 85, 0.09);
}

.lab-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.quiz-console,
.lab-sidebar,
.contact-section {
  padding: 22px;
}

.console-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.console-topbar h3 {
  margin: 0;
}

.console-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.console-meta span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.68);
}

.quiz-stage {
  min-height: 460px;
  margin-top: 18px;
}

.empty-state,
.question-card,
.result-card {
  height: 100%;
  padding: 24px;
}

.question-card {
  display: grid;
  gap: 18px;
}

.question-prompt {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  line-height: 1.1;
}

.question-tags,
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(15, 95, 85, 0.1);
}

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

.answer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.answer:hover {
  transform: translateY(-1px);
}

.answer.selected {
  border-color: rgba(16, 53, 96, 0.35);
  background: rgba(18, 79, 157, 0.08);
}

.answer.correct {
  border-color: rgba(26, 127, 75, 0.35);
  background: rgba(26, 127, 75, 0.08);
}

.answer.wrong {
  border-color: rgba(178, 75, 63, 0.35);
  background: rgba(178, 75, 63, 0.08);
}

.answer-badge {
  display: grid;
  place-items: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 800;
  background: rgba(15, 95, 85, 0.1);
}

.answer-copy {
  line-height: 1.5;
}

.question-explanation {
  padding: 18px;
  border-radius: 18px;
  background: rgba(15, 95, 85, 0.08);
}

.question-explanation strong {
  color: var(--primary-strong);
}

.lab-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.sidebar-panel {
  padding: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.topic-radar,
.study-plan {
  display: grid;
  gap: 10px;
}

.topic-row {
  display: grid;
  gap: 6px;
}

.topic-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.topic-bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(29, 26, 24, 0.08);
}

.topic-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.plan-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.plan-card strong {
  display: block;
  margin-bottom: 6px;
}

.contact-section {
  justify-content: space-between;
  margin-top: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 245, 247, 0.92)),
    rgba(255, 255, 255, 0.7);
}

.language-picker {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.language-picker span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-picker select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.82);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-up 700ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 120ms;
}

.reveal:nth-child(3) {
  animation-delay: 180ms;
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .hero,
  .curriculum-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .lab-layout {
    grid-template-columns: 1fr;
  }

  .library-layout,
  .module-grid,
  .module-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .site-header,
  .hero-actions,
  .contact-section {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav,
  .console-topbar,
  .console-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .library-layout,
  .mode-grid,
  .curriculum-grid,
  .hero-metrics,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .quiz-console,
  .lab-sidebar,
  .contact-section {
    padding: 18px;
  }

  .hero h1 {
    max-width: none;
    font-size: 2.75rem;
  }

  .question-prompt {
    font-size: 1.55rem;
  }
}
