:root {
  --bg: #040a18;
  --bg2: #08142b;
  --panel: rgba(9, 20, 43, .84);
  --line: rgba(94, 234, 212, .3);
  --cyan: #5eead4;
  --cyan2: #22d3ee;
  --mars: #ff8a5b;
  --text: #eaf2ff;
  --muted: #a9bbd6;
  --accent: #5eead4;
  --display: "Space Grotesk", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --top: 68px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--body);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0
}

p {
  margin: 0 0 .8em
}

a {
  color: var(--cyan)
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(34, 211, 238, .45)
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--cyan);
  color: #021;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
  font-weight: 700
}

.skip:focus {
  top: 8px
}

.muted {
  color: var(--muted)
}

.small {
  font-size: .9rem
}

code {
  background: rgba(255, 255, 255, .08);
  padding: 1px 6px;
  border-radius: 5px
}

kbd {
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0 7px;
  font-size: .85em
}

[hidden] {
  display: none !important
}

/* boot / errors */
.boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: var(--bg);
  text-align: center;
  padding: 24px
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(94, 234, 212, .2);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  padding: 0 clamp(12px, 3vw, 40px);
  background: linear-gradient(#040a18f2, #040a18cc);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(94, 234, 212, .15)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  text-decoration: none
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1
}

.brand b {
  font: 700 1.6rem/1 var(--display);
  letter-spacing: .22em;
  color: #fff
}

.brand small {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-top: 4px
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.4vw, 20px)
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 20, 43, .92);
  color: var(--text);
  font: 700 .95rem var(--body);
  cursor: pointer
}

.menu-toggle svg { width: 20px; height: 20px }
.menu-x { display: none; }
#menu-toggle[aria-expanded="true"] .menu-line { display: none; }
#menu-toggle[aria-expanded="true"] .menu-x { display: block; }

nav a,
nav button {
  font: 700 .98rem var(--body);
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 6px;
  cursor: pointer;
  min-height: 44px
}

nav a:hover,
nav button:hover {
  color: var(--cyan)
}

