:root {
  color-scheme: light;
  --bg: #f8f8fc;
  --paper: #fff;
  --ink: #211a36;
  --body: #514961;
  --muted: #615875;
  --line: #e5e0ed;
  --purple: #5738ca;
  --deep: #3d249a;
  --soft: #f1ebff;
  --shadow: 0 12px 32px #2c174508;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #7753e2;
  outline-offset: 4px;
}
:is(main, h1, h2, .feedback)[tabindex]:focus { outline: none; }
h1, h2, h3, p, figure { margin: 0; }
svg { flex: none; vertical-align: middle; }
p { line-height: 1.65; color: var(--body); }
.skip {
  position: absolute; z-index: 10; top: 8px; left: 8px; padding: 12px 18px;
  transform: translateY(-150%); background: white; border-radius: 8px;
}
.skip:focus { transform: translateY(0); }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner {
  width: min(1232px, calc(100% - 72px)); min-height: 73px; margin: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; font-size: 16px; font-weight: 620; letter-spacing: -.4px; }
.brand strong { font-weight: 800; }
.brand small { display: block; margin-top: 3px; font: 700 9px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .11em; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 5px; }
.top-nav a { padding: 9px 17px; border-radius: 8px; font-size: 14px; font-weight: 680; color: var(--body); }
.top-nav a[aria-current] { color: var(--deep); background: var(--soft); }
.top-nav a:hover { background: #f5f1fc; }
.guide { justify-self: end; font-size: 13px; color: var(--body); font-weight: 680; }
.guide span { padding-left: 4px; color: var(--purple); }
.guide:hover, .source:hover, .next-link:hover, .back:hover { text-decoration: underline; }
.shell { width: min(1232px, calc(100% - 72px)); margin: 32px auto 0; }
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; position: relative;
  border: 1px solid #ded2fa; border-radius: 24px; overflow: hidden;
  background: radial-gradient(ellipse at 89% 62%, #dfd1fc 0, transparent 55%), linear-gradient(110deg, #f4edff, #eee6ff);
}
.hero-copy { padding: 43px 0 45px 48px; position: relative; z-index: 1; }
.badge {
  display: inline-flex; gap: 7px; align-items: center; padding: 6px 10px;
  color: var(--deep); background: #fbf8ff; border: 1px solid #d9cbfa; border-radius: 6px;
  font: 700 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .075em;
}
.badge svg { width: 13px; height: 13px; }
.hero h1, .practice-hero h1 {
  font-size: clamp(43px, 5.05vw, 74px); line-height: 1.01; letter-spacing: -.066em; font-weight: 800; margin: 17px 0;
}
h1 em { font-style: normal; color: var(--purple); }
.hero p, .practice-hero p { font-size: 16px; max-width: 480px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero .actions, .practice-hero .actions { margin-top: 25px; }
.primary, .secondary {
  border: 1px solid transparent; border-radius: 9px; min-height: 44px; padding: 10px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14px; line-height: 1.4; font-weight: 700;
}
.primary { color: white; background: var(--purple); box-shadow: 0 3px 6px #39238524; }
.primary:hover { background: var(--deep); }
.secondary { color: var(--deep); background: #fffc; border-color: #d8cbed; }
.secondary:hover, .secondary[aria-pressed="true"] { background: var(--soft); }
.hero-art { padding: 0 28px 0 0; }
.hero-art svg { display: block; width: 100%; height: auto; }
.overview-strip {
  display: flex; gap: 27px; align-items: center; padding: 17px 4px 19px;
  margin-bottom: 10px; color: var(--muted); font-size: 13px;
}
.overview-strip span { display: inline-flex; align-items: center; gap: 5px; }
.overview-strip svg { color: var(--purple); margin-right: 3px; width: 16px; }
.overview-strip strong { color: var(--ink); }
.study { display: grid; grid-template-columns: 273px minmax(0, 1fr); gap: 25px; align-items: start; }
.sidebar, .lesson, .quiz-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow);
}
.sidebar { padding: 17px 13px 13px; }
.sidebar-title, .progress-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-title { padding: 2px 7px 0; }
.eyebrow { color: var(--deep); font: 750 11px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.tiny { font-size: 12px; font-weight: 600; color: var(--muted); }
.progress-info { font-size: 12px; color: var(--muted); padding: 15px 7px 7px; }
.progress-info strong { color: var(--deep); }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 20px; appearance: none; overflow: hidden; color: var(--purple); background: #ece7f4; }
progress::-webkit-progress-bar { background: #ece7f4; }
progress::-webkit-progress-value { background: var(--purple); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--purple); border-radius: 20px; }
.sidebar progress { width: calc(100% - 14px); margin: 0 7px 17px; }
.domains { display: grid; gap: 4px; }
.domain { border: 1px solid transparent; border-radius: 10px; }
.domain.active { background: #f5f1fd; border-color: #e8ddfa; }
.domain-link { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 7px; border-radius: 8px; font-size: 13px; font-weight: 720; }
.domain-link:hover { background: #f4f0fa; }
.domain-link small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.domain-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--purple); background: #f1ebff; }
.domain.active .domain-icon { background: #e8dcff; }
.chapter-links { margin: 0 7px 8px 23px; padding-left: 10px; border-left: 1px solid #d8c6f2; display: grid; gap: 2px; }
.chapter-links a { padding: 7px 8px; border-radius: 6px; font-size: 12px; font-weight: 580; color: var(--body); display: flex; justify-content: space-between; gap: 6px; }
.chapter-links a:hover, .chapter-links a[aria-current] { background: #ebe2fa; color: var(--deep); }
.chapter-links a[aria-current] { font-weight: 760; }
.tick { color: #276446; }
.side-practice {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  color: var(--deep); font-size: 13px; font-weight: 720; padding: 13px 8px 4px; margin: 10px 0 0; border-top: 1px solid var(--line);
}
.side-practice:hover { text-decoration: underline; }
.lesson { min-width: 0; padding: 27px; scroll-margin-top: 20px; }
.lesson-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 660; }
.lesson-kicker span:first-child { color: var(--deep); font: 750 10px/1.45 ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .07em; }
.bullet { width: 4px; height: 4px; background: #a491c9; border-radius: 50%; }
.lesson-head h2, .practice-catalog h2 { margin-top: 6px; font-size: clamp(28px, 3.25vw, 45px); letter-spacing: -.05em; line-height: 1.12; }
.lesson-head h2 { scroll-margin-top: 20px; }
.lesson-head p { margin-top: 9px; font-size: 15px; }
.diagram {
  margin-top: 22px; overflow: hidden; border: 1px solid #e2d9f0; border-radius: 12px;
  background: radial-gradient(circle, #ded4ed 1px, transparent 1.2px) 0 0 / 15px 15px, #fbf9ff;
}
.diagram-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 15px; border-bottom: 1px solid #e7def2; background: #f6f0fe;
}
.diagram-heading > span:first-child { display: flex; align-items: center; gap: 7px; color: var(--deep); font: 750 10px/1.3 ui-monospace, Consolas, monospace; letter-spacing: .085em; }
.diagram-heading svg { width: 15px; height: 15px; }
.graph {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 22px;
  position: relative; margin: 0 auto; max-width: 800px; padding: 25px 19px 23px;
}
.node {
  background: white; color: var(--ink); position: relative; z-index: 1;
  min-height: 74px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px;
  text-align: left; overflow-wrap: anywhere; padding: 11px; border-radius: 9px; border: 1px solid #daceed;
  box-shadow: 0 3px 8px #4b2a7110; font-size: 13px; font-weight: 720;
}
.node:hover { border-color: #967be1; }
.node[aria-pressed="true"] { background: #eee7ff; border-color: #8260dd; color: var(--deep); box-shadow: 0 0 0 2px #b09af047; }
.node-num { font: 750 10px/1.4 ui-monospace, Consolas, monospace; color: var(--purple); background: #f3eefe; border-radius: 4px; padding: 2px 5px; }
.node[aria-pressed="true"] .node-num { background: var(--purple); color: white; }
.graph:is(.loop, .flow) .node:not(.node-4)::after {
  content: "→"; position: absolute; left: calc(100% + 3px); top: 50%; transform: translateY(-50%);
  color: #785bb6; font-size: 16px; width: 16px; text-align: center; pointer-events: none;
}
.graph.loop { padding-bottom: 42px; }
.loop-back {
  position: absolute; left: 12%; right: 12%; bottom: 19px; height: 19px; border: 1px dashed #9c80ce;
  border-top: 0; border-radius: 0 0 7px 7px; display: flex; justify-content: center; align-items: flex-end;
}
.loop-back::before { content: ""; position: absolute; left: -4px; top: 0; border: 3px solid transparent; border-bottom: 5px solid #9c80ce; }
.loop-back span { transform: translateY(50%); background: #fbf9ff; padding: 0 8px; color: var(--deep); font-size: 10px; text-align: center; }
.graph.branch { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; max-width: 640px; }
.branch .node-1 { grid-column: 2; }
.branch:not(.merge)::before { content: ""; position: absolute; left: 17%; right: 17%; top: 106px; border-top: 1px dashed #9c80ce; }
.branch:not(.merge) .node:not(.node-1)::before {
  content: ""; position: absolute; height: 17px; left: 50%; bottom: 100%; border-left: 1px dashed #9c80ce;
}
.branch:not(.merge) .node-2 { grid-column: 1; }
.graph.merge { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 545px; }
.merge :is(.node-1, .node-4) { grid-column: 1 / -1; justify-self: center; width: 55%; }
.merge::before, .merge::after {
  content: ""; position: absolute; inset: 27% 25% auto; height: 18%; border: 1px dashed #9c80ce; border-radius: 5px;
}
.merge::after { inset: auto 25% 27%; }
.graph.stack { grid-template-columns: 1fr; gap: 7px; max-width: 640px; padding-block: 20px; }
.stack .node { min-height: 44px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.stack .node:nth-child(2) { margin-inline: 10px; }
.stack .node:nth-child(3) { margin-inline: 20px; }
.stack .node:nth-child(4) { margin-inline: 30px; }
.step-detail { display: flex; align-items: flex-start; gap: 12px; padding: 15px; background: #f4eefe; border-top: 1px solid #e5daf6; min-height: 86px; }
.step-counter { flex: none; background: #e7dbfd; color: var(--deep); border-radius: 5px; padding: 4px 6px; font: 750 10px/1.3 ui-monospace, Consolas, monospace; }
.step-detail strong { font-size: 14px; color: var(--deep); }
.step-detail p { margin-top: 3px; font-size: 13px; line-height: 1.5; }
.lesson-copy { margin-top: 22px; }
.principle { display: flex; gap: 11px; align-items: flex-start; background: #f4f0ff; border-left: 3px solid #825fe7; border-radius: 0 8px 8px 0; padding: 14px 16px; }
.principle svg, .principle strong { color: var(--deep); }
.principle p, .trap p { margin-top: 3px; font-size: 15px; }
.example { margin: 25px 0 20px; }
.example h3 { margin: 5px 0 10px; font-size: 23px; letter-spacing: -.035em; }
.example p { margin-bottom: 8px; font-size: 15px; max-width: 74ch; }
.trap { background: #fff8ed; border: 1px solid #f0e2c7; border-radius: 9px; padding: 13px 15px; }
.trap strong { color: #754a14; }
.recall { padding: 12px 14px; margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; }
summary { cursor: pointer; color: var(--deep); font-weight: 700; }
.recall p { font-size: 14px; margin: 8px 0; }
.recall details { margin-top: 8px; }
.recall details summary { font-size: 13px; }
.source, .back, .next-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 720; color: var(--deep); }
.source { margin-top: 14px; }
.lesson-end { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.lesson-end .next-link { margin-left: auto; }
.footer { width: min(1232px, calc(100% - 72px)); margin: 36px auto 0; padding: 16px 0 27px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.footer span:first-child { color: var(--ink); font-weight: 750; }
.noscript { padding: 20px; }

.practice-hero { padding: 43px 48px; background: radial-gradient(ellipse at 95% 10%, #daceff, #f1eaff 65%); border: 1px solid #ded2fa; border-radius: 24px; }
.practice-catalog { margin-top: 10px; }
.practice-catalog h2 { font-size: 34px; margin-bottom: 15px; }
.practice-domains { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.practice-domain {
  min-height: 74px; display: grid; align-items: center; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line); background: white; border-radius: 11px; box-shadow: var(--shadow);
}
.practice-domain:hover { border-color: #ad96eb; }
.practice-domain strong { display: block; font-size: 15px; }
.practice-domain small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.practice-domain > svg { color: var(--purple); }
.fine-print { font-size: 12px; margin-top: 15px; }
.quiz-shell { max-width: 850px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.quiz-top .tiny { flex: none; }
.quiz-card { margin-top: 16px; padding: clamp(18px, 4vw, 36px); }
.quiz-card h1 { font-size: clamp(24px, 3.6vw, 40px); line-height: 1.16; letter-spacing: -.042em; margin: 9px 0 18px; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { margin-bottom: 10px; padding: 0; font-size: 14px; color: var(--body); }
.options { display: grid; gap: 9px; }
.option {
  display: grid; grid-template-columns: 17px 25px minmax(0, 1fr); align-items: start; gap: 10px;
  padding: 12px; background: #fcfbff; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; line-height: 1.45; font-size: 14px;
}
.option:has(input:checked) { border-color: #9f81e7; background: #f4eeff; }
.option:hover:has(input:enabled) { border-color: #9f81e7; }
.option:has(input:disabled) { cursor: default; }
.option.option-correct { background: #eef8f1; border-color: #a9d1b8; }
.option.option-wrong { background: #fff3ef; border-color: #e9b6a6; }
.option input { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--purple); }
.option-letter { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 5px; background: #eee8fa; color: var(--deep); font: 750 12px/1 ui-monospace, Consolas, monospace; }
.option-title { font-weight: 650; }
.option small { display: block; margin-top: 4px; color: var(--body); font-size: 13px; }
.form-error { margin: 12px 0; color: #8f3327; font-size: 13px; }
.form-error:empty { margin-top: 0; }
.feedback { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0; padding: 11px 13px; border-radius: 8px; font-size: 14px; }
.feedback.good { color: #235b38; background: #e8f5ec; }
.feedback.wrong { color: #83392c; background: #fff1eb; }
.results h1 { margin-bottom: 5px; }
.results h2 { font-size: 17px; margin-top: 17px; }
.results ul { padding-left: 20px; }
.results li { margin-bottom: 8px; color: var(--deep); }
.results li a:hover { text-decoration: underline; }
.results .actions { margin-top: 20px; }

@media (max-width: 1020px) {
  .top-inner, .shell, .footer { width: calc(100% - 44px); }
  .hero-copy { padding-left: 33px; }
  .study { grid-template-columns: 222px minmax(0, 1fr); gap: 15px; }
  .lesson { padding: 21px; }
  .graph { padding-inline: 12px; gap: 18px; }
  .graph:is(.loop, .flow) .node:not(.node-4)::after { left: calc(100% + 1px); }
}
@media (max-width: 760px) {
  .top-inner, .shell, .footer { width: calc(100% - 32px); }
  .top-inner { gap: 10px; min-height: 63px; grid-template-columns: 1fr auto; }
  .guide { display: none; }
  .shell { margin-top: 18px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); }
  .hero-copy { padding: 24px 0 25px 23px; }
  .hero h1 { font-size: clamp(36px, 7.4vw, 56px); }
  .hero p { font-size: 14px; }
  .hero-art { padding-right: 9px; }
  .study { grid-template-columns: minmax(0, 1fr); }
  .domains { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .domain.active { grid-row: span 2; }
  .sidebar { padding: 11px; }
  .practice-hero { padding: 28px; }
}
@media (max-width: 500px) {
  .top-inner, .shell, .footer { width: calc(100% - 24px); }
  .brand { font-size: 14px; gap: 6px; }
  .brand img { width: 29px; height: 29px; }
  .brand small { font-size: 8px; letter-spacing: .05em; }
  .top-nav { gap: 1px; }
  .top-nav a { font-size: 12px; padding: 8px 9px; }
  .hero { grid-template-columns: 1fr; border-radius: 16px; }
  .hero-copy { padding: 20px 17px 0; }
  .hero h1 { margin-block: 12px; }
  .hero .actions { margin-top: 15px; }
  .hero-art { width: min(74%, 270px); margin: -5px auto -9px; padding: 0; }
  .overview-strip { gap: 10px; flex-wrap: wrap; font-size: 11px; padding-block: 12px; }
  .overview-strip svg { width: 13px; margin: 0; }
  .lesson { padding: 15px; }
  .domain-link { font-size: 12px; gap: 5px; padding: 5px; }
  .domain-icon { width: 26px; height: 26px; }
  .domain-icon svg { width: 15px; }
  .chapter-links { margin-left: 13px; padding-left: 5px; }
  .diagram-heading .tiny { font-size: 10px; }
  .graph:is(.loop, .flow) { grid-template-columns: minmax(0, 1fr); max-width: 290px; gap: 13px; padding: 14px 30px 15px 14px; }
  .graph:is(.loop, .flow) .node { min-height: 41px; flex-direction: row; justify-content: flex-start; align-items: center; padding: 6px 8px; }
  .graph:is(.loop, .flow) .node:not(.node-4)::after { content: "↓"; top: calc(100% + 6px); left: calc(50% - 8px); }
  .loop-back { height: auto; right: 14px; left: 40%; top: 34px; bottom: 34px; border: 1px dashed #9c80ce; border-left: 0; border-radius: 0 6px 6px 0; }
  .loop-back::before { left: auto; right: 14px; top: -4px; transform: rotate(-90deg); }
  .loop-back span { display: none; }
  .node { font-size: 11px; padding: 6px; }
  .graph.branch { gap: 10px; }
  .branch:not(.merge)::before { top: 103px; }
  .branch:not(.merge) .node:not(.node-1)::before { height: 11px; }
  .practice-domains { grid-template-columns: 1fr; }
  .practice-hero { padding: 23px 17px; border-radius: 16px; }
  .quiz-top .eyebrow { font-size: 9px; }
  .option { grid-template-columns: 17px 20px minmax(0, 1fr); gap: 6px; }
  .option-letter { width: 20px; }
  .footer { flex-direction: column; margin-top: 25px; }
}
