:root {
  --navy: #003b5f;
  --navy-deep: #02283f;
  --teal: #78a8ab;
  --teal-dark: #357a7f;
  --gold: #f4b942;
  --coral: #e86d4f;
  --green: #2e9d70;
  --violet: #6f5aa8;
  --sky: #3a87c8;
  --ink: #102434;
  --muted: #61717c;
  --line: #d9e2e6;
  --soft: #f4f8fa;
  --white: #ffffff;
  --shadow: 0 28px 70px rgba(0, 59, 95, 0.15);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--ink);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(217, 226, 230, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: 0;
}

.brand span {
  line-height: 1.05;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 30px);
  color: #314b5c;
  font-size: 0.92rem;
  font-weight: 800;
}

.nav-links a,
.site-footer a {
  transition: color 160ms ease;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--teal-dark);
}

.nav-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav-action,
.button.primary {
  background: var(--gold);
  color: var(--navy-deep);
  box-shadow: 0 14px 28px rgba(244, 185, 66, 0.25);
}

.button.secondary {
  border-color: rgba(0, 59, 95, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: var(--navy);
}

.button.dark {
  background: var(--navy-deep);
  color: var(--white);
}

.nav-action:hover,
.button:hover,
.subject-link:hover {
  transform: translateY(-3px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: clamp(54px, 8vw, 112px) clamp(18px, 6vw, 88px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0 40%, rgba(255, 255, 255, 0.82) 70%, rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, rgba(120, 168, 171, 0.22), rgba(244, 185, 66, 0.14) 42%, rgba(232, 109, 79, 0.1));
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  content: "";
  background:
    linear-gradient(90deg, var(--navy) 0 28%, var(--teal-dark) 28% 50%, var(--gold) 50% 64%, var(--coral) 64% 78%, var(--violet) 78% 100%);
  clip-path: polygon(0 54%, 100% 0, 100% 100%, 0 100%);
  opacity: 0.16;
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 760px;
}

.hero h1,
.section-copy h2,
.feature-lead h2,
.split-section h2,
.guide-panel h2,
.cape-section h2,
.subject-page h1 {
  margin: 0;
  color: var(--navy-deep);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 750;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(3.6rem, 9vw, 9.6rem);
  line-height: 0.88;
  overflow-wrap: break-word;
}

.hero p {
  max-width: 690px;
  margin: 28px 0 0;
  color: #2e4657;
  font-size: clamp(1.12rem, 2vw, 1.42rem);
  font-weight: 700;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-mark {
  position: absolute;
  right: max(-120px, -6vw);
  bottom: max(-180px, -10vw);
  width: min(62vw, 820px);
  opacity: 0.12;
  transform: rotate(-5deg);
  pointer-events: none;
}

.subject-band {
  padding: clamp(58px, 8vw, 110px) clamp(18px, 6vw, 88px);
  background: var(--white);
}

.section-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.section-copy h2,
.feature-lead h2,
.split-section h2,
.guide-panel h2,
.cape-section h2 {
  font-size: clamp(2.1rem, 4.8vw, 4.7rem);
  line-height: 0.98;
}

.section-copy p,
.feature-lead p,
.split-section p,
.guide-panel p {
  max-width: 550px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.65;
}

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

.subject-link {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 174px;
  overflow: hidden;
  padding: 22px;
  border-radius: 8px;
  color: var(--white);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.subject-link::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 32%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 38px);
  opacity: 0.7;
}

.subject-link::after {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 14%, transparent 15%);
}

.subject-link span {
  position: relative;
  z-index: 1;
  max-width: 250px;
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  font-weight: 900;
  line-height: 1;
}

.mathematics {
  background: linear-gradient(135deg, var(--navy), #006b95);
}

.additional {
  background: linear-gradient(135deg, #4b3f8f, var(--violet));
}

.biology {
  background: linear-gradient(135deg, #17764e, var(--green));
}

.chemistry {
  background: linear-gradient(135deg, #a5452e, var(--coral));
}

.physics {
  background: linear-gradient(135deg, #246ca6, var(--sky));
}

.technology {
  background: linear-gradient(135deg, #2f5961, var(--teal-dark));
}

.learning-system {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 72px);
  padding: clamp(62px, 8vw, 118px) clamp(18px, 6vw, 88px);
  background:
    linear-gradient(180deg, rgba(244, 248, 250, 0.9), rgba(255, 255, 255, 0.96)),
    linear-gradient(135deg, rgba(120, 168, 171, 0.16), rgba(244, 185, 66, 0.12));
}

.feature-lead {
  position: sticky;
  top: 110px;
  align-self: start;
}

.feature-lead p {
  margin-top: 24px;
}

.feature-list {
  display: grid;
  gap: 16px;
}

.feature-list article {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  column-gap: 24px;
  padding: 28px 0;
  border-top: 1px solid rgba(16, 36, 52, 0.16);
}

.feature-list article:last-child {
  border-bottom: 1px solid rgba(16, 36, 52, 0.16);
}

.feature-list span {
  color: var(--coral);
  font-size: 1rem;
  font-weight: 900;
}

.feature-list h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  line-height: 1;
}

.feature-list p {
  grid-column: 2;
  max-width: 540px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.65;
}

.split-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(56px, 7vw, 96px) clamp(18px, 6vw, 88px);
  background: var(--navy);
  color: var(--white);
}

.split-section h2,
.split-section p {
  color: var(--white);
}

.split-section p {
  max-width: 730px;
  margin-top: 18px;
  opacity: 0.84;
}

.guide-section {
  padding: clamp(62px, 8vw, 120px) clamp(18px, 6vw, 88px);
  background:
    linear-gradient(135deg, rgba(244, 185, 66, 0.2), rgba(255, 255, 255, 0.9) 48%, rgba(120, 168, 171, 0.18)),
    var(--soft);
}

.guide-panel {
  max-width: 870px;
}

.guide-panel p {
  margin-top: 18px;
}

.guide-panel .button {
  margin-top: 28px;
}

.cape-section {
  padding: clamp(62px, 8vw, 120px) clamp(18px, 6vw, 88px);
  background: var(--white);
  text-align: center;
}

.cape-section p {
  margin: 0 0 16px;
  color: var(--coral);
  font-size: clamp(1.25rem, 2.5vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
}

.cape-section h2 {
  max-width: 900px;
  margin: 0 auto;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px clamp(18px, 6vw, 88px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-weight: 800;
}

.site-footer span {
  color: var(--navy);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: 12px;
}

.powered-by span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.powered-by img {
  width: min(230px, 48vw);
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.subject-page {
  display: grid;
  min-height: calc(100vh - 78px);
  place-items: center;
  padding: clamp(40px, 7vw, 84px) 18px;
  background:
    linear-gradient(135deg, rgba(120, 168, 171, 0.18), rgba(244, 185, 66, 0.12)),
    var(--white);
}

.subject-page-panel {
  width: min(920px, 100%);
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.subject-page h1 {
  font-size: clamp(2.4rem, 7vw, 6rem);
  line-height: 0.92;
}

.subject-page p {
  max-width: 690px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.65;
}

.subject-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.course-page,
.lesson-page {
  background:
    linear-gradient(135deg, rgba(120, 168, 171, 0.12), rgba(244, 185, 66, 0.08) 42%, rgba(255, 255, 255, 0.96)),
    var(--white);
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(60px, 8vw, 112px) clamp(18px, 6vw, 88px);
}

.course-hero h1,
.lesson-hero h1,
.lesson-section-heading h2,
.lesson-outline h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 750;
  letter-spacing: 0;
}

.course-hero h1,
.lesson-hero h1 {
  max-width: 860px;
  font-size: clamp(3rem, 8vw, 7.4rem);
  line-height: 0.9;
  overflow-wrap: break-word;
}

.course-hero p,
.lesson-hero p,
.lesson-section-heading p,
.course-status p,
.lesson-card small,
.guide-grid p,
.flashcard-answer,
.quiz-question label,
.quiz-feedback {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.65;
}

.course-hero p,
.lesson-hero p {
  max-width: 760px;
  margin: 24px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.course-status {
  padding: 28px;
  border: 1px solid rgba(16, 36, 52, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.course-status span,
.lesson-card span,
.lesson-metrics span,
.quiz-meta span {
  display: block;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.course-status strong {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.course-status p {
  margin: 12px 0 0;
}

.course-modules {
  padding: 0 clamp(18px, 6vw, 88px) clamp(62px, 8vw, 112px);
}

.lesson-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 26px;
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 46px rgba(0, 59, 95, 0.08);
}

.lesson-card.available {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.lesson-card.available:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.lesson-card strong {
  color: var(--navy-deep);
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  line-height: 1.05;
}

.lesson-card.locked {
  opacity: 0.72;
}

.about-page {
  background:
    linear-gradient(135deg, rgba(120, 168, 171, 0.12), rgba(244, 185, 66, 0.08) 42%, rgba(255, 255, 255, 0.96)),
    var(--white);
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(28px, 6vw, 78px);
  align-items: center;
  padding: clamp(54px, 8vw, 110px) clamp(18px, 6vw, 88px);
}

.about-hero h1,
.about-section h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 750;
  letter-spacing: 0;
}

.about-hero h1 {
  max-width: 820px;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
}

.about-hero p,
.about-section p,
.about-list li {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.65;
}

.about-hero p {
  max-width: 760px;
  margin: 24px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.about-photo-card {
  padding: 18px;
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.about-photo {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.about-content {
  display: grid;
  gap: 24px;
  padding: 0 clamp(18px, 6vw, 88px) clamp(62px, 8vw, 112px);
}

.about-section {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(0, 59, 95, 0.08);
}

.about-section h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1;
}

.about-section p {
  margin: 16px 0 0;
}

.about-list,
.about-grid {
  margin-top: 18px;
}

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

.about-grid article {
  padding: 18px;
  border: 1px solid rgba(16, 36, 52, 0.12);
  border-radius: 8px;
  background: var(--soft);
}

.about-grid h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.about-grid p {
  margin-top: 10px;
}

.about-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.lesson-page {
  min-height: 100vh;
}

.lesson-nav {
  justify-content: center;
}

.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: end;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(52px, 7vw, 96px) clamp(18px, 6vw, 88px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgba(46, 157, 112, 0.14), rgba(244, 185, 66, 0.16));
}

.lesson-hero-copy {
  min-width: 0;
}

.lesson-metrics {
  display: grid;
  gap: 12px;
}

.lesson-metrics div {
  padding: 18px;
  border: 1px solid rgba(16, 36, 52, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(0, 59, 95, 0.08);
}

.lesson-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 1.4rem;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(38px, 6vw, 72px) clamp(18px, 6vw, 88px) clamp(66px, 8vw, 120px);
}

.lesson-outline {
  position: static;
  align-self: start;
  padding: 22px;
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 42px rgba(0, 59, 95, 0.08);
}

.lesson-outline h2 {
  font-size: 1.55rem;
}

.lesson-outline ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 0;
  list-style-position: inside;
  color: var(--muted);
  font-weight: 800;
}

.lesson-outline a {
  color: var(--navy);
}

.lesson-content {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.video-panel,
.study-guide,
.flashcard-section,
.quiz-section {
  scroll-margin-top: 110px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(0, 59, 95, 0.08);
}

.lesson-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.lesson-section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.lesson-section-heading p {
  max-width: 420px;
  margin: 0;
}

.video-panel video,
.video-frame iframe {
  width: 100%;
  border-radius: 8px;
  background: var(--navy-deep);
  box-shadow: 0 22px 54px rgba(0, 59, 95, 0.16);
}

.video-panel video {
  max-height: 620px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.video-frame iframe {
  height: 100%;
  border: 0;
}

.video-fallback {
  margin: 14px 0 0;
  font-weight: 800;
}

.video-fallback a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.guide-grid article {
  padding: 20px;
  border: 1px solid rgba(16, 36, 52, 0.12);
  border-radius: 8px;
  background: var(--soft);
}

.guide-grid h3,
.flashcard-group h3,
.quiz-question legend {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.2;
}

.guide-grid p {
  margin: 10px 0 0;
}

.flashcard-section {
  display: grid;
  gap: 24px;
}

.flashcard-group {
  display: grid;
  gap: 10px;
}

.flashcard {
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.flashcard-toggle {
  position: relative;
  width: 100%;
  padding: 18px 54px 18px 18px;
  border: 0;
  background: var(--white);
  color: var(--navy-deep);
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.flashcard-toggle::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 26px;
  height: 26px;
  content: "+";
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-50%);
}

.flashcard.is-open .flashcard-toggle::after {
  content: "-";
}

.flashcard-answer {
  display: none;
  padding: 0 18px 18px;
  color: #3e5362;
}

.flashcard.is-open .flashcard-answer {
  display: block;
}

.quiz-form {
  display: grid;
  gap: 16px;
}

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

.quiz-meta span {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(120, 168, 171, 0.14);
}

.quiz-question {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(16, 36, 52, 0.14);
  border-radius: 8px;
  background: var(--white);
}

.quiz-question legend {
  padding: 0 0 6px;
  font-weight: 900;
}

.quiz-question label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #314b5c;
}

.quiz-question .short-answer {
  display: grid;
  gap: 8px;
}

.quiz-question input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--teal-dark);
  flex: 0 0 auto;
}

.quiz-question input[type="text"],
.quiz-question input[type="number"],
.quiz-question textarea,
.quiz-question select {
  width: min(100%, 420px);
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(16, 36, 52, 0.18);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-deep);
  font: inherit;
  font-weight: 800;
}

.quiz-question textarea {
  width: min(100%, 640px);
  min-height: 92px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

.quiz-question input[type="text"]:focus,
.quiz-question input[type="number"]:focus,
.quiz-question textarea:focus,
.quiz-question select:focus {
  border-color: var(--teal-dark);
  outline: 3px solid rgba(120, 168, 171, 0.26);
}

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

.matching-grid .short-answer select {
  width: 100%;
}

.data-table {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}

.data-table.four-column {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-table div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(16, 36, 52, 0.12);
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
}

.data-table span:first-child {
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.data-table span:last-child {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 900;
}

.question-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.quiz-feedback,
.quiz-result {
  margin: 0;
}

.quiz-question.is-correct {
  border-color: rgba(46, 157, 112, 0.5);
  background: rgba(46, 157, 112, 0.08);
}

.quiz-question.is-incorrect,
.quiz-question.is-unanswered {
  border-color: rgba(232, 109, 79, 0.45);
  background: rgba(232, 109, 79, 0.08);
}

.quiz-result {
  min-height: 34px;
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 900;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 920px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: auto;
  }

  .hero-mark {
    right: -130px;
    width: 620px;
  }

  .section-copy,
  .learning-system,
  .split-section {
    display: block;
  }

  .section-copy p,
  .split-section p {
    margin-top: 16px;
  }

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

  .feature-lead {
    position: static;
    margin-bottom: 24px;
  }

  .split-section .button {
    margin-top: 28px;
  }

  .course-hero,
  .about-hero,
  .lesson-hero,
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .course-status,
  .lesson-outline {
    position: static;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .lesson-section-heading {
    display: block;
  }

  .lesson-section-heading p {
    margin-top: 12px;
  }

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

@media (max-width: 620px) {
  .site-header {
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    overflow-x: visible;
  }

  .nav-links a {
    min-width: 0;
    font-size: 0.86rem;
    white-space: normal;
  }

  .brand span {
    font-size: 0.98rem;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

  .nav-action {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 16vw, 4.45rem);
    max-width: 100%;
  }

  .hero-content {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }

  .hero p {
    width: min(100%, 318px);
    max-width: 318px;
    font-size: 1.02rem;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    max-width: 332px;
  }

  .hero-mark {
    right: -210px;
    bottom: -180px;
    width: 560px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .subject-link {
    min-height: 144px;
  }

  .feature-list article {
    grid-template-columns: 1fr;
  }

  .feature-list p {
    grid-column: 1;
  }

  .site-footer {
    display: grid;
  }

  .course-hero h1,
  .about-hero h1,
  .lesson-hero h1 {
    font-size: clamp(2.05rem, 9.6vw, 2.75rem);
    line-height: 0.96;
    overflow-wrap: anywhere;
  }

  .course-hero > div,
  .about-hero > div,
  .lesson-hero-copy {
    width: min(100%, calc(100vw - 58px));
    max-width: calc(100vw - 58px);
    min-width: 0;
  }

  .course-hero p,
  .about-hero p,
  .lesson-hero p {
    max-width: 318px;
    overflow-wrap: anywhere;
  }

  .course-status,
  .about-section,
  .lesson-metrics div,
  .video-panel,
  .study-guide,
  .flashcard-section,
  .quiz-section,
  .lesson-outline {
    padding: 18px;
  }

  .quiz-actions .button {
    width: 100%;
  }

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

  .lesson-outline ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .about-grid,
  .matching-grid,
  .data-table {
    grid-template-columns: 1fr;
  }
}
