@font-face { font-family: Inter; src: url(/assets/fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/assets/fonts/space-grotesk.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/assets/fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0b0d12; --panel: #12161f; --panel-2: #171c27; --line: #252c3b; --text: #e8ebf2; --text-2: #b7bfcf; --muted: #8590a6;
  --accent: #ff7a3d; --accent-2: #ffb08a; --good: #3ecf8e; --bad: #ff6b6b; --ok: #f5c451; --cyan: #5cc8ff;
  --radius: 14px; --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f7fb; --panel: #ffffff; --panel-2: #f0f2f7; --line: #dde1ea; --text: #141822; --text-2: #3a4252; --muted: #687387;
    --accent: #d9531a; --accent-2: #b4441a; --good: #148a59; --bad: #c73a3a; --ok: #9a6b00; --cyan: #0b74b5; color-scheme: light; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 Inter, system-ui, sans-serif; }
a { color: var(--cyan); }
h1, h2, h3, .ep-title { font-family: 'Space Grotesk', Inter, sans-serif; letter-spacing: -0.01em; line-height: 1.2; }
code, pre, textarea.code { font-family: var(--mono); }
code { font-size: 0.92em; background: var(--panel-2); padding: 0.05em 0.35em; border-radius: 5px; }
.muted { color: var(--muted); }
button, select { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.9rem; cursor: pointer; }
select { max-width: 100%; text-overflow: ellipsis; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.8rem 0; }

.top { max-width: 960px; margin: 0 auto; padding: 2rem 1.2rem 0.5rem; }
.top .home { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.top h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0.2rem 0 0; }
.top .tag { color: var(--text-2); margin: 0.2rem 0 0; max-width: 60ch; }
main { max-width: 960px; margin: 0 auto; padding: 0 1.2rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
main > *, .player > *, .scene { min-width: 0; }
.foot { max-width: 960px; margin: 0 auto; padding: 1rem 1.2rem 3rem; color: var(--muted); font-size: 0.88rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); margin: 0; max-width: min(90vw, 560px); background: var(--panel); border: 1px solid var(--accent); color: var(--text); border-radius: 999px; padding: 0.5rem 1.1rem; box-shadow: 0 8px 30px rgb(0 0 0 / 0.35); }
.toast:empty { display: none; }

.stats { display: grid; grid-template-columns: auto auto 1fr; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat { display: grid; }
.stat b { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat progress { width: 140px; accent-color: var(--accent); }
.skills { display: grid; gap: 0.25rem; justify-self: end; min-width: 220px; }
.skill { display: grid; grid-template-columns: 110px 1fr 40px; gap: 0.5rem; align-items: center; font-size: 0.85rem; }
.skill meter { width: 100%; }
.skill small { color: var(--muted); text-align: right; }
@media (max-width: 680px) { .stats { grid-template-columns: 1fr 1fr; } .skills { grid-column: 1 / -1; justify-self: stretch; } }

.review, .hero, .stage-card, .archive, .about { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.review.quiet { padding: 0.7rem 1.2rem; color: var(--muted); font-size: 0.92rem; }
.review.quiet p { margin: 0; }
.review h2, .archive h2, .about h2 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.card { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.choices { display: grid; gap: 0.4rem; }
.choice { text-align: left; }
.choice.right, .choice.best { border-color: var(--good); }
.choice.wrong, .choice.poor { border-color: var(--bad); }
.choice.ok { border-color: var(--ok); }
.choice.picked { box-shadow: 0 0 0 2px var(--cyan); }
.why { margin: 0.4rem 0 0; color: var(--text-2); }
.why.right strong { color: var(--good); }
.why.wrong strong { color: var(--bad); }

.hero .kicker { color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; margin: 0; }
.ep-title { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.3rem 0; }
.lede { color: var(--text-2); font-size: 1.08rem; margin: 0.2rem 0 0.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.chips li { font-size: 0.8rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem; color: var(--text-2); }

.stage-card header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.stage-card h2 { margin: 0; font-size: 1.35rem; flex: 1; }
.step { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; }
.stage-card.done .step { background: var(--good); border-color: var(--good); color: #04120b; }
.meta { color: var(--muted); font-size: 0.85rem; }
.stage-card.done .meta { color: var(--good); font-weight: 600; }

.player { display: grid; gap: 0.6rem; }
.stage { position: relative; aspect-ratio: 16 / 9; min-height: 15rem; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 120% at 0% 0%, #1d2433 0%, #0d1118 60%); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 2.4rem clamp(1rem, 4vw, 2.6rem) clamp(1rem, 3vw, 2rem); color: #eef1f7; }
@media (max-width: 680px) { .stage { aspect-ratio: auto; } }
.scene { width: 100%; animation: fade 0.5s ease both; }
.scene-n { position: absolute; top: 0.7rem; left: 1rem; margin: 0; font-size: 0.75rem; letter-spacing: 0.08em; color: #8f9ab0; text-transform: uppercase; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.v-title h3 { font-size: clamp(1.6rem, 4.5vw, 3rem); margin: 0; }
.v-title .kicker { color: #ffb08a; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; }
.v-statement .big { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.3rem, 3.4vw, 2.3rem); line-height: 1.25; margin: 0; }
.v-statement .sub { color: #aab4c8; font-size: clamp(0.95rem, 2vw, 1.2rem); }
.v-bullets, .v-compare ul { margin: 0; padding-left: 1.2rem; font-size: clamp(1rem, 2.4vw, 1.45rem); display: grid; gap: 0.4rem; }
.v-bullets li, .v-compare li, .v-flow li { animation: rise 0.5s ease both; animation-delay: calc(var(--i) * 0.45s + 0.2s); }
.v-code { margin: 0; font-size: clamp(0.72rem, 1.6vw, 1rem); line-height: 1.5; background: rgb(0 0 0 / 0.35); padding: 1rem; border-radius: 10px; overflow: auto; font-variant-ligatures: none; }
.v-code code { background: none; padding: 0; }
.v-code .line { display: block; min-height: 1.5em; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 2ch; text-indent: -2ch; }
.v-code .line.hot { background: rgb(255 122 61 / 0.22); }
.v-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 560px) { .v-compare { grid-template-columns: 1fr; gap: 0.8rem; } }
.v-compare h4 { margin: 0 0 0.5rem; color: #ffb08a; font-size: clamp(1rem, 2.2vw, 1.3rem); }
.v-flow { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; counter-reset: step; }
.v-flow li { border: 1px solid #39435a; border-radius: 10px; padding: 0.6rem 0.9rem; font-size: clamp(0.9rem, 2vw, 1.2rem); background: rgb(255 255 255 / 0.04); }
.v-flow li::before { counter-increment: step; content: counter(step) '. '; color: #ffb08a; }
.bar { display: flex; gap: 4px; }
.bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.bar span.done { background: var(--accent); }
.bar span.now { background: var(--accent-2); }
.caption { margin: 0; min-height: 3.2em; color: var(--text-2); font-size: 1.02rem; }
.controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.reading article { max-width: 70ch; }
.reading h3 { margin: 1.1rem 0 0.2rem; }
.sources { padding-left: 1.2rem; }
.quiz fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 0.8rem; padding: 0.8rem 1rem; }
.quiz legend { font-weight: 600; padding: 0 0.3rem; }
.opt { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.25rem 0; cursor: pointer; }
.opt input { margin-top: 0.35rem; accent-color: var(--accent); }
.score { color: var(--text-2); }
.scenario { background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 0.4rem 1rem; }
.judge-opt { margin: 0.5rem 0; }
.judge-opt .choice { width: 100%; }

textarea.code { width: 100%; min-height: 22rem; resize: vertical; tab-size: 4; font-size: 0.9rem; line-height: 1.5; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem; }
textarea.prose-input { width: 100%; resize: vertical; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; }
.results { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.results li { border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.7rem; }
.results li.pass strong { color: var(--good); }
.results li.fail { border-color: var(--bad); }
.results li.fail strong { color: var(--bad); }
.results pre { margin: 0.3rem 0 0; white-space: pre-wrap; font-size: 0.82rem; color: var(--text-2); }
.hints li { color: var(--text-2); }
.solution pre { background: var(--panel-2); padding: 0.8rem; border-radius: 8px; overflow: auto; font-size: 0.85rem; }
.prompt { font-weight: 600; }
.coach { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.6rem; }
.coach h3 { margin: 0.2rem 0; font-size: 1.05rem; }
.coach-out { white-space: pre-wrap; color: var(--text-2); }
.archive ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.archive li.current a { font-weight: 700; }
.archive time { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .scene, .v-bullets li, .v-compare li, .v-flow li { animation: none; } }
