:root {
  color-scheme: light;
  --navy: #0c1322;
  --ink: #172033;
  --muted: #5d6678;
  --teal: #14b8a6;
  --gold: #f59e0b;
  --pink: #ff4fa3;
  --blue: #2563eb;
  --lime: #b7f52a;
  --paper: #fbfcff;
  --line: #dfe6f2;
  --shadow: 0 18px 50px rgba(12, 19, 34, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.12), transparent 42%),
    linear-gradient(300deg, rgba(245, 158, 11, 0.16), transparent 40%),
    var(--paper);
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
}

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

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  color: white;
  background: rgba(12, 19, 34, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--navy);
  background: var(--lime);
  border-radius: 8px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
}

.lesson-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.lesson-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
  white-space: nowrap;
}

.lesson-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

main {
  overflow: hidden;
}

.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1.14fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  min-height: min(720px, calc(100vh - 74px));
  padding: clamp(34px, 6vw, 76px) clamp(16px, 5vw, 72px) clamp(26px, 4vw, 46px);
  color: white;
  background:
    radial-gradient(circle at 84% 22%, rgba(183, 245, 42, 0.34), transparent 20%),
    linear-gradient(135deg, #08111f 0%, #102f44 42%, #1a1240 100%);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lesson-hero h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-text {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.65;
}

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

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  color: var(--navy);
  background: var(--lime);
}

.secondary-action {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-art {
  position: relative;
  min-height: 340px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-band article {
  min-height: 126px;
  padding: 26px clamp(18px, 4vw, 42px);
  background: white;
}

.summary-label {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-band strong {
  display: block;
  max-width: 420px;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.34;
}

.materials-library {
  background: #f7fbff;
}

.additional-lessons {
  background: white;
}

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

.lesson-card {
  display: grid;
  min-height: 180px;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 34px rgba(12, 19, 34, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lesson-card:hover,
.lesson-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(12, 19, 34, 0.14);
}

.lesson-card span {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-card strong {
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.12;
}

.lesson-card small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

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

.additional-card em {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 8px;
  color: white;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  background: var(--navy);
}

.materials-page-hero {
  padding: clamp(46px, 7vw, 96px) clamp(16px, 5vw, 72px);
  color: white;
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.18), transparent 45%),
    linear-gradient(135deg, #08111f 0%, #102f44 54%, #1a1240 100%);
}

.materials-page-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.materials-page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.dark-action {
  color: var(--navy);
  border-color: rgba(12, 19, 34, 0.18);
  background: white;
}

.library-body {
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.1), transparent 38%),
    linear-gradient(300deg, rgba(255, 79, 163, 0.1), transparent 42%),
    #f8fbff;
}

.library-shell {
  background:
    linear-gradient(180deg, #071827 0 520px, transparent 520px),
    #f8fbff;
}

.library-topbar {
  background: rgba(7, 24, 39, 0.95);
}

.library-page {
  overflow: hidden;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  min-height: min(660px, calc(100vh - 70px));
  padding: clamp(36px, 6vw, 78px) clamp(16px, 5vw, 72px) clamp(30px, 5vw, 60px);
  color: white;
  background:
    radial-gradient(circle at 10% 16%, rgba(183, 245, 42, 0.24), transparent 19%),
    radial-gradient(circle at 84% 12%, rgba(255, 79, 163, 0.18), transparent 22%),
    linear-gradient(135deg, #071827 0%, #102f44 52%, #191238 100%);
}

.library-hero-copy {
  max-width: 680px;
}

.library-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 9vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.library-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.65;
}

.library-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.library-hero-art {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    #12314b;
  box-shadow: var(--shadow);
}

.library-hero-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, rgba(7, 24, 39, 0.48));
  pointer-events: none;
}

.library-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
}

.library-band,
.library-cast-band {
  padding: clamp(36px, 6vw, 76px) clamp(16px, 5vw, 72px);
}

.library-band {
  background: #f8fbff;
}

.library-band-light {
  background: white;
}

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

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

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

.library-lesson-card {
  position: relative;
  display: grid;
  min-height: 192px;
  align-content: space-between;
  gap: 14px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(12, 19, 34, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(236, 250, 255, 0.92)),
    white;
  box-shadow: 0 14px 34px rgba(12, 19, 34, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.library-lesson-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--lime), var(--teal), var(--pink));
}

.library-lesson-card:hover,
.library-lesson-card:focus-visible {
  border-color: rgba(20, 184, 166, 0.42);
  box-shadow: 0 20px 46px rgba(12, 19, 34, 0.14);
  transform: translateY(-3px);
}

