/* Fonts self-hosted, same files as the landing */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 800; font-display: swap;
    src: url('/assets/fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 800; font-display: swap;
    src: url('/assets/fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
    src: url('/assets/fonts/jbm-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --fs-s: .875rem; --fs-m: .9375rem; --fs-base: 1rem; --fs-l: 1.125rem; --fs-h2: 1.375rem;
    --as-bg: #0d1117; --as-surface: #161b22; --as-raised: #1c2333; --as-border: #30363d;
    --as-muted: #8b949e; --as-text: #c9d1d9; --as-bright: #f0f6fc;
    --as-brand: #58a6ff; --as-accent: #f78166; --as-online: #3fb950; --as-warning: #d29922; --as-danger: #f85149;
    --measure: 68ch;
    --as-text2: #d5dbe5; --as-text3: #b8bfcc; --line2: #4a5360; --line3: #3d4650; --on-brand: #04101f; --on-accent: #1a0d09; --bar-bg: rgba(13,17,23,.92);
    --con-bg: #070b12; --con-bar: #121a2b; --con-text: #e6edf6; --con-muted: #9fb0c6; --con-line: #26344d; --pc: #5aa7ff; --srv: #ff9a6b;
    --font-ui: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; --font-read: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color-scheme: dark;
}
/* Light theme: follows the system, or the manual choice stored by the toggle (data-theme). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --as-bg: #e6ebf2; --as-surface: #fcfdfe; --as-raised: #edf1f7; --as-border: #c9d1de;
    --as-muted: #41505f; --as-text: #243040; --as-bright: #0b1220;
    --as-brand: #0b5cc4; --as-accent: #b4410f; --as-online: #1a7f37; --as-warning: #8a5a00; --as-danger: #c62828;
    --as-text2: #2c3a4c; --as-text3: #41505f; --line2: #aab4c2; --line3: #bcc5d2; --on-brand: #ffffff; --on-accent: #ffffff; --bar-bg: rgba(230,235,242,.94);
    --con-bg: #0e1624; --con-bar: #172238;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
    --as-bg: #e6ebf2; --as-surface: #fcfdfe; --as-raised: #edf1f7; --as-border: #c9d1de;
    --as-muted: #41505f; --as-text: #243040; --as-bright: #0b1220;
    --as-brand: #0b5cc4; --as-accent: #b4410f; --as-online: #1a7f37; --as-warning: #8a5a00; --as-danger: #c62828;
    --as-text2: #2c3a4c; --as-text3: #41505f; --line2: #aab4c2; --line3: #bcc5d2; --on-brand: #ffffff; --on-accent: #ffffff; --bar-bg: rgba(230,235,242,.94);
    --con-bg: #0e1624; --con-bar: #172238;
    color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body { background: var(--as-bg); color: var(--as-text); font: 400 var(--fs-base)/1.6 var(--font-ui); }
h1, h2, h3, .brand, .btn, .node, .lv-title { font-family: var(--font-ui); }
.prose, .page-head .lede, .intro .lede { font-family: var(--font-read); }
.prose { font-size: clamp(1rem, .82rem + .26vw, 1.0625rem); line-height: 1.7; }
.page-head .lede, .intro .lede { line-height: 1.6; }
a { color: var(--as-brand); text-underline-offset: 3px; }
a:hover { color: var(--as-bright); }
:focus-visible { outline: 2px solid var(--as-brand); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--as-brand); color: var(--on-brand); padding: .5rem 1rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 1rem; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 100; background: var(--bar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--as-border); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.4rem; }
.brand { font-weight: 700; color: var(--as-bright); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--as-brand); }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; font-size: var(--fs-m); }
.topbar nav a { color: var(--as-muted); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--as-bright); border-bottom-color: var(--as-border); }
.topbar nav a[aria-current] { border-bottom-color: var(--as-brand); }
.topbar nav a.cta { color: var(--as-accent); background: transparent; padding: .4rem 1rem; border-radius: 8px; border: 1px solid var(--as-accent); font-weight: 600; }
.topbar nav a.cta:hover { color: var(--on-accent); background: var(--as-accent); }

/* Page header (index and articles) */
.page-head { padding: 3rem 0 1.5rem; }
.page-head h1 { color: var(--as-bright); font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; max-width: 22ch; }
.page-head .lede { margin-top: .9rem; max-width: 60ch; color: var(--as-text); font-size: var(--fs-l); }

/* Article layout: text + sticky summary */
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-bottom: 4rem; }
@media (min-width: 1024px) { .article { grid-template-columns: minmax(0, var(--measure)) 16rem; justify-content: center; column-gap: 3.5rem; } }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { color: var(--as-bright); font-size: var(--fs-h2); line-height: 1.25; letter-spacing: -.01em; margin-top: 3rem; display: flex; gap: .8rem; align-items: baseline; }
.prose h2 .n { flex: none; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-m); font-weight: 500; color: var(--as-brand); border: 1px solid var(--as-border); border-radius: 6px; padding: .05rem .5rem; transform: translateY(-.1rem); }
.prose h3 { color: var(--as-bright); font-size: var(--fs-l); margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .35rem; }
.prose strong { color: var(--as-bright); font-weight: 600; }
.prose code { font-family: 'JetBrains Mono', monospace; font-size: .9em; background: var(--as-raised); border: 1px solid var(--as-border); border-radius: 4px; padding: .08em .35em; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Summary */
.toc { font-size: var(--fs-m); }
.toc summary { cursor: pointer; color: var(--as-bright); font-weight: 600; padding: .6rem 0; }
.toc ol { list-style: none; border-left: 1px solid var(--as-border); }
.toc a { display: block; padding: .3rem .9rem; color: var(--as-muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--as-bright); }
.toc a[aria-current="true"] { color: var(--as-bright); border-left-color: var(--as-brand); }
@media (min-width: 1024px) { .toc { position: sticky; top: 5rem; align-self: start; } .toc summary { pointer-events: none; list-style: none; } .toc summary::-webkit-details-marker { display: none; } }
@media (max-width: 1023px) { .toc { border: 1px solid var(--as-border); border-radius: 10px; background: var(--as-surface); padding: 0 1rem .4rem; } }

/* Command blocks: a console panel whose colour says which machine runs it (blue = your computer, orange = the server). */
.cmd { margin-top: 1.2rem; border: 1px solid var(--con-line); border-radius: 10px; background: var(--con-bg); overflow: hidden; --m: var(--con-muted); }
.cmd.pc { --m: var(--pc); }
.cmd.srv { --m: var(--srv); }
.cmd figcaption { display: flex; align-items: center; gap: .55rem; padding: .5rem .9rem; font-size: var(--fs-m); font-weight: 500; color: var(--m); background: var(--con-bar); border-bottom: 1px solid var(--con-line); border-left: 4px solid var(--m); font-family: var(--font-ui); }
.cmd-body { position: relative; }
.cmd pre { overflow-x: auto; padding: .95rem 5.4rem .95rem 1rem; font: 400 var(--fs-m)/1.65 'JetBrains Mono', ui-monospace, monospace; color: var(--con-text); tab-size: 4; border-left: 4px solid var(--m); }
.cmd pre code { white-space: pre; }
.cmd .copy { position: absolute; top: .55rem; right: .55rem; font: 500 var(--fs-s) var(--font-ui); color: var(--con-text); background: #1d2a44; border: 1px solid #38486a; border-radius: 6px; padding: .35rem .75rem; min-height: 32px; cursor: pointer; }
.cmd .copy:hover { border-color: var(--con-muted); }
.cmd .copy.ok { color: #6ee7a0; border-color: #6ee7a0; }
.out { border-top: 1px dashed var(--con-line); border-left: 4px solid var(--con-line); }
.out-label { display: block; padding: .5rem 1rem 0; font-size: var(--fs-s); color: var(--con-muted); font-family: var(--font-ui); }
.out pre { padding: .35rem 1rem .95rem; color: var(--con-muted); font-size: var(--fs-s); border-left: 0; }

/* Callouts: border carries the severity */
.call { border-left: 3px solid var(--as-brand); background: var(--as-surface); border-radius: 0 8px 8px 0; padding: .8rem 1rem; font-size: var(--fs-m); }
.call strong { margin-right: .35rem; }
.call.warn { border-left-color: var(--as-warning); }
.call.fail { border-left-color: var(--as-danger); }

/* Animated table (SVG) */
.tbl { margin-top: 1.4rem; border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-surface); padding: .6rem; }
.tbl svg { display: block; width: 100%; height: auto; }
.tbl text { font-family: var(--font-ui); fill: var(--as-text); }
.tbl .h { fill: var(--as-muted); font-size: var(--fs-s); }
.tbl .c { font-size: var(--fs-s); }
.tbl .t { fill: var(--as-bright); font-weight: 600; font-size: var(--fs-s); }
.tbl .grid { stroke: var(--as-border); stroke-width: 1; }
.tbl .row-bg { fill: var(--as-brand); opacity: 0; }
.tbl .bar { fill: var(--as-brand); transform-box: fill-box; transform-origin: left center; }
.tbl .dot { fill: var(--as-brand); }
.tbl.go .row-bg { animation: rowpulse 1.1s ease-out forwards; animation-delay: var(--d); }
.tbl.go .bar { animation: barfill .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d); }
@keyframes barfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rowpulse { 0% { opacity: .0; } 25% { opacity: .14; } 100% { opacity: 0; } }
.tbl-caption { margin-top: .6rem; font-size: var(--fs-m); color: var(--as-muted); }

/* Index */
.list { list-style: none; display: grid; gap: .9rem; padding: 0 0 1.5rem; }
.list a.item { display: block; text-decoration: none; border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-surface); padding: 1.1rem 1.25rem; }
.list a.item:hover { border-color: var(--as-muted); }
.list .t { display: block; color: var(--as-bright); font-weight: 600; font-size: var(--fs-h2); }
.list .d { display: block; margin-top: .25rem; color: var(--as-text); }
.list .m { display: block; margin-top: .5rem; color: var(--as-muted); font-size: var(--fs-m); }