nav a[aria-current] {
  border-bottom-color: var(--cyan);
  color: var(--cyan)
}
#main-nav a svg { display: none; }

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1.2vw, 16px);
  min-width: 0;
}
.header-tools #language-toggle {
  min-height: 44px;
  border: 1px solid rgba(94, 234, 212, .2);
  border-radius: 12px;
  padding: 8px 14px;
  background: rgba(8, 20, 43, .65);
  color: var(--text);
  font: 700 .95rem var(--body);
  cursor: pointer;
}
.header-tools #open-credits {
  min-height: 44px;
  color: var(--muted);
  font: 700 .94rem var(--body);
  cursor: pointer;
  white-space: nowrap;
}
.sound-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(94, 234, 212, .36);
  border-radius: 13px;
  background: rgba(8, 20, 43, .86);
  color: var(--cyan);
}
.sound-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  color: inherit;
  background: transparent;
  border: 0;
  font: 700 .94rem var(--body);
  cursor: pointer;
}
.sound-control .sound-mute { border-radius: 12px 0 0 12px; }
.sound-control .sound-settings-trigger { border-radius: 0 12px 12px 0; }
.sound-control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-control[data-enabled="false"] .sound-wave { opacity: 0; }
.sound-settings-trigger svg { width: 14px; height: 14px; transition: transform .18s ease; }
.sound-settings-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.sound-control:has(.sound-settings-trigger[aria-expanded="true"]) { background: rgba(94, 234, 212, .12); }
.sound-popover {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 50;
  width: min(330px, calc(100vw - 24px));
  padding: 42px 16px 16px;
  border: 1px solid rgba(94, 234, 212, .4);
  border-radius: 18px;
  background: #0b1b36;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .5);
}
.sound-popover-close {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-end: 7px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(94,234,212,.24);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.sound-option, .sound-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 4px;
  color: var(--text);
  font-weight: 700;
}
.sound-option + .sound-range, .sound-range + .sound-option { border-top: 1px solid rgba(255,255,255,.08); }
.sound-option input[type="checkbox"] { appearance: none; position: relative; flex: 0 0 48px; width: 48px; height: 28px; border: 1px solid rgba(169,187,214,.4); border-radius: 999px; background: #203655; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.sound-option input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #c2d0e5; transition: transform .18s ease, background .18s ease; }
.sound-option input[type="checkbox"]:checked { border-color: var(--cyan); background: var(--cyan); }
.sound-option input[type="checkbox"]:checked::before { background: #04202b; transform: translateX(20px); }
body.rtl .sound-option input[type="checkbox"]:checked::before { transform: translateX(-20px); }
.sound-range input { flex: 1 1 130px; max-width: 155px; min-height: 30px; accent-color: var(--cyan); }
.sound-popover .muted { margin: 8px 0 0; }
.mobile-menu-sheet {
  display: none;
}

.header-tools #open-credits {
  border: 0;
  padding: 8px 4px;
  color: var(--muted);
  background: transparent;
}

@media (max-width:640px) {
  .topbar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    height: auto;
    min-height: calc(var(--top) + 8px);
    padding-inline: 12px;
    padding-block: 8px;
    backdrop-filter: none;
  }
  .brand { order: 1; }
  .header-tools { order: 2; }
  .menu-toggle { order: 3; }
  .brand { gap: 7px; }
  .brand svg { width: 34px; height: 34px; }
  .brand b { font-size: 1.32rem; }
  .brand small { display: none; }
  .header-tools { gap: 7px; margin-inline-start: auto; }
  .sound-control { min-height: 42px; border-radius: 12px; }
  .sound-control .sound-mute { min-width: 42px; padding: 8px 10px; border-radius: 11px; }
  .sound-control .sound-settings-trigger { display: none; }
  .header-tools #language-toggle { min-width: 42px; padding: 8px 10px; font-size: .9rem; }
  .header-tools #open-credits { display: none; }
  .menu-toggle { display: inline-flex; flex: 0 0 42px; min-height: 42px; width: 42px; padding: 8px; margin: 0; }
  #main-nav {
    position: fixed;
    inset: auto 12px calc(10px + env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    justify-content: space-around;
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(94, 234, 212, .22);
    border-radius: 18px;
    background: rgba(8, 20, 43, .97);
    box-shadow: 0 12px 36px rgba(0,0,0,.42);
    backdrop-filter: blur(14px);
  }
  #main-nav a {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 6px;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.1;
  }
  #main-nav a svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #main-nav a[data-nav="home"] { display: flex; }
  #main-nav a[aria-current] { color: var(--cyan); background: rgba(94,234,212,.09); }
  #main-nav a[aria-current]::after { content: ""; position: absolute; bottom: 4px; width: 28px; height: 2px; border-radius: 2px; background: var(--cyan); }
  .story-bar { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .hud-bottom { bottom: calc(76px + env(safe-area-inset-bottom)); padding-bottom: 8px; }
  main { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-menu-sheet:not([hidden]) {
    position: absolute;
    inset: 100% 10px auto;
    z-index: 45;
    display: grid;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(8, 20, 43, .98);
    box-shadow: 0 16px 34px rgba(0,0,0,.45);
  }
  .mobile-menu-sheet button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: 700 .96rem var(--body);
    text-align: start;
    cursor: pointer;
  }
  .mobile-menu-sheet button:hover { background: rgba(94,234,212,.1); color: var(--cyan); }
  .sound-popover {
    position: fixed;
    top: calc(var(--top) + 12px);
    inset-inline: 12px;
    width: auto;
    max-width: 360px;
    margin-inline-start: auto;
  }
  .sound-popover-close { top: 8px; }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 12px;
  font: 700 1.05rem var(--body);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--cyan);
  transition: transform .15s, box-shadow .2s, background .2s
}

