.math-page {
  --math-deep: #071015;
  --math-teal: #0f9f8a;
  --math-cyan: #19c7e8;
  --math-amber: #f1ad4e;
}

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

.math-hero > img {
  object-position: center;
}

.math-hero .hero-copy {
  max-width: 690px;
}

.math-hero .hero-title-art {
  position: relative;
  inset: auto;
  display: block;
  width: min(100%, 680px);
  height: auto;
  max-height: 188px;
  margin: 0 0 18px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 28px 52px rgba(0, 0, 0, 0.34));
}

.formula-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.formula-strip span {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 199, 232, 0.24), rgba(241, 173, 78, 0.16)),
    rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.math-profile {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(7, 16, 21, 0.68);
}

.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.split-heading h2 {
  margin-bottom: 0;
}

.split-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.section-dark .split-heading p {
  color: rgba(255, 255, 255, 0.72);
}

.section-soft {
  background:
    radial-gradient(circle at 12% 10%, rgba(25, 199, 232, 0.11), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #eef6f3 100%);
}

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

.research-card,
.system-card,
.stage-card,
.ability-grid article,
.parent-guide-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(13, 28, 37, 0.07);
}

.research-card,
.system-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.research-card > span,
.system-card > span,
.ability-grid span {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e7f8f5;
  color: #063d35;
  font-weight: 900;
}

.system-card > span {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  background: rgba(231, 248, 245, 0.92);
  box-shadow: 0 10px 22px rgba(7, 16, 21, 0.12);
}

.card-visual {
  width: calc(100% + 48px);
  height: 190px;
  margin: -24px -24px 20px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.research-card h3,
.system-card h3,
.ability-grid h3,
.parent-guide-grid h3 {
  margin: 0 0 12px;
}

.research-card p,
.research-card li,
.system-card p,
.system-card li,
.ability-grid p,
.parent-guide-grid p {
  color: var(--muted);
  line-height: 1.75;
}

.course-showcase,
.section-visual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  min-height: 280px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 8px;
  background: #071015;
  color: #fff;
  box-shadow: 0 22px 60px rgba(13, 28, 37, 0.14);
}

.course-showcase img,
.section-visual img {
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.course-showcase figcaption,
.section-visual figcaption {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 159, 138, 0.2), rgba(7, 16, 21, 0.92)),
    #071015;
}

.course-showcase strong,
.section-visual strong {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.15;
}

.course-showcase span,
.section-visual span {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.75;
}

.course-showcase-dark figcaption,
.diagnosis-visual figcaption {
  background:
    linear-gradient(135deg, rgba(241, 173, 78, 0.18), rgba(7, 16, 21, 0.92)),
    #071015;
}

.research-card ul,
.system-card ul {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 18px;
}

.course-block {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(13, 28, 37, 0.07);
}

.course-block-head {
  margin-bottom: 18px;
}

.title-badge-art,
.section-title-art {
  display: block;
  width: min(100%, 920px);
  height: auto;
  margin: 0 0 16px;
}

.section-title-art {
  max-width: 820px;
}

.section-dark .section-title-art {
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.2));
}

.course-block-head h3 {
  margin-bottom: 10px;
  font-size: clamp(24px, 2.6vw, 36px);
}

.course-block-head p:not(.eyebrow) {
  max-width: 880px;
  color: var(--muted);
  line-height: 1.75;
}

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

.syllabus-card {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.syllabus-card span {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 9px;
  border-radius: 999px;
  background: #e7f8f5;
  color: #063d35;
  font-size: 12px;
  font-weight: 900;
}

.syllabus-card h4 {
  margin: 0 0 10px;
  font-size: 20px;
}

.syllabus-card p,
.syllabus-card em {
  color: var(--muted);
  line-height: 1.7;
}

.syllabus-card strong,
.syllabus-card em {
  display: block;
}

.syllabus-card strong {
  margin-top: 14px;
  color: #223039;
}

.syllabus-card em {
  margin-top: 6px;
  font-style: normal;
  font-size: 14px;
}

.math-visual-banner {
  margin-bottom: 22px;
}

.math-visual-banner img {
  max-height: 480px;
  object-position: center;
}

.stage-ladder {
  display: grid;
  gap: 18px;
}

.stage-card {
  padding: 26px;
  overflow: hidden;
}

.section-dark .stage-card {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.03);
  color: #fff;
  box-shadow: none;
}

