/* SAII Learn. Design system D (Artem): Geist, paper + ink, indigo only for actions and "you are here",
   one spark per screen, level colours only for levels, white cards without shadows, glass only on floating bars,
   rainbow only on the AI tutor ring and on certificates. */
/* Geist, self-hosted (SIL OFL, web/fonts/LICENSE.txt): no request to Google. Only 400/500/600 exist, so 700 (b, strong) maps to 600 without faux bold. */
@font-face { font-family: 'Geist'; src: url('../fonts/geist-400.woff2') format('woff2'); font-weight: 100 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/geist-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/geist-600.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('../fonts/geist-mono-400.woff2') format('woff2'); font-weight: 100 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('../fonts/geist-mono-500.woff2') format('woff2'); font-weight: 500 900; font-style: normal; font-display: swap; }
:root {
  --bg: #F4F4F6; --sf: #FFFFFF; --sf2: #E9E9EE; --line: #DCDDE3; --ink: #0B0C10; --ink2: #55575F; --ink3: #6B6D75;
  --ind: #3D3BF3; --ind-h: #2E2CC9; --ind-s: #ECECFE; --on-ind: #FFFFFF; --spark: #C8F25A; --card: #0B0C10; --on-card: #FFFFFF; --on-card2: #9A9CA6;
  --l1: #2E7D46; --l2: #C2560F; --l3: #C42B37; --l4: #6E3A9A; --l5: #147A7C; --ok: #2E7D46; --bad: #C42B37;
  --glass: rgba(255,255,255,.72); --glass-edge: rgba(255,255,255,.9); --code-bg: #0B0C10; --code-ink: #E9E9EE;
  --r: 22px; --r-s: 14px; --wrap: 1180px; --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0C10; --sf: #15161B; --sf2: #1F2128; --line: #2A2C34; --ink: #F4F4F6; --ink2: #B4B6BE; --ink3: #8E909A;
  --ind: #5250F5; --ind-h: #6F6DFF; --ind-s: #24234D; --card: #1F2128; --on-card2: #B4B6BE;
  --l1: #4CC274; --l2: #F08A3E; --l3: #F2606B; --l4: #B184DD; --l5: #36C2C4; --ok: #4CC274; --bad: #F2606B;
  --glass: rgba(21,22,27,.72); --glass-edge: rgba(255,255,255,.1); --code-bg: #06070A;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
::selection { background: var(--ind); color: #fff; }
a { color: var(--ind); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ind); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; text-wrap: balance; }
h1 { font-size: clamp(36px, 5.2vw, 64px); letter-spacing: -0.035em; }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3 { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
.grey { color: var(--ink3); }
.muted { color: var(--ink2); }
.mono { font: 500 12.5px/1.4 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* layout */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.page { padding: 104px 0 120px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.sec { margin-top: 64px; }
.sec > h2 { margin-bottom: 20px; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink2); max-width: 62ch; margin-top: 14px; }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .page { padding: 84px 0 132px; } .sec { margin-top: 44px; } }

/* cards, buttons, chips */
.card { background: var(--sf); border-radius: var(--r); padding: 24px; }
.card.dark { background: var(--card); color: var(--on-card); }
.card.dark .muted { color: var(--on-card2); }
.card.link { display: block; color: inherit; text-decoration: none; transition: transform .18s cubic-bezier(.22,1,.36,1); }
.card.link:hover { transform: translateY(-2px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--sf2); color: var(--ink); font-weight: 500; font-size: 15.5px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; transition: transform .16s cubic-bezier(.22,1,.36,1), background-color .16s; }
.btn:hover { transform: translateY(-1px); } .btn:active { transform: scale(.97); }
.btn.primary { background: var(--ind); color: var(--on-ind); } .btn.primary:hover { background: var(--ind-h); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.white { background: var(--sf); }
.btn.s { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.xs { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; } .btn.icon.s { width: 40px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--sf2); font-size: 12.5px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.chip.spark { background: var(--spark); color: #0B0C10; font-weight: 600; }
.chip.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.chip.on { background: var(--ink); color: var(--bg); }
button.chip { border: 0; cursor: pointer; height: 36px; padding: 0 14px; font-size: 14px; }
.lvl { --c: var(--l1); display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); letter-spacing: .04em; color: var(--c); text-transform: uppercase; }
.lvl::before { content: ""; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--c); }
.lvl.l2 { --c: var(--l2); } .lvl.l3 { --c: var(--l3); } .lvl.l4 { --c: var(--l4); } .lvl.l5 { --c: var(--l5); }
.patch { --c: var(--l1); --ps: 54px; width: var(--ps); height: var(--ps); flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 600 calc(var(--ps) * .3) var(--font); letter-spacing: -0.02em; color: var(--ink); background: var(--sf); box-shadow: inset 0 0 0 calc(var(--ps) * .085) var(--c); position: relative; }
.patch::after { content: ""; position: absolute; inset: calc(var(--ps) * .16); border-radius: 50%; border: 1px dashed var(--c); opacity: .55; }
.patch.l2 { --c: var(--l2); } .patch.l3 { --c: var(--l3); } .patch.l4 { --c: var(--l4); } .patch.l5 { --c: var(--l5); }
.patch.q { --c: var(--ind); background: var(--ind); color: #fff; } .patch.q::after { border-color: rgba(255,255,255,.6); }
.patch.here { outline: 3px solid var(--ind); outline-offset: 4px; }
.bars { display: inline-flex; align-items: flex-end; gap: 4px; height: 24px; }
.bars i { display: block; width: 5px; height: 100%; border-radius: 1px; background: var(--line); }
.bars i.d { background: var(--ink); } .bars i.c { background: var(--ind); }
.bars.s { height: 16px; gap: 3px; } .bars.s i { width: 3px; }
.bars.l { height: 34px; gap: 6px; } .bars.l i { width: 7px; }
.card.dark .bars i { background: rgba(255,255,255,.22); } .card.dark .bars i.d { background: #fff; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.input, .textarea, .select { width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: var(--r-s); background: var(--sf2); color: var(--ink); outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s; }
.input:focus, .textarea:focus, .select:focus { box-shadow: inset 0 0 0 1.5px var(--ind); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.card .input, .card .textarea, .card .select { background: var(--bg); }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.empty { padding: 44px 24px; text-align: center; color: var(--ink2); }
.toast { position: fixed; left: 50%; bottom: 108px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; animation: rise .25s cubic-bezier(.22,1,.36,1); max-width: calc(100vw - 32px); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* glass + nav */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); box-shadow: inset 0 1px 0 var(--glass-edge), 0 12px 32px -10px rgba(11,12,16,.16); }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--sf); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.nav { position: fixed; top: 14px; left: 0; right: 0; z-index: 60; pointer-events: none; }
.nav-in { pointer-events: auto; max-width: var(--wrap); margin: 0 auto; height: 60px; border-radius: 999px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 22px; }
.nav .wrap { padding: 0 12px; }
.logo { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 21px; letter-spacing: -0.04em; color: var(--ink); text-decoration: none; margin-right: 14px; }
.logo i { display: block; width: 4.5px; height: 15px; background: var(--ink); margin-left: 1.5px; } .logo i + i { background: var(--ind); }
.logo small { font: 500 11px var(--mono); letter-spacing: .06em; color: var(--ink3); margin-left: 8px; text-transform: uppercase; }
.nav-links { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav-links a { height: 40px; padding: 0 13px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); } .nav-links a[aria-current] { color: var(--ink); background: var(--sf2); }
.nav-tools { display: flex; align-items: center; gap: 4px; }
.nav-tools .btn { background: transparent; } .nav-tools .btn:hover { background: var(--sf2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ind-s); color: var(--ind); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
:root[data-theme="dark"] .avatar { color: #fff; }
.tabbar { display: none; position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 60; height: 66px; border-radius: 999px; padding: 0 5px; align-items: center; }
.tabbar a { flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: 10.5px; font-weight: 500; }
.tabbar a[aria-current] { color: var(--ind); font-weight: 600; background: color-mix(in srgb, var(--ind) 10%, transparent); }
@media (max-width: 860px) { .nav-links, .logo small { display: none; } .nav-in { height: 54px; } .nav-tools { margin-left: auto; } .tabbar { display: flex; } }
.focus-mode .nav, .focus-mode .tabbar { display: none; }

/* home */
.hello { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; margin-top: 28px; }
.continue h2 { font-size: clamp(24px, 2.6vw, 32px); }
.event-date { font-size: 64px; font-weight: 600; letter-spacing: -0.05em; line-height: .9; }
.line5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.line5 a { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--sf); color: inherit; text-decoration: none; min-height: 150px; }
.line5 a.cur { box-shadow: inset 0 0 0 2px var(--ind); }
.line5 b { font-size: 16px; letter-spacing: -0.015em; } .line5 span { font-size: 13px; color: var(--ink2); }
.rows { background: var(--sf); border-radius: var(--r); overflow: hidden; }
.rowlink { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.rowlink:first-child { border-top: 0; } .rowlink:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.rowlink .t { flex: 1; min-width: 0; } .rowlink .t b { display: block; font-weight: 500; font-size: 15.5px; } .rowlink .t span { display: block; font-size: 13px; color: var(--ink2); margin-top: 2px; }
@media (max-width: 860px) { .hello { grid-template-columns: 1fr; } .line5 { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; } .line5 a { scroll-snap-align: start; } }

/* catalog cards */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 18px; }
.cat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ccard { display: flex; flex-direction: column; background: var(--sf); border-radius: var(--r); overflow: hidden; color: inherit; text-decoration: none; transition: transform .18s cubic-bezier(.22,1,.36,1); min-height: 100%; }
.ccard:hover { transform: translateY(-3px); }
.cover { position: relative; aspect-ratio: 16 / 7.2; background: var(--sf2); overflow: hidden; }
.cover svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cover .chip { position: absolute; left: 14px; top: 14px; background: var(--sf); color: var(--ink); }
.cover .chip.spark { left: auto; right: 14px; }
.ccard .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ccard h3 { font-size: 19px; } .ccard p { font-size: 14.5px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 10px; font: 500 12px var(--mono); color: var(--ink3); letter-spacing: .02em; }
.ccard.planned .cover { opacity: .55; } .ccard.planned h3 { color: var(--ink2); }
@media (max-width: 980px) { .cat { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 640px) { .cat { grid-template-columns: 1fr; } }

/* item page */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 18px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); }
.hero .cover { border-radius: 26px; aspect-ratio: 16 / 10; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink3); flex-wrap: wrap; } .crumbs a { color: var(--ink2); text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.checks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; } .checks svg { flex: none; margin-top: 3px; color: var(--ind); }
.facts { list-style: none; margin: 16px 0 20px; padding: 0; display: grid; gap: 12px; font-size: 15px; } .facts li { display: flex; gap: 12px; align-items: center; } .facts svg { color: var(--ink3); flex: none; }
.chapter { background: var(--sf); border-radius: var(--r); padding: 6px 0; }
.chapter > header { display: flex; align-items: center; gap: 14px; padding: 16px 22px 10px; } .chapter > header b { flex: 1; font-size: 17px; letter-spacing: -0.015em; }
.num { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--font); }
.pbar { height: 6px; border-radius: 99px; background: var(--sf2); overflow: hidden; width: 120px; } .pbar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; } .pbar.full i { background: var(--ok); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: inherit; text-decoration: none; font-size: 15px; } .lrow:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.lrow .dot { width: 18px; height: 18px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); display: inline-flex; align-items: center; justify-content: center; } .lrow.done .dot { background: var(--ink); box-shadow: none; color: var(--bg); }
.lrow span.k { margin-left: auto; font: 500 11.5px var(--mono); color: var(--ink3); white-space: nowrap; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* lesson prose and blocks */
.prose { font-size: 17px; line-height: 1.65; }
.prose > * + * { margin-top: 18px; }
.prose h3 { font-size: 23px; margin-top: 36px; scroll-margin-top: 96px; } .prose h4 { font-size: 18px; margin-top: 26px; letter-spacing: -0.01em; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 0; } .prose li + li { margin-top: 6px; } .prose li::marker { color: var(--ink3); }
.prose code { font: 500 .86em var(--mono); background: var(--sf2); padding: 2px 6px; border-radius: 6px; }
.prose a { font-weight: 500; }
.prose img { max-width: 100%; border-radius: var(--r-s); }
.prose blockquote { margin: 18px 0 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--line); color: var(--ink2); }
pre.code { position: relative; margin: 18px 0 0; padding: 18px 20px; border-radius: var(--r-s); background: var(--code-bg); color: var(--code-ink); font: 13.5px/1.65 var(--mono); overflow-x: auto; white-space: pre; tab-size: 2; }
pre.code code { background: none; padding: 0; font: inherit; color: inherit; }
.hl-c { color: #7C7F8A; } .hl-s { color: #C8F25A; } .hl-n { color: #F0A46B; } .hl-k { color: #9B9AFF; }
.copy { position: absolute; top: 10px; right: 10px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; font: 500 12px var(--font); opacity: 0; transition: opacity .15s; } pre.code:hover .copy, .copy:focus { opacity: 1; }
.table-wrap { overflow-x: auto; margin-top: 18px; border-radius: var(--r-s); background: var(--sf); }
table { border-collapse: collapse; width: 100%; font-size: 15px; } th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; } thead th { border-top: 0; font-size: 13px; color: var(--ink3); font-weight: 500; }
.callout { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-s); background: var(--sf); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 16px; }
.callout::before { content: "Note"; font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); padding-top: 4px; grid-row: 1 / span 9; min-width: 52px; }
.callout > * { grid-column: 2; margin: 0; } .callout > * + * { margin-top: 8px; }
.callout.tip::before { content: "Tip"; } .callout.warning::before { content: "Careful"; color: var(--bad); } .callout.example::before { content: "Example"; }
.callout.key { background: var(--card); color: var(--on-card); } .callout.key::before { content: "Key"; color: var(--spark); }
:root[lang="de"] .callout::before { content: "Hinweis"; } :root[lang="de"] .callout.tip::before { content: "Tipp"; } :root[lang="de"] .callout.warning::before { content: "Achtung"; } :root[lang="de"] .callout.example::before { content: "Beispiel"; } :root[lang="de"] .callout.key::before { content: "Merke"; }
.blk { margin-top: 22px; background: var(--sf); border-radius: var(--r); padding: 22px; }
.blk > header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; } .blk > header h4 { font-size: 18px; letter-spacing: -0.015em; flex: 1; min-width: 160px; }
.tag { font: 500 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3); }
.tag.ok { color: var(--ok); } .tag.req { color: var(--ind); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; } .cmp figure { margin: 0; padding: 18px; border-radius: var(--r-s); background: var(--sf); } .cmp figure + figure { box-shadow: inset 0 0 0 1.5px var(--ind); }
.cmp figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; } .cmp figure + figure figcaption { color: var(--ind); } .cmp p { font: 13.5px/1.65 var(--mono); white-space: pre-wrap; color: var(--ink2); } .cmp figure + figure p { color: var(--ink); }
.cmp-note { margin-top: 10px; font-size: 15px; color: var(--ink2); }
@media (max-width: 700px) { .cmp { grid-template-columns: 1fr; } }
.pcard pre { margin: 0; padding: 16px; border-radius: var(--r-s); background: var(--bg); font: 13.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; } .pcard mark { background: var(--ind-s); color: inherit; border-radius: 4px; padding: 1px 4px; }
.opts { display: grid; gap: 8px; } .opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-radius: var(--r-s); background: var(--bg); font-size: 15.5px; line-height: 1.45; box-shadow: inset 0 0 0 1.5px transparent; }
.opt:hover { box-shadow: inset 0 0 0 1.5px var(--line); } .opt.sel { box-shadow: inset 0 0 0 1.5px var(--ind); } .opt.right { box-shadow: inset 0 0 0 1.5px var(--ok); } .opt.wrong { box-shadow: inset 0 0 0 1.5px var(--bad); }
.opt .mk { width: 20px; height: 20px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink3); margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; color: #fff; } .opt.multi .mk { border-radius: 6px; } .opt.sel .mk { background: var(--ind); box-shadow: none; } .opt.right .mk { background: var(--ok); box-shadow: none; } .opt.wrong .mk { background: var(--bad); box-shadow: none; }
.opt small { display: block; margin-top: 6px; font-size: 14px; color: var(--ink2); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; } .steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 15.5px; } .steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--mono); }
.ticks { display: grid; gap: 4px; } .tick { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 15.5px; cursor: pointer; } .tick input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ind); flex: none; }
.crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; } .crit li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; } .crit .mk { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); display: inline-flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px; } .crit li.pass .mk { background: var(--ok); box-shadow: none; } .crit li.fail .mk { background: var(--bad); box-shadow: none; } .crit small { display: block; color: var(--ink2); margin-top: 2px; } .crit q { color: var(--ink2); font-style: italic; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; } .fcard { min-height: 130px; padding: 18px; border: 0; border-radius: var(--r-s); background: var(--bg); text-align: left; font-size: 15.5px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; } .fcard.open { background: var(--card); color: var(--on-card); }
details.rev { margin-top: 22px; background: var(--sf); border-radius: var(--r-s); padding: 0 18px; } details.rev summary { cursor: pointer; padding: 16px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; } details.rev summary::after { content: "+"; font: 400 20px var(--mono); color: var(--ink3); } details.rev[open] summary::after { content: "−"; } details.rev .prose { padding-bottom: 18px; font-size: 16px; }
.gloss { display: grid; gap: 10px; margin: 0; } .gloss div { display: grid; grid-template-columns: 180px 1fr; gap: 14px; font-size: 15.5px; } .gloss dt { font-weight: 600; } .gloss dd { margin: 0; color: var(--ink2); } @media (max-width: 640px) { .gloss div { grid-template-columns: 1fr; gap: 2px; } }
.chart svg { width: 100%; height: auto; display: block; } .chart figcaption { font-size: 13px; color: var(--ink3); margin-top: 10px; }
.flow { overflow-x: auto; } .flow svg { display: block; min-width: 560px; width: 100%; height: auto; } .flow .data { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--code-bg); color: var(--code-ink); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; min-height: 44px; }

