:root {
  --ink: #11242c;
  --muted: #536a73;
  --paper: #f7fbfb;
  --panel: rgba(255, 255, 255, 0.88);
  --teal: #00a6a6;
  --green: #55c271;
  --blue: #2776ea;
  --purple: #6f55d9;
  --yellow: #ffd166;
  --orange: #f97345;
  --shadow: 0 22px 70px rgba(19, 53, 61, 0.18);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(85, 194, 113, 0.18), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(39, 118, 234, 0.18), transparent 33%),
    linear-gradient(135deg, #f2fbf7 0%, #eff7ff 50%, #fff8ee 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(30deg, transparent 46%, rgba(0, 166, 166, 0.09) 47%, rgba(0, 166, 166, 0.09) 49%, transparent 50%),
    radial-gradient(circle, rgba(17, 36, 44, 0.06) 1px, transparent 1px);
  background-size: 90px 90px, 22px 22px;
  z-index: -1;
}

a { color: inherit; }
button, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px clamp(20px, 5vw, 72px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  box-shadow: 0 12px 26px rgba(39, 118, 234, 0.25);
}
.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}
.nav-links a { text-decoration: none; font-weight: 750; }
.nav-links a:hover { color: var(--blue); }

.hero { min-height: 92vh; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 48px clamp(20px, 5vw, 72px) 72px;
}
.eyebrow {
  color: var(--teal);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  font-size: clamp(3.1rem, 8vw, 7.2rem);
  line-height: 0.91;
  letter-spacing: -0.08em;
  margin-bottom: 28px;
}
h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 16px;
}
h3 { font-size: 1.28rem; margin-bottom: 10px; }
.hero-lead {
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.65;
  max-width: 760px;
}
.hero-actions, .timer-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0;
}
.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: white;
  box-shadow: 0 14px 32px rgba(39, 118, 234, 0.28);
}
.button.ghost { background: white; color: var(--ink); box-shadow: var(--shadow); }
.button.small { padding: 10px 15px; min-height: 40px; font-size: 0.92rem; }
.lesson-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}
.lesson-stats span {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(17, 36, 44, 0.08);
  border-radius: 999px;
  padding: 10px 14px;
}
.lesson-stats strong { color: var(--ink); }

.science-window {
  position: relative;
  min-height: 560px;
  border-radius: 42px;
  overflow: hidden;
  background:
    radial-gradient(circle at 55% 40%, rgba(255, 209, 102, 0.36), transparent 22%),
    radial-gradient(circle at 60% 60%, rgba(111, 85, 217, 0.16), transparent 32%),
    linear-gradient(160deg, rgba(255,255,255,0.9), rgba(214, 247, 239, 0.75));
  border: 1px solid rgba(17,36,44,0.08);
  box-shadow: var(--shadow);
}
.orbit {
  position: absolute;
  width: 420px;
  height: 180px;
  border: 3px solid rgba(39, 118, 234, 0.24);
  border-radius: 50%;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) rotate(-24deg);
}
.orbit-two { transform: translate(-50%, -50%) rotate(28deg); border-color: rgba(0,166,166,0.25); }
.cell {
  position: absolute;
  width: 142px;
  height: 110px;
  border-radius: 54% 46% 48% 52%;
  background: rgba(85, 194, 113, 0.28);
  border: 2px solid rgba(85, 194, 113, 0.7);
  filter: drop-shadow(0 18px 30px rgba(0, 166, 166, 0.18));
}
.cell span {
  display: block;
  width: 42px;
  height: 34px;
  background: rgba(111, 85, 217, 0.42);
  border-radius: 50%;
  margin: 34px auto;
}
.cell-a { top: 82px; right: 68px; transform: rotate(12deg); }
.cell-b { bottom: 70px; left: 50px; transform: scale(0.82) rotate(-18deg); }
.dna {
  position: absolute;
  left: 72px;
  top: 72px;
  width: 74px;
  height: 360px;
}
.dna i {
  position: relative;
  display: block;
  width: 72px;
  height: 18px;
  margin: 21px 0;
  border-top: 5px solid var(--orange);
  transform: rotate(var(--r, 18deg));
}
.dna i:nth-child(even) { --r: -18deg; border-color: var(--blue); }
.dna::before, .dna::after {
  content: "";
  position: absolute;
  inset: 0 8px;
  border-left: 5px solid rgba(17,36,44,0.22);
  border-radius: 50%;
  transform: rotate(8deg);
}
.dna::after { transform: rotate(-8deg); left: auto; right: 8px; }
.microscope {
  position: absolute;
  right: 72px;
  bottom: 72px;
  width: 210px;
  height: 300px;
}
.scope-top, .scope-arm, .scope-base, .scope-stage { position: absolute; background: var(--ink); }
.scope-top { width: 120px; height: 34px; border-radius: 20px; transform: rotate(-35deg); top: 36px; left: 34px; }
.scope-arm { width: 64px; height: 174px; border-radius: 36px; transform: rotate(18deg); top: 70px; left: 84px; background: linear-gradient(var(--blue), var(--teal)); }
.scope-stage { width: 156px; height: 18px; border-radius: 10px; bottom: 86px; left: 18px; }
.scope-base { width: 198px; height: 42px; border-radius: 30px 30px 12px 12px; bottom: 24px; left: 0; }

