:root {
  --bg: #04060f;
  --panel: rgba(14, 20, 42, 0.72);
  --panel-solid: #0e142a;
  --line: rgba(120, 160, 255, 0.18);
  --text: #e8edff;
  --muted: #9aa6c9;
  --accent: #ff9933;   /* saffron */
  --accent-2: #4fd1ff; /* orbit blue */
  --green: #3ddc84;
  --red: #ff5d6c;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, sans-serif; line-height: 1.6;
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
h1, h2, h3, .hud-brand, .btn, .eyebrow, small { font-family: Orbitron, sans-serif; letter-spacing: .04em; }
a { color: var(--accent-2); }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0 24px; }

/* HUD */
.hud {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 16px; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: rgba(4, 6, 15, .78); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.hud-brand { font-weight: 900; font-size: 14px; }
.hud-brand span { color: var(--muted); font-weight: 500; }
.hud-stats { display: flex; gap: 22px; align-items: center; }
.hud small { display: block; font-size: 10px; color: var(--muted); }
.hud strong { font-family: Orbitron; font-size: 14px; color: var(--accent); }
.hud-xp { width: 170px; }
.bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #fff, var(--green)); transition: width .6s ease; }

/* HERO */
.hero { display: grid; grid-template-columns: 1.25fr .9fr; gap: 48px; align-items: center; min-height: calc(100vh - 60px); padding-top: 40px; }
.eyebrow { color: var(--accent-2); font-size: 12px; text-transform: uppercase; margin: 0 0 8px; }
h1 { font-size: clamp(42px, 7vw, 84px); line-height: 1; margin: 0; font-weight: 900; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), #fff 55%, #138808); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-size: 18px; color: var(--muted); margin: 12px 0 18px; font-style: italic; }
.lede { font-size: 17px; max-width: 580px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 30px; }
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 12px 20px; border-radius: 99px;
  font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 22px rgba(79,209,255,.35); }
.btn.primary { background: linear-gradient(90deg, #ff9933, #ff6a00); border: 0; color: #120700; font-weight: 700; }
.btn.ghost { background: transparent; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-row div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat-row strong { display: block; font-family: Orbitron; color: var(--accent); font-size: 16px; }
.stat-row span { font-size: 12px; color: var(--muted); }
.hero-cover { position: relative; display: grid; place-items: center; }
.hero-cover img { width: min(340px, 80%); border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 60px rgba(79,209,255,.25); transform: rotate(-3deg); transition: transform .4s; }
.hero-cover img:hover { transform: rotate(0) scale(1.03); }
.cover-orbit { position: absolute; width: 115%; aspect-ratio: 1; border: 1px dashed rgba(79,209,255,.35); border-radius: 50%; animation: spin 18s linear infinite; }
.cover-orbit .sat { position: absolute; top: -14px; left: 50%; font-size: 26px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SECTIONS */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 28px; }
h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 8px; }
.section-head p { color: var(--muted); }
.phase-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 12px; }
.phase-legend span { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.phase-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.orbit-wrap { background: radial-gradient(ellipse at center, rgba(30,60,140,.25), transparent 70%); border-radius: var(--radius); }
#orbit { width: 100%; height: auto; display: block; }
#orbit .node { cursor: pointer; }
#orbit .node:focus { outline: none; }
#orbit .node:hover circle.core, #orbit .node:focus circle.core { r: 20; }
#orbit .node circle.core { transition: r .2s; }
#orbit text { font-family: Orbitron; fill: var(--text); pointer-events: none; }
#orbit .locked { cursor: default; opacity: .35; }
.pulse { animation: pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 50% { opacity: .2; transform: scale(1.5); } }

.chapter-list { display: none; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 24px; }
.ch-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text);
  cursor: pointer; display: flex; gap: 12px; align-items: center; font: inherit; transition: border-color .2s, transform .15s;
}
.ch-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.ch-card .num { font-family: Orbitron; font-size: 12px; color: var(--muted); }
.ch-card .ic { font-size: 26px; }
.ch-card .t { font-weight: 600; }
.ch-card .st { margin-left: auto; font-size: 18px; }

/* LESSONS */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lesson { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 56px; min-height: 120px; transition: all .4s; }
.lesson .star { position: absolute; left: 16px; top: 16px; font-size: 24px; filter: grayscale(1) brightness(.4); transition: filter .4s; }
.lesson small { color: var(--muted); font-size: 10px; }
.lesson p { margin: 6px 0 0; color: var(--muted); filter: blur(4px); user-select: none; transition: filter .4s; }
.lesson.lit { border-color: rgba(255,153,51,.5); box-shadow: 0 0 30px rgba(255,153,51,.12); }
.lesson.lit .star { filter: none; animation: twinkle 2.5s ease-in-out infinite; }
.lesson.lit p { filter: none; color: var(--text); user-select: auto; }
@keyframes twinkle { 50% { transform: scale(1.2); } }