/* Footer */
.foot { border-top: 1px solid var(--as-border); padding: 2rem 0; text-align: center; color: var(--as-text3); font-size: var(--fs-m); }
.foot a { color: var(--as-text2); }
.foot a:hover { color: var(--as-bright); }
.foot-small { margin-top: .5rem; font-size: var(--fs-m); }

@media (prefers-reduced-motion: reduce) {
    .tbl.go .row-bg, .tbl.go .bar { animation: none; }
    html { scroll-behavior: auto; }
}

/* Fixed frame + prev/next */
.frame { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-surface); padding: 1.1rem 1.25rem; margin-bottom: 2rem; }
@media (min-width: 720px) { .frame { grid-template-columns: 1fr 1fr; } }
.frame h2 { color: var(--as-bright); font-size: var(--fs-base); margin-bottom: .4rem; }
.frame ul { padding-left: 1.2rem; font-size: var(--fs-m); }
.frame li + li { margin-top: .25rem; }
.prevnext { display: grid; gap: .8rem; grid-template-columns: minmax(0, 1fr); margin-top: 3rem; }
@media (min-width: 720px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.prevnext > * { display: block; border: 1px solid var(--as-border); border-radius: 10px; padding: .8rem 1rem; text-decoration: none; color: var(--as-bright); background: var(--as-surface); }
.prevnext a:hover { border-color: var(--as-muted); }
.prevnext > * > span:first-child { display: block; color: var(--as-muted); font-size: var(--fs-s); }
.prevnext .next { text-align: right; grid-column: 2; }
.prevnext .soon-link { opacity: .6; }
@media (max-width: 719px) { .prevnext .next { grid-column: 1; text-align: left; } }
@media (min-width: 1024px) { .article .prose { grid-column: 1; grid-row: 1; } .article .toc { grid-column: 2; grid-row: 1; } }

/* Touch targets >= 24px high (WCAG 2.2 AA 2.5.8) */
.brand { display: inline-block; padding: .6rem 0; }
.topbar nav a:not(.cta) { display: inline-block; padding: .6rem 0 .5rem; }
.foot a { display: inline-block; padding: .5rem .3rem; }


.ref-soon { color: var(--as-muted); }
.ref-soon small { font-size: .9em; }
.levelmap { margin-top: 3rem; border-top: 1px solid var(--as-border); padding-top: 1.2rem; }
.levelmap h2 { color: var(--as-bright); font-size: var(--fs-base); margin: 0 0 .6rem; display: block; }
.levelmap ol { list-style: none; border-left: 1px solid var(--as-border); }
.levelmap li { padding: .3rem 0 .3rem 1rem; }
.levelmap li[aria-current] { border-left: 2px solid var(--as-brand); margin-left: -1px; }
.levelmap small { color: var(--as-muted); margin-left: .4rem; }

/* Index: learning path. Anything a beginner must read uses --as-bright or var(--as-text), never --as-muted. */
.intro, .how, .roadmap { margin-left: auto; margin-right: auto; max-width: 52rem; }
.intro { padding: 2.6rem 0 1.4rem; }
.intro h1 { color: var(--as-bright); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.intro .lede { margin-top: 1rem; font-size: var(--fs-l); color: var(--as-bright); }
.promises { list-style: none; margin-top: 1.2rem; display: grid; gap: .5rem; }
.promises li { padding-left: 1.7rem; position: relative; color: var(--as-text); }
.promises li::before { content: ""; position: absolute; left: 0; top: .5em; width: .9rem; height: .5rem; border-left: 2px solid var(--as-online); border-bottom: 2px solid var(--as-online); transform: rotate(-45deg) translateY(-30%); }
.promises strong { color: var(--as-bright); }
.start { margin-top: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
.btn { display: inline-block; background: var(--as-brand); color: var(--on-brand); font-weight: 700; text-decoration: none; padding: .95rem 1.5rem; border-radius: 10px; font-size: var(--fs-l); line-height: 1.3; }
a.btn:hover { color: var(--on-brand); filter: brightness(1.1); }
.progress { margin-top: 1rem; color: var(--as-text); }
.progress strong { color: var(--as-bright); }
.progress .bar-wrap { display: block; height: 8px; margin-top: .45rem; max-width: 22rem; border-radius: 999px; background: var(--as-raised); border: 1px solid var(--line2); overflow: hidden; }
.progress .bar-fill { display: block; height: 100%; background: var(--as-online); }

.roadmap { padding: .6rem 0 1.5rem; }
.roadmap > h2 { color: var(--as-bright); font-size: var(--fs-h2); }
.road-note { margin: .4rem 0 1rem; color: var(--as-text2); font-size: var(--fs-base); }
.level { border: 1px solid var(--line3); border-radius: 12px; background: var(--as-surface); margin-top: .8rem; }
.level summary { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; cursor: pointer; list-style: none; min-height: 3.5rem; }
.level summary::-webkit-details-marker { display: none; }
.level summary::after { content: ""; flex: none; width: .6rem; height: .6rem; border-right: 2px solid var(--as-text); border-bottom: 2px solid var(--as-text); transform: rotate(45deg); margin-left: auto; transition: transform .15s; }
.level[open] summary::after { transform: rotate(-135deg); }
.node { flex: none; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--as-brand); color: var(--on-brand); font: 700 var(--fs-base) 'Outfit', sans-serif; }
.lv-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.lv-title { color: var(--as-bright); font-weight: 600; font-size: var(--fs-l); }
.lv-promise { color: var(--as-text2); font-size: var(--fs-base); }
.lv-meta { color: var(--as-text); font-size: var(--fs-m); }
.lessons { list-style: none; padding: 0 1.2rem 1rem; margin-left: 1.55rem; border-left: 2px solid var(--line2); }
.lessons li { margin-top: .4rem; }
.lessons a, .lessons .row { display: flex; align-items: center; gap: .8rem; min-height: 3rem; padding: .5rem .8rem; border-radius: 8px; text-decoration: none; color: var(--as-bright); }
.lessons a { background: var(--as-raised); border: 1px solid var(--line2); }
.lessons a:hover { border-color: var(--as-brand); }
.lessons .num { flex: none; font: 500 var(--fs-m) 'JetBrains Mono', monospace; color: var(--as-text); min-width: 1.6rem; }
.lessons .t { flex: 1; font-size: var(--fs-base); }
.dur { flex: none; color: var(--as-text); font-size: var(--fs-m); }
.lessons .later .dur.later-label { color: var(--as-text3); font-style: italic; }
.lessons a .dur { color: var(--as-text); }
.lessons a .t { font-weight: 500; }
.lessons a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.lessons .later .row { color: var(--as-text); }
.chip { flex: none; font-size: var(--fs-s); border: 1px solid #8b949e; color: var(--as-text); border-radius: 999px; padding: .05rem .65rem; }
.chip.ok { background: var(--as-brand); border-color: var(--as-brand); color: var(--on-brand); font-weight: 600; }
.lessons li.read .chip.ok { background: var(--as-online); border-color: var(--as-online); font-size: 0; }
.lessons li.read .chip.ok::before { font-size: var(--fs-s); content: "Lu \2713"; }

.how { margin-top: 1.2rem; margin-bottom: 4rem; border: 1px solid var(--line3); border-radius: 12px; background: var(--as-surface); padding: 1.2rem 1.4rem; }
.how h2 { color: var(--as-bright); font-size: var(--fs-l); margin-bottom: .7rem; }
.how ol { padding-left: 1.3rem; display: grid; gap: .5rem; color: var(--as-text); }
.how strong { color: var(--as-bright); }
@media (max-width: 600px) { .promises { gap: .35rem; } .promises li { font-size: var(--fs-m); line-height: 1.45; } }
@media (max-width: 520px) { .level summary { gap: .7rem; padding: .9rem; } .lessons { margin-left: .9rem; padding-right: .4rem; } .btn { display: block; text-align: center; width: 100%; } .start { gap: .6rem; }  }

/* Theme toggle */
.theme-toggle { font: 500 var(--fs-m) var(--font-ui); color: var(--as-text); background: transparent; border: 1px solid var(--line2); border-radius: 8px; padding: .45rem .8rem; min-height: 40px; cursor: pointer; }
.theme-toggle:hover { border-color: var(--as-brand); color: var(--as-bright); }
.theme-toggle[hidden] { display: none; }

/* Index: main column + sticky level map */
.index-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.levels-nav { display: none; }
@media (min-width: 1100px) {
  .index-grid { grid-template-columns: minmax(0, 52rem) 14rem; column-gap: 4rem; justify-content: center; }
  .levels-nav { display: block; position: sticky; top: 5rem; align-self: start; margin-top: 3rem; }
}
.ln-title { color: var(--as-bright); font-weight: 600; margin-bottom: .5rem; }
.levels-nav ol { list-style: none; border-left: 2px solid var(--line2); }
.levels-nav a { display: flex; align-items: center; gap: .7rem; min-height: 2.5rem; padding: .3rem .8rem; color: var(--as-text); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.levels-nav a:hover { color: var(--as-bright); border-left-color: var(--as-brand); }
.levels-nav .n { flex: none; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--as-brand); color: var(--on-brand); font-size: var(--fs-s); font-weight: 700; }

/* Tutorial steps: a rail with numbered markers. Explanation sections ("concept") stay plain prose. */
.prose .sec { margin-top: 3rem; }
.prose .sec > :first-child { margin-top: 0; }
.prose .sec.step { margin-left: 1.15rem; padding-left: 2.1rem; border-left: 2px solid var(--line2); padding-bottom: 2rem; }
.prose .sec.step + .sec.step { margin-top: 0; }
.prose .sec.step > h2 { display: block; position: relative; margin-top: 0; }
.prose .sec.step > h2 .n { position: absolute; left: calc(-2.1rem - 1px - 1.2rem); top: -.1rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--as-brand); color: var(--on-brand); font: 700 var(--fs-base) var(--font-ui); transform: none; padding: 0; }
.prose .sec.step:last-of-type { border-left-color: transparent; }
.prose .sec.concept > h2 { margin-top: 0; }
@media (max-width: 600px) { .prose .sec.step { margin-left: 1rem; padding-left: 1.4rem; } .prose .sec.step > h2 .n { left: calc(-1.4rem - 1px - 1rem); width: 2rem; height: 2rem; font-size: var(--fs-m); } }
.prose .sec > * + * { margin-top: 1.1rem; }
.prose .sec > h2 + * { margin-top: .7rem; }
.prose .sec > h3 { margin-top: 2rem; }

/* Compact top bar on phones: nothing wraps */
.brand, .theme-toggle, .topbar nav a { white-space: nowrap; }
@media (max-width: 520px) {
  .theme-toggle .mode-text { display: none; }
  .theme-toggle { padding: 0; width: 40px; justify-content: center; }
  .topbar-in { gap: .5rem; }
  .topbar nav { gap: .55rem; font-size: var(--fs-m); }
  .brand { font-size: var(--fs-m); }
  .theme-toggle { padding: .4rem .65rem; }
  .topbar nav a.cta { padding: .4rem .75rem; }
}
@media (max-width: 420px) { .topbar nav a.cta { display: none; } }
.prose :not(pre) > code { overflow-wrap: anywhere; }

/* Round 2 (article radar + feedback): airier chapters, smaller type, structured tables, stronger secondary text. */
.prose .sec { margin-top: 0; padding-top: 3.2rem; }
.prose .sec.concept { margin-top: 3.2rem; padding-top: 2.2rem; border-top: 1px solid var(--as-border); }
.prose .sec.step { padding-bottom: 2.4rem; }
.prose .sec:first-child { padding-top: 0; }
.prose .sec.concept:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.prose .sec > * + * { margin-top: 1.2rem; }
.prose .sec.step > h2 .n { width: 2.1rem; height: 2.1rem; font-size: var(--fs-m); left: calc(-2.1rem - 1px - 1.05rem); top: 0; }
.cmd pre { font-size: var(--fs-s); }
.toc { font-size: var(--fs-m); }
.toc a { color: var(--as-text2); }
.toc a[aria-current="true"] { color: var(--as-brand); font-weight: 600; border-left-color: var(--as-brand); }
.ref-soon { color: var(--as-text2); font: inherit; opacity: .85; }
.ref-soon small { font-size: .9em; }
.frame { grid-template-columns: minmax(0, 1fr); }
.frame .prereq { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--as-border); font-size: var(--fs-m); }

/* Tables: one style for every table in an article. */
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-m); line-height: 1.45; border: 1px solid var(--as-border); border-radius: 10px; overflow: hidden; background: var(--as-surface); }
.prose caption { caption-side: top; text-align: left; font-weight: 600; color: var(--as-bright); padding: 0 0 .6rem; font-size: var(--fs-base); }
.prose thead th { background: var(--as-raised); color: var(--as-bright); font-weight: 600; text-align: left; border-bottom: 2px solid var(--line2); }
.prose th, .prose td { padding: .7rem .9rem; vertical-align: top; text-align: left; }
.prose tbody th { color: var(--as-bright); font-weight: 600; width: 22%; }
.prose tbody tr + tr > * { border-top: 1px solid var(--as-border); }
.prose tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--as-raised) 55%, transparent); }
.prose td code { overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; }
@media (max-width: 600px) { .prose table { font-size: var(--fs-m); } .prose th, .prose td { padding: .55rem .6rem; } .prose tbody th { width: 28%; } .out pre { white-space: pre-wrap; overflow-wrap: anywhere; } }