.section { padding: 68px clamp(20px, 5vw, 72px); }
.section-heading { max-width: 880px; margin-bottom: 30px; }
.section-heading p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.intro-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.intro-strip article, .panel, .timeline-card, .exit-grid article, .future-grid article {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(17, 36, 44, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.intro-strip article { padding: 26px; }
.intro-strip p, .intro-strip li { color: var(--muted); line-height: 1.55; }

.timeline {
  display: grid;
  gap: 18px;
}
.timeline-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 22px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.timeline-card::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -50px;
  top: -50px;
  border-radius: 50%;
  background: rgba(0, 166, 166, 0.12);
}
.time-pill {
  display: grid;
  place-items: center;
  align-self: start;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0,166,166,0.15), rgba(39,118,234,0.15));
  font-weight: 950;
  color: var(--blue);
}
.timeline-card p, .timeline-card li { color: var(--muted); line-height: 1.55; }
.teacher-script {
  padding: 14px 16px;
  background: rgba(255, 209, 102, 0.18);
  border-left: 4px solid var(--yellow);
  border-radius: 14px;
  margin: 14px 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}
.tool-grid.three { grid-template-columns: repeat(3, 1fr); }
.panel { padding: 24px; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.badge {
  border-radius: 999px;
  background: rgba(85, 194, 113, 0.18);
  color: #24783a;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}
.card-sort {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.object-card {
  min-height: 120px;
  border: 2px solid rgba(17, 36, 44, 0.08);
  background: white;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(17, 36, 44, 0.08);
}
.object-card span { display: block; font-size: 2.2rem; margin-bottom: 8px; }
.object-card.correct { border-color: var(--green); background: rgba(85, 194, 113, 0.12); }
.object-card.consider { border-color: var(--yellow); background: rgba(255, 209, 102, 0.16); }
.feedback-box, .poll-result, .prompt-box {
  padding: 16px;
  background: rgba(39, 118, 234, 0.08);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.flashcard {
  min-height: 230px;
  perspective: 1000px;
  margin-bottom: 16px;
}
.flash-inner {
  position: relative;
  width: 100%;
  height: 230px;
  transition: transform 0.55s ease;
  transform-style: preserve-3d;
}
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-front, .flash-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border-radius: 22px;
  backface-visibility: hidden;
  background: linear-gradient(135deg, rgba(0,166,166,0.12), rgba(39,118,234,0.12));
  border: 1px solid rgba(17, 36, 44, 0.08);
}
.flash-back { transform: rotateY(180deg); background: linear-gradient(135deg, rgba(255,209,102,0.22), rgba(85,194,113,0.12)); }
.mini-label { margin-bottom: 0; text-transform: uppercase; letter-spacing: 0.12em; color: var(--teal); font-weight: 900; font-size: 0.75rem; }
.flashcard h4 { font-size: 2rem; margin: 0; }
.poll-options { display: grid; gap: 10px; margin: 16px 0; }
.poll-options button {
  border: 1px solid rgba(17, 36, 44, 0.08);
  background: white;
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  font-weight: 800;
}
.poll-options button:hover { border-color: var(--blue); }
.question { font-weight: 800; }

.levels-grid, .exit-grid, .future-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.level-card {
  border: 2px solid rgba(17, 36, 44, 0.08);
  background: white;
  border-radius: 24px;
  padding: 20px;
  text-align: left;
  min-height: 150px;
}
.level-card span { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.level-card strong { display: block; font-size: 1.18rem; }
.level-card small { color: var(--muted); line-height: 1.4; display: block; margin-top: 7px; }
.level-card.active { border-color: var(--teal); box-shadow: 0 18px 40px rgba(0, 166, 166, 0.18); }
.level-display {
  margin-top: 18px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(235, 252, 249, 0.88));
  border: 1px solid rgba(17, 36, 44, 0.08);
  box-shadow: var(--shadow);
  min-height: 170px;
}
.level-display h3 { font-size: 2rem; }
.level-display p { color: var(--muted); line-height: 1.65; }
.level-art { font-size: 3.2rem; letter-spacing: 0.25em; }

.timer {
  font-size: 4rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.06em;
  color: var(--blue);
  margin: 18px 0;
}
textarea {
  width: 100%;
  border: 1px solid rgba(17, 36, 44, 0.12);
  border-radius: 18px;
  padding: 14px;
  resize: vertical;
  background: white;
  color: var(--ink);
}
.saved-status { color: var(--green); font-weight: 800; min-height: 22px; }
.exit-ticket { background: rgba(17, 36, 44, 0.03); }
.exit-grid { grid-template-columns: repeat(3, 1fr); }
.exit-grid article { padding: 26px; }
.exit-grid span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 900;
  margin-bottom: 18px;
}
.exit-grid p, .future-grid p { color: var(--muted); line-height: 1.55; }
.future-grid { grid-template-columns: repeat(3, 1fr); }
.future-grid article { padding: 24px; }
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px clamp(20px, 5vw, 72px);
  color: var(--muted);
}
footer a { font-weight: 900; text-decoration: none; color: var(--blue); }

@media (max-width: 980px) {
  .hero-grid, .intro-strip, .tool-grid, .tool-grid.three, .levels-grid, .exit-grid, .future-grid {
    grid-template-columns: 1fr;
  }
  .science-window { min-height: 460px; }
  .timeline-card { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav-links { flex-direction: column; gap: 8px; }
  .card-sort { grid-template-columns: 1fr; }
  h1 { font-size: 3.25rem; }
  .section { padding-block: 48px; }
  .science-window { min-height: 380px; }
  .microscope { right: 25px; transform: scale(0.82); transform-origin: bottom right; }
  .dna { left: 28px; transform: scale(0.78); transform-origin: top left; }
  footer { flex-direction: column; }
}

@media print {
  .topbar, .hero-actions, .interactive-lab, .teacher-tools, footer { display: none; }
  body { background: white; }
  body::before { display: none; }
  .hero { min-height: auto; }
  .hero-grid, .intro-strip, .timeline-card, .levels-grid, .exit-grid, .future-grid { grid-template-columns: 1fr; }
  .science-window { display: none; }
  .section { padding: 20px 0; }
  .timeline-card, .intro-strip article, .exit-grid article, .future-grid article { box-shadow: none; border: 1px solid #ddd; }
}
