@import url("../../shared/editor/editor.css");

:root {
  color-scheme: dark;
  --bg: #07101a;
  --bg-2: #0b1622;
  --surface: rgba(13, 26, 40, .78);
  --surface-solid: #101d2a;
  --surface-2: #152536;
  --text: #edf7ff;
  --muted: #8da3b6;
  --line: rgba(154, 197, 224, .16);
  --line-strong: rgba(104, 203, 255, .35);
  --cyan: #46c7ff;
  --blue: #4e8bff;
  --green: #3be0ad;
  --violet: #a881ff;
  --warning: #ffcb6b;
  --danger: #ff758f;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
  --radius: 20px;
  --editor-font-size: 15px;
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
::selection { color: #041019; background: #70ddff; }
.skip-link { position: fixed; z-index: 1000; left: 1rem; top: -5rem; padding: .75rem 1rem; background: var(--text); color: var(--bg); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.topbar {
  position: absolute; z-index: 20; inset: 0 0 auto; height: 86px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(22px, 4.6vw, 74px); border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(89,209,255,.36); border-radius: 13px;
  background: linear-gradient(145deg, rgba(49,160,221,.2), rgba(38,235,181,.06)); color: #cbedff; font-weight: 750; letter-spacing: -.08em;
}
.brand-mark span { color: #4fe1b1; font-size: .6em; vertical-align: top; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: #7f9eb5; font-size: 9px; letter-spacing: .18em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.pill-link, .icon-button {
  height: 38px; border: 1px solid rgba(162,213,242,.22); background: rgba(7,16,26,.42); backdrop-filter: blur(14px); color: #d8edfb;
}
.pill-link { display: inline-flex; align-items: center; padding: 0 17px; border-radius: 999px; font-size: 12px; letter-spacing: .03em; }
.pill-link:hover { border-color: var(--cyan); }
.icon-button { width: 38px; border-radius: 50%; cursor: pointer; }

.hero {
  position: relative; min-height: 770px; height: 92vh; overflow: hidden; display: grid; align-items: center;
  background: radial-gradient(circle at 74% 47%, #112142 0, #08121d 47%, #050a11 100%);
}
#fluid-canvas, .fluid-fallback, .hero-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
#fluid-canvas { z-index: 2; opacity: .85; touch-action: none; }
.fluid-fallback { z-index: 1; background: radial-gradient(ellipse at 69% 52%, rgba(35,225,159,.23), transparent 18%), radial-gradient(ellipse at 60% 45%, rgba(70,113,255,.28), transparent 31%), radial-gradient(ellipse at 82% 19%, rgba(125,58,255,.2), transparent 37%); filter: blur(12px); }
.fluid-fallback-only #fluid-canvas { display: none; }
.hero-grid { z-index: 3; pointer-events: none; opacity: .28; background-image: linear-gradient(rgba(110,173,209,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(110,173,209,.07) 1px, transparent 1px); background-size: 88px 88px; mask-image: linear-gradient(to right, black, transparent 78%); }
.hero::after { content: ""; position: absolute; z-index: 4; inset: auto 0 0; height: 190px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-copy { position: relative; z-index: 6; width: min(690px, 74vw); margin-left: clamp(24px, 8.6vw, 150px); pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.eyebrow, .section-kicker { margin: 0 0 18px; color: #52d4ff; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(58px, 7.2vw, 112px); line-height: .9; letter-spacing: -.075em; font-weight: 650; }
.hero h1 em { color: transparent; -webkit-text-stroke: 1px rgba(205,236,255,.82); font-style: normal; text-shadow: 0 0 35px rgba(46,185,255,.16); }
.hero-lead { width: min(590px, 100%); margin: 32px 0; color: #a9bfce; font-size: clamp(15px, 1.35vw, 19px); line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 25px; }
.primary-button {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 23px; border: 1px solid rgba(87,213,255,.52); border-radius: 12px;
  background: linear-gradient(110deg, rgba(26,130,200,.84), rgba(24,166,142,.8)); color: white; box-shadow: 0 12px 45px rgba(0,137,203,.28); font-size: 13px; font-weight: 700;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 50px rgba(0,163,207,.35); }
.text-button { color: #a8bdcd; font-size: 13px; }
.hero-status {
  position: absolute; z-index: 6; right: clamp(24px, 5vw, 76px); bottom: 112px; width: 245px; padding: 18px 19px; border: 1px solid rgba(133,202,234,.18); border-radius: 14px; background: rgba(7,15,25,.38); backdrop-filter: blur(18px); pointer-events: none;
}
.status-dot { float: left; width: 7px; height: 7px; margin: 8px 11px 0 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 13px var(--green); }
.hero-status p { margin: 0; display: grid; font-size: 12px; }
.hero-status p span { margin-top: 4px; color: #819bae; font-size: 10px; }
.status-meter { height: 2px; margin: 16px 0 11px; background: rgba(255,255,255,.1); }
.status-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.hero-status small { color: #748b9c; font-size: 10px; }

.intro-strip { width: min(1180px, 88vw); margin: -35px auto 100px; position: relative; z-index: 8; }
.intro-strip > .section-kicker { text-align: center; }
.path-steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); backdrop-filter: blur(15px); overflow: hidden; box-shadow: var(--shadow); }
.path-steps article { display: flex; align-items: center; gap: 17px; min-height: 98px; padding: 20px 28px; border-right: 1px solid var(--line); }
.path-steps article:last-child { border: 0; }
.path-steps b { color: transparent; -webkit-text-stroke: 1px var(--line-strong); font-size: 31px; font-weight: 500; }
.path-steps span { display: grid; gap: 5px; }
.path-steps strong { font-size: 14px; }
.path-steps small { color: var(--muted); font-size: 11px; }

.course-section { width: min(1240px, 90vw); margin: 0 auto 130px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.section-heading h2 { margin: 0; max-width: 650px; font-size: clamp(31px, 4vw, 58px); letter-spacing: -.055em; }
.section-heading > p { max-width: 390px; margin: 0 0 5px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.track { margin-top: 54px; }
.track-heading { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.track-letter { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--cyan); font: 600 26px/1 ui-monospace, monospace; }
.track-violet .track-letter { color: var(--violet); }
.track-heading h3 { margin: 0 0 5px; font-size: 14px; letter-spacing: .13em; }
.track-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.track-heading b { color: var(--muted); font: 500 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.course-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; padding-top: 13px; }
.course-card {
  position: relative; min-height: 245px; padding: 20px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-solid), transparent 16%), color-mix(in srgb, var(--bg), transparent 4%)); transition: .25s ease;
}
.course-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -90px; top: -95px; border-radius: 50%; background: var(--cyan); filter: blur(70px); opacity: 0; transition: opacity .3s; }
.track-violet .course-card::after { background: var(--violet); }
.course-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.course-card:hover::after, .course-card.is-open::after { opacity: .16; }
.course-index { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 500 10px/1 ui-monospace, monospace; }
.course-index span { color: var(--cyan); font-size: 12px; }
.track-violet .course-index span { color: var(--violet); }
.course-index i { height: 1px; flex: 1; background: var(--line); }
.course-title { margin-top: 31px; }
.course-status { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.status-available { color: var(--green); border-color: color-mix(in srgb, var(--green), transparent 65%); background: color-mix(in srgb, var(--green), transparent 92%); }
.status-prelude { color: var(--warning); }
.course-title h4 { margin: 13px 0 8px; font-size: 18px; line-height: 1.35; }
.course-title p { margin: 0; color: var(--muted); font: 500 10px/1 ui-monospace, monospace; }
.course-card-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.course-card-actions a { color: var(--muted); }
.course-card-actions a:first-child { color: var(--cyan); }
.course-card-actions a:hover { color: var(--text); }

.site-footer { min-height: 100px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.translation-bubble { position: fixed; z-index: 1100; max-width: 320px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }

/* Beginner guide */
.guide-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, rgba(72, 207, 255, .16), transparent 27%),
    radial-gradient(circle at 14% 38%, rgba(137, 86, 255, .13), transparent 30%),
    linear-gradient(180deg, #07101a 0%, #091521 48%, #05090f 100%);
}
.guide-page .topbar { position: fixed; background: rgba(7, 16, 26, .72); backdrop-filter: blur(18px); }
.guide-main { width: min(1120px, calc(100vw - 42px)); margin: 0 auto; padding: 145px 0 120px; }
.guide-hero { min-height: 470px; display: grid; align-content: center; position: relative; }
.guide-hero::before {
  content: ""; position: absolute; inset: 9% -8% 2% auto; width: min(480px, 42vw);
  border: 1px solid rgba(84, 211, 255, .16); border-radius: 32px;
  background: linear-gradient(135deg, rgba(70, 199, 255, .12), rgba(168, 129, 255, .08));
  box-shadow: 0 32px 120px rgba(0, 0, 0, .28); transform: rotate(3deg); pointer-events: none;
}
.guide-hero h1 { max-width: 780px; margin: 0; font-size: clamp(44px, 6.2vw, 86px); line-height: .95; letter-spacing: -.065em; }
.guide-hero p { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.85; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 34px; }
.guide-panel, .guide-grid article {
  border: 1px solid var(--line); border-radius: 24px; background: rgba(12, 25, 39, .74);
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.guide-panel { padding: clamp(24px, 4vw, 46px); margin-top: 32px; }
.guide-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.guide-panel-heading h2, .guide-warning h2 { margin: 0; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; }
.guide-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.guide-steps li {
  min-height: 230px; padding: 22px; border: 1px solid rgba(154, 197, 224, .14); border-radius: 18px;
  background: linear-gradient(145deg, rgba(7, 16, 26, .58), rgba(13, 31, 47, .5));
}
.guide-steps b { display: block; margin-bottom: 30px; color: transparent; -webkit-text-stroke: 1px rgba(83, 214, 255, .7); font: 650 42px/1 ui-monospace, monospace; }
.guide-steps h3, .guide-grid h2 { margin: 0 0 12px; font-size: 19px; }
.guide-steps p, .guide-grid p, .guide-warning p { margin: 0; color: var(--muted); line-height: 1.78; font-size: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.guide-grid article { min-height: 255px; padding: 26px; }
.guide-grid span { display: inline-flex; margin-bottom: 34px; color: var(--green); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .18em; }
.guide-warning { border-color: rgba(59, 224, 173, .35); background: linear-gradient(135deg, rgba(13, 33, 42, .85), rgba(28, 21, 51, .72)); }

@media (max-width: 880px) {
  .guide-main { width: min(100% - 28px, 720px); padding-top: 118px; }
  .guide-page .topbar { height: auto; min-height: 70px; flex-wrap: wrap; gap: 10px; padding-block: 12px; }
  .guide-steps, .guide-grid { grid-template-columns: 1fr; }
  .guide-hero { min-height: 420px; }
  .guide-hero::before { opacity: .45; width: 62vw; }
}

/* Help */
.help-shell[hidden] { display: none; }
.help-shell { position: fixed; z-index: 900; inset: 0; }
.help-backdrop { position: absolute; inset: 0; background: rgba(1,7,12,.64); backdrop-filter: blur(5px); }
.help-panel { position: absolute; top: 0; right: 0; width: min(480px, 100vw); height: 100%; padding: 27px; overflow: auto; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid), transparent 3%); box-shadow: -30px 0 90px rgba(0,0,0,.35); }
.help-panel > header { display: flex; align-items: center; justify-content: space-between; }
.help-panel header small { color: var(--cyan); letter-spacing: .18em; }
.help-panel h2 { margin: 5px 0 0; font-size: 33px; }
.help-panel header button { border: 0; background: transparent; font-size: 31px; cursor: pointer; }
.help-search { height: 48px; margin: 25px 0 12px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.help-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.hover-option { display: flex; align-items: center; gap: 8px; padding: 10px 3px 20px; color: var(--muted); font-size: 12px; }
.help-results article { border-top: 1px solid var(--line); }
.help-results article > button { width: 100%; padding: 18px 2px; display: flex; justify-content: space-between; border: 0; background: transparent; text-align: left; cursor: pointer; }
.help-results article > div { display: none; padding: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.help-results article.open > div { display: block; }
.help-results pre { overflow: auto; padding: 13px; border-radius: 8px; background: var(--bg); color: var(--green); }

/* Terminal */
.terminal-backdrop { position: fixed; z-index: 850; inset: 0; display: grid; place-items: center; background: rgba(0,5,10,.58); backdrop-filter: blur(4px); }
.terminal-window { width: min(720px, 88vw); height: min(460px, 68vh); min-width: 330px; min-height: 220px; resize: both; overflow: hidden; border: 1px solid rgba(119,187,225,.34); border-radius: 12px; background: #071019; box-shadow: 0 35px 120px rgba(0,0,0,.55); }
.terminal-titlebar { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid #1a3447; background: #0d1b27; color: #b8d0df; font: 600 11px/1 ui-monospace, monospace; cursor: move; }
.terminal-titlebar i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #3de5ad; box-shadow: 0 0 10px #3de5ad; }
.terminal-titlebar button { border: 0; background: transparent; color: #8ba3b3; font-size: 22px; cursor: pointer; }
.terminal-meta { height: 32px; padding: 9px 17px; border-bottom: 1px solid #142737; color: #608aa5; font: 11px/1 ui-monospace, monospace; }
.terminal-screen { height: calc(100% - 74px); margin: 0; padding: 20px; overflow: auto; outline: 0; white-space: pre-wrap; color: #d8f6e9; font: 13px/1.65 "Cascadia Code", Consolas, monospace; }
.terminal-error { color: #ff8295; }
.terminal-input { color: #75a0ba; }
.terminal-dim { color: #627d90; }
.term-cursor { display: inline-block; width: 8px; height: 1.08em; margin-left: 1px; vertical-align: -.16em; background: #d4d4d4; animation: terminalBlink 1s step-end infinite; }
@keyframes terminalBlink { 50% { opacity: 0; } }

/* Lesson */
.lesson-page { background: var(--bg); }
.lesson-page .topbar { position: fixed; height: 70px; background: color-mix(in srgb, var(--bg), transparent 13%); backdrop-filter: blur(18px); border-color: var(--line); }
.lesson-page .brand-mark { width: 39px; height: 39px; }
.lesson-progress { position: fixed; z-index: 30; top: 69px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg,var(--cyan),var(--green)); }
.lesson-hero { min-height: 620px; padding: 150px max(7vw,24px) 80px; display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,520px); gap: 7vw; align-items: center; background: radial-gradient(circle at 80% 30%, rgba(41,151,211,.16), transparent 28%), linear-gradient(180deg,var(--bg-2),var(--bg)); }
.lesson-hero-copy { max-width: 760px; }
.lesson-label { display: flex; align-items: center; gap: 12px; color: var(--cyan); font: 600 11px/1 ui-monospace,monospace; letter-spacing: .15em; }
.lesson-label i { width: 35px; height: 1px; background: var(--cyan); }
.lesson-hero h1 { margin: 23px 0; font-size: clamp(46px,6.2vw,92px); line-height: .96; letter-spacing: -.065em; }
.lesson-hero h1 span { color: var(--muted); font-weight: 350; }
.lesson-hero p { max-width: 650px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.lesson-stats { display: flex; gap: 27px; margin-top: 31px; }
.lesson-stats span { display: grid; gap: 5px; }
.lesson-stats b { font: 500 25px/1 ui-monospace,monospace; }
.lesson-stats small { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.lesson-preview { position: relative; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transform: rotate(1.5deg); }
.lesson-preview img { display: block; width: 100%; border-radius: 8px; }
.lesson-preview span { position: absolute; left: -23px; bottom: 35px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-solid); color: var(--muted); font: 10px/1 ui-monospace,monospace; transform: rotate(-1.5deg); }
.lesson-layout { width: min(960px, calc(100vw - 48px)); margin: 0 auto; padding: 100px 0 160px; }
.lesson-module { position: relative; scroll-margin-top: 90px; margin-bottom: 150px; }
.module-number { position: absolute; right: calc(100% + 36px); top: 3px; color: var(--line-strong); font: 500 13px/1 ui-monospace,monospace; }
.module-meta { display: flex; align-items: center; gap: 12px; color: var(--cyan); font: 600 10px/1 ui-monospace,monospace; letter-spacing: .12em; }
.module-meta i { flex: 1; height: 1px; background: var(--line); }
.lesson-module h2 { margin: 21px 0 24px; font-size: clamp(31px,4.4vw,51px); letter-spacing: -.045em; }
.module-lead { margin: 0 0 30px; color: var(--muted); font-size: 17px; line-height: 1.85; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin: 28px 0; }
.concept-card, .callout { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.concept-card h3 { margin: 0 0 10px; font-size: 15px; }
.concept-card p, .concept-card li, .callout { color: var(--muted); font-size: 13px; line-height: 1.75; }
.concept-card ul { margin: 0; padding-left: 18px; }
.callout { border-left: 3px solid var(--green); }
.lesson-code { position: relative; margin: 25px 0; overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #071019; color: #dbeaf5; font: 13px/1.7 "Cascadia Code",Consolas,monospace; }
.lesson-code::before { content: "C11"; position: absolute; right: 12px; top: 10px; color: #426378; font-size: 9px; }
.module-actions { display: flex; gap: 9px; margin-top: 23px; }
.outline-button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--cyan); cursor: pointer; }

.lesson-toc-zone { position: fixed; z-index: 40; top: 70px; bottom: 0; left: 0; width: 64px; }
.lesson-toc {
  position: absolute; top: 50%; left: 14px; width: 245px; padding: 15px 15px 15px 8px; transform: translate(-215px,-50%);
  border-radius: 0 14px 14px 0; background: color-mix(in srgb,var(--bg),transparent 18%); backdrop-filter: blur(16px); transition: transform .28s ease;
}
.lesson-toc-zone:hover .lesson-toc, .lesson-toc-zone:focus-within .lesson-toc { transform: translate(-14px,-50%); }
.lesson-toc a { display: block; padding: 7px 10px; color: var(--muted); font-size: 11px; white-space: nowrap; border-left: 1px solid var(--line); }
.lesson-toc a.active { color: var(--cyan); border-left-color: var(--cyan); }
.toc-tab { position: absolute; left: 225px; top: 50%; writing-mode: vertical-rl; color: var(--muted); font: 9px/1 ui-monospace,monospace; letter-spacing: .16em; }
.mobile-toc-button { display: none; }

/* Interactions */
.interaction-shell { margin: 34px 0; padding: 25px; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface),transparent 35%)); box-shadow: inset 0 1px rgba(255,255,255,.03); }
.interaction-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.interaction-header h3 { margin: 0 0 5px; font-size: 16px; }
.interaction-header p { margin: 0; color: var(--muted); font-size: 12px; }
.interaction-header small { color: var(--green); font: 10px/1 ui-monospace,monospace; }
.interactive-stage { min-height: 230px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: color-mix(in srgb,var(--bg),transparent 15%); }
.interaction-controls { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.interaction-controls button, .interaction-controls input { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.interaction-controls button { padding: 0 12px; cursor: pointer; }
.interaction-controls button.active { color: var(--cyan); border-color: var(--cyan); }
.diagram-row { width: 90%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.diagram-node { min-width: 110px; padding: 14px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); }
.diagram-node.active { border-color: var(--green); box-shadow: 0 0 30px color-mix(in srgb,var(--green),transparent 75%); }
.diagram-arrow { color: var(--muted); }
.memory-cells { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.memory-cell { min-width: 46px; padding: 11px 7px; display: grid; gap: 6px; text-align: center; border: 1px solid var(--line); background: var(--surface-solid); font: 13px/1 ui-monospace,monospace; }
.memory-cell small { color: var(--muted); font-size: 9px; }
.memory-cell.null { color: var(--danger); border-color: color-mix(in srgb,var(--danger),transparent 50%); }
.bucket-grid { width: 90%; display: grid; grid-template-columns: repeat(10,1fr); gap: 6px; align-items: end; }
.bucket { display: grid; align-content: end; min-height: 150px; text-align: center; color: var(--muted); font: 10px/1 ui-monospace,monospace; }
.bucket i { display: block; min-height: 3px; margin-bottom: 8px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--cyan),var(--blue)); transition: height .3s; }
.stream-line { width: 90%; display: flex; flex-wrap: wrap; gap: 7px; }
.stream-char { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 11px/1 ui-monospace,monospace; }
.stream-char.active { color: var(--bg); background: var(--green); border-color: var(--green); }

/* Exercises */
.exercise-section { margin-top: 50px; }
.exercise-section > h3 { margin: 0 0 14px; color: var(--muted); font: 600 11px/1 ui-monospace,monospace; letter-spacing: .15em; }
.exercise-card { margin: 10px 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.exercise-card > summary { min-height: 72px; padding: 18px 20px; display: flex; align-items: center; gap: 15px; list-style: none; cursor: pointer; }
.exercise-card > summary::-webkit-details-marker { display: none; }
.exercise-card > summary b { color: var(--cyan); font: 500 12px/1 ui-monospace,monospace; }
.exercise-card > summary span { flex: 1; font-weight: 650; }
.exercise-card > summary i { color: var(--muted); font-style: normal; }
.exercise-card[open] > summary { border-bottom: 1px solid var(--line); }
.exercise-body { padding: 23px; }
.exercise-task { color: var(--muted); line-height: 1.75; font-size: 14px; }
.exercise-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.exercise-formats section, .sample-box { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.exercise-formats h4, .sample-box h4 { margin: 0 0 8px; color: var(--text); font-size: 11px; }
.exercise-formats p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 13px 0 20px; }
.sample-box pre { min-height: 42px; margin: 0; overflow: auto; color: var(--green); font: 12px/1.55 ui-monospace,monospace; }
.exercise-editor { min-height: 420px; }
.exercise-actions { display: flex; gap: 9px; margin-top: 12px; }
.exercise-actions button { min-height: 41px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.exercise-actions button:first-child { color: var(--cyan); border-color: var(--line-strong); }
.exercise-actions .submit-button { margin-left: auto; color: #04150f; border-color: var(--green); background: var(--green); font-weight: 750; }
.judge-results { margin-top: 13px; display: grid; gap: 7px; }
.judge-case { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.judge-case.pass b { color: var(--green); }
.judge-case.fail b { color: var(--danger); }
.judge-case pre { grid-column: 2/-1; margin: 6px 0 0; white-space: pre-wrap; color: var(--danger); }
.submission-banner { padding: 12px 14px; border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: 12px; }
.submission-banner.pass { color: var(--green); border: 1px solid color-mix(in srgb,var(--green),transparent 60%); }
.submission-banner.fail { color: var(--danger); border: 1px solid color-mix(in srgb,var(--danger),transparent 60%); }

/* Slide viewer */
.slide-shell[hidden] { display: none; }
.slide-shell { position: fixed; z-index: 880; inset: 0; display: grid; place-items: center; background: rgba(1,6,11,.82); backdrop-filter: blur(8px); }
.slide-viewer { width: min(1180px,95vw); height: min(780px,92vh); display: grid; grid-template-rows: 48px 1fr 48px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-solid); overflow: hidden; box-shadow: var(--shadow); }
.slide-viewer header, .slide-viewer footer { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); }
.slide-viewer footer { border: 0; border-top: 1px solid var(--line); }
.slide-viewer button, .slide-viewer a { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.slide-stage { overflow: auto; display: grid; place-items: center; padding: 20px; background: #060b10; }
.slide-stage img { max-width: 100%; max-height: 100%; transform: scale(var(--slide-zoom,1)); transform-origin: center; box-shadow: 0 15px 45px #000; }

/* Standalone IDE */
.ide-page { height: 100vh; overflow: hidden; background: var(--bg); }
.ide-shell { height: 100%; display: grid; grid-template-rows: 55px 1fr 25px; }
.ide-header { display: flex; align-items: center; gap: 15px; padding: 0 15px; border-bottom: 1px solid var(--line); background: var(--surface-solid); }
.ide-header .brand { margin-right: 15px; }
.ide-header .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.ide-header button, .ide-header label { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.ide-header .ide-run { color: #04150f; background: var(--green); border-color: var(--green); font-weight: 700; }
.ide-header .spacer { flex: 1; }
.ide-workbench { min-height: 0; display: grid; grid-template-columns: 225px minmax(0,1fr) 320px; }
.ide-sidebar, .ide-io { min-width: 0; border-right: 1px solid var(--line); background: var(--bg-2); overflow: auto; }
.ide-io { border: 0; border-left: 1px solid var(--line); }
.pane-heading { height: 38px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.file-list { padding: 8px; }
.file-item { width: 100%; padding: 8px 9px; display: flex; gap: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; font-size: 12px; }
.file-item.active { background: var(--surface-2); color: var(--text); }
.ide-editor-wrap { min-width: 0; min-height: 0; }
.ide-editor-wrap .code-editor { height: 100%; border: 0; border-radius: 0; }
.ide-io section { border-bottom: 1px solid var(--line); }
.ide-io textarea { width: 100%; min-height: 160px; padding: 13px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--text); font: 12px/1.6 ui-monospace,monospace; }
.ide-output { min-height: 220px; margin: 0; padding: 13px; white-space: pre-wrap; color: var(--green); font: 12px/1.6 ui-monospace,monospace; }
.ide-status { padding: 0 12px; display: flex; align-items: center; justify-content: space-between; background: #0a74a8; color: white; font-size: 10px; }

@media (max-width: 1050px) {
  .course-grid { grid-template-columns: repeat(2,1fr); }
  .lesson-hero { grid-template-columns: 1fr; }
  .lesson-preview { max-width: 590px; }
  .ide-workbench { grid-template-columns: 190px 1fr; }
  .ide-io { position: fixed; z-index: 20; right: 0; top: 55px; bottom: 25px; width: min(360px,90vw); box-shadow: var(--shadow); transform: translateX(100%); transition: transform .25s; }
  .ide-page.io-open .ide-io { transform: none; }
}

@media (max-width: 720px) {
  .topbar { height: 68px; padding: 0 17px; }
  .brand > span:last-child, .pill-link { display: none; }
  .hero { height: auto; min-height: 720px; }
  .hero-copy { width: auto; margin: 50px 23px 0; }
  .hero h1 { font-size: clamp(52px,18vw,79px); }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .primary-button { justify-content: center; }
  .hero-status { display: none; }
  .hero-grid { background-size: 54px 54px; }
  .intro-strip { margin-top: -20px; }
  .path-steps { grid-template-columns: 1fr; }
  .path-steps article { border: 0; border-bottom: 1px solid var(--line); }
  .section-heading { align-items: start; flex-direction: column; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: 210px; }
  .site-footer { padding: 25px; align-items: start; flex-direction: column; gap: 9px; }
  .lesson-page .topbar { height: 62px; }
  .lesson-page .pill-link { display: none; }
  .lesson-progress { top: 61px; }
  .lesson-hero { padding-top: 115px; }
  .lesson-preview { margin: 0 10px; }
  .lesson-layout { width: min(100% - 30px,960px); padding-top: 70px; }
  .lesson-module { margin-bottom: 105px; }
  .module-number { position: static; display: block; margin-bottom: 9px; }
  .content-grid, .exercise-formats, .sample-grid { grid-template-columns: 1fr; }
  .lesson-toc-zone { display: none; }
  .mobile-toc-button { display: grid; place-items: center; position: fixed; z-index: 45; left: 14px; bottom: 17px; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-solid); color: var(--cyan); box-shadow: var(--shadow); }
  .mobile-toc-open .lesson-toc-zone { display: block; z-index: 44; inset: 62px 0 0; width: auto; background: rgba(0,5,10,.5); }
  .mobile-toc-open .lesson-toc { top: auto; bottom: 0; left: 0; width: 100%; max-height: 72vh; overflow: auto; padding: 20px; transform: none; border-radius: 20px 20px 0 0; background: var(--surface-solid); }
  .mobile-toc-open .toc-tab { display: none; }
  .exercise-body { padding: 15px; }
  .exercise-editor { min-height: 470px; }
  .exercise-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .exercise-actions .submit-button { grid-column: 1/-1; margin: 0; }
  .interaction-shell { padding: 17px; }
  .bucket-grid { gap: 2px; }
  .bucket { font-size: 8px; }
  .ide-header .brand, .ide-header button span, .ide-header label { display: none; }
  .ide-header { gap: 7px; }
  .ide-workbench { grid-template-columns: 1fr; }
  .ide-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
  #fluid-canvas { display: none; }
}
