:root {
  --ink: #0b2a33;
  --ink-soft: #234854;
  --mint: #e8f7f2;
  --foam: #f3fbf8;
  --teal: #0d8a74;
  --teal-deep: #066655;
  --lime: #b8e03a;
  --sun: #ffc857;
  --coral: #ff6b4a;
  --sky: #3db7d4;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(11, 42, 51, 0.12);
  --radius: 22px;
  --max: 1120px;
  --nav-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(61, 183, 212, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 5%, rgba(184, 224, 58, 0.16), transparent 50%),
    linear-gradient(180deg, #f7fcfa 0%, #eef8f4 40%, #f7fcfa 100%);
  line-height: 1.55;
  overflow-x: hidden;
}
body.gate-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.site-main { transition: filter 0.4s ease; }
body.gate-open .site-main,
body.gate-open .topbar { filter: blur(5px); pointer-events: none; user-select: none; }

/* Character — Cyber Defender mascot */
.byte {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  position: relative;
  animation: byteBob 2.8s ease-in-out infinite;
  filter: drop-shadow(0 16px 28px rgba(8, 60, 30, 0.35));
}
.byte img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  pointer-events: none;
}
.byte.wave { animation: byteWave 0.9s ease-in-out 2; }
.byte.talk { animation: byteTalk 0.45s ease-in-out infinite; }
.byte.jump { animation: byteJump 0.55s ease; }
.byte.mini { width: 96px; height: 96px; }
.byte.guide { width: 124px; height: 124px; }
#gateByte {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  animation: byteFloat 3.2s ease-in-out infinite;
}
.hero-mascot-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  transition: transform 0.25s ease-out;
}
.hero-mascot {
  position: relative;
  width: min(100%, 420px);
  z-index: 2;
  pointer-events: none;
  animation: heroMascotFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,0.35));
  transition: transform 0.2s ease-out;
}
.hero-mascot img {
  width: 100%;
  height: auto;
  display: block;
}
.hero-mascot-glow {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 72%;
  height: 30%;
  translate: -50% 0;
  background: radial-gradient(ellipse, rgba(184,224,58,0.5), transparent 70%);
  filter: blur(18px);
  animation: glowPulse 2.8s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
.top-controls {
  position: fixed;
  top: calc(var(--nav-h) + 0.75rem);
  right: 1rem;
  z-index: 120;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  max-width: calc(100vw - 1.5rem);
  pointer-events: none;
}
body.gate-open .top-controls { top: 1rem; }
/* Welcome card already has language — hide floating lang on gate */
body.gate-open .top-controls .top-lang { display: none; }
/* Nav language row (shown in mobile menu) */
.nav-lang {
  display: none;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(13, 138, 116, 0.12);
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}
.nav-lang-label {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--teal-deep);
}
.nav-lang .lang-switch {
  width: 100%;
  justify-content: stretch;
  box-shadow: none;
}
.nav-lang .lang-btn {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.75rem;
}
html[dir="rtl"] .top-controls {
  right: auto;
  left: 1rem;
  justify-content: flex-start;
}
.lang-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(13, 138, 116, 0.18);
  box-shadow: 0 10px 24px rgba(11, 42, 51, 0.12);
  pointer-events: auto;
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--teal-deep);
  cursor: pointer;
  line-height: 1.2;
}
.lang-btn.is-active {
  background: var(--teal);
  color: #fff;
}
.gate-lang {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.15rem;
}
.gate-lang-label {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--teal-deep);
}
.gate-lang .lang-switch {
  box-shadow: 0 6px 16px rgba(11, 42, 51, 0.1);
}
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(13, 138, 116, 0.18);
  box-shadow: 0 10px 24px rgba(11, 42, 51, 0.12);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--teal-deep);
  pointer-events: auto;
}
.sound-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}
.sound-toggle.on .dot { background: var(--teal); }
html[lang="ur"] body {
  font-family: "Noto Nastaliq Urdu", "Nunito", sans-serif;
  line-height: 1.85;
  letter-spacing: 0;
}
html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] h3,
html[lang="ur"] .welcome-card h2,
html[lang="ur"] .brand-text strong,
html[lang="ur"] .question-title,
html[lang="ur"] .path-card strong,
html[lang="ur"] .btn,
html[lang="ur"] .lang-btn,
html[lang="ur"] .sound-toggle,
html[lang="ur"] .option,
html[lang="ur"] .episode strong,
html[lang="ur"] .help-action strong,
html[lang="ur"] .faq-item summary {
  font-family: "Noto Nastaliq Urdu", "Fredoka", sans-serif;
  font-weight: 700;
}
/* Nastaliq needs more vertical room than Latin */
html[lang="ur"] h1 {
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
html[lang="ur"] h2 {
  line-height: 1.5;
}
html[lang="ur"] h3,
html[lang="ur"] .question-title {
  line-height: 1.65;
}
html[lang="ur"] .hero-kicker {
  font-size: 0.78rem;
  letter-spacing: 0;
  line-height: 1.6;
  text-transform: none;
}
html[lang="ur"] #heroLead,
html[lang="ur"] .section-head p,
html[lang="ur"] .mission-details p,
html[lang="ur"] .resource p,
html[lang="ur"] .help-action span,
html[lang="ur"] .faq-item p,
html[lang="ur"] .footer-brand p {
  line-height: 1.9;
}
html[lang="ur"] .speech,
html[lang="ur"] .guide-bubble,
html[lang="ur"] .buddy-bubble {
  line-height: 1.9;
  padding: 0.95rem 1.1rem;
}
html[lang="ur"] .welcome-card {
  padding: 1.35rem 1.25rem 1.45rem;
}
html[lang="ur"] .welcome-card h2 {
  line-height: 1.55;
  margin-bottom: 0.65rem;
}
html[lang="ur"] .btn,
html[lang="ur"] .unlock-btn,
html[lang="ur"] .sound-toggle,
html[lang="ur"] .lang-btn {
  line-height: 1.55;
  padding-top: 0.55rem;
  padding-bottom: 0.65rem;
}
html[lang="ur"] .lang-btn {
  font-size: 0.8rem;
  padding-inline: 0.85rem;
}
html[lang="ur"] .sound-toggle {
  font-size: 0.8rem;
  gap: 0.5rem;
}
html[lang="ur"] .path-card {
  padding: 1.05rem 1rem 1.15rem;
}
html[lang="ur"] .path-card strong {
  line-height: 1.55;
  display: block;
  margin-bottom: 0.35rem;
}
html[lang="ur"] .path-card span {
  line-height: 1.75;
  font-size: 0.92rem;
}
html[lang="ur"] .option {
  line-height: 1.7;
  padding: 0.85rem 1rem 0.95rem;
  text-align: right;
}
html[lang="ur"] .question-title {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  margin-bottom: 1rem;
}
html[lang="ur"] .q-meta,
html[lang="ur"] .initiative-meta span,
html[lang="ur"] .tag {
  line-height: 1.55;
  font-size: 0.82rem;
}
html[lang="ur"] .episode {
  padding: 0.85rem 0.95rem;
}
html[lang="ur"] .episode strong {
  line-height: 1.55;
}
html[lang="ur"] .nav a,
html[lang="ur"] .nav-cta {
  line-height: 1.5;
  font-size: 0.9rem;
}
html[lang="ur"] .help-action,
html[lang="ur"] .resource {
  padding: 1.05rem 1.05rem 1.15rem;
}
html[lang="ur"] .mission-body {
  padding-bottom: 1.15rem;
}
html[dir="rtl"] .welcome-card,
html[dir="rtl"] .speech,
html[dir="rtl"] .section-head,
html[dir="rtl"] .hero-content,
html[dir="rtl"] .quiz-intro,
html[dir="rtl"] .help-panel,
html[dir="rtl"] .resource,
html[dir="rtl"] .mission-details,
html[dir="rtl"] .guide-row,
html[dir="rtl"] .q-meta,
html[dir="rtl"] .footer-grid,
html[dir="rtl"] .path-card,
html[dir="rtl"] .help-action,
html[dir="rtl"] .faq-item,
html[dir="rtl"] .episode {
  text-align: right;
}
html[dir="rtl"] .guide-row { direction: rtl; }
html[dir="rtl"] .cta-row,
html[dir="rtl"] .gate-actions,
html[dir="rtl"] .quiz-nav,
html[dir="rtl"] .initiative-actions {
  flex-direction: row-reverse;
}
html[dir="rtl"] .path-grid {
  direction: rtl;
}
html[dir="rtl"] .buddy { right: auto; left: 1rem; }
html[dir="rtl"] .buddy-bubble {
  right: auto;
  left: 0;
  text-align: right;
}
html[dir="rtl"] .brand-text {
  text-align: right;
}
html[dir="rtl"] .mission-top,
html[dir="rtl"] .guide-row {
  text-align: right;
}

/* Welcome gate */
.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 28%, rgba(184, 224, 58, 0.22), transparent 55%),
    linear-gradient(145deg, rgba(6, 40, 22, 0.96), rgba(11, 66, 26, 0.94) 45%, rgba(13, 107, 58, 0.93));
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.welcome-gate.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Briefly keep the gate on top to swallow the same tap (prevents click-through) */
.welcome-gate.is-done.eat-clicks {
  visibility: visible;
  opacity: 0;
  pointer-events: auto;
}
.welcome-card {
  width: min(100%, 560px);
  background: rgba(255,255,255,0.97);
  border-radius: 28px;
  padding: 1.2rem 1.5rem 1.4rem;
  box-shadow: 0 30px 70px rgba(0,0,0,0.28);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.75rem;
  animation: popIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.welcome-card h2 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  color: var(--teal-deep);
  line-height: 1.15;
}
.speech {
  position: relative;
  width: 100%;
  background: var(--mint);
  border: 2px solid rgba(13, 138, 116, 0.18);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  font-weight: 700;
  color: var(--ink);
  min-height: 74px;
  text-align: left;
}
.speech::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  translate: -50% 0;
  border: 10px solid transparent;
  border-bottom-color: var(--mint);
  filter: drop-shadow(0 -2px 0 rgba(13, 138, 116, 0.12));
}
.speech .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--teal);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blinkCaret 0.8s step-end infinite;
}
.gate-step { width: 100%; display: none; animation: riseIn 0.35s ease; }
.gate-step.active { display: grid; gap: 0.85rem; justify-items: center; }
.name-field {
  width: 100%;
  display: grid;
  gap: 0.55rem;
}
.name-field label {
  font-weight: 800;
  color: var(--teal-deep);
  font-size: 0.92rem;
}
.name-field input {
  width: 100%;
  border: 2px solid rgba(13, 138, 116, 0.22);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.name-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 138, 116, 0.12);
}
.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  width: 100%;
}
.path-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  /* Keep Quiz | Explore order stable in Urdu RTL */
  direction: ltr;
}
.path-card:disabled {
  opacity: 0.7;
  pointer-events: none;
}
.path-card {
  display: grid;
  gap: 0.5rem;
  text-align: left;
  padding: 1.2rem;
  border-radius: 20px;
  border: 2px solid rgba(13, 138, 116, 0.16);
  background: var(--foam);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: pathPulse 2.8s ease-in-out infinite;
}
.path-card:nth-child(2) { animation-delay: 0.4s; }
.path-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--teal);
  box-shadow: 0 14px 30px rgba(13, 138, 116, 0.16);
  animation: none;
}
@keyframes pathPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 138, 116, 0); }
  50% { box-shadow: 0 0 0 6px rgba(184, 224, 58, 0.18); }
}
.path-card strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--teal-deep);
}
.path-card span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.path-card.quiz-path { background: linear-gradient(160deg, #e8f7f2, #dff4ff); }
.path-card.explore-path { background: linear-gradient(160deg, #f4ffe4, #e8f7f2); }

/* Floating companion */
.buddy {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: none;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: min(360px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.buddy.show { display: flex; animation: popIn 0.45s ease; }
.buddy-bubble {
  background: #fff;
  border: 2px solid rgba(13, 138, 116, 0.16);
  border-radius: 16px 16px 4px 16px;
  padding: 0.75rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.buddy-bubble.show {
  opacity: 1;
  transform: translateY(0);
}
.buddy-btn {
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
}
.buddy-btn::after {
  content: attr(data-help-label);
  position: absolute;
  right: 0;
  top: -1.6rem;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--teal-deep);
  background: #fff;
  border: 1px solid rgba(13,138,116,0.15);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  box-shadow: 0 6px 14px rgba(11,42,51,0.1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
html[dir="rtl"] .buddy-btn::after {
  right: auto;
  left: 0;
}
.buddy-btn:hover::after,
.buddy-btn:focus-visible::after { opacity: 1; transform: translateY(0); }
.buddy-btn:focus-visible {
  outline: 3px solid rgba(184, 224, 58, 0.7);
  outline-offset: 3px;
}
.buddy-btn .byte { pointer-events: none; }

/* Help popup */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 40, 22, 0.55);
  display: grid;
  place-items: end center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.help-overlay.open {
  opacity: 1;
  visibility: visible;
}
.help-panel {
  width: min(100%, 440px);
  max-height: min(86vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  padding: 1.2rem 1.15rem 1.25rem;
  transform: translateY(24px);
  transition: transform 0.3s ease;
}
.help-overlay.open .help-panel { transform: translateY(0); }
.help-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.help-head h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: var(--teal-deep);
  line-height: 1.15;
}
.help-head p {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.help-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--teal-deep);
  font-size: 1.3rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.help-actions {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
}
.help-action {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 2px solid rgba(13, 138, 116, 0.14);
  background: var(--foam);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.help-action:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  background: var(--mint);
}
.help-action .ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  color: var(--teal-deep);
  border: 1px solid rgba(13,138,116,0.12);
}
.help-action strong {
  display: block;
  font-family: "Fredoka", sans-serif;
  color: var(--ink);
  font-size: 1rem;
}
.help-action span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.help-faq h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--teal-deep);
  margin-bottom: 0.55rem;
}
.faq-item {
  border: 1px solid rgba(13, 138, 116, 0.12);
  border-radius: 14px;
  margin-bottom: 0.45rem;
  overflow: hidden;
  background: #fff;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.8rem 0.9rem;
  font-weight: 800;
  color: var(--ink);
  font-size: 0.92rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--teal);
  font-weight: 800;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  padding: 0 0.9rem 0.85rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(18px) saturate(1.2);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(13, 138, 116, 0.1);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.topbar.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(11, 42, 51, 0.08);
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.brand-lockup img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 6px 16px rgba(13, 138, 116, 0.12);
}
.brand-text strong {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 1.08rem;
  color: var(--teal-deep);
}
.brand-text span {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem 0.35rem;
  list-style: none;
  font-weight: 800;
  font-size: 0.9rem;
}
.nav-links a {
  color: var(--ink-soft);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--teal-deep); background: var(--mint); }
.nav-cta {
  margin-left: 0.35rem;
  padding: 0.58rem 1.05rem !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--teal), #0aa38a) !important;
  color: var(--white) !important;
  box-shadow: 0 8px 18px rgba(13, 138, 116, 0.28);
}
.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mint);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--teal-deep);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  align-items: center;
  padding: 3.5rem 0 4.5rem;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
}
.hero-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 55% at 82% 55%, rgba(184, 224, 58, 0.28), transparent 60%),
    radial-gradient(ellipse 40% 45% at 15% 20%, rgba(50, 205, 50, 0.16), transparent 55%),
    linear-gradient(145deg, #062816 0%, #0b421a 28%, #0d6b3a 58%, #127a4a 100%);
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(184,224,58,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,224,58,0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 50%, black 15%, transparent 75%);
  animation: gridDrift 18s linear infinite;
}
.hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 30, 18, 0.25) 0%, transparent 30%, transparent 55%, rgba(4, 30, 18, 0.45) 100%);
  pointer-events: none;
}
.hero-aurora {
  position: absolute;
  inset: -15%;
  background: conic-gradient(from 120deg at 70% 45%, transparent 0deg, rgba(184,224,58,0.22) 50deg, transparent 110deg, rgba(50,205,50,0.16) 190deg, transparent 280deg);
  filter: blur(42px);
  animation: auroraSpin 16s linear infinite;
}
.hero-scan {
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(184,224,58,0.14), transparent);
  animation: scanMove 5.5s ease-in-out infinite;
  pointer-events: none;
}
.hero-binary {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
}
.bin-col {
  position: absolute;
  top: -20%;
  font-family: "Nunito", monospace;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(184, 224, 58, 0.55);
  writing-mode: horizontal-tb;
  white-space: pre;
  animation: binaryFall linear infinite;
}
.hero-floaters {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.floater {
  position: absolute;
  width: 34px;
  height: 34px;
  opacity: 0.75;
  animation: floaterDrift linear infinite;
}
.floater svg { width: 100%; height: 100%; }
.hero-circuits {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
}
.hero-circuits path {
  fill: none;
  stroke: rgba(184, 224, 58, 0.65);
  stroke-width: 1.8;
  stroke-dasharray: 10 16;
  animation: circuitFlow 7s linear infinite;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: orbPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.hero-orb.a {
  width: 160px; height: 160px;
  left: 8%; top: 18%;
  background: radial-gradient(circle, rgba(184,224,58,0.35), transparent 70%);
}
.hero-orb.b {
  width: 120px; height: 120px;
  right: 18%; top: 12%;
  background: radial-gradient(circle, rgba(255,230,80,0.3), transparent 70%);
  animation-delay: -1.5s;
}
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(184, 224, 58, 0.85);
  animation: particleRise linear infinite;
  opacity: 0;
}
.hero-layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
  align-items: center;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.15rem;
  color: rgba(255,255,255,0.92);
}
.hero-kicker img {
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 9px;
  padding: 3px;
}
.hero h1 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: 1.05rem;
  text-shadow: 0 14px 40px rgba(0,0,0,0.22);
}
.hero h1 .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: 0.18em;
}
.hero h1 .letter {
  display: inline-block;
  transform: translateY(110%);
  animation: letterUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero p {
  font-size: clamp(1.08rem, 2.2vw, 1.28rem);
  max-width: 34ch;
  font-weight: 700;
  color: rgba(255,255,255,0.94);
  margin-bottom: 1.85rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-lime {
  position: relative;
  overflow: hidden;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(184, 224, 58, 0.35);
}
.btn-ghost {
  background: rgba(255,255,255,0.16);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(8px);
}
.btn-teal {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(13, 138, 116, 0.28);
}
.btn-outline {
  background: transparent;
  color: var(--teal-deep);
  border: 2px solid rgba(13, 138, 116, 0.35);
}
.btn-outline:hover { background: var(--mint); }
.btn-soft {
  background: transparent;
  color: var(--ink-soft);
  border: 2px solid rgba(13, 138, 116, 0.18);
  font-weight: 800;
}

/* Sections */
section { padding: 4.5rem 0; }
#top,
#initiatives,
#superheroes,
#quiz,
#parents {
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}
.section-head {
  max-width: 680px;
  margin-bottom: 2.25rem;
}
.section-head h2 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
  color: var(--teal-deep);
  margin-bottom: 0.65rem;
}
.section-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Initiatives mission path */
.initiatives {
  background:
    radial-gradient(circle at 8% 20%, rgba(61,183,212,0.12), transparent 28%),
    radial-gradient(circle at 92% 70%, rgba(184,224,58,0.14), transparent 26%),
    linear-gradient(180deg, transparent, rgba(232, 247, 242, 0.75) 10%, rgba(232, 247, 242, 0.75) 90%, transparent);
}
.mission-map {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding-left: 0.25rem;
}
.mission-map::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 28px;
  bottom: 28px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sky), var(--teal), var(--lime));
  opacity: 0.35;
}
.initiative-block {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0.85rem;
  align-items: start;
  opacity: 0;
  transform: translateY(48px) scale(0.98);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.initiative-block.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mission-node {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(145deg, var(--accent, var(--teal)), color-mix(in srgb, var(--accent, var(--teal)) 55%, #033));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent, var(--teal)) 35%, transparent);
  border: 3px solid #fff;
  z-index: 1;
  position: relative;
}
.mission-node.unlocked {
  animation: nodePop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.mission-card {
  position: relative;
  border-radius: 26px;
  background: #fff;
  border: 2px solid rgba(13, 138, 116, 0.1);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(11, 42, 51, 0.14);
  border-color: color-mix(in srgb, var(--accent, var(--teal)) 45%, white);
}
.mission-card.locked .mission-body {
  filter: blur(1.5px);
  opacity: 0.55;
  pointer-events: none;
}
.mission-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1.15rem 1.2rem 0.85rem;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent, var(--teal)) 16%, white), #fff 55%);
}
.mission-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent, var(--teal)) 18%, white);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent, var(--teal)) 22%, white);
}
.mission-icon svg { width: 36px; height: 36px; }
.mission-top h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.15;
}
.mission-top .mission-tag {
  display: inline-flex;
  margin-top: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--accent, var(--teal)) 16%, white);
  color: var(--teal-deep);
}
.unlock-btn {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: var(--accent, var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent, var(--teal)) 35%, transparent);
  white-space: nowrap;
}
.mission-card:not(.locked) .unlock-btn {
  background: var(--lime);
  color: var(--ink);
}
.mission-body {
  padding: 0 1.2rem 1.2rem;
  display: grid;
  gap: 0.85rem;
  transition: filter 0.35s ease, opacity 0.35s ease;
}
.guide-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b421a, #127a4a 55%, #1aa05a);
  color: #fff;
}
.guide-bubble {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  min-height: 52px;
}
.guide-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.initiative-copy {
  color: var(--ink-soft);
  font-weight: 600;
}
.initiative-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--teal-deep);
}
.initiative-meta span {
  background: var(--mint);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
}
.initiative-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.initiative-actions .btn { padding: 0.7rem 1.05rem; font-size: 0.92rem; }
.mission-details {
  display: none;
  gap: 0.85rem;
}
.mission-card.open .mission-details { display: grid; }
.mission-card.open .unlock-btn::after { content: none; }
.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  pointer-events: none;
  animation: sparkleFly 0.8s ease-out forwards;
}