/* Reading sheet: the text sits on a framed sheet over a slightly deeper desk (same logic in dark mode). */
.article { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .article { grid-template-columns: minmax(0, calc(var(--measure) + 5.6rem)) 16rem; } }
.article .prose { background: var(--as-surface); border: 1px solid var(--as-border); border-radius: 14px; padding: 2.4rem 2.8rem 2.2rem; box-shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px -12px rgba(20, 30, 50, .12); }
:root[data-theme="dark"] .article .prose, :root:not([data-theme="light"]) .article .prose { box-shadow: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .article .prose { box-shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px -12px rgba(20, 30, 50, .12); } }
.prose .call { background: var(--as-raised); }
.prose table { background: transparent; }
.prose .sec.concept { border-top-color: var(--as-border); }
@media (max-width: 720px) {
  .article .prose { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; padding: 1.6rem 1rem 1.4rem; }
}

/* Diagrams (SVG): drawn with 14-unit text on a 300-unit canvas, shown at 320px so the text matches the 15px interface size. */
.prose svg[viewBox] { display: block; width: 100%; max-width: 20rem; height: auto; margin-left: auto; margin-right: auto; }

/* Bar chart in HTML: same type scale as the text around it. */
.bars { margin-top: 1.4rem; padding: 1.1rem 1.2rem; border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-raised); }
.bars figcaption { font-weight: 600; color: var(--as-bright); font-size: var(--fs-m); margin-bottom: .9rem; }
.bars ul { list-style: none; display: grid; gap: .65rem; padding: 0; }
.bars li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) 5.2rem; gap: .8rem; align-items: center; font-size: var(--fs-m); }
.bars .lab { font-weight: 600; color: var(--as-bright); }
.bars .val { text-align: right; color: var(--as-bright); font-variant-numeric: tabular-nums; }
.bars .track { height: 1.05rem; border-radius: 6px; background: var(--as-border); overflow: hidden; }
.bars .fill { display: block; height: 100%; width: var(--w); background: var(--as-brand); border-radius: 6px; transform-origin: left center; }
.bars.go .fill { animation: barfill .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * .12s); }
.bars-note { margin-top: .9rem; font-size: var(--fs-s); color: var(--as-text3); }
@media (prefers-reduced-motion: reduce) { .bars.go .fill { animation: none; } }
@media (max-width: 420px) { .bars li { grid-template-columns: 3rem minmax(0, 1fr) 4.6rem; gap: .5rem; } }