.btn.primary {
  background: linear-gradient(135deg, #5eead4, #22d3ee);
  color: #03121f;
  box-shadow: 0 0 28px rgba(94, 234, 212, .35)
}

.btn.ghost {
  background: rgba(4, 10, 24, .55);
  color: var(--cyan)
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(94, 234, 212, .5)
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed
}

.linklike {
  background: none;
  border: 0;
  color: var(--cyan);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 8px 4px;
  min-height: 44px
}

.chip {
  white-space: nowrap;
  font: 700 .95rem var(--body);
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(7, 16, 36, .78);
  color: var(--text);
  border: 1.5px solid var(--line);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s
}

.chip:hover {
  border-color: var(--accent);
  background: rgba(94, 234, 212, .12)
}

.chip[aria-pressed=true] {
  background: var(--cyan);
  color: #03121f;
  border-color: var(--cyan)
}

.chip small {
  opacity: .7;
  font-weight: 400;
  margin-left: 4px
}

.chip.reset {
  border-style: dashed
}

.badge {
  display: inline-block;
  font: 700 .72rem var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  line-height: 2;
}

.fact-b {
  background: rgba(94, 234, 212, .16);
  color: #7ff2e0;
  border: 1px solid rgba(94, 234, 212, .5)
}

.voice-b {
  background: rgba(255, 200, 120, .12);
  color: #ffd49a;
  border: 1px solid rgba(255, 200, 120, .45)
}

.sci-b {
  background: rgba(124, 156, 255, .16);
  color: #b6c6ff;
  border: 1px solid rgba(124, 156, 255, .5)
}

/* views */
.view {
  flex: 1;
  min-width: 0
}

/* HERO */
.hero {
  position: relative;
  min-height: calc(100svh - var(--top) - 150px);
  padding: clamp(28px, 6vh, 64px) clamp(14px, 4vw, 48px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  isolation: isolate
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(120% 70% at 50% 100%, #3a1a1f 0%, #14122b 45%, #050b1b 80%)
}

.sky canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none
}

.moon-orb {
  position: absolute;
  right: clamp(6%, 12vw, 16%);
  top: 8%;
  width: clamp(54px, 8vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #f4f7ff, #aab4cc 45%, #59647f 78%);
  box-shadow: 0 0 60px 8px rgba(160, 200, 255, .35);
  animation: float 9s ease-in-out infinite
}

@keyframes float {
  50% {
    transform: translateY(-8px)
  }
}

.ridge {
  position: absolute;
  bottom: 0;
  z-index: -2;
  height: 62%;
  width: 46%;
  background: linear-gradient(#7a3a2c, #3a1a1e 70%, #1a0f1c);
  opacity: .85
}

.ridge-l {
  left: 0;
  clip-path: polygon(0 18%, 10% 12%, 18% 28%, 28% 22%, 40% 46%, 52% 52%, 70% 70%, 100% 100%, 0 100%)
}

.ridge-r {
  right: 0;
  clip-path: polygon(100% 8%, 88% 14%, 80% 30%, 68% 26%, 58% 48%, 44% 56%, 30% 74%, 0 100%, 100% 100%)
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  z-index: -1;
  background: linear-gradient(transparent, rgba(32, 12, 20, .9) 65%, #0b0a17)
}

.hero-copy {
  max-width: 860px;
  text-align: center
}

.eyebrow {
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px
}

.hero h1 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  outline: none
}

.hero h1 span {
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  letter-spacing: .18em;
  padding-left: .18em;
  text-shadow: 0 0 38px rgba(94, 234, 212, .55)
}

.hero h1 em {
  font-style: normal;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  color: #d6fff7;
  text-shadow: 0 0 22px rgba(94, 234, 212, .45)
}

.lede {
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  max-width: 640px;
  margin: 16px auto 22px;
  color: #d8e6fb
}

.cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap
}

.cta-note {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 14px
}

.cta-note b {
  color: var(--text)
}

.steles {
  list-style: none;
  margin: clamp(22px, 5vh, 48px) 0 0;
  padding: 0 0 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 200px));
  gap: clamp(10px, 2.4vw, 30px);
  justify-content: center;
  width: 100%;
  align-items: end
}

.steles li:nth-child(2n) {
  transform: translateY(-18px)
}

.stele {
  --accent: #5eead4;
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 22px 12px 18px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, #17284a), #0b1630 85%);
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #000);
  border-radius: 48% 48% 8px 8px/26% 26% 0 0;
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 30px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform .25s, box-shadow .25s;
  animation: rise .8s var(--d, 0s) both
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px)
  }
}