.stage-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.stage-card-head span {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(25, 199, 232, 0.15);
  color: var(--math-cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-card h3 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
}

.stage-card p {
  max-width: 980px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.8;
}

.stage-card-image {
  margin: 20px 0 8px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.stage-card-image img {
  height: 280px;
  object-fit: cover;
}

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

.stage-modules div {
  min-height: 124px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.stage-modules strong,
.stage-modules span {
  display: block;
}

.stage-modules strong {
  margin-bottom: 8px;
  color: #fff;
}

.stage-modules span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.65;
}

.target-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.target-strip span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(241, 173, 78, 0.16);
  color: #ffd08c;
  font-size: 13px;
  font-weight: 800;
}

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

.ability-visual {
  margin-bottom: 22px;
}

.ability-grid article {
  min-height: 230px;
  padding: 22px;
}

.math-table td {
  vertical-align: top;
}

.mistake-lab {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(15, 159, 138, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(13, 28, 37, 0.09);
}

.diagnosis-visual {
  margin-bottom: 18px;
}

.mistake-selector {
  padding: 18px;
  border-radius: 8px;
  background: #071015;
  color: #fff;
}

.mistake-selector label,
.mistake-selector span {
  display: grid;
  gap: 8px;
}

.mistake-selector span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.mistake-selector select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 12px;
  font: inherit;
}

.mistake-selector option {
  color: #111;
}

.mistake-result {
  padding: 8px;
}

.mistake-result h3 {
  margin: 0 0 14px;
  font-size: clamp(24px, 2vw, 32px);
}

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

.mistake-cards article {
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.mistake-cards strong {
  display: block;
  margin-bottom: 8px;
  color: #223039;
}

.mistake-cards p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.diagnostic-lab {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(15, 159, 138, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(13, 28, 37, 0.09);
}

.planner-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #071015;
  color: #fff;
}

.planner-controls label,
.planner-controls span {
  display: grid;
  gap: 8px;
}

.planner-controls span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.planner-controls select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 12px;
  font: inherit;
}

.planner-controls option {
  color: #111;
}

.planner-result {
  padding: 18px;
}

.planner-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #e7f8f5;
  color: #063d35;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planner-result h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.2vw, 34px);
}

.planner-result p,
.planner-result li {
  color: var(--muted);
  line-height: 1.75;
}

.module-chip-board {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.module-chip-board span {
  padding: 9px 11px;
  border: 1px solid rgba(15, 159, 138, 0.18);
  border-radius: 999px;
  background: #f5fbf8;
  color: #174138;
  font-size: 13px;
  font-weight: 800;
}

.planner-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
  gap: 14px;
  margin-top: 16px;
}

.planner-columns div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.planner-columns strong {
  display: block;
  margin-bottom: 8px;
  color: #223039;
}

.planner-columns ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

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

.parent-guide-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.parent-guide-grid article {
  min-height: 250px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.14);
}

.parent-guide-grid p {
  color: rgba(255, 255, 255, 0.72);
}

.math-faq details {
  border-radius: 8px;
}

.school-footer {
  padding: 28px 0;
  background: #071015;
  color: #fff;
}

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

.school-footer p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.68);
}

.school-footer a {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff;
  color: #071015;
  font-weight: 900;
}

@media (max-width: 980px) {
  .split-heading,
  .research-grid,
  .system-grid,
  .course-showcase,
  .section-visual,
  .mistake-lab,
  .diagnostic-lab,
  .planner-columns,
  .timeline-grid.math-timeline,
  .syllabus-grid {
    grid-template-columns: 1fr;
  }

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

  .course-showcase img,
  .section-visual img {
    min-height: 260px;
  }

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

  .mistake-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .math-hero .hero-inner {
    min-height: 640px;
    padding: 44px 0 28px;
  }

  .math-hero h1 {
    font-size: clamp(38px, 10.5vw, 50px);
  }

  .hero-title-art {
    max-height: none;
    margin-bottom: 14px;
  }

  .math-hero .hero-tags {
    gap: 7px;
    margin-top: 18px;
  }

  .math-hero .hero-tags span {
    padding: 7px 9px;
    font-size: 12px;
  }

  .math-profile {
    display: none;
  }

  .formula-strip span {
    min-width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .stage-card,
  .course-block,
  .mistake-lab,
  .diagnostic-lab {
    padding: 16px;
  }

  .card-visual {
    width: calc(100% + 32px);
    margin: -16px -16px 18px;
  }

  .course-showcase,
  .section-visual {
    margin: 14px 0;
  }

  .course-showcase figcaption,
  .section-visual figcaption {
    padding: 18px;
  }

  .stage-card-image img {
    height: 220px;
  }

  .stage-card-head {
    display: grid;
  }

  .stage-modules,
  .ability-grid,
  .parent-guide-grid {
    grid-template-columns: 1fr;
  }

  .school-footer-inner {
    display: grid;
  }

  .school-footer a {
    width: 100%;
    text-align: center;
  }
}