/* Article header: breadcrumb, title, lede, then a facts strip (series position, reading time, what it was tested on). */
.page-head { padding: 2.2rem 0 0; }
.page-head h1 { max-width: none; margin: 0; line-height: 1.15; }
.page-head .lede { margin-top: 1rem; max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: var(--fs-s); color: var(--as-text3); }
.crumbs a { color: var(--as-text3); text-decoration: none; padding: .35rem 0; }
.crumbs a:hover { color: var(--as-brand); text-decoration: underline; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.6rem; border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-surface); overflow: hidden; }
.fact { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.2rem; }
.fact + .fact { border-left: 1px solid var(--as-border); }
.fact > svg { flex: none; color: var(--as-brand); margin-top: .1rem; }
.fact dt { font-size: var(--fs-s); color: var(--as-text3); }
.fact dd { margin-top: .15rem; font-size: var(--fs-m); line-height: 1.45; color: var(--as-text); }
.fact dd strong { color: var(--as-bright); font-weight: 600; }
.mini-bar { display: block; height: 4px; margin-top: .55rem; border-radius: 4px; background: var(--as-border); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--as-brand); border-radius: 4px; }
.frame { margin-top: 1.6rem; margin-bottom: 2.4rem; }
@media (max-width: 720px) { .facts { grid-template-columns: minmax(0, 1fr); } .fact + .fact { border-left: 0; border-top: 1px solid var(--as-border); } .page-head { padding-top: 1.4rem; } }