.stele:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 48px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 30px color-mix(in srgb, var(--accent) 25%, transparent)
}

.stele-ico svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent))
}

.stele strong {
  font: 700 1.3rem var(--display);
  color: #fff;
  text-shadow: 0 0 14px var(--accent)
}

.stele-type {
  font-size: .82rem;
  color: var(--muted)
}

.stele-years {
  font: 700 .85rem var(--display);
  color: var(--accent);
  letter-spacing: .04em
}

.stele-world {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted)
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px clamp(14px, 4vw, 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  transform: translateY(-14px);
  width: calc(100% - 28px)
}

.features div {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 12px;
  align-items: center
}

.features svg {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.8;
  stroke-linejoin: round
}

.features h2 {
  font-size: 1.15rem
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem
}

/* STORY */
.story {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 6fr;
  gap: clamp(16px, 4vw, 56px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) clamp(14px, 4vw, 40px) 120px;
  min-height: calc(100svh - var(--top))
}

.story-stage {
  position: relative;
  --accent: #5eead4;
  aspect-ratio: 1/1.08;
  border-radius: 50% 50% 14px 14px/30% 30% 0 0;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #000);
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--accent) 24%, #0d1b3a), #070f22 72%);
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 0 50px color-mix(in srgb, var(--accent) 16%, transparent);
  overflow: hidden;
  max-width: 520px;
  width: 100%;
  justify-self: center
}

.stage-preview {
  position: absolute;
  inset: 6% 6% 12%
}

.preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab
}

.stage-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
  margin: 0
}

.icon-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  gap: 8px;
  color: var(--muted);
  font-size: .9rem
}

.icon-fallback svg {
  width: 96px;
  height: 96px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round
}

.intro-art {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  place-content: center;
  height: 100%;
  padding: 10%
}

.intro-art span svg {
  width: 100%;
  max-width: 110px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--accent));
  margin: auto;
  display: block
}

.story-text h1,
.story-text h2 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  margin: 6px 0 8px;
  outline: none
}

.kicker {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0
}

.status {
  color: #ffd49a
}

.tagline {
  font-size: 1.2rem;
  color: #d6e6ff
}

.voice {
  margin: 14px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, .04);
  border-radius: 0 12px 12px 0;
  font-size: 1.15rem;
  font-style: italic
}

.voice .badge {
  display: block;
  width: max-content;
  font-style: normal
}

.cards2,
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0
}

.card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line)
}

.card p {
  margin: 0
}

.card h4 {
  font-size: 1.05rem;
  margin-bottom: 4px
}

.mini-tl,
.timeline {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.mini-tl li,
.timeline li {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem;
  color: var(--muted)
}

.mini-tl b,
.timeline b {
  color: #fff;
  font: 700 .95rem var(--display)
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0
}

.recap {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  margin: 16px 0
}

.recap-b {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, #000);
  background: rgba(9, 20, 43, .8);
  color: var(--text);
  font: inherit;
  cursor: pointer
}

.recap-b b {
  color: var(--accent);
  font: 700 1.15rem var(--display)
}

.recap-b span {
  color: var(--muted);
  font-size: .95rem
}

.recap-b:hover {
  background: color-mix(in srgb, var(--accent) 12%, #0a1530)
}

.mission-timeline {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 20, 43, .55)
}

.mission-timeline h2 {
  margin: 0 0 6px;
  font-size: 1.15rem
}

.mission-timeline>p {
  margin: 0 0 12px
}

.mission-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px
}

