* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #182033;
  --muted: #5d6b82;
  --primary: #3157d5;
  --primary-dark: #2343aa;
  --accent: #16a3a3;
  --soft: #eef6ff;
  --success: #eafaf0;
  --warning: #fff8e6;
  --border: #dbe3f0;
  --shadow: 0 18px 45px rgba(31, 45, 80, 0.12);
  --radius: 22px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 18px;
}

.wrap,
.app-wrap {
  width: min(1120px, 92%);
  margin: auto;
}

.app-wrap {
  max-width: 840px;
  padding: 28px 0 60px;
}

.hero {
  padding: 70px 0;
  background: linear-gradient(135deg, #3157d5, #22a7a7);
  color: #fff;
}

.top-nav,
.app-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-nav {
  margin-bottom: 34px;
}

.app-link-row {
  justify-content: center;
  margin: 0 auto 18px;
}

.top-nav a,
.app-link-row a {
  text-decoration: none;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
}

.top-nav a {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.app-link-row a {
  color: var(--primary);
  background: #eaf0ff;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.app-link-row a:hover,
.app-link-row a:focus-visible {
  background: #dfe8ff;
}

.hero-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 34px;
  align-items: center;
}

.eyebrow,
.mini-label {
  display: inline-block;
  color: var(--primary);
  background: #eaf0ff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero .eyebrow {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.hero h1,
.lesson-header h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  margin: 0 0 18px;
}

.tagline {
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  max-width: 760px;
  margin-bottom: 16px;
}

.hero-text,
.section-lead {
  max-width: 680px;
  margin-bottom: 28px;
}

.hero-text {
  color: rgba(255, 255, 255, 0.9);
}

.section-lead,
.card p,
.two-column p,
.hero-card small,
.lesson-subtitle {
  color: var(--muted);
}

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

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  min-height: 52px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible,
select:focus-visible,
#answerInput:focus-visible {
  outline: 4px solid rgba(49, 87, 213, 0.28);
  outline-offset: 3px;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(49, 87, 213, 0.24);
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid rgba(49, 87, 213, 0.16);
}

.hero .secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.full {
  width: 100%;
}

.hero-card,
.card,
.coach-box,
.question-card,
.confidence-box,
.progress-section,
.practice-controls,
.parent-tip-box,
.highlight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  color: var(--text);
  padding: 30px;
}

.hero-card h2,
.coach-box h2,
.confidence-box h3,
.parent-tip-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.coach-bubble {
  display: inline-block;
  color: var(--accent);
  background: #e6fbfb;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.answer-preview {
  margin: 20px 0;
  background: var(--success);
  border: 2px solid #bce8ca;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
}

.section {
  padding: 58px 0;
}

.section.soft {
  background: var(--soft);
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.15;
  margin-bottom: 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.card {
  padding: 26px;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eaf0ff;
  color: var(--primary);
  font-weight: 900;
  margin-bottom: 16px;
}

.check-list {
  list-style: none;
  margin-top: 20px;
  padding-left: 0;
}

.check-list li {
  margin: 10px 0;
  padding-left: 30px;
  position: relative;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}

.highlight-card {
  border-top: 6px solid var(--accent);
}

footer {
  text-align: center;
  padding: 34px 20px;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 28px;
}

footer a {
  color: var(--primary);
  font-weight: 800;
}

.lesson-header {
  text-align: center;
  padding: 12px 0 22px;
}

.back-btn {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 16px;
}

.practice-controls,
.progress-section,
.coach-box,
.question-card,
.confidence-box,
.parent-tip-box {
  padding: 24px;
  margin-top: 20px;
}

.practice-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.practice-controls label {
  display: block;
  font-weight: 900;
  margin-bottom: 8px;
}

select,
#answerInput {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid #cbd6e8;
  font-size: 1.1rem;
  background: #fff;
}

select:focus,
#answerInput:focus {
  border-color: var(--primary);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-weight: 900;
  margin-bottom: 12px;
}

.progress-bar {
  height: 18px;
  background: #dbe5f4;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s;
}

.coach-box {
  background: #eefcff;
  border-color: #bfeef1;
}

.question-card {
  border-top: 6px solid var(--primary);
}

#questionTitle {
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  line-height: 1.15;
  margin-bottom: 12px;
}

#questionText {
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 800;
  margin-bottom: 18px;
}

#answerInput {
  margin-bottom: 16px;
}

.confidence-box {
  background: var(--success);
  border-color: #c8ecd2;
}

.parent-tip-box {
  background: var(--warning);
  border-color: #f3dfab;
}

.level-path-box ul {
  margin: 14px 0 20px 22px;
}

.level-path-box li {
  margin: 8px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
}

@media (max-width: 820px) {
  body {
    font-size: 17px;
  }

  .hero {
    padding: 46px 0;
  }

  .hero-grid,
  .two-column,
  .practice-controls {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .practice-controls,
  .progress-section,
  .coach-box,
  .question-card,
  .confidence-box,
  .parent-tip-box,
  .card {
    padding: 20px;
    border-radius: 18px;
  }

  .section {
    padding: 42px 0;
  }

  .button-row,
  .hero-actions,
  .practice-actions,
  .app-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  button,
  .app-link-row a {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