/* One shared column: header, goals card, reading sheet + summary, and footer navigation share the same left and right edges. */
:root { --grid-w: calc(var(--measure) + 5.6rem + 3.5rem + 16rem); }
@media (min-width: 1024px) {
  .wrap > .page-head, .wrap > .frame, .wrap > .article, .wrap > .done, .wrap > .prevnext, .wrap > .levelmap { max-width: var(--grid-w); margin-left: auto; margin-right: auto; }
  .article { justify-content: start; }
}
.frame ul { columns: 2 18rem; column-gap: 2.4rem; }
.frame li { break-inside: avoid; }
.frame { gap: 0; }
@media (min-width: 1024px) { .topbar .wrap { max-width: calc(var(--grid-w) + 2rem); } }

/* Character: drop cap, ornaments between chapters, photos, callouts with a voice. */
:root { --fs-read: clamp(1rem, .82rem + .26vw, 1.0625rem); }
.prose { font-size: var(--fs-read); }
.frame ul, .frame .prereq { font-size: var(--fs-read); }
.prose p, .prose li { text-wrap: pretty; }
h1, h2, h3, .lede, .call { text-wrap: balance; }
.prose .sec.concept { border-top: 0; }
.prose .sec.concept::before { content: ""; display: block; width: .65rem; height: .65rem; margin: 0 auto 2.2rem; background: var(--as-brand); transform: rotate(45deg); border-radius: 2px; opacity: .85; box-shadow: -1.6rem 0 0 -.2rem var(--as-border), 1.6rem 0 0 -.2rem var(--as-border); }
.prose .sec.concept:first-child::before { display: none; }
.photo { margin: 0; position: relative; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 12px; background: var(--as-raised); }
.photo.hero { margin: -2.4rem -2.8rem 1.8rem; }
.photo.hero img { border-radius: 13px 13px 0 0; aspect-ratio: 16 / 6; max-height: 300px; }
.photo.sep { margin: 2.4rem 0; }
.prose .call.key { border-left-color: var(--as-online); }
.prose .call.avis { border-left-color: var(--as-accent); font-style: italic; }
.prose .call.avis strong { font-style: normal; }
@media (max-width: 720px) { .photo.hero { margin: -1.6rem -1rem 1.4rem; } .photo.hero img { border-radius: 0; aspect-ratio: 16 / 8; } .prose > p:first-of-type::first-letter { font-size: 3.1em; } }

