:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --text: #1c2230;
  --heading: #111827;
  --muted: #5a6475;
  --line: #d9dce3;
  --blue: #2166e5;
  --blue-dark: #174fba;
  --blue-soft: #eaf1ff;
  --blue-faint: #f3f7ff;
  --green-soft: #ecffd8;
  --green-line: #b8e986;
  --shadow-soft: 0 8px 24px rgba(10, 25, 60, 0.07);
  --radius: 18px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(33, 102, 229, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(var(--container), calc(100% - 44px));
  margin: 0 auto;
}

.promo-bar {
  background: var(--blue);
  color: #ffffff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 800;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 244, 244, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 34, 48, 0.08);
}

.site-header__inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__text {
  color: #303540;
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  color: #5a5f69;
  font-size: 0.98rem;
  font-weight: 700;
}

.nav a {
  color: inherit;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.nav .is-active {
  color: var(--blue);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 13px 20px;
  min-height: 46px;
  color: #ffffff;
  background: var(--blue);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(33, 102, 229, 0.16);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
  outline: none;
}

.btn--ghost {
  color: #273244;
  background: #ffffff;
  border-color: #c4cbd8;
  box-shadow: none;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--blue);
  background: #ffffff;
  border-color: var(--blue);
}

.hero {
  padding: 64px 0 38px;
}

.hero--lesson {
  padding-bottom: 26px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 42px;
  align-items: center;
}

.hero__label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(33, 102, 229, 0.16);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 0.88rem;
  font-weight: 900;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.08;
}

h1 {
  max-width: 860px;
  margin: 18px 0 18px;
  font-size: clamp(2.25rem, 6vw, 4.7rem);
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

p {
  margin: 0 0 16px;
}

.lead {
  max-width: 750px;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero__actions,
.card-actions,
.lesson-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-panel,
.content-card,
.lesson-card,
.resource-card,
.check-card {
  background: var(--surface);
  border: 1px solid rgba(28, 34, 48, 0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: 28px;
}

.hero-panel ul,
.meta-list,
.answer-list,
.mistake-list {
  margin: 0;
  padding-left: 20px;
}

.hero-panel li,
.meta-list li,
.answer-list li,
.mistake-list li {
  margin: 8px 0;
}

.band {
  padding: 36px 0;
}

.band--soft {
  background: rgba(255, 255, 255, 0.48);
  border-block: 1px solid rgba(28, 34, 48, 0.06);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.strand-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.strand-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #c4cbd8;
  border-radius: 999px;
  background: #ffffff;
  color: #273244;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

.strand-nav a:hover,
.strand-nav a:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.strand-heading {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(28, 34, 48, 0.12);
}

.strand-heading h3 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.strand-heading p {
  margin: 0;
  color: var(--muted);
}

.lesson-card,
.resource-card,
.check-card {
  padding: 24px;
}

.lesson-card p,
.resource-card p,
.check-card p {
  color: var(--muted);
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c4cbd8;
  color: #3b4658;
  font-size: 0.9rem;
  font-weight: 800;
}

.spec-fit-card {
  display: grid;
  gap: 18px;
  border-color: rgba(33, 102, 229, 0.2);
  background:
    linear-gradient(135deg, #ffffff 0%, #f3f7ff 100%);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.spec-grid div {
  padding: 14px;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.spec-grid strong,
.spec-grid span {
  display: block;
}

.spec-grid strong {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.spec-grid span {
  color: var(--heading);
  font-weight: 900;
}

.board-summary {
  padding: 16px;
  border: 1px solid #c4cbd8;
  border-radius: 14px;
  background: #ffffff;
}

.board-summary summary,
.reveal-answer summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 900;
}

.crumbs {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.lesson-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.content-card {
  padding: 28px;
  min-width: 0;
}

.content-card :last-child {
  margin-bottom: 0;
}

.lesson-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.sidebar-box {
  padding: 20px;
  background: #ffffff;
  border: 1px solid rgba(28, 34, 48, 0.09);
  border-radius: 16px;
}

.sidebar-box a {
  display: block;
  margin: 8px 0;
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.diagram {
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #c4cbd8;
  border-radius: 16px;
  background: var(--surface-soft);
}

.diagram img {
  width: 100%;
  height: auto;
}

.worked-example,
.practice-item,
.quick-check {
  padding: 18px;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  background: var(--surface-soft);
}

.choice-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe4ee;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.choice-list input {
  margin-top: 3px;
  accent-color: var(--blue);
}

.quiz-feedback {
  min-height: 28px;
  margin-top: 12px;
  font-weight: 800;
}

.quiz-feedback--neutral {
  color: var(--muted);
}

.quiz-feedback--correct {
  color: #246b18;
}

.quiz-feedback--incorrect {
  color: #9b2d20;
}

.reveal-answer {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #dfe4ee;
  border-radius: 12px;
  background: #ffffff;
}

.reveal-answer[open] {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.worked-example + .worked-example,
.practice-item + .practice-item,
.quick-check + .quick-check {
  margin-top: 14px;
}

.math-line {
  display: block;
  margin: 8px 0;
  padding: 9px 12px;
  border-left: 4px solid var(--blue);
  background: #ffffff;
  color: #17223b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.55;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
}

.math-block {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #ffffff;
  color: #17223b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.55;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.math-step {
  display: block;
  min-width: max-content;
}

.number-line {
  display: block;
  max-width: 100%;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #dfe4ee;
  border-radius: 12px;
  background: #ffffff;
  color: #17223b;
  overflow: visible;
}

.diagram-card {
  margin: 20px 0;
}

.construction-ideas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.construction-idea {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.construction-idea h4 {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 1.02rem;
  line-height: 1.16;
}

.construction-idea svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 210px;
}

.construction-idea p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.28;
}

.fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 1.6em;
  text-align: center;
  vertical-align: middle;
}

.fraction > span:first-child {
  padding: 0 0.2em 0.08em;
  border-bottom: 2px solid currentColor;
}

.fraction > span:last-child {
  padding: 0.08em 0.2em 0;
}

.answer-box {
  margin-top: 12px;
  padding: 14px;
  border-left: 4px solid #78b848;
  background: var(--green-soft);
}

.board-guidance {
  display: grid;
  gap: 12px;
}

.board-note {
  padding: 16px;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  background: #ffffff;
}

.board-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--heading);
}

.disclaimer {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 42px;
  background: #ffffff;
  border-top: 1px solid rgba(28, 34, 48, 0.08);
}

.site-footer__inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #6a7280;
  font-size: 0.92rem;
}

.site-footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: inherit;
  text-decoration: none;
}

.footer-note {
  flex-basis: 100%;
  margin: -8px 0 18px;
  color: #7a8290;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .site-header__inner,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }

  .nav {
    justify-content: flex-start;
    gap: 14px 18px;
  }

  .hero__grid,
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
  }

  .grid,
  .grid--two,
  .spec-grid,
  .construction-ideas {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .brand__text {
    white-space: normal;
    font-size: 1.18rem;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .btn {
    width: 100%;
  }

  .content-card,
  .hero-panel,
  .lesson-card,
  .resource-card,
  .check-card {
    padding: 20px;
  }
}