.mission-span {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(100px, 2fr) 92px;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: start;
  font: inherit;
  cursor: pointer
}

.mission-span:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04)
}

.mission-span-label {
  font-weight: 700
}

.mission-span-years {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .9rem;
  text-align: end
}

.mission-span-track {
  position: relative;
  display: block;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden
}

.mission-span-bar {
  position: absolute;
  left: var(--start);
  width: var(--span);
  top: 3px;
  bottom: 3px;
  min-width: 6px;
  border-radius: 999px;
  background: var(--accent)
}

.mission-timeline-axis {
  display: flex;
  justify-content: space-between;
  margin: 4px 102px 0 calc(10px + min(110px, 25%));
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums
}

.story-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px clamp(12px, 3vw, 40px) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #040a18 30%);
}

.story-bar .btn {
  background-clip: padding-box
}

#view-story[hidden]+* {}

.progress {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  max-width: 520px;
  width: 100%;
  justify-self: center
}

.progress-track {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 15px;
  height: 3px;
  background: rgba(255, 255, 255, .14);
  border-radius: 3px
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cyan);
  border-radius: 3px;
  transition: width .4s
}

.dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative
}

.dots button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  background: #08142b;
  cursor: pointer;
  position: relative
}

.dots button::after {
  content: "";
  position: absolute;
  inset: -7px
}

.dots button.done {
  background: var(--cyan);
  border-color: var(--cyan)
}

.dots button.on {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, .3), 0 0 16px var(--cyan);
  background: #0c2a35
}

.progress p {
  margin: 0;
  font-size: .85rem
}

/* EXPLORE */
.explore {
  position: relative;
  height: calc(100svh - var(--top));
  min-height: 460px;
  overflow: hidden;
  background: #030712
}

.gl-host {
  position: absolute;
  inset: 0
}

.gl-host canvas {
  display: block;
  cursor: grab
}

.gl-host canvas:active {
  cursor: grabbing
}

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  font: 700 .85rem var(--body);
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--accent, #5eead4);
  background: rgba(4, 10, 24, .72);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: opacity .25s;
  will-change: transform
}

.tag-artifact {
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent)
}

.tag-world {
  --accent: #a9bbd6;
  font-weight: 400;
  opacity: .9
}

.tag.dim {
  opacity: .28
}

.tag:hover {
  background: var(--accent);
  color: #03121f
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 12px clamp(10px, 2vw, 24px);
  pointer-events: none
}

.hud>* {
  pointer-events: auto
}

.hud-top {
  top: 0
}

.hud-bottom {
  bottom: 0;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(3, 7, 18, .82))
}

.hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0
}

.hints li {
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(4, 10, 24, .7);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px)
}

.filters,
.explorer-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0
}

.explorer-list .chip {
  --accent: #5eead4;
  border-color: color-mix(in srgb, var(--accent) 70%, #000)
}

.scale-note {
  font-size: .78rem;
  color: var(--muted);
  margin: 0
}

.world-chip {
  position: absolute;
  z-index: 6;
  right: clamp(10px, 2vw, 24px);
  top: 60px;
  width: min(340px, calc(100% - 20px));
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px)
}

.world-chip h2 {
  font-size: 1.4rem;
  margin-bottom: 6px
}

.world-chip .close {
  top: 8px;
  right: 8px
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
  background: radial-gradient(circle, #0a1530, #030712);
  padding: 20px
}

.fallback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 760px;
  width: 100%
}

.fallback-list .stele {
  min-height: 150px
}

/* dialogs */
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #08142b;
  color: var(--text);
  padding: 0;
  max-width: min(650px, 100vw);
  width: 100%;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  height: 100dvh;
  border-radius: 20px 0 0 20px;
  box-shadow: -20px 0 80px rgba(0, 0, 0, .6);
  overflow: auto;
  --accent: #5eead4
}

dialog::backdrop {
  background: rgba(2, 6, 16, .55);
  backdrop-filter: blur(2px)
}