/* Navigation: smooth jumps, landing highlight, sliding marker, share links, progress bar, back to top. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.prose h2[id] { scroll-margin-top: 5.2rem; }
@keyframes landing { 0% { background: color-mix(in srgb, var(--as-brand) 24%, transparent); box-shadow: 0 0 0 .5rem color-mix(in srgb, var(--as-brand) 24%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 .5rem transparent; } }
.prose h2:target { animation: landing 2.2s ease-out; border-radius: 6px; }
.toc ol { position: relative; }
.toc a[aria-current="true"] { border-left-color: transparent; }
.toc-marker { position: absolute; left: -2px; top: 0; width: 3px; background: var(--as-brand); border-radius: 2px; transition: transform .28s cubic-bezier(.3, .7, .2, 1), height .28s; pointer-events: none; }
.toc a { transition: color .2s; }
.anchor { margin-left: .6rem; font: 500 var(--fs-m) var(--font-ui); color: var(--as-text3); text-decoration: none; opacity: 0; transition: opacity .15s; padding: .3rem .5rem; }
.prose h2:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--as-brand); }
@media (hover: none) { .anchor { opacity: .45; } }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 1rem); background: var(--as-bright); color: var(--as-bg); padding: .55rem 1rem; border-radius: 8px; font-size: var(--fs-m); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 150; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: var(--as-brand); transform: scaleX(0); transform-origin: left; }
.to-top { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line2); background: var(--as-surface); color: var(--as-text); box-shadow: 0 4px 14px rgba(20, 30, 50, .18); cursor: pointer; opacity: 0; transform: translateY(.6rem); pointer-events: none; transition: opacity .2s, transform .2s; z-index: 160; }
.to-top.on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--as-brand); color: var(--as-brand); }
@media (prefers-reduced-motion: reduce) { .prose h2:target { animation: none; } .toc-marker, .toast, .to-top { transition: none; } }

/* Round 3: character. */
.theme-toggle { display: inline-flex; align-items: center; gap: .5rem; }
/* Drop cap on the first paragraph, whether it sits before the first chapter or inside it. */
/* Ornament between chapters: two hairlines and a diamond. */
.prose .sec.concept::before { content: "\25C6"; display: block; margin: 0 0 1.7rem; height: 1.2rem; line-height: 1.2rem; text-align: center; font-size: .75rem; color: var(--as-brand); background: linear-gradient(to right, var(--as-border) 0 calc(50% - 1.2rem), transparent calc(50% - 1.2rem) calc(50% + 1.2rem), var(--as-border) calc(50% + 1.2rem) 100%) center / 100% 1px no-repeat; transform: none; width: auto; box-shadow: none; opacity: 1; border-radius: 0; }
.prose .sec.concept { margin-top: 2.6rem; padding-top: 0; }
.prose .sec.concept:first-child { margin-top: 0; }
/* Level colour: the same hue follows the reader from the index to the article. */
.node, .levels-nav .n { background: var(--lvc, var(--as-brand)); }
.prose .sec.step > h2 .n { background: var(--lvc, var(--as-brand)); }
.mini-bar i, .toc-marker { background: var(--lvc, var(--as-brand)); }
.level[open] { border-color: var(--lvc, var(--line3)); }
/* Photo: a soft gradient so the credit reads, and the image feels part of the sheet. */
.photo.hero { overflow: hidden; border-radius: 13px 13px 0 0; }
/* Next step: the one big call to action at the end of an article. */
.prevnext .next { background: var(--lvc, var(--as-brand)); border-color: transparent; color: var(--on-brand); }
.prevnext .next > span:first-child { color: color-mix(in srgb, var(--on-brand) 82%, transparent); }
.prevnext a.next:hover { filter: brightness(1.08); }
.prevnext a.next::after { content: " \2192"; }
.prevnext .next.soon-link { background: var(--as-surface); color: var(--as-text); border-color: var(--as-border); opacity: 1; }
.prevnext .next.soon-link span { color: var(--as-text3); }
@media (max-width: 720px) { .photo.hero { border-radius: 0; } }

