:root {
  color-scheme: dark;
  --ink: #f4f7fb;
  --paper: #07090f;
  --orange: #f4aa7a;
  --accent: #94b8ff;
  --button: #2f6df6;
  --muted: #a9b7cb;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
a { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #ffcf79; outline-offset: 5px; }
.topbar { max-width: 1320px; margin: auto; padding: 25px 40px; display: flex; gap: 32px; align-items: center; border-bottom: 1px solid #293548; }
.brand { font-size: 17px; font-weight: 850; letter-spacing: 1.5px; text-decoration: none; }
.brand-dot { color: var(--orange); font-size: 27px; }
.back-link { font-size: 13px; text-decoration: none; }
.edition { margin-left: auto; color: var(--muted); font-size: 10px; letter-spacing: 1.8px; }
.shell { max-width: 1220px; margin: auto; padding: 38px 40px 0; }
.lesson-heading { text-align: center; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 750; margin: 0 0 12px; }
.eyebrow span { color: #75869d; margin: 0 10px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(35px, 4.5vw, 58px); font-weight: 500; letter-spacing: -2px; margin: 0; line-height: 1.1; }
h1 > span { color: var(--orange); }
.lesson-heading > p:last-child { color: var(--muted); font-size: 14px; margin: 15px 0 27px; }
.chapters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.chapters button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid #293548; padding: 13px 3px; font-size: 12px; text-align: left; transition: color .2s; }
.chapters span { font-size: 10px; margin-right: 9px; opacity: .7; }
.chapters button[aria-current] { color: var(--accent); font-weight: 750; border-color: var(--accent); }
.story-card { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 460px; border: 1px solid #2c3b51; border-radius: 18px; overflow: hidden; background: #111a2b; box-shadow: 0 12px 32px #00000038; }
.scene-panel { background: #152337; position: relative; display: flex; flex-direction: column; min-width: 0; transition: background .4s; overflow: hidden; }
.scene-top, .scene-bottom { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 9px; letter-spacing: 1.4px; font-weight: 700; position: relative; z-index: 1; }
.scene-top { min-height: 64px; }
.scene-bottom { letter-spacing: .4px; font-size: 10px; font-weight: 500; margin-top: auto; color: #a9b7cb; }
.traveler-key { display: flex; align-items: center; gap: 7px; background: #0c1626e6; padding: 7px 9px; border-radius: 20px; letter-spacing: 0; white-space: nowrap; color: var(--ink); }
.traveler-key i { width: 10px; height: 10px; border: 2px solid #856107; background: #ffdb61; border-radius: 50%; }
.art { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; }
.art svg { display: block; width: 100%; max-height: 360px; overflow: visible; }
.art.enter svg { animation: arrive .55s cubic-bezier(.2,.7,.3,1) both; }
.art.zoom svg { animation: zoom-in .6s cubic-bezier(.2,.7,.3,1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.78); } to { opacity: 1; transform: scale(1); } }
.art text { font-family: "Segoe UI", sans-serif; }
.float { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-7px); } }
.carbon-halo { animation: glow 2.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glow { 50% { opacity: .35; transform: scale(1.2); } }
.story-panel { padding: 38px 36px 25px; display: flex; flex-direction: column; min-width: 0; }
.date { color: #f4aa7a; font-size: 10px; letter-spacing: 1.3px; font-weight: 800; text-transform: uppercase; margin: 0 0 15px; }
h2 { font-family: Georgia, serif; font-size: clamp(29px, 3vw, 39px); line-height: 1.12; letter-spacing: -1px; font-weight: 500; margin: 0 0 17px; }
.narrative { font-size: 15px; line-height: 1.7; margin: 0 0 18px; color: #c6cfdd; }
.insight { font-size: 13px; font-weight: 650; line-height: 1.55; padding-left: 14px; border-left: 3px solid #dfac59; margin: 0 0 22px; }
.navigation { display: flex; gap: 10px; margin-top: auto; padding-top: 20px; }
.primary, .small-button { border: 0; min-height: 48px; border-radius: 8px; font-size: 13px; font-weight: 650; }
.primary { background: var(--button); color: white; display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 14px 20px; flex: 1; }
.primary:hover { background: #225bda; }
.small-button { width: 48px; background: #243249; color: var(--ink); font-size: 19px; }
.navigation-note { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 12px 0 0; }
.journey-bar { display: flex; gap: 16px; align-items: center; padding: 22px 0; }
.journey-bar label { font-size: 9px; letter-spacing: 1px; font-weight: 700; }
select { border: 1px solid #3d506c; background: #111a2b; border-radius: 6px; padding: 8px; color: var(--ink); width: 190px; font-size: 12px; }
progress { flex: 1; min-width: 30px; height: 5px; border: 0; border-radius: 9px; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #26354b; }
progress::-webkit-progress-value { background: var(--accent); }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 11px; padding: 9px 0; white-space: nowrap; }
.fiction-note { text-align: center; color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0 0 27px; }
.fiction-note span { color: #ecc47c; margin-right: 5px; }
.science-notes { border-top: 1px solid #293548; border-bottom: 1px solid #293548; }
summary { cursor: pointer; font-size: 12px; font-weight: 650; padding: 19px 0; }
summary > span { float: right; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; padding: 0 0 25px; }
.notes-grid h3 { font-size: 14px; }
.notes-grid p, .notes-grid a { font-size: 12px; line-height: 1.7; }
.notes-grid a { color: #94b8ff; }
footer { padding: 24px 0; font-size: 10px; letter-spacing: 1px; font-weight: 700; }
footer span { float: right; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.particle-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.particle-controls button, .answer { border: 1px solid #536681; border-radius: 6px; padding: 9px 10px; background: #111a2b; font-size: 11px; color: var(--ink); min-height: 38px; }
.particle-controls button[aria-pressed="true"] { background: var(--button); color: white; border-color: var(--accent); }
.particle-description, .feedback { font-size: 12px; line-height: 1.55; margin: 12px 0 0; }
.answer { display: block; width: 100%; text-align: left; margin: 6px 0; font-size: 12px; }
.answer[aria-pressed="true"] { border: 2px solid var(--accent); background: #152337; }
.question { font-weight: 650; font-size: 13px; line-height: 1.5; }
.space .scene-panel { background: #0b1428; color: #f4f7fb; }
.space .scene-bottom { color: #b3bfd4; }
.noscript { border: 2px solid var(--orange); padding: 20px; }
@media (max-width: 850px) {
  .shell { padding: 28px 22px 0; }
  .topbar { padding: 18px 22px; }
  .edition { display: none; }
  .back-link { margin-left: auto; }
  .story-panel { padding: 28px 25px 22px; }
}
@media (max-width: 650px) {
  .shell { padding: 25px 16px 0; }
  .topbar { padding: 14px 16px; }
  .brand { font-size: 14px; }
  .lesson-heading > p:last-child { font-size: 12px; line-height: 1.6; margin-bottom: 17px; }
  h1 { letter-spacing: -1.3px; }
  .chapters { gap: 8px; }
  .chapters button { font-size: 10px; line-height: 1.5; }
  .chapters span { display: block; }
  .story-card { grid-template-columns: 1fr; }
  .scene-top, .scene-bottom { padding: 13px 17px; }
  .scene-top { min-height: 45px; }
  .art svg { max-height: 240px; }
  .story-panel { padding: 23px; }
  h2 { font-size: 31px; }
  .narrative { font-size: 14px; }
  .journey-bar { gap: 10px; flex-wrap: wrap; padding: 17px 0; }
  .journey-bar label { display: none; }
  select { width: 155px; }
  .notes-grid { grid-template-columns: 1fr; gap: 6px; }
  .navigation-note { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