/* code exercise + ai task */
.ws { display: grid; gap: 10px; }
.editor { position: relative; border-radius: var(--r-s); background: var(--code-bg); min-height: 180px; font: 13.5px/1.65 var(--mono); }
.editor pre, .editor textarea { margin: 0; padding: 16px 16px 16px 52px; font: inherit; white-space: pre; tab-size: 2; border: 0; width: 100%; min-height: 180px; overflow: auto; }
.editor pre { color: var(--code-ink); pointer-events: none; position: absolute; inset: 0; } .editor textarea { position: relative; display: block; background: transparent; color: transparent; caret-color: #fff; resize: vertical; outline: none; }
.editor .gut { position: absolute; left: 0; top: 0; bottom: 0; width: 40px; padding: 16px 8px 0 0; text-align: right; color: #555864; user-select: none; overflow: hidden; white-space: pre; }
.console { border-radius: var(--r-s); background: var(--code-bg); color: var(--code-ink); font: 12.5px/1.6 var(--mono); padding: 12px 16px; min-height: 56px; max-height: 240px; overflow: auto; white-space: pre-wrap; } .console .err { color: #F2606B; } .console .ok { color: #C8F25A; } .console .dim { color: #7C7F8A; }
.ws-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .ws-bar .sp { flex: 1; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.msgs { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; max-height: 420px; padding: 2px; }
.msg { max-width: 88%; padding: 11px 15px; border-radius: 18px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; } .msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; } .msg.ai { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; } .blk .msg.ai, .card .msg.ai { background: var(--bg); }
.msg.ai.wait::after { content: "▍"; animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ai-ring { position: relative; isolation: isolate; border-radius: 999px; }
.ai-ring::before { content: ""; position: absolute; inset: -1.5px; padding: 1.5px; border-radius: inherit; background: conic-gradient(from var(--a), #3D3BF3, #8B8AFF, #6FD6F0, #C8F25A, #FF9FD6, #3D3BF3); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 5s linear infinite; pointer-events: none; }
.ai-ring::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; background: conic-gradient(from var(--a), #3D3BF3, #8B8AFF, #6FD6F0, #C8F25A, #FF9FD6, #3D3BF3); filter: blur(14px); opacity: .22; z-index: -1; animation: spin 5s linear infinite; pointer-events: none; }
@keyframes spin { to { --a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ai-ring::before, .ai-ring::after { animation: none; } .btn, .card.link, .ccard { transition: none; } html { scroll-behavior: auto; } }
.ask { display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 16px; border-radius: 26px; background: var(--sf); }
.ask textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none; font-size: 15px; line-height: 1.45; padding: 9px 0; max-height: 140px; }
.ask .send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--ind); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.sugg { display: flex; gap: 8px; flex-wrap: wrap; } .sugg button { border: 0; background: var(--bg); border-radius: 999px; padding: 8px 12px; font-size: 13.5px; text-align: left; color: var(--ink2); } .sugg button:hover { color: var(--ink); }

/* lesson shells */
.lesson-head h1 { font-size: clamp(32px, 4vw, 48px); } .lesson-head .lead { margin-top: 12px; }
.lnav { display: flex; gap: 10px; margin-top: 44px; align-items: center; } .lnav .sp { flex: 1; }
.side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 4px; }
.side h5 { margin: 18px 10px 6px; font: 500 11.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3); }
.side a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-size: 14.5px; line-height: 1.3; }
.side a:hover { color: var(--ink); } .side a[aria-current] { background: var(--sf); color: var(--ink); font-weight: 500; }
.side .dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); } .side a.done .dot { background: var(--ink); box-shadow: none; } .side a[aria-current] .dot { box-shadow: inset 0 0 0 4px var(--ind); background: none; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--ink2); text-decoration: none; font-size: 13.5px; } .toc a:hover { color: var(--ink); border-color: var(--ink); }
/* A: reader */
.shell-a { display: grid; grid-template-columns: 264px minmax(0, 1fr) 232px; gap: 36px; max-width: 1320px; margin: 0 auto; padding: 100px 20px 120px; }
.shell-a .main { max-width: 760px; width: 100%; margin: 0 auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 22px; padding-bottom: 2px; } .tabs a { flex: none; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: 14px; font-weight: 500; } .tabs a[aria-current] { background: var(--ink); color: var(--bg); }
@media (max-width: 1180px) { .shell-a { grid-template-columns: 240px minmax(0, 1fr); } .shell-a .rail { display: none; } }
@media (max-width: 860px) { .shell-a { grid-template-columns: 1fr; padding: 84px 16px 150px; } .shell-a .side { display: none; } }
/* B: workbench */
.shell-b { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); height: 100vh; padding-top: 58px; }
.b-top { position: fixed; top: 0; left: 0; right: 0; height: 58px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.b-top .title { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .b-top .sp { flex: 1; }
.b-left { overflow-y: auto; padding: 30px 34px 80px; } .b-left .main { max-width: 640px; margin: 0 auto; }
.b-right { background: var(--code-bg); color: #E9E9EE; display: flex; flex-direction: column; min-height: 0; }
.b-tabs { display: flex; gap: 2px; padding: 8px 10px 0; } .b-tabs button { height: 38px; padding: 0 14px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: #9A9CA6; font-size: 13.5px; font-weight: 500; } .b-tabs button[aria-selected="true"] { background: #15161B; color: #fff; }
.b-pane { flex: 1; min-height: 0; overflow-y: auto; background: #15161B; padding: 18px; }
.b-pane { --sf: #1F2128; --bg: #0B0C10; --sf2: #2A2C34; --ink: #F4F4F6; --ink2: #B4B6BE; --ink3: #8E909A; --line: #2A2C34; --ind-s: #24234D; color: var(--ink); }
.b-pane .blk { margin-top: 0; background: transparent; padding: 0; } .b-pane .blk + .blk { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.b-pane .editor { min-height: 260px; } .b-pane .editor pre, .b-pane .editor textarea { min-height: 260px; }
.openws { margin-top: 22px; display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-s); background: var(--sf); border: 0; width: 100%; text-align: left; } .openws b { display: block; font-size: 15.5px; } .openws span { font-size: 13px; color: var(--ink2); } .openws.cur { box-shadow: inset 0 0 0 1.5px var(--ind); }
.b-switch { display: none; }
@media (max-width: 900px) { .shell-b { grid-template-columns: 1fr; height: auto; min-height: 100vh; padding-bottom: 76px; } .shell-b[data-pane="work"] .b-left, .shell-b[data-pane="read"] .b-right { display: none; } .b-left { padding: 22px 16px 60px; } .b-right { min-height: calc(100vh - 134px); } .b-switch { display: flex; position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 55; height: 56px; border-radius: 999px; padding: 5px; gap: 4px; } .b-switch button { flex: 1; border: 0; border-radius: 999px; background: transparent; font-weight: 500; font-size: 14.5px; color: var(--ink2); } .b-switch button[aria-selected="true"] { background: var(--ink); color: var(--bg); } }
/* C: focus */
.shell-c { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; max-width: 1120px; margin: 0 auto; padding: 96px 20px 190px; }
.shell-c .main { max-width: 680px; width: 100%; margin: 0 auto; } .shell-c .prose { font-size: 18px; }
.c-top { position: fixed; top: 14px; left: 0; right: 0; z-index: 55; pointer-events: none; } .c-top > div { pointer-events: auto; max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 12px; }
.c-top .btn { background: var(--sf); } .c-top .sp { flex: 1; }
.c-dock { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 55; pointer-events: none; } .c-dock > div { pointer-events: auto; max-width: 720px; margin: 0 auto; padding: 10px; border-radius: 30px; display: flex; flex-direction: column; gap: 10px; width: calc(100% - 24px); }
.c-dock .rowx { display: flex; gap: 8px; align-items: center; } .c-dock .rowx .btn.ink { flex: 1; }
.c-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 220px); }
.c-aside .card { padding: 20px; } .c-aside .msgs { max-height: 300px; }
@media (max-width: 1040px) { .shell-c { grid-template-columns: 1fr; } .c-aside { display: none; } }
/* drawers and dialogs */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(11,12,16,.42); display: flex; justify-content: flex-end; animation: fade .2s; } @keyframes fade { from { opacity: 0; } }
.drawer { width: min(440px, 100%); height: 100%; background: var(--bg); padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; animation: slide .28s cubic-bezier(.22,1,.36,1); } @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer.left { margin-right: auto; animation-name: slideL; } @keyframes slideL { from { transform: translateX(-40px); opacity: 0; } }
.scrim.center { align-items: center; justify-content: center; padding: 16px; } .dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; animation: rise2 .25s cubic-bezier(.22,1,.36,1); } @keyframes rise2 { from { transform: translateY(14px); opacity: 0; } }
.dialog.wide { width: min(720px, 100%); }
@media (max-width: 640px) { .scrim.center { align-items: flex-end; padding: 0; } .dialog { border-radius: 28px 28px 0 0; width: 100%; } }
.xhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .xhead h3 { font-size: 22px; }
.ask-fab { position: fixed; right: 22px; bottom: 26px; z-index: 50; } .ask-fab .btn { background: var(--sf); height: 52px; padding: 0 20px 0 16px; }
@media (max-width: 860px) { .ask-fab { bottom: 94px; right: 14px; } }

/* roadmap */
.quiz { max-width: 640px; } .quiz h2 { font-size: clamp(24px, 3vw, 34px); }
.route { position: relative; display: grid; gap: 10px; } .rstep { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--sf); border-radius: 18px; padding: 14px 16px; } .rstep.known { opacity: .5; }
.rstep .n { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 500 13px var(--mono); background: var(--bg); } .rstep.done .n { background: var(--ink); color: var(--bg); }
.rstep b { display: block; font-size: 15.5px; font-weight: 500; } .rstep small { display: block; color: var(--ink2); font-size: 13px; margin-top: 2px; } .rstep .acts { display: flex; gap: 4px; } .rstep .acts .btn { background: transparent; } .rstep .acts .btn:hover { background: var(--sf2); }
.lvhead { display: flex; align-items: center; gap: 14px; margin: 30px 0 12px; } .lvhead h3 { font-size: 22px; } .lvhead p { font-size: 14px; color: var(--ink2); }
.fields { display: flex; gap: 8px; flex-wrap: wrap; }

/* blog */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } .post { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--sf); border-radius: var(--r); color: inherit; text-decoration: none; min-height: 220px; } .post h3 { font-size: 21px; } .post p { color: var(--ink2); font-size: 15px; } .post.big { grid-column: span 2; background: var(--card); color: var(--on-card); } .post.big h3 { font-size: clamp(26px, 3vw, 36px); } .post.big p { color: var(--on-card2); } .post.big .meta { color: var(--on-card2); }
@media (max-width: 980px) { .posts { grid-template-columns: 1fr 1fr; } } @media (max-width: 640px) { .posts { grid-template-columns: 1fr; } .post.big { grid-column: auto; } }
.article { max-width: 720px; margin: 0 auto; } .article h1 { font-size: clamp(32px, 4.6vw, 52px); margin-top: 14px; } .srcs { font-size: 14px; color: var(--ink2); } .srcs a { color: var(--ink2); }