/* Round 4: plain drop cap, tighter header, readable level colour in dark mode, watermark number, completion card. */
.prose > p:first-of-type::first-letter, .prose:not(:has(> p)) .sec:first-of-type > h2 + p::first-letter { float: left; font-family: var(--font-ui); font-weight: 700; font-size: 3.3em; line-height: .8; color: var(--lvc-ui, var(--as-brand)); padding: .04em .12em 0 0; margin: 0; background: none; border: 0; border-radius: 0; }
.wrap { --lvc-ui: color-mix(in srgb, var(--lvc, var(--as-brand)) 62%, #fff); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .wrap { --lvc-ui: var(--lvc, var(--as-brand)); } }
:root[data-theme="light"] .wrap { --lvc-ui: var(--lvc, var(--as-brand)); }
.mini-bar i, .toc-marker { background: var(--lvc-ui, var(--as-brand)); }
.crumbs, .crumbs a { color: var(--as-text2); }
.crumbs > span { color: var(--as-text3); }
.call { text-wrap: pretty; }
.page-head { padding-top: 1.7rem; }
.facts { margin-top: 1.3rem; }
.frame { margin-top: 1.2rem; margin-bottom: 1.8rem; padding: 1rem 1.3rem; }
.frame .prereq { margin-top: .7rem; padding-top: .65rem; }
.done { margin-top: 3rem; padding: 1.1rem 1.3rem; border: 1px solid var(--as-border); border-radius: 12px; background: var(--as-surface); }
.done p { font-size: var(--fs-m); color: var(--as-text); }
.done strong { color: var(--as-bright); }
.done .mini-bar { height: 6px; margin-top: .8rem; }
.done + .prevnext { margin-top: 1rem; }
.photo.sep { margin: 1.6rem 0 2rem; }
@media (max-width: 720px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1rem; }
  .fact { padding: .75rem .85rem; gap: .6rem; }
  .fact > svg { width: 18px; height: 18px; }
  .fact + .fact { border-top: 0; border-left: 1px solid var(--as-border); }
  .fact:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--as-border); }
  .frame { padding: .9rem 1rem; }
  .frame ul { columns: 1; }
  .page-head .lede { font-size: var(--fs-base); }
}

/* Round 5: goals box folds on phones, softer photos, intro with a side photo. */
.frame { display: block; }
.goals summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; font-weight: 600; color: var(--as-bright); font-size: var(--fs-base); }
.goals summary::-webkit-details-marker { display: none; }
.goals summary::after { content: ""; flex: none; width: .55rem; height: .55rem; border-right: 2px solid var(--as-text2); border-bottom: 2px solid var(--as-text2); transform: rotate(45deg); transition: transform .15s; }
.goals[open] summary::after { transform: rotate(-135deg); }
.goals ul { margin-top: .6rem; padding-left: 1.2rem; }
.photo img { filter: saturate(.85); }
@media (min-width: 900px) {
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; column-gap: 2.4rem; align-items: start; max-width: 52rem; }
  .intro > * { grid-column: 1; }
  .intro > .photo { grid-column: 2; grid-row: 1 / span 5; margin: .4rem 0 0; }
  .intro > .photo img { aspect-ratio: 3 / 4; height: 100%; max-height: 22rem; }
}
@media (max-width: 899px) { .intro > .photo { display: none; } }