.library-lesson-card.is-featured {
  color: white;
  background:
    linear-gradient(135deg, rgba(183, 245, 42, 0.18), transparent 34%),
    linear-gradient(145deg, #0a2135, #123f58);
}

.library-lesson-card span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.library-lesson-card strong {
  color: var(--navy);
  font-size: clamp(1.12rem, 1.8vw, 1.45rem);
  line-height: 1.12;
}

.library-lesson-card.is-featured strong,
.library-lesson-card.is-featured small {
  color: white;
}

.library-lesson-card small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.library-cast-band {
  color: white;
  background:
    radial-gradient(circle at 12% 20%, rgba(183, 245, 42, 0.2), transparent 24%),
    linear-gradient(135deg, #071827, #102f44);
}

.library-cast-band .section-heading h2 {
  color: white;
}

.library-cast-copy {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.55;
}

.library-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.library-cast-grid article {
  display: grid;
  min-height: 228px;
  place-items: end center;
  gap: 10px;
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.library-cast-grid img {
  width: 100%;
  height: 164px;
  object-fit: contain;
  object-position: center bottom;
}

.library-cast-grid strong {
  color: white;
  font-size: 1.1rem;
}

.lesson-player-section,
.characters-section,
.vocab-section,
.storyboard-section,
.qa-section,
.materials-library,
.additional-lessons {
  padding: clamp(36px, 6vw, 76px) clamp(16px, 5vw, 72px);
}

.section-heading {
  max-width: 920px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.slide-list,
.slide-stage,
.character-grid article,
.qa-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
}

.slide-list {
  height: min(720px, calc(100vh - 120px));
  min-height: 420px;
  overflow: hidden;
}

.slide-list-title {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-buttons {
  display: grid;
  gap: 8px;
  height: calc(100% - 52px);
  padding: 12px;
  overflow-y: auto;
}

.slide-buttons button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f5f8fd;
}

.slide-buttons button strong,
.slide-buttons button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-buttons button strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  font-size: 0.82rem;
}

.slide-buttons button span {
  font-size: 0.86rem;
  font-weight: 800;
}

.slide-buttons button.is-active {
  border-color: rgba(20, 184, 166, 0.72);
  background: rgba(20, 184, 166, 0.12);
}

.slide-buttons button.is-active strong {
  color: var(--navy);
  background: var(--lime);
}

.slide-stage {
  min-height: 620px;
  padding: clamp(18px, 4vw, 38px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    linear-gradient(120deg, rgba(20, 184, 166, 0.16), rgba(245, 158, 11, 0.14));
}

.slide-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-visual {
  display: grid;
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(12, 19, 34, 0.08);
  border-radius: 8px;
  color: var(--ink);
  background: #e9fbff;
}

.lesson-art {
  width: 100%;
  height: 100%;
  margin: 0;
}

.scene-svg {
  display: block;
  width: 100%;
  min-height: 320px;
  aspect-ratio: 16 / 9;
}

.lesson-art figcaption {
  padding: 12px 16px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(12, 19, 34, 0.08);
  font-size: clamp(0.94rem, 1.7vw, 1.08rem);
  font-weight: 800;
  line-height: 1.35;
}

.slide-stage h3 {
  margin: 28px 0 18px;
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

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

.slide-panels div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.slide-panels span {
  display: block;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-panels p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.5;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.controls button {
  display: inline-flex;
  min-width: 110px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--navy);
  border: 0;
  border-radius: 8px;
  background: var(--lime);
  font-weight: 900;
}

.controls button:first-child {
  color: white;
  background: var(--navy);
}

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

.character-grid article {
  padding: 22px;
}

.character-avatar {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  object-position: center bottom;
}

.character-grid h3 {
  margin: 16px 0 8px;
  font-size: 1.35rem;
}

.character-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.vocab-section {
  color: white;
  background: var(--navy);
}

.vocab-section .section-heading h2 {
  color: white;
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(92px, 1fr));
  gap: 10px;
}

.vocab-grid span {
  display: grid;
  min-height: 74px;
  place-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 900;
}

.storyboard-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}

th {
  position: sticky;
  top: 68px;
  z-index: 5;
  color: white;
  background: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td:first-child {
  color: var(--blue);
  font-weight: 900;
}

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

.qa-grid label {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 18px;
  line-height: 1.35;
}

.qa-grid input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

@media (max-width: 1050px) {
  .library-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

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

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

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

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

  .hero-art {
    min-height: 300px;
  }

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

  .slide-list {
    height: auto;
    min-height: 0;
  }

  .slide-buttons {
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 1fr);
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
  }

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

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

  .vocab-grid,
  .qa-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-hero {
    padding-top: 34px;
  }

  .library-hero-actions,
  .library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .library-card-grid,
  .library-card-grid-two,
  .library-cast-grid {
    grid-template-columns: 1fr;
  }

  .lesson-hero {
    min-height: auto;
    padding-top: 34px;
  }

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

  .primary-action,
  .secondary-action,
  .controls button {
    flex: 1 1 150px;
  }

  .summary-band,
  .lesson-card-grid,
  .additional-card-grid,
  .slide-panels,
  .character-grid,
  .vocab-grid,
  .qa-grid {
    grid-template-columns: 1fr;
  }

  .slide-stage {
    min-height: 560px;
  }

  .slide-visual {
    min-height: 260px;
  }

  .scene-svg {
    min-height: 260px;
  }
}

@media print {
  .topbar,
  .lesson-hero,
  .summary-band,
  .materials-library,
  .additional-lessons,
  .lesson-player-section,
  .characters-section,
  .vocab-section,
  .qa-section {
    display: none;
  }

  .storyboard-section {
    padding: 0;
  }

  th {
    position: static;
  }
}
