@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #08100f;
  --deep: #050b0a;
  --panel: #0d1715;
  --panel-2: #111d1a;
  --ink: #e8ecf3;
  --muted: #8d9b99;
  --faint: #586762;
  --line: #263330;
  --accent: #b7f23a;
  --teal: #49d2bd;
  --orange: #ffb45b;
  --pink: #f27ca6;
  color: var(--ink);
  background: var(--bg);
  font: 400 16px/1.6 'Manrope', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--ink); }
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--accent); color: var(--deep); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 200; left: 16px; top: -100px; padding: 10px 14px; background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 700; }
.skip-link:focus { top: 12px; }

.topbar { height: 78px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 28px; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: rgba(8, 16, 15, .94); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; font: 500 12px 'DM Mono', monospace; letter-spacing: .12em; white-space: nowrap; }
.brand em { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-style: normal; font-size: 9px; }
.brand-mark { display: flex; align-items: center; gap: 3px; height: 22px; }
.brand-mark i { display: block; width: 2px; height: 10px; background: var(--accent); }
.brand-mark i:nth-child(2) { height: 20px; }
.brand-mark i:nth-child(3) { height: 15px; }
.brand-mark i:nth-child(4) { height: 7px; }
.course-nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.course-nav > a { color: var(--muted); text-decoration: none; font: 500 10px 'DM Mono', monospace; letter-spacing: .07em; text-transform: uppercase; transition: color .18s; }
.course-nav > a:hover, .course-nav > a:focus-visible { color: var(--ink); }
.runtime-chip { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #3d5133; border-radius: 99px; color: var(--accent); font: 500 8px 'DM Mono', monospace; letter-spacing: .06em; }
.runtime-chip i, .studio-runtime i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(183, 242, 58, .1); }
.runtime-chip.is-loading i, .studio-runtime.is-loading i { animation: pulse 1s infinite alternate; }
.runtime-chip.is-error, .studio-runtime.is-error { color: #ff8b8b; border-color: #5a3333; }
.runtime-chip.is-error i, .studio-runtime.is-error i { background: #ff8b8b; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); padding: 0; place-content: center; gap: 4px; }
.menu-button > span:not(.sr-only) { display: block; width: 16px; height: 1px; background: var(--ink); }
@keyframes pulse { from { opacity: .25; } to { opacity: 1; box-shadow: 0 0 14px currentColor; } }

.hero { min-height: calc(100vh - 78px); padding: clamp(58px, 7vw, 112px) clamp(24px, 7vw, 112px) 0; position: relative; display: grid; grid-template-columns: minmax(470px, .95fr) minmax(470px, 1.05fr); grid-template-rows: 1fr auto; gap: 64px clamp(42px, 6vw, 110px); overflow: hidden; }
.hero-glow { position: absolute; width: 760px; height: 760px; right: -150px; top: -40px; border-radius: 50%; background: radial-gradient(circle, rgba(73, 210, 189, .13), transparent 67%); pointer-events: none; }
.hero-grid { position: absolute; inset: 0 0 auto 44%; height: 77%; opacity: .22; background-image: linear-gradient(rgba(73, 210, 189, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(73, 210, 189, .13) 1px, transparent 1px); background-size: 66px 66px; mask-image: linear-gradient(90deg, transparent, #000 30%, #000); pointer-events: none; }
.hero-copy, .hero-console { position: relative; z-index: 2; align-self: center; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--accent); font: 500 10px 'DM Mono', monospace; letter-spacing: .14em; }
.eyebrow span + span { color: var(--muted); }
.hero h1 { margin: 34px 0 30px; max-width: 860px; font-size: clamp(62px, 7vw, 118px); line-height: .84; letter-spacing: -.072em; font-weight: 500; }
.hero h1 span { color: var(--accent); }
.hero-copy > p { max-width: 700px; margin: 0; color: #a9b4b2; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.65; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.primary-button, .lab-button, .run-button { min-height: 52px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 30px; border: 0; border-radius: 99px; background: var(--accent); color: #0b130e; text-decoration: none; font-weight: 700; transition: transform .18s, box-shadow .18s; }
.primary-button:hover, .lab-button:hover, .run-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(183, 242, 58, .12); }
.text-button { border: 0; background: transparent; padding: 8px 0; color: var(--ink); font-size: 13px; }
.text-button span { margin-left: 9px; color: var(--accent); }
.support-note { margin-top: 30px; display: flex; align-items: center; gap: 10px; color: var(--muted); font: 400 9px 'DM Mono', monospace; letter-spacing: .04em; }
.support-note i, .live-pulse, .lab-topline i, .week-lab-label i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(183, 242, 58, .1); }

.hero-console { width: 100%; border: 1px solid rgba(73, 210, 189, .28); background: rgba(5, 12, 10, .88); box-shadow: 0 28px 80px rgba(0, 0, 0, .4), 0 0 42px rgba(73, 210, 189, .08); }
.console-toolbar, .console-footer { min-height: 42px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; color: #71817c; font: 500 8px 'DM Mono', monospace; letter-spacing: .1em; }
.console-toolbar { border-bottom: 1px solid var(--line); }
.console-toolbar span:first-child { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.console-toolbar i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.console-code { padding: 18px 0; border-bottom: 1px solid var(--line); background: #07100e; }
.console-code > span { min-height: 26px; display: grid; grid-template-columns: 42px 1fr; align-items: center; }
.console-code b { text-align: right; padding-right: 13px; color: #3e504b; font: 400 9px 'DM Mono', monospace; }
.console-code code { color: #a9b5b1; font: 400 10px 'DM Mono', monospace; }
.console-code em { color: #e39ac1; font-style: normal; }
.console-code strong { color: var(--orange); font-weight: 500; }
.hero-chart-wrap { padding: 16px 16px 8px; }
.hero-chart-labels { display: flex; justify-content: space-between; color: var(--muted); font: 500 8px 'DM Mono', monospace; letter-spacing: .08em; }
#hero-analysis { width: 100%; height: 185px; display: block; }
.hero-control { padding: 4px 16px 0; display: flex; justify-content: space-between; color: #81908b; font: 500 8px 'DM Mono', monospace; letter-spacing: .08em; }
.hero-control output { color: var(--accent); }
.hero-console > input[type="range"] { width: calc(100% - 32px); margin: 8px 16px 18px; accent-color: var(--accent); }
.console-footer { border-top: 1px solid var(--line); }
.console-footer strong { color: var(--teal); font-weight: 500; }
.course-facts { grid-column: 1 / -1; margin: 0 calc(clamp(24px, 7vw, 112px) * -1); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(7, 14, 13, .82); }
.course-facts div { min-height: 126px; padding: 22px clamp(24px, 4vw, 64px); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.course-facts div:last-child { border-right: 0; }
.course-facts strong { font-size: 30px; font-weight: 500; letter-spacing: -.04em; }
.course-facts span { color: var(--muted); font: 400 9px 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }

.section { padding: 90px clamp(24px, 7vw, 112px) 110px; border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 72px 1fr; gap: 28px; align-items: start; margin-bottom: 64px; }
.section-number { padding-top: 10px; color: var(--accent); font: 500 10px 'DM Mono', monospace; }
.kicker { margin: 0; color: var(--accent); font: 500 9px 'DM Mono', monospace; letter-spacing: .15em; }
.section-heading h2 { margin: 17px 0 0; font-size: clamp(44px, 5.7vw, 88px); line-height: .94; letter-spacing: -.06em; font-weight: 500; }
.overview { background: #0b1412; }
.overview-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(50px, 8vw, 130px); }
.overview-intro .lead { margin: 0 0 24px; color: var(--ink); font-size: clamp(22px, 2.15vw, 33px); line-height: 1.38; letter-spacing: -.025em; }
.overview-intro .lead a { text-decoration-color: var(--accent); text-underline-offset: 4px; }
.overview-intro > p:not(.lead) { color: var(--muted); max-width: 650px; }
.privacy-note { margin-top: 38px; padding: 18px 20px; border: 1px solid #3c512d; background: #121b13; display: flex; align-items: flex-start; gap: 14px; }
.privacy-note .live-pulse { margin-top: 7px; }
.privacy-note p { margin: 0; color: #91a08f; font-size: 12px; line-height: 1.7; }
.privacy-note strong { color: var(--ink); }
.pipeline { border: 1px solid var(--line); }
.pipeline > div { min-height: 142px; padding: 22px; display: grid; grid-template-columns: 52px 130px 1fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); background: var(--panel); }
.pipeline > div:last-child { border-bottom: 0; }
.pipeline span { color: var(--accent); font: 500 9px 'DM Mono', monospace; }
.pipeline strong { font-size: 18px; }
.pipeline p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.principles { background: var(--deep); }
.compact-heading { margin-bottom: 48px; }
.principle-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.principle-grid article { min-height: 250px; padding: 25px; border-right: 1px solid var(--line); background: #091210; }
.principle-grid article:last-child { border-right: 0; }
.principle-number { color: var(--accent); font: 500 9px 'DM Mono', monospace; }
.principle-grid h3 { margin: 75px 0 12px; font-size: 19px; }
.principle-grid p { margin: 0; color: var(--muted); font-size: 13px; }

.curriculum { background: #091210; }
.curriculum-heading { grid-template-columns: 72px 1fr minmax(210px, .35fr); }
.curriculum-actions { align-self: end; display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; }
.curriculum-actions > span { color: var(--muted); font: 500 8px 'DM Mono', monospace; letter-spacing: .08em; }
.curriculum-actions button { grid-row: 1 / 3; grid-column: 2; border: 0; background: transparent; color: var(--accent); font: 500 9px 'DM Mono', monospace; text-transform: uppercase; }
.progress-track { height: 2px; overflow: hidden; background: var(--line); }
.progress-track i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s; }
.week-list { border-top: 1px solid var(--line); }
.week { border-bottom: 1px solid var(--line); }
.week summary { min-height: 118px; padding: 18px 0; display: grid; grid-template-columns: 72px minmax(260px, 1fr) 170px 52px; gap: 28px; align-items: center; list-style: none; cursor: pointer; }
.week summary::-webkit-details-marker { display: none; }
.week-number { color: var(--accent); font: 500 10px 'DM Mono', monospace; }
.week-title { display: flex; flex-direction: column; gap: 6px; }
.week-title small { color: var(--muted); font: 500 8px 'DM Mono', monospace; letter-spacing: .13em; }
.week-title strong { font-size: clamp(21px, 2vw, 30px); line-height: 1.2; font-weight: 500; letter-spacing: -.025em; }
.week-lab-label { display: flex; align-items: center; gap: 11px; color: var(--accent); font: 500 8px 'DM Mono', monospace; letter-spacing: .08em; }
.week-toggle { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; position: relative; }
.week-toggle::before, .week-toggle::after { content: ''; position: absolute; left: 13px; right: 13px; top: 21px; height: 1px; background: var(--ink); transition: transform .2s; }
.week-toggle::after { transform: rotate(90deg); }
.week[open] .week-toggle::after { transform: rotate(0); }
.week-content { padding: 8px 0 48px 100px; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); gap: clamp(34px, 6vw, 90px); }
.lesson-materials > h3 { margin: 0 0 14px; color: var(--muted); font: 500 8px 'DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.resource-list { padding: 0; margin: 0 0 28px; list-style: none; border-top: 1px solid var(--line); }
.resource-list li { min-height: 51px; padding: 11px 0; display: grid; grid-template-columns: 54px 1fr; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); }
.resource-list li > span { color: var(--accent); font: 500 8px 'DM Mono', monospace; }
.resource-list a, .resource-list p { margin: 0; color: var(--ink); text-decoration: none; font-size: 13px; }
.resource-list a:hover { color: var(--accent); }
.resource-list b { float: right; color: var(--accent); font-weight: 400; }
.weekly-work { margin: 0; padding-left: 19px; color: var(--muted); font-size: 13px; }
.weekly-work li + li { margin-top: 8px; }
.python-lab { padding: 25px; min-height: 330px; border: 1px solid #2d463d; background: linear-gradient(145deg, #101d19, #0b1513); display: flex; flex-direction: column; box-shadow: inset 0 1px rgba(255, 255, 255, .018); }
.lab-topline { display: flex; justify-content: space-between; color: var(--muted); font: 500 8px 'DM Mono', monospace; letter-spacing: .08em; }
.lab-topline span { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.lab-topline em { font-style: normal; }
.python-lab h3 { margin: 54px 0 14px; font-size: clamp(25px, 2.4vw, 38px); line-height: 1.05; letter-spacing: -.04em; font-weight: 500; }
.python-lab > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; }
.lab-goal { margin-top: 25px; padding-top: 17px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 70px 1fr; gap: 16px; }
.lab-goal span { color: var(--accent); font: 500 8px 'DM Mono', monospace; }
.lab-goal p { margin: 0; color: #a6b1ae; font-size: 12px; }
.lab-actions { margin-top: auto; padding-top: 25px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lab-button { min-height: 46px; padding: 0 18px; font-size: 13px; }
.complete-button { min-height: 42px; padding: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.complete-button i { width: 17px; height: 17px; border: 1px solid var(--faint); border-radius: 50%; }
.complete-button.is-complete { color: var(--accent); }
.complete-button.is-complete i { border: 5px solid var(--accent); }
.noscript-note { padding: 20px; border: 1px solid #664; }

.assessment { background: var(--deep); }
.assessment-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.grade-card { min-height: 340px; padding: 34px; display: grid; grid-template-columns: 150px 1fr; gap: 35px; border-right: 1px solid var(--line); background: #091210; }
.grade-card:last-child { border-right: 0; }
.grade-number { font-size: 72px; line-height: 1; letter-spacing: -.07em; color: var(--accent); }
.grade-number span { font-size: 22px; }
.grade-card h3 { margin: 60px 0 13px; font-size: 21px; font-weight: 500; line-height: 1.35; }
.grade-card p:last-child { color: var(--muted); font-size: 13px; }
.enrolment-panel { margin-top: 34px; padding: 42px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 36px 90px; border: 1px solid #3c512d; background: #111b13; }
.enrolment-panel h2 { margin: 15px 0 18px; font-size: 38px; letter-spacing: -.04em; }
.enrolment-panel > div > p:last-child { color: var(--muted); font-size: 13px; }
.enrolment-panel ol { margin: 0; padding: 0; list-style: none; }
.enrolment-panel li { padding: 12px 0; display: grid; grid-template-columns: 42px 1fr; border-bottom: 1px solid #2b372b; color: #abb4aa; font-size: 12px; }
.enrolment-panel li span { color: var(--accent); font: 500 8px 'DM Mono', monospace; }
.form-links { grid-column: 1 / -1; display: flex; gap: 12px; }
.form-links a { min-height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 40px; border: 1px solid #44513f; color: var(--ink); text-decoration: none; font-size: 12px; }
.form-links a:hover { border-color: var(--accent); color: var(--accent); }

footer { min-height: 210px; padding: 45px clamp(24px, 7vw, 112px); display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 20px; background: #050a09; }
footer p { margin: 0; color: var(--muted); font-size: 12px; }
footer > div { grid-row: 1 / 3; grid-column: 2; display: flex; align-items: center; justify-content: flex-end; gap: 26px; }
footer > div a { color: var(--muted); text-decoration: none; font: 500 9px 'DM Mono', monospace; }
footer > div a:hover { color: var(--accent); }

.analysis-studio { width: min(1480px, calc(100vw - 28px)); height: min(920px, calc(100dvh - 28px)); max-width: none; max-height: none; padding: 0; border: 1px solid #34443f; background: var(--deep); color: var(--ink); box-shadow: 0 45px 140px #000; }
.analysis-studio::backdrop { background: rgba(1, 6, 5, .82); backdrop-filter: blur(9px); }
.studio-shell { height: 100%; display: grid; grid-template-rows: 76px minmax(0, 1fr) auto; }
.studio-header { padding: 0 26px; display: grid; grid-template-columns: 1fr auto 48px; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); background: #08110f; }
.studio-identity { display: flex; align-items: center; gap: 24px; min-width: 0; }
.studio-identity > span { color: var(--accent); font: 500 8px 'DM Mono', monospace; letter-spacing: .1em; }
.studio-identity h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 21px; font-weight: 500; letter-spacing: -.025em; }
.studio-runtime { min-height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #344638; border-radius: 99px; color: var(--accent); font: 500 8px 'DM Mono', monospace; }
.studio-close { width: 40px; height: 40px; padding: 0 0 4px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; }
.studio-close:hover { color: var(--ink); border-color: var(--muted); }
.studio-body { min-height: 0; display: grid; grid-template-columns: 310px minmax(0, 1fr); }
.control-panel { min-height: 0; overflow-y: auto; padding: 27px 24px; border-right: 1px solid var(--line); background: #091210; }
.control-intro { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.control-intro > p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
#lab-controls { padding: 8px 0 18px; }
.lab-control { display: block; padding: 16px 0 15px; border-bottom: 1px solid var(--line); }
.control-label { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #a9b4b1; font: 500 9px 'DM Mono', monospace; letter-spacing: .04em; }
.control-label output { color: var(--accent); }
.lab-control input[type="range"] { width: 100%; accent-color: var(--accent); }
.lab-control select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); color: var(--ink); font-size: 12px; }
.run-button { width: 100%; border-radius: 0; min-height: 50px; justify-content: space-between; }
.run-button b { font: 500 8px 'DM Mono', monospace; }
.run-button:disabled { cursor: wait; opacity: .6; transform: none; }
.run-note { margin: 10px 0 0; color: var(--faint); font: 400 8px/1.6 'DM Mono', monospace; }
.result-panel { min-height: 0; overflow-y: auto; padding: 26px; background: #07100e; }
.result-toolbar { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.result-toolbar > div { display: flex; align-items: baseline; gap: 16px; }
.result-kicker { color: var(--accent); font: 500 8px 'DM Mono', monospace; letter-spacing: .12em; }
.result-toolbar strong { font-size: 14px; font-weight: 500; }
.result-toolbar > span { color: var(--faint); font: 500 8px 'DM Mono', monospace; }
.plot-area { min-height: 330px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.empty-result { grid-column: 1 / -1; min-height: 330px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px solid var(--line); background: var(--panel); }
.empty-mark { width: 48px; height: 48px; border: 1px solid #375148; border-radius: 50%; position: relative; }
.empty-mark::before, .empty-mark::after { content: ''; position: absolute; left: 13px; right: 13px; top: 23px; height: 1px; background: var(--teal); transform: rotate(27deg); }
.empty-mark::after { transform: rotate(-27deg); }
.empty-result h3 { margin: 18px 0 5px; font-size: 18px; font-weight: 500; }
.empty-result p { margin: 0; color: var(--muted); font-size: 11px; }
.plot-card { min-height: 330px; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.plot-card:only-child { grid-column: 1 / -1; }
.plot-title { min-height: 28px; display: flex; align-items: center; justify-content: space-between; color: #9eaaa6; font: 500 8px 'DM Mono', monospace; letter-spacing: .07em; }
.plot-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.plot-legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 7px; }
.plot-legend i { width: 12px; height: 2px; }
.plot-card canvas { width: 100%; height: 270px; display: block; }
.metric-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.metric { min-height: 86px; padding: 13px; border-right: 1px solid var(--line); background: #0d1715; }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font: 500 7px 'DM Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 15px; font-size: 20px; font-weight: 500; color: var(--ink); }
.interpretation { margin-top: 14px; padding: 14px 16px; display: grid; grid-template-columns: 120px 1fr; gap: 20px; border: 1px solid #39502d; background: #101912; }
.interpretation span { color: var(--accent); font: 500 8px 'DM Mono', monospace; letter-spacing: .1em; }
.interpretation p { margin: 0; color: #9daa99; font-size: 11px; }
.code-drawer { border-top: 1px solid var(--line); background: #080f0e; }
.code-toggle { width: 100%; min-height: 48px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: var(--ink); }
.code-toggle > span { display: flex; align-items: center; gap: 10px; font: 500 8px 'DM Mono', monospace; letter-spacing: .09em; }
.code-toggle i { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }
.code-toggle b { color: var(--muted); font: 500 8px 'DM Mono', monospace; }
.code-panel { height: 285px; border-top: 1px solid var(--line); }
.code-toolbar { min-height: 42px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 500 8px 'DM Mono', monospace; }
.code-toolbar > div { display: flex; gap: 8px; }
.code-toolbar button { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 8px; }
.code-toolbar button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.code-toolbar button:disabled { opacity: .4; }
#python-code { width: 100%; height: 242px; resize: none; padding: 17px 20px 30px; border: 0; border-top: 1px solid var(--line); outline: 0; background: #050b0a; color: #b8c5c1; font: 400 11px/1.62 'DM Mono', monospace; tab-size: 4; }
#python-code:focus { box-shadow: inset 0 0 0 1px #35584e; }
.analysis-error { grid-column: 1 / -1; min-height: 260px; padding: 34px; border: 1px solid #633; background: #1b0e0e; }
.analysis-error h3 { color: #ff9797; }
.analysis-error pre { overflow: auto; white-space: pre-wrap; color: #c9a2a2; font: 400 10px/1.6 'DM Mono', monospace; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-console { max-width: 760px; }
  .overview-grid { grid-template-columns: 1fr; }
  .principle-grid { grid-template-columns: 1fr 1fr; }
  .principle-grid article { border-bottom: 1px solid var(--line); }
  .principle-grid article:nth-child(2) { border-right: 0; }
  .principle-grid article:nth-last-child(-n+2) { border-bottom: 0; }
  .week-content { padding-left: 0; grid-template-columns: .8fr 1.2fr; }
  .grade-card { grid-template-columns: 1fr; gap: 12px; }
  .grade-card h3 { margin-top: 25px; }
  .studio-body { grid-template-columns: 270px minmax(0, 1fr); }
  .plot-area { grid-template-columns: 1fr; }
  .plot-card:only-child { grid-column: auto; }
}

@media (max-width: 800px) {
  .topbar { height: 68px; }
  .brand em { display: none; }
  .menu-button { display: grid; }
  .course-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; padding: 20px; align-items: stretch; flex-direction: column; border-bottom: 1px solid var(--line); background: #08100f; }
  .course-nav.is-open { display: flex; }
  .course-nav > a { padding: 10px 0; }
  .runtime-chip { align-self: flex-start; }
  .hero { min-height: 0; padding: 70px 20px 0; gap: 55px; }
  .hero h1 { font-size: clamp(54px, 15vw, 84px); }
  .hero-console { min-width: 0; }
  .console-code { overflow-x: auto; }
  .console-code > span { min-width: 430px; }
  .course-facts { grid-template-columns: 1fr 1fr; margin: 0 -20px; }
  .course-facts div { min-height: 100px; border-bottom: 1px solid var(--line); }
  .course-facts div:nth-child(2) { border-right: 0; }
  .course-facts div:nth-last-child(-n+2) { border-bottom: 0; }
  .section { padding: 70px 20px 82px; }
  .section-heading, .curriculum-heading { grid-template-columns: 42px 1fr; gap: 12px; margin-bottom: 45px; }
  .section-heading h2 { font-size: clamp(42px, 14vw, 64px); }
  .curriculum-actions { grid-column: 1 / -1; margin-top: 15px; }
  .pipeline > div { grid-template-columns: 38px 96px 1fr; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article { min-height: 190px; border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .principle-grid article:last-child { border-bottom: 0 !important; }
  .principle-grid h3 { margin-top: 44px; }
  .week summary { min-height: 96px; grid-template-columns: 32px 1fr 38px; gap: 12px; }
  .week-lab-label { display: none; }
  .week-toggle { width: 36px; height: 36px; }
  .week-toggle::before, .week-toggle::after { left: 11px; right: 11px; top: 17px; }
  .week-title strong { font-size: 20px; }
  .week-content { padding: 5px 0 42px; grid-template-columns: 1fr; gap: 32px; }
  .python-lab { min-height: 0; }
  .assessment-grid { grid-template-columns: 1fr; }
  .grade-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .grade-card:last-child { border-bottom: 0; }
  .enrolment-panel { grid-template-columns: 1fr; gap: 32px; padding: 25px; }
  .form-links { grid-column: 1; flex-direction: column; }
  footer { grid-template-columns: 1fr; }
  footer > div { grid-row: auto; grid-column: auto; align-items: flex-start; flex-direction: column; gap: 12px; margin-top: 20px; }
  .analysis-studio { width: 100vw; height: 100dvh; max-height: none; border: 0; }
  .studio-shell { grid-template-rows: 68px minmax(0, 1fr) auto; }
  .studio-header { padding: 0 12px; grid-template-columns: 1fr 40px; }
  .studio-identity { gap: 10px; }
  .studio-identity h2 { font-size: 15px; }
  .studio-runtime { display: none; }
  .studio-body { overflow-y: auto; display: block; }
  .control-panel { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .result-panel { overflow: visible; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .interpretation { grid-template-columns: 1fr; gap: 7px; }
  .code-panel { height: 45dvh; }
  #python-code { height: calc(45dvh - 42px); }
  .code-toolbar { overflow-x: auto; }
}

@media (max-width: 500px) {
  .pipeline > div { grid-template-columns: 32px 1fr; }
  .pipeline p { grid-column: 2; }
  .lab-actions { align-items: stretch; flex-direction: column; }
  .lab-button { width: 100%; }
  .form-links a { width: 100%; }
  .code-toolbar > span { display: none; }
  .code-toolbar { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