/* Round 6: legible white on level colours in both themes, nowrap hyphenated words, rhythm at the end of an article. */
.node, .levels-nav .n, .prose .sec.step > h2 .n { color: #fff; }
.prevnext .next { color: #fff; }
.prevnext .next > span:first-child { color: rgba(255, 255, 255, .86); }
.nw { white-space: nowrap; }
.photo img { filter: saturate(var(--sat, .85)); }
.done .voice { margin-top: .5rem; font-style: italic; color: var(--as-text2); font-size: var(--fs-m); }
.article { padding-bottom: 1.2rem; }
.done { margin-top: 2rem; }
.levelmap { margin-bottom: 3.5rem; }
.levelmap small { white-space: nowrap; }
.intro > .photo img { max-height: 18rem; }
.credits a { color: inherit; }

/* Sources: small, italic, a few lines. */
.sources { margin-top: 2.4rem; padding-top: .9rem; border-top: 1px solid var(--as-border); font-size: var(--fs-s); font-style: italic; line-height: 1.55; color: var(--as-text3); }
.sources a { color: inherit; text-decoration-thickness: 1px; }
.sources a:hover { color: var(--as-brand); }


/* Sources: a real list (one source per line, visible bullets), small and italic. */
.sources p.sources-head { margin: 0 0 .4rem; }
.sources-title { font-style: normal; font-weight: 600; color: var(--as-text2); }
.sources-date { color: var(--as-text3); }
.sources ul { list-style: disc; margin: 0; padding-left: 1.2rem; }
.sources li { margin: .2rem 0; padding-left: .15rem; }
.sources li::marker { color: var(--as-text3); }

/* Navigation cards: balanced titles, arrow glued to the last word. Drop cap only when the paragraph is not followed by a list. */
.prevnext a { text-wrap: balance; }
.prevnext a.next::after { content: "\00a0\2192"; white-space: nowrap; }
.prose p { text-wrap: pretty; }
.prose > p:first-of-type:has(+ ul, + ol)::first-letter { float: none; font-size: inherit; line-height: inherit; padding: 0; margin: 0; font-weight: inherit; color: inherit; font-family: inherit; }

/* Optional deeper dive, folded by default. */
.prose details.more { margin: 1.2rem 0; border: 1px solid var(--as-border); border-radius: 10px; background: color-mix(in srgb, var(--as-surface) 70%, transparent); }
.prose details.more > summary { cursor: pointer; padding: .7rem 1rem; font-weight: 600; color: var(--as-bright); font-size: var(--fs-m); }
.prose details.more > summary::marker { color: var(--lvc-ui, var(--as-brand)); }
.prose details.more[open] > summary { border-bottom: 1px solid var(--as-border); }
.prose details.more > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
.prose details.more > :last-child { margin-bottom: 1rem; }

/* Download box */
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1.2rem 0; padding: .85rem 1rem; border: 1px solid var(--as-border); border-radius: 10px; background: var(--as-surface); }
.dl p { margin: 0; flex: 1 1 14rem; font-size: var(--fs-s); color: var(--as-text2); }
.dl-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 8px; background: var(--as-brand); color: #fff; font-weight: 600; text-decoration: none; }
.dl-btn:hover { filter: brightness(1.08); }

/* Design loop: copy button sits in the caption bar, mobile step markers re-aligned, footer clears the back-to-top button. */
.cmd pre { padding-right: 1rem; }
.cmd .copy { top: calc(-2.25rem - 1px); right: .5rem; }
@media (max-width: 600px) {
  .prose .sec.step { margin-left: 1.4rem; padding-left: 1.3rem; }
  .prose .sec.step > h2 .n { left: calc(-1.3rem - 1px - 1.05rem); }
  .foot, footer { padding-bottom: 4.5rem; }
}

.prose .faq details { margin: .6rem 0; border: 1px solid var(--as-border); border-radius: 10px; background: color-mix(in srgb, var(--as-surface) 70%, transparent); }
.prose .faq summary { cursor: pointer; padding: .7rem 1rem; font-weight: 600; color: var(--as-bright); }
.prose .faq details[open] summary { border-bottom: 1px solid var(--as-border); }
.prose .faq details p { margin: 0; padding: .8rem 1rem; }
.prose .seealso { margin: 2rem 0 0; padding: .9rem 1.1rem; border-left: 3px solid var(--lvc, var(--as-brand)); background: color-mix(in srgb, var(--as-surface) 70%, transparent); border-radius: 0 10px 10px 0; }
.prose .seealso ul { margin: .4rem 0 0; padding-left: 1.2rem; }

/* Language switcher: two segments side by side, the active one filled. */
.topbar nav .lang { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.topbar nav .lang a, .topbar nav .lang a:not(.cta) { padding: .4rem .65rem; min-height: 40px; display: inline-flex; align-items: center; border-bottom: 0; font-weight: 600; font-size: var(--fs-s, .85rem); letter-spacing: .03em; }
.topbar nav .lang a + a { border-left: 1px solid var(--line2); }
.topbar nav .lang a[aria-current] { background: var(--as-brand); color: var(--on-brand); }
.topbar nav .lang a:hover:not([aria-current]) { color: var(--as-bright); }
@media (max-width: 420px) { .topbar nav .lang a, .topbar nav .lang a:not(.cta) { padding: .4rem .5rem; } .topbar nav { gap: .4rem; } .topbar-in { gap: .4rem; } }
@media (max-width: 360px) { .topbar nav .lang a, .topbar nav .lang a:not(.cta) { padding: .4rem .4rem; } .theme-toggle { padding: 0; width: 36px; min-height: 36px; } .topbar nav { gap: .3rem; } .brand { font-size: .875rem; } }

/* Mobile: wide tables scroll sideways inside themselves; small code and links in callouts stay readable and tappable. */
.prose code { font-size: max(.9em, 12.5px); }
.call a { padding-block: .2rem; }
@media (max-width: 720px) { .prose :not(.scroll-x) > table { display: block; max-width: 100%; overflow-x: auto; } .prose table th, .prose table td { min-width: 6.5rem; } }