/* Watch */
.watch-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.video-frame {
  border-radius: 24px;
  overflow: hidden;
  background: #062a30;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.episode-list { display: grid; gap: 0.65rem; }
.episode {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: var(--white);
  border: 1.5px solid transparent;
  text-align: left;
  box-shadow: 0 8px 20px rgba(11, 42, 51, 0.06);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.episode:hover,
.episode.active {
  border-color: var(--teal);
  background: var(--mint);
  transform: translateX(4px);
}
.ep-num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  background: var(--teal);
  color: white;
}
.episode.active .ep-num { background: var(--lime); color: var(--ink); }
.ep-copy strong { display: block; font-size: 0.98rem; }
.ep-copy span { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.ep-play {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--teal-deep);
  text-transform: uppercase;
}

/* Quiz */
.quiz-section {
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 200, 87, 0.18), transparent 30%),
    radial-gradient(circle at 5% 80%, rgba(61, 183, 212, 0.16), transparent 28%);
}
.quiz-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.5rem;
}
.quiz-intro {
  padding: 2rem;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--teal-deep), #0a7f8f 60%, var(--sky));
  color: white;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}
.quiz-intro h2 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  margin: 0.6rem 0 0.9rem;
}
.quiz-intro p { font-weight: 700; }
.quiz-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.quiz-stat {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 16px;
  padding: 0.8rem 0.6rem;
  text-align: center;
}
.quiz-stat strong {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
}
.quiz-stat span { font-size: 0.75rem; font-weight: 800; }
.quiz-panel {
  background: var(--white);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(13, 138, 116, 0.08);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
#quizPlay {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 360px;
}
.progress-track {
  height: 10px;
  background: var(--mint);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  transition: width 0.35s ease;
}
.q-meta {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}
.question-title {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  margin-bottom: 1.15rem;
}
.options { display: grid; gap: 0.65rem; }
.option {
  text-align: left;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  border: 2px solid rgba(13, 138, 116, 0.14);
  background: var(--foam);
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.option:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateX(3px);
}
.option.correct { border-color: var(--teal); background: #d8f5ea; }
.option.wrong { border-color: var(--coral); background: #ffe6e0; }
.option:disabled { cursor: default; }
.quiz-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.ok { background: #d8f5ea; color: var(--teal-deep); }
.quiz-feedback.bad { background: #ffe6e0; color: #9a2f18; }
.quiz-nav {
  margin-top: auto;
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}
.quiz-nav .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.results {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: riseIn 0.5s ease both;
}
.results.show { display: flex; }
.result-badge {
  align-self: flex-start;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--lime);
}
.results h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.8rem;
  color: var(--teal-deep);
}
.score-ring-wrap {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.score-ring {
  --p: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), #d7ebe4 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.score-ring > span {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: var(--teal-deep);
}
.recommend-list { display: grid; gap: 0.7rem; }
.recommend {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: var(--mint);
  border: 1px solid rgba(13, 138, 116, 0.12);
}
.recommend strong { display: block; }
.recommend span { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.recommend .btn { padding: 0.65rem 0.95rem; font-size: 0.88rem; }

/* Resources */
.resource-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.resource {
  padding: 1.4rem;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid rgba(13, 138, 116, 0.1);
  box-shadow: 0 10px 28px rgba(11, 42, 51, 0.06);
}
.resource h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  margin: 0.4rem 0 0.55rem;
  color: var(--teal-deep);
}
.resource p {
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.resource .icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--mint);
}

footer {
  padding: 2.5rem 0 2rem;
  background: #06363d;
  color: rgba(255,255,255,0.88);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
footer h3 {
  font-family: "Fredoka", sans-serif;
  color: white;
  margin-bottom: 0.75rem;
}
footer p, footer li {
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.78);
}
footer ul { list-style: none; display: grid; gap: 0.45rem; }
footer a:hover { color: var(--lime); }
.footer-brand {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}
.footer-brand img {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 12px;
  padding: 4px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
}

@keyframes byteBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes byteFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes heroMascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1.5deg); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, 0) scale(1); }
  50% { opacity: 0.95; transform: translate(-50%, 0) scale(1.12); }
}
@keyframes byteJump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes byteWave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-4deg); }
  55% { transform: translateY(-2px) rotate(5deg); }
}
@keyframes byteTalk {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.02); }
}
@keyframes scanMove {
  0% { top: -10%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}
@keyframes binaryFall {
  0% { transform: translateY(-10%); opacity: 0; }
  10% { opacity: 0.8; }
  100% { transform: translateY(120vh); opacity: 0; }
}
@keyframes floaterDrift {
  0% { transform: translateY(20vh) rotate(0deg); opacity: 0; }
  15% { opacity: 0.85; }
  100% { transform: translateY(-30vh) rotate(25deg); opacity: 0; }
}
@keyframes circuitFlow {
  to { stroke-dashoffset: -140; }
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes nodePop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes sparkleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0.2); }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes letterUp { to { transform: translateY(0); } }
@keyframes gridDrift { to { transform: translate(56px, 56px); } }
@keyframes auroraSpin { to { transform: rotate(360deg) scale(1.05); } }
@keyframes particleRise {
  0% { opacity: 0; transform: translateY(20px) scale(0.6); }
  15% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-110vh) scale(1); }
}
@keyframes blinkCaret {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero h1 .letter { transform: none; }
  .initiative-block { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .watch-layout,
  .quiz-shell,
  .resource-strip,
  .footer-grid,
  .path-grid,
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-mascot-wrap {
    order: -1;
    justify-self: center;
    width: min(58vw, 300px);
    min-height: 240px;
  }
  .mission-map::before { left: 24px; }
  .quiz-intro { min-height: auto; }
  section { padding: 3.25rem 0; }
  .section-head { margin-bottom: 1.6rem; }
  .watch-layout,
  .quiz-shell,
  .resource-strip { gap: 1.15rem; }
  .mission-map { gap: 1.15rem; }
}
@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .wrap { padding-inline: 1.05rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(247, 252, 250, 0.98);
    padding: 0.85rem 1rem 1.15rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    border-bottom: 1px solid rgba(13, 138, 116, 0.12);
    box-shadow: 0 16px 28px rgba(11, 42, 51, 0.1);
    max-height: calc(100vh - var(--nav-h) - 0.5rem);
    overflow: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
  }
  .nav-cta {
    display: flex !important;
    margin: 0.35rem 0 0 !important;
    text-align: center;
    justify-content: center;
  }
  .nav-lang { display: flex; }
  .menu-btn { display: inline-flex; }

  /* Language lives in the menu on phones — hide floating lang */
  .top-controls .top-lang { display: none !important; }
  .top-controls {
    top: calc(var(--nav-h) + 0.45rem);
    bottom: auto;
    right: 0.7rem;
    left: auto;
    gap: 0.35rem;
    max-width: none;
  }
  body.gate-open .top-controls { top: 0.65rem; }
  html[dir="rtl"] .top-controls {
    right: auto;
    left: 0.7rem;
  }
  .sound-toggle {
    padding: 0.45rem 0.7rem;
    font-size: 0.74rem;
  }

  .recommend { grid-template-columns: 1fr; gap: 0.85rem; }
  .hero {
    align-items: center;
    padding: 1.1rem 0 2rem;
    min-height: auto;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    max-width: none;
  }
  html[dir="rtl"] .hero-content { align-items: flex-end; }
  .hero h1 { font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1.05; margin-bottom: 0.7rem; }
  #heroLead {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 0.85rem;
  }
  .hero-kicker {
    font-size: 0.72rem;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: none;
  }
  .cta-row { gap: 0.65rem; }
  .btn { padding: 0.78rem 1.05rem; font-size: 0.92rem; }
  .hero-mascot-wrap {
    width: min(62vw, 220px);
    min-height: 200px;
    margin-bottom: 0.25rem;
  }

  .buddy { right: 0.6rem; bottom: 0.6rem; }
  .buddy .byte { width: 70px; height: 70px; }
  html[dir="rtl"] .buddy { left: 0.6rem; }

  section { padding: 2.6rem 0; }
  .section-head { margin-bottom: 1.35rem; max-width: none; }
  .section-head h2 { font-size: clamp(1.55rem, 6.5vw, 2rem); margin-bottom: 0.5rem; }
  .section-head p { font-size: 0.95rem; line-height: 1.55; }

  .mission-top {
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
  }
  .mission-top .unlock-btn { grid-column: 1 / -1; justify-self: stretch; }
  .mission-map::before { display: none; }
  .mission-map { gap: 1rem; padding-left: 0; }
  .initiative-block { grid-template-columns: 1fr; gap: 0; }
  .mission-node { display: none; }
  .mission-body { padding: 0 1rem 1rem; }
  .mission-details { gap: 0.85rem; }
  .initiative-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .initiative-actions {
    display: grid;
    gap: 0.55rem;
  }
  .initiative-actions .btn { width: 100%; justify-content: center; }
  .guide-row { gap: 0.65rem; margin-bottom: 0.75rem; }
  .guide-bubble { font-size: 0.9rem; line-height: 1.45; }

  .watch-layout { gap: 1rem; }
  .video-frame { border-radius: 18px; }
  .episode-list { gap: 0.55rem; }
  .episode { padding: 0.75rem 0.8rem; gap: 0.65rem; }
  .ep-copy strong { font-size: 0.92rem; }
  .ep-copy span { font-size: 0.75rem; }

  .quiz-shell { gap: 1rem; }
  .quiz-intro {
    padding: 1.25rem 1.15rem;
    border-radius: 22px;
    min-height: 0;
  }
  .quiz-intro h2 { font-size: 1.45rem; margin: 0.45rem 0 0.55rem; }
  .quiz-intro p { font-size: 0.92rem; line-height: 1.5; }
  .quiz-stats { gap: 0.45rem; margin-top: 1rem; }
  .quiz-stat { padding: 0.65rem 0.4rem; border-radius: 12px; }
  .quiz-stat strong { font-size: 1.15rem; }
  .quiz-panel {
    padding: 1.15rem;
    border-radius: 22px;
    min-height: 0;
  }
  #quizPlay { min-height: 0; }
  .question-title { font-size: 1.12rem; margin-bottom: 0.9rem; line-height: 1.35; }
  .options { gap: 0.55rem; }
  .option {
    padding: 0.85rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.4;
  }
  html[lang="ur"] .question-title {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1rem;
  }
  html[lang="ur"] .option {
    font-size: 0.9rem;
    line-height: 1.7;
    padding: 0.9rem 0.95rem 1rem;
  }
  html[lang="ur"] .speech {
    font-size: 0.9rem;
    line-height: 1.85;
    min-height: 72px;
  }
  html[lang="ur"] .welcome-card h2 {
    line-height: 1.55;
  }
  html[lang="ur"] .section-head p,
  html[lang="ur"] .quiz-intro p,
  html[lang="ur"] .resource p {
    line-height: 1.85;
  }
  html[lang="ur"] .btn {
    font-size: 0.88rem;
    padding: 0.82rem 1rem 0.9rem;
  }
  html[lang="ur"] .hero h1 {
    line-height: 1.4;
  }
  html[lang="ur"] #heroLead {
    font-size: 0.95rem;
    line-height: 1.85;
  }
  .q-meta { font-size: 0.82rem; margin-bottom: 0.7rem; gap: 0.5rem; flex-wrap: wrap; }
  .quiz-nav {
    margin-top: 1rem;
    gap: 0.55rem;
  }
  .quiz-nav .btn { flex: 1; justify-content: center; }
  .score-ring-wrap { gap: 0.85rem; }

  .resource-strip { gap: 0.9rem; }
  .resource {
    padding: 1.15rem;
    border-radius: 20px;
  }
  .resource h3 { font-size: 1.05rem; }
  .resource p { font-size: 0.92rem; line-height: 1.5; }

  .footer-grid { gap: 1.5rem; }
  .footer-brand { gap: 0.75rem; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.8rem;
  }

  .welcome-gate { padding: 0.75rem; align-items: start; padding-top: max(0.75rem, env(safe-area-inset-top)); }
  .welcome-card {
    padding: 1rem 1.05rem 1.15rem;
    gap: 0.65rem;
    border-radius: 22px;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
  }
  .welcome-card h2 { font-size: clamp(1.25rem, 5.5vw, 1.55rem); }
  .speech { padding: 0.85rem 0.95rem; min-height: 64px; font-size: 0.92rem; }
  .gate-step.active { gap: 0.75rem; }
  .path-grid { gap: 0.65rem; }
  .path-card { padding: 1rem; }
  .path-card strong { font-size: 1.05rem; }
  .path-card span { font-size: 0.88rem; line-height: 1.4; }
  .gate-actions .btn { flex: 1 1 100%; justify-content: center; }
  .gate-lang { gap: 0.4rem; }
  .help-panel { padding: 1rem; border-radius: 20px; }
  .help-action { padding: 0.85rem; gap: 0.7rem; }
}
/* Moved from inline styles for strict CSP */
.initiative-block[data-accent="sky"] { --accent: #3db7d4; }
.initiative-block[data-accent="teal"] { --accent: #0d8a74; }
.initiative-block[data-accent="lime"] { --accent: #9ccc2f; }
.initiative-block[data-accent="sun"] { --accent: #ffc857; }
.mb-0 { margin-bottom: 0; }
.text-soft-strong { font-weight: 700; color: var(--ink-soft); }
.text-teal-strong { font-weight: 800; color: var(--teal-deep); }
