:root {
  color-scheme: light;
  --ink: #17212f;
  --muted: #526173;
  --paper: #f7fbff;
  --surface: #ffffff;
  --surface-strong: #f0f7ff;
  --line: #cbd9e8;
  --teal: #058b80;
  --blue: #245cc7;
  --coral: #d94d45;
  --yellow: #f2bd2e;
  --violet: #7255d9;
  --green-soft: #e4f7ee;
  --blue-soft: #e8f1ff;
  --yellow-soft: #fff5ce;
  --coral-soft: #ffebe7;
  --violet-soft: #efeaff;
  --shadow: 0 16px 34px rgba(23, 33, 47, 0.12);
  --focus: #0d6efd;
  --font-heading: "Baloo 2", "Nunito", Arial, Helvetica, sans-serif;
  --font-body: "Nunito", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(36, 92, 199, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 139, 128, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--focus) 70%, white);
  outline-offset: 3px;
}

body.calm-mode {
  --paper: #fbfcf8;
  --surface-strong: #f4f7f0;
  --teal: #31766c;
  --blue: #49668f;
  --coral: #a45b52;
  --yellow: #c6a33c;
  --violet: #6b628f;
  --shadow: 0 10px 24px rgba(23, 33, 47, 0.08);
  background: var(--paper);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(247, 251, 255, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

body.calm-mode .topbar {
  background: rgba(251, 252, 248, 0.95);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
.topnav a,
.calm-toggle,
.primary-action,
.secondary-action,
h2,
h3,
.eyebrow,
.metric-band strong,
.capsule-number,
.capsule-status,
.step > span,
.lesson-card dt,
.toolbar label {
  font-family: var(--font-heading);
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.hero-logo {
  display: block;
  width: min(260px, 64vw);
  height: auto;
  margin: 0 0 18px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a,
.calm-toggle,
.primary-action,
.secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.topnav a {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid transparent;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--green-soft);
  color: var(--ink);
  border-color: var(--line);
}

.calm-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 33, 47, 0.06);
}

.calm-toggle[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--teal);
}

.hero,
.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(34px, 6vw, 72px) clamp(18px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}

.hero::before,
.lesson-hero::before {
  content: "";
  position: absolute;
  inset: 24px clamp(18px, 5vw, 64px) auto auto;
  width: min(36vw, 420px);
  height: 14px;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--coral), var(--blue));
  border-radius: 999px;
}

body.calm-mode .hero::before,
body.calm-mode .lesson-hero::before {
  opacity: 0.28;
}

.lesson-hero {
  min-height: auto;
  align-items: stretch;
  padding-bottom: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, white);
  border-radius: 8px;
  background: var(--green-soft);
  color: #075d55;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6.8vw, 6.2rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

.lesson-hero h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
}

.hero-copy > p:not(.eyebrow),
.lesson-hero > div > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.14rem;
  background: rgba(255, 255, 255, 0.72);
  border-left: 6px solid var(--yellow);
  border-radius: 8px;
  padding: 16px 18px;
}

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

.primary-action {
  background: linear-gradient(135deg, var(--ink), var(--blue));
  color: #fff;
  box-shadow: 0 14px 26px rgba(36, 92, 199, 0.22);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.network-art {
  min-height: 360px;
  margin: 0;
  padding: clamp(8px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 18%, rgba(242, 189, 46, 0.28), transparent 22%),
    radial-gradient(circle at 84% 70%, rgba(5, 139, 128, 0.2), transparent 28%),
    linear-gradient(135deg, #ffffff, var(--surface-strong));
  box-shadow: var(--shadow);
}

.network-art svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 32px rgba(27, 36, 48, 0.12));
}

.line {
  fill: none;
  stroke: #5f6f82;
  stroke-width: 5;
  stroke-linecap: round;
}

.line.soft {
  stroke: #c78d47;
}

.node {
  fill: var(--green-soft);
  stroke: var(--teal);
  stroke-width: 6;
}