#credits {
  margin: auto;
  height: auto;
  max-height: 90dvh;
  border-radius: 20px
}

.rec-wrap {
  position: relative;
  padding: 22px clamp(16px, 3vw, 30px) 40px
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(4, 10, 24, .8);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2
}

.close:hover {
  background: var(--cyan);
  color: #021
}

.rec-top {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
  margin: 8px 36px 12px 0
}

.rec-preview {
  aspect-ratio: 1;
  border-radius: 50% 50% 12px 12px/32% 32% 0 0;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #000);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 24%, #0d1b3a), #070f22 75%);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent);
  overflow: hidden
}

.rec-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  outline: none
}

.rec-head p {
  margin: 4px 0
}

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  background: rgba(255, 200, 120, .14);
  color: #ffd49a;
  border: 1px solid rgba(255, 200, 120, .4)
}

.pill.alt {
  background: rgba(94, 234, 212, .12);
  color: #7ff2e0;
  border-color: rgba(94, 234, 212, .4)
}

dialog h3 {
  font-size: 1.15rem;
  margin: 22px 0 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: var(--accent)
}

.prose p {
  margin: 0 0 .8em
}

.prose .lead {
  font-size: 1.15rem;
  font-style: italic
}

/* word-by-word speech reveal */
.rec-story-line {
  white-space: pre-line
}

.rec-story-line.speaking {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 10px
}

/* Words start hidden; the JS boundary handler flips them to visible one at a time */
.word-hidden {
  visibility: hidden
}

.word-visible {
  visibility: visible
}

/* Subtle pulse on the last revealed word while narration is active */
.rec-story-line.speaking .word-visible:last-of-type {
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent)
}

.note {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 200, 120, .08);
  border: 1px solid rgba(255, 200, 120, .35);
  font-size: .95rem
}

.facts {
  padding-left: 1.2em;
  display: grid;
  gap: 6px
}

.sources {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 4px
}

.sources a {
  display: inline-block;
  padding: 6px 0
}

.qa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0
}

.qa-form {
  display: flex;
  gap: 8px
}

.qa-form input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #050d20;
  color: var(--text);
  font: inherit
}

.qa-out {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  min-height: 3em
}

.noscript {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 200
}

.foot {
  padding: 20px clamp(14px, 4vw, 40px) 28px;
  border-top: 1px solid rgba(94, 234, 212, .15);
  background: #030712;
  font-size: .9rem;
  color: var(--muted);
  text-align: center
}

.quiz {
  margin-top: 16px
}

.quiz h3 {
  margin: 0 0 10px;
  border: 0;
  padding: 0
}

.quiz-question {
  padding: 8px 0
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.quiz-options .chip {
  white-space: normal;
  text-align: start
}

.quiz-result {
  min-height: 1.5em;
  color: var(--cyan);
  margin: 6px 0 0
}

.data-timeline {
  display: block;
  width: 100%;
  height: auto;
  color: var(--cyan);
  overflow: visible
}

.data-timeline text {
  fill: var(--text);
  font: 12px var(--body)
}

.data-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px
}

.data-stat {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035)
}

.data-stat b {
  font: 700 1.2rem var(--display);
  color: var(--accent)
}

.data-stat span {
  font-size: .9rem
}

.data-stat a {
  font-size: .8rem
}

body.rtl {
  --body: "Noto Naskh Arabic", "Cairo", "Segoe UI", Tahoma, sans-serif;
  direction: rtl
}

body.rtl .voice {
  border-left: 0;
  border-right: 4px solid var(--accent);
  border-radius: 12px 0 0 12px
}

body.rtl .close {
  right: auto;
  left: 12px
}

body.rtl .skip {
  left: auto;
  right: 8px
}

body.rtl .brand b {
  letter-spacing: 0
}

body.rtl .brand small {
  letter-spacing: 0
}

.foot p {
  max-width: 820px;
  margin: 0 auto .4em
}