/* certificate */
.holo { position: relative; overflow: hidden; border-radius: clamp(14px, 2.6vw, 28px); box-shadow: 0 40px 80px -40px rgba(61,59,243,.5); } .holo svg, .holo img { display: block; width: 100%; height: auto; }
.holo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 46%, transparent 58%); background-size: 250% 100%; background-position: 100% 0; transition: background-position 1.3s cubic-bezier(.22,1,.36,1); pointer-events: none; } .holo:hover::after { background-position: 0 0; }
.stars { display: inline-flex; gap: 2px; } .stars button { border: 0; background: none; padding: 2px; color: var(--line); } .stars button.on { color: var(--ink); }
.art { aspect-ratio: 16 / 9; border-radius: var(--r-s); background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--ink3); overflow: hidden; }
.proto { position: fixed; left: 14px; bottom: 14px; z-index: 70; display: flex; gap: 4px; padding: 5px; border-radius: 999px; font-size: 12.5px; } .proto button { border: 0; background: transparent; height: 30px; padding: 0 11px; border-radius: 999px; color: var(--ink2); font-weight: 500; } .proto button[aria-pressed="true"] { background: var(--ink); color: var(--bg); } .proto span { align-self: center; padding: 0 6px 0 10px; font: 500 11px var(--mono); color: var(--ink3); letter-spacing: .05em; }
@media (max-width: 860px) { .proto { display: none; } }  /* on phones the layout is set in the profile */
.wdg { display: grid; gap: 14px; } .wdg .ctl { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; } .wdg label { display: inline-flex; gap: 8px; align-items: center; } .wdg input[type=range] { accent-color: var(--ind); } .wdg .out { background: var(--bg); border-radius: var(--r-s); padding: 14px; } .wdg table { font-size: 14px; } .wdg .big { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