.node.alt {
  fill: #fff5df;
  stroke: var(--yellow);
}

.node.core {
  fill: url("#nodeGradient");
  stroke: #fff;
  stroke-width: 8;
}

.network-art text {
  fill: #fff;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
}

.metric-band div {
  min-height: 132px;
  padding: 26px clamp(18px, 4vw, 48px);
  border-right: 1px solid var(--line);
}

.metric-band div:nth-child(1) {
  border-top: 7px solid var(--teal);
}

.metric-band div:nth-child(2) {
  border-top: 7px solid var(--yellow);
}

.metric-band div:nth-child(3) {
  border-top: 7px solid var(--coral);
}

.metric-band div:nth-child(4) {
  border-top: 7px solid var(--blue);
}

.metric-band div:last-child {
  border-right: 0;
}

.metric-band strong {
  display: block;
  font-size: 2.35rem;
  line-height: 1;
}

.metric-band span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.support-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 clamp(18px, 5vw, 64px) clamp(28px, 5vw, 48px);
}

.lesson-support {
  padding-top: 0;
}

.support-strip article {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.support-strip article:nth-child(1) {
  border-top: 8px solid var(--teal);
}

.support-strip article:nth-child(2) {
  border-top: 8px solid var(--yellow);
}

.support-strip article:nth-child(3) {
  border-top: 8px solid var(--coral);
}

.support-strip strong,
.support-strip span {
  display: block;
}

.support-strip strong {
  font-size: 1.15rem;
}

.support-strip span {
  margin-top: 6px;
  color: var(--muted);
}

.video-section {
  padding: 0 clamp(18px, 5vw, 64px) clamp(34px, 6vw, 56px);
}

.home-video {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: clamp(18px, 5vw, 48px);
}

.home-video .section-heading {
  margin-inline: auto;
  text-align: center;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.section {
  padding: clamp(42px, 7vw, 88px) clamp(18px, 5vw, 64px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.analysis-panel h2 {
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.05;
  text-wrap: balance;
}

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

.level-grid article,
.lesson-card,
.curriculum-area,
.step,
.analysis-panel,
.response-grid article,
.perspective-pair article {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.level-grid article {
  min-height: 180px;
  padding: 20px;
  border-top-width: 8px;
}

.level-grid article:nth-child(1) {
  border-top-color: var(--teal);
}

.level-grid article:nth-child(2) {
  border-top-color: var(--yellow);
}

.level-grid article:nth-child(3) {
  border-top-color: var(--blue);
}

.level-grid article:nth-child(4) {
  border-top-color: var(--violet);
}

.level-grid article:nth-child(5) {
  border-top-color: var(--coral);
}

.level-grid span {
  color: var(--coral);
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.toolbar label {
  font-weight: 700;
}

.toolbar input {
  width: min(420px, 100%);
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.toolbar input:focus {
  border-color: var(--blue);
}

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

.curriculum-area {
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.curriculum-area:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.area-header {
  padding: 18px;
  background: var(--green-soft);
  border-bottom: 1px solid var(--line);
}

.area-header h3 {
  margin-bottom: 4px;
}

.area-header p {
  margin: 0;
  color: var(--muted);
}

.capsule-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.capsule-list > li > a,
.capsule-list > li > span {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.capsule-list li:nth-child(4n + 1) .capsule-number {
  color: var(--teal);
}

.capsule-list li:nth-child(4n + 2) .capsule-number {
  color: var(--blue);
}

.capsule-list li:nth-child(4n + 3) .capsule-number {
  color: var(--coral);
}

.capsule-list li:nth-child(4n + 4) .capsule-number {
  color: var(--violet);
}

.capsule-list li:last-child > a,
.capsule-list li:last-child > span {
  border-bottom: 0;
}

.capsule-list > li > a:hover,
.capsule-list > li > a:focus-visible {
  background: var(--blue-soft);
}

.capsule-number {
  font-weight: 700;
  color: var(--blue);
}

.capsule-title {
  overflow-wrap: break-word;
}

.capsule-status {
  color: var(--muted);
  font-size: 0.83rem;
  background: #f3f5f8;
  border-radius: 8px;
  padding: 5px 8px;
}

.capsule-list .ready .capsule-status {
  color: #075d55;
  background: var(--green-soft);
  font-weight: 700;
}

.lesson-card {
  padding: 24px;
  border-top: 8px solid var(--yellow);
}

.lesson-card dl,
.lesson-card dd {
  margin: 0;
}

.lesson-card div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.lesson-card div:last-child {
  border-bottom: 0;
}

.lesson-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lesson-card dd {
  margin-top: 4px;
  font-weight: 700;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
  padding: 0 clamp(18px, 5vw, 64px) clamp(42px, 7vw, 88px);
}

.lesson-main {
  display: grid;
  gap: 16px;
}

.step {
  position: relative;
  padding: 24px 24px 24px 72px;
  border-left: 10px solid var(--blue);
  scroll-margin-top: 100px;
}

.step:nth-child(4n + 1) {
  border-left-color: var(--teal);
}

.step:nth-child(4n + 2) {
  border-left-color: var(--yellow);
}

.step:nth-child(4n + 3) {
  border-left-color: var(--coral);
}

.step:nth-child(4n + 4) {
  border-left-color: var(--violet);
}

.step > span {
  position: absolute;
  top: 24px;
  left: 24px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.step:nth-child(4n + 1) > span {
  background: var(--teal);
}

.step:nth-child(4n + 2) > span {
  background: #9d7600;
}

.step:nth-child(4n + 3) > span {
  background: var(--coral);
}

.step:nth-child(4n + 4) > span {
  background: var(--violet);
}

.step h2 {
  margin-bottom: 10px;
}

.prompt,
.dialogue-line {
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--yellow-soft);
}

.concept-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.concept-map div {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  font-weight: 700;
  text-align: center;
}

.concept-map div:nth-child(2) {
  background: var(--green-soft);
}

.concept-map div:nth-child(3) {
  background: var(--coral-soft);
}

.concept-map div:nth-child(4) {
  background: var(--yellow-soft);
}

.concept-map div:nth-child(5) {
  background: var(--violet-soft);
}

.question-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.question-list li {
  position: relative;
  padding: 12px 12px 12px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.question-list li::before {
  content: "?";
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.question-list li + li {
  margin-top: 8px;
}

.perspective-pair,
.response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

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

.perspective-pair article,
.response-grid article {
  padding: 16px;
  box-shadow: none;
}

.analysis-panel {
  position: sticky;
  top: 94px;
  padding: 22px;
  border-top: 8px solid var(--teal);
}

.analysis-panel ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
}

.analysis-panel li {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.analysis-panel li strong,
.analysis-panel li span {
  display: block;
}

.analysis-panel li span {
  color: var(--muted);
  margin-top: 4px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 64px);
  background: var(--ink);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.footer a {
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero,
  .lesson-hero,
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .metric-band,
  .level-grid,
  .curriculum-grid,
  .support-strip,
  .response-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar,
  .toolbar,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topnav a {
    padding-inline: 8px;
    text-align: center;
  }

  .hero,
  .lesson-hero {
    min-height: auto;
  }

  .network-art {
    min-height: 0;
  }

  .metric-band,
  .level-grid,
  .curriculum-grid,
  .concept-map,
  .support-strip,
  .perspective-pair,
  .response-grid {
    grid-template-columns: 1fr;
  }

  .metric-band div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-band div:last-child {
    border-bottom: 0;
  }

  .step {
    padding: 72px 18px 20px;
  }

  .step > span {
    left: 18px;
  }

  .capsule-list > li > a,
  .capsule-list > li > span {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .capsule-status {
    grid-column: 2;
  }
}