body:has(#view-story:not([hidden])) .foot,
body:has(#view-explore:not([hidden])) .foot {
  display: none
}

body:has(#view-explore:not([hidden])) {
  height: 100svh;
  overflow: hidden
}

/* responsive */
@media (max-width:860px) {
  :root {
    --top: 60px
  }

  .brand small {
    display: none
  }

  .brand b {
    font-size: 1.2rem;
    letter-spacing: .14em
  }

  .brand svg {
    width: 32px;
    height: 32px
  }

  .topbar {
    gap: 6px
  }

  nav a,
  nav button {
    font-size: .9rem;
    padding: 8px 4px
  }

  .steles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 420px;
    gap: 14px
  }

  .steles li:nth-child(2n) {
    transform: none
  }

  .stele {
    min-height: 170px;
    padding-top: 14px
  }

  .features {
    grid-template-columns: 1fr;
    transform: none;
    margin-top: 10px
  }

  .ridge {
    width: 60%
  }

  .story {
    grid-template-columns: 1fr;
    padding-bottom: 150px;
    align-items: start
  }

  .story-stage {
    max-width: 300px;
    aspect-ratio: 1/0.9
  }

  .story-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "p p" "b n"
  }

  .progress {
    grid-area: p;
    max-width: none
  }

  #story-back {
    grid-area: b
  }

  #story-next {
    grid-area: n
  }

  .story-bar .btn {
    padding: 8px 12px;
    font-size: .95rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2
  }

  dialog {
    margin: auto 0 0;
    height: 92dvh;
    max-width: 100vw;
    border-radius: 20px 20px 0 0
  }

  .rec-top {
    grid-template-columns: 110px 1fr
  }

  .hints li:nth-child(n+3) {
    display: none
  }

  .world-chip {
    top: auto;
    bottom: 210px
  }

  .scale-note {
    display: none
  }

  .filters,
  .explorer-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    scrollbar-width: none;
    padding: 2px 2px 4px
  }

  .filters::-webkit-scrollbar,
  .explorer-list::-webkit-scrollbar {
    display: none
  }

  .filters .chip,
  .explorer-list .chip {
    flex: none;
    font-size: .9rem;
    padding: 6px 14px
  }

  .tag {
    font-size: .78rem;
    min-height: 32px;
    padding: 3px 9px
  }

  .hud-bottom {
    gap: 4px
  }

  .world-chip {
    bottom: 140px
  }
}

@media (max-width:420px) {
  .hero h1 span {
    letter-spacing: .1em
  }

  .cta .btn {
    width: 100%
  }
}

@media (max-width:520px) {
  .mission-span {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px
  }

  .mission-span-track {
    grid-column: 1/-1;
    grid-row: 2
  }

  .mission-span-years {
    grid-column: 2;
    grid-row: 1
  }

  .mission-timeline-axis {
    margin: 4px 0 0;
    grid-column: 1/-1
  }
}

@media (prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important
  }
}

@media (forced-colors:active) {

  .stele,
  .card,
  .chip {
    border: 2px solid CanvasText
  }
}

@media print {
  body {
    background: white !important;
    color: #111 !important;
    display: block
  }

  body>* {
    display: none !important
  }

  #view-story {
    display: block !important;
    background: white !important;
    color: #111 !important
  }

  #view-story .story-stage,
  #view-story .story-bar,
  .topbar,
  .foot {
    display: none !important
  }

  #view-story .story {
    display: block;
    padding: 0;
    min-height: 0
  }

  #story-text {
    color: #111 !important
  }

  #story-text .muted,
  #story-text span {
    color: #333 !important
  }

  #story-text .recap {
    display: block
  }

  #story-text .recap-b {
    color: #111 !important;
    background: white !important;
    border: 1px solid #777 !important;
    break-inside: avoid
  }

  #story-text .row {
    display: none !important
  }

  #story-text h2 {
    font-size: 24pt
  }

  #story-text::before {
    content: "ATHAR classroom summary — Garden Keeper";
    display: block;
    font-weight: bold;
    font-size: 20pt;
    margin-bottom: 12pt
  }
}