/* DOCKING */
.dock-wrap { position: relative; max-width: 780px; margin: 0 auto; text-align: center; }
#dock { width: 100%; height: auto; background: #02030a; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.dock-hud { font-family: Orbitron; font-size: 12px; color: var(--accent-2); display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 10px 0; min-height: 20px; }
.dock-controls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 8px 0 16px; }
.dock-controls button { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 0; font-family: Orbitron; font-size: 12px; cursor: pointer; user-select: none; touch-action: none; }
.dock-controls button:active, .dock-controls button.on { background: var(--accent); color: #120700; }

/* MODAL */
.modal { position: fixed; inset: 0; background: rgba(2,3,10,.75); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(760px, 100%); max-height: 92vh; overflow: auto; background: linear-gradient(160deg, #111a38, #070a17); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 0 80px rgba(79,209,255,.15); }
.close { position: absolute; right: 14px; top: 14px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.m-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.m-icon { font-size: 44px; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: rgba(79,209,255,.1); border: 1px solid var(--line); flex-shrink: 0; }
.m-head h3 { margin: 0; font-size: 24px; }
.m-tag { margin: 4px 0 0; color: var(--muted); font-style: italic; }
.m-body p { margin: 0 0 12px; }
.m-lesson { border-left: 3px solid var(--accent); background: rgba(255,153,51,.07); padding: 12px 16px; border-radius: 0 10px 10px 0; margin-bottom: 16px; }
.m-lesson small, .m-quiz small { font-size: 10px; color: var(--accent); }
.m-lesson p { margin: 4px 0 0; font-size: 17px; }
.m-quiz { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.m-quiz p { margin: 6px 0 10px; font-weight: 600; }
.opts { display: grid; gap: 8px; }
.opts button { text-align: left; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; cursor: pointer; }
.opts button:hover:not(:disabled) { border-color: var(--accent-2); }
.opts button.right { border-color: var(--green); background: rgba(61,220,132,.12); }
.opts button.wrong { border-color: var(--red); background: rgba(255,93,108,.12); }
.feedback { min-height: 22px; margin: 10px 0 0 !important; font-weight: 500 !important; }
.m-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* COUNTDOWN + TOAST */
.countdown { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; background: radial-gradient(circle, #0b1330, #000); }
.countdown.on { display: grid; }
.countdown span { font-family: Orbitron; font-size: 160px; font-weight: 900; color: var(--accent); text-shadow: 0 0 40px var(--accent); }
.countdown .rocket { position: absolute; bottom: 10%; font-size: 64px; transform: rotate(-45deg); }
.countdown.lift .rocket { transition: bottom 1.2s ease-in; bottom: 120%; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 140%); background: var(--panel-solid); border: 1px solid var(--accent); color: var(--text); padding: 12px 20px; border-radius: 99px; z-index: 70; transition: transform .35s, opacity .35s; opacity: 0; pointer-events: none; font-family: Orbitron; font-size: 13px; text-align: center; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

footer { max-width: 900px; margin: 60px auto 0; padding: 30px 16px 50px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; text-decoration: underline; font: inherit; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 32px; }
  .hero-cover { order: -1; }
  .chapter-list { display: grid; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .hud-brand span, .hud-rank { display: none; }
  .hud-xp { width: 110px; }
  .hud { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* STORY SPOTLIGHT + LEADERSHIP LENS */
.m-spot { background: linear-gradient(120deg, rgba(79,209,255,.1), rgba(192,132,252,.08)); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 4px 0 14px; }
.m-spot small, .m-lens small { font-size: 10px; color: var(--accent-2); }
.m-spot h4 { margin: 4px 0 4px; font-family: Orbitron; font-size: 15px; }
.m-spot p { margin: 0; color: #d3dbf5; }
.m-lens { border: 1px solid rgba(255,153,51,.35); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: rgba(255,153,51,.04); }
.lens-tabs, .lens-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.lens-tabs button, .lens-picker button {
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px;
  font: 500 13px Inter, sans-serif; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: border-color .2s, background .2s;
}
.lens-tabs button:hover, .lens-picker button:hover { border-color: var(--accent); }
.lens-tabs button.seen { border-color: rgba(61,220,132,.45); }
.lens-tabs button.on, .lens-picker button.on { background: var(--accent); color: #120700; border-color: var(--accent); font-weight: 600; }
.lens-text { margin: 0; font-size: 16px; min-height: 48px; }
.lens-text b { color: var(--accent); }
.lens-picker { justify-content: center; }
.lens-picker button { padding: 10px 16px; font-size: 14px; }
.lens-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.playbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pb-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; animation: fade .3s; }
.pb-card header { display: flex; gap: 12px; align-items: center; }
.pb-card .ic { font-size: 28px; }
.pb-card small { font-size: 10px; color: var(--muted); }
.pb-card h4 { margin: 2px 0 0; font-family: Orbitron; font-size: 15px; }
.pb-card .pb-spot { color: var(--accent-2); font-size: 13px; margin: 10px 0 0; }
.pb-card p { margin: 8px 0 12px; }
.pb-card .link { margin-top: auto; align-self: flex-start; padding: 0; font-size: 13px; }
.disclaimer { font-size: 12px; opacity: .85; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 16px 0; }

/* CHAPTER SCENES (art.js) */
.m-art { margin: -28px -28px 18px; height: 190px; overflow: hidden; border-radius: 20px 20px 0 0; border-bottom: 1px solid var(--line); }
.pb-art { margin: -16px -18px 12px; height: 110px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.m-art svg, .pb-art svg { width: 100%; height: 100%; display: block; }
.m-art svg *, .pb-art svg * { transform-box: fill-box; transform-origin: center; }
.a-twinkle { animation: a-twinkle 2.6s ease-in-out infinite; }
.a-float { animation: a-float 4s ease-in-out infinite; }
.a-fly { animation: a-fly 6s linear infinite; }
.a-spin { animation: spin 5s linear infinite; }
.a-glow { animation: a-glow 3s ease-in-out infinite; }
.a-blink { animation: a-blink 1.4s steps(2, jump-none) infinite; }
.a-bob { animation: a-bob 3.2s ease-in-out infinite; }
.a-paddle { animation: a-paddle 1.6s ease-in-out infinite; }
.a-drift { animation: a-drift 4s linear infinite; }
.a-cloud { animation: a-cloud 14s linear infinite; }
.a-draw { stroke-dasharray: 260; animation: a-draw 2.6s linear infinite; }
.a-beat { animation: a-beat 1.3s ease-in-out infinite; }
.a-rise { animation: a-rise 3.6s ease-in infinite; }
.a-flame { animation: a-flame .25s ease-in-out infinite alternate; }
.a-puff { animation: a-puff 2s ease-out infinite; }
.a-dock { animation: a-dock 4.5s ease-out infinite; }
.a-ring { animation: a-ring 2.4s ease-out infinite; }
.a-grow { animation: a-grow 4s ease-out infinite; }
.a-wobble { animation: a-wobble 3s ease-in-out infinite; }
.a-earth { animation: spin 60s linear infinite; }
.a-sunrise { animation: a-sunrise 5s ease-in-out infinite; }
@keyframes a-twinkle { 50% { opacity: .25; } }
@keyframes a-float { 50% { transform: translateY(-9px); } }
@keyframes a-fly { from { transform: translateX(-60px); } to { transform: translateX(470px); } }
@keyframes a-glow { 50% { opacity: .5; transform: scale(1.12); } }
@keyframes a-blink { 50% { opacity: .35; } }
@keyframes a-bob { 50% { transform: translateY(4px) rotate(-1.5deg); } }
@keyframes a-paddle { 50% { transform: rotate(-38deg); } }
@keyframes a-drift { to { transform: translateX(40px); } }
@keyframes a-cloud { from { transform: translateX(-120px); } to { transform: translateX(460px); } }
@keyframes a-draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: -260; } }
@keyframes a-beat { 15%, 45% { transform: scale(1.25); } 30% { transform: scale(1); } }
@keyframes a-rise { 0%, 15% { transform: translateY(0); } 100% { transform: translateY(-200px); } }
@keyframes a-flame { to { transform: scaleY(1.5); } }
@keyframes a-puff { from { transform: scale(.4); opacity: .6; } to { transform: scale(2.2) translateY(-6px); opacity: 0; } }
@keyframes a-dock { 0% { transform: translateX(-150px); } 70%, 100% { transform: translateX(10px); } }
@keyframes a-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
@keyframes a-grow { 0% { transform: scaleY(0); opacity: 0; } 40%, 90% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes a-wobble { 33% { transform: scale(1.08, .93); } 66% { transform: scale(.94, 1.06); } }
@keyframes a-sunrise { 50% { opacity: .9; } }
@media (max-width: 860px) { .m-art { margin: -20px -20px 16px; height: 150px; } .modal-card { padding: 20px; } }
.close { z-index: 2; background: rgba(4,6,15,.6) !important; border-radius: 50%; width: 34px; height: 34px; }
