:root {
  color-scheme: dark;
  --night: #071223;
  --panel: #101f36;
  --line: #466594;
  --blue: #8acaff;
  --ink: #f5f8ff;
  --muted: #c7d7ed;
  --yellow: #ffdc54;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--night); color: var(--ink); font: 1.125rem/1.65 Inter, system-ui, sans-serif; }
a { color: var(--blue); text-underline-offset: .19em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.skip { position: absolute; top: .5rem; left: .5rem; transform: translateY(-180%); z-index: 2; background: var(--night); padding: .5rem 1rem; }
.skip:focus { transform: translateY(0); }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .top nav, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.top-inner { justify-content: space-between; padding-block: .8rem; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; }
.brand span { color: var(--muted); font-weight: 500; }
.hero { background: radial-gradient(ellipse at 75% 10%, #123c77, transparent 75%), linear-gradient(125deg,#0a172e,#081327); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(2rem, 6vw, 5.5rem); }
.hero img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.02; object-fit: cover; object-position: center 44%; border: 1px solid #6699dc; border-radius: 1.3rem; box-shadow: 0 0 38px #428cff33; }
.kicker { color: var(--yellow); font-weight: 800; font-size: .94rem; letter-spacing: .09em; }
h1,h2,h3,h4 { line-height: 1.16; text-wrap: balance; }
h1 { margin: .45rem 0 1rem; font-size: clamp(2rem, 4.65vw, 4.25rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.55rem); margin: 0 0 1rem; }
h3 { font-size: clamp(1.35rem, 2.7vw, 1.95rem); margin: .35rem 0 1rem; }
h4 { font-size: 1.2rem; margin: 1.65rem 0 .5rem; }
.lead { font-size: clamp(1.13rem, 2vw, 1.28rem); color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .6rem .95rem; min-height: 46px; border: 1px solid #76a9eb; border-radius: .65rem; background: #152b48; color: var(--ink); text-decoration: none; font: inherit; font-size: .92rem; font-weight: 750; text-align: center; cursor: pointer; }
.button:hover { background: #244c7a; }
.button.yellow { background: var(--yellow); border-color: var(--yellow); color: #101b2d; }
.button.yellow:hover { background: #fff19d; }
.course > section { margin-block: clamp(2.6rem, 6vw, 4.8rem); }
section, article, main { scroll-margin-top: 1.25rem; }
.panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); padding: clamp(1rem, 4vw, 2.6rem); }
.toc, .specialties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .8rem; padding: 0; }
.toc { list-style: none; }
.toc a,.specialties a { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #0e2038; color: var(--ink); text-decoration: none; }
.toc a:hover,.specialties a:hover { border-color: var(--blue); background: #172f51; }
.toc span,.specialties span { color: var(--blue); font-size: 1rem; }
.lesson { margin-block: 1.25rem; border-color: #527ab6; box-shadow: inset 0 0 25px #3d83ef13; }
.lesson > .kicker { margin: 0; }
.lesson p,.course section > p,.goal { max-width: 77ch; }
.goal { border-left: 4px solid var(--yellow); padding-left: .8rem; color: var(--muted); }
figure { margin: 1.2rem 0; }
figcaption { font-weight: 750; color: var(--muted); margin-bottom: .5rem; }
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: .6rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.flow li { counter-increment: step; flex: 1 1 10rem; min-width: 0; border: 1px solid var(--line); border-radius: .6rem; padding: .6rem .75rem; background: #0a172b; }
.flow li::before { content: counter(step, decimal-leading-zero); color: var(--yellow); font-weight: 800; margin-right: .5rem; }
details { border: 1px solid var(--line); border-radius: .6rem; background: #0b192d; margin-block: .65rem; padding-inline: .9rem; }
summary { color: var(--blue); cursor: pointer; font-weight: 730; padding-block: .65rem; }
details p { margin-top: 0; }
.progress-box { display: grid; gap: .3rem; padding: .9rem 1rem; border-radius: .65rem; background: #122849; }
progress { display: block; width: 100%; min-height: 1rem; accent-color: var(--yellow); }
.lesson-nav { margin-top: 1.4rem; }
.completion[aria-pressed="true"] { background: #164736; border-color: #74d4ad; }
.quiz fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .65rem; margin: 1.2rem 0; padding: .45rem .8rem .8rem; }
.quiz legend { font-weight: 750; padding-inline: .35rem; }
.quiz label { display: flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; }
.quiz label:hover { color: var(--blue); }
.quiz input { appearance: auto; flex: 0 0 1.15rem; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--yellow); }
.feedback { padding: .65rem .75rem; border-left: 3px solid var(--blue); background: #0b1729; margin-bottom: 0; }
.feedback[data-state="correct"] { border-color: #74d4ad; }
.feedback[data-state="incorrect"] { border-color: #ffb6a6; }
.result:empty { margin: 0; }
.result { font-weight: 800; color: var(--yellow); }
.comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.final-cta { background: linear-gradient(125deg,#132340,#102f57); }
footer { border-top: 1px solid var(--line); padding-block: 1.25rem; }
@media (max-width: 680px) {
  .hero-inner,.comparison { grid-template-columns: 1fr; }
  .hero img { max-height: 15rem; aspect-ratio: 16 / 8; object-position: center 42%; }
  .top-inner { gap: .15rem 1rem; }
  .flow { display: grid; grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .hero .actions,.final-cta .actions { align-items: stretch; flex-direction: column; }
}
