/* Copyright © 2026 Christopher Snow. */
:root { color-scheme: light; --idle-bg:#e9ebed; --idle-ink:#50565c; --bg:#f8f9f6; --panel:#fff; --ink:#172b29; --muted:#5d716d; --line:#d8e1dc; --soft:#edf2ee; --accent:#14634d; --accent-soft:#def0e4; --code:#122824; --code-ink:#e1eee6; }
:root[data-theme="dark"] { color-scheme:dark; --idle-bg:#2a2d30; --idle-ink:#bdc3c9; --bg:#111b19; --panel:#182622; --ink:#e3ece7; --muted:#a0b5ab; --line:#354a40; --soft:#20332a; --accent:#9fe3b4; --accent-soft:#284c37; --code:#0c1511; --code-ink:#e1eee6; }
* { box-sizing:border-box; } html { scroll-behavior:smooth; scroll-padding-top:90px; } body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.65 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; } a { color:var(--accent); text-underline-offset:4px; } button,input,select { font:inherit; } button,select,input { border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--ink); min-height:42px; padding:7px 12px; } button,select { cursor:pointer; } button:hover { border-color:var(--accent); background:var(--accent-soft); } :focus-visible { outline:3px solid var(--accent); outline-offset:3px; } button.primary { background:var(--accent); color:var(--bg); border-color:var(--accent); font-weight:650; } .skip { position:absolute; top:-100px; background:var(--panel); padding:12px; z-index:10; } .skip:focus { top:10px; } .topbar { height:74px; position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; padding:0 36px; border-bottom:1px solid var(--line); background:var(--bg); } .brand { text-decoration:none; color:var(--ink); font-size:20px; font-weight:750; display:flex; align-items:center; gap:12px; } .brand-icon { font-size:30px; color:var(--accent); } .brand-note { color:var(--muted); font-size:13px; font-weight:400; margin-left:14px; } .top-actions { display:flex; gap:24px; align-items:center; font-size:13px; } .top-actions a { text-decoration:none; color:var(--muted); } .top-actions button { font-size:13px; } .layout { max-width:1600px; margin:auto; display:grid; grid-template-columns:245px minmax(0,1fr); } .sidebar { position:sticky; top:74px; height:calc(100vh - 74px); padding:38px 22px; border-right:1px solid var(--line); display:flex; flex-direction:column; } .eyebrow { font:600 11px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:1.5px; color:var(--accent); margin:0 0 14px; } .sidebar-title { font-size:21px; font-weight:650; margin:0 0 30px; } nav { display:grid; gap:6px; } nav a { display:flex; align-items:center; gap:10px; padding:10px; font-size:13px; color:var(--muted); text-decoration:none; border-radius:5px; min-height:42px; } nav a.current { background:var(--accent-soft); color:var(--accent); font-weight:650; } .dot { width:6px; height:6px; background:var(--accent); border-radius:50%; margin-left:auto; } .sidebar-bottom { margin-top:auto; padding-top:30px; color:var(--muted); font-size:12px; } .sidebar-bottom a { display:block; padding:5px 0; } .status-label { font:10px ui-monospace,monospace; letter-spacing:1px; } main { min-width:0; padding:54px 6% 0; max-width:1200px; } .intro { padding-bottom:45px; border-bottom:1px solid var(--line); margin-bottom:40px; } h1 { font-size:clamp(38px,4.6vw,64px); line-height:1.08; font-weight:600; letter-spacing:-2.4px; margin:20px 0 24px; } .lead { max-width:650px; font-size:19px; line-height:1.7; color:var(--muted); } .intro-meta { display:flex; flex-wrap:wrap; gap:8px 26px; font-size:12px; color:var(--muted); margin-top:24px; } h2 { font-size:28px; font-weight:600; letter-spacing:-.7px; line-height:1.25; margin:0 0 20px; } h3 { font-size:15px; margin:0; font-weight:650; } p { margin:0 0 17px; } .prose { max-width:760px; } .section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; } .tag { white-space:nowrap; border:1px solid var(--line); border-radius:4px; padding:4px 8px; font-size:11px; color:var(--muted); align-self:center; } .tag.live { color:var(--accent); border-color:var(--accent); } .lab-panel { margin-top:28px; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; box-shadow:0 8px 32px #14251d05; } .panel-top { display:flex; justify-content:space-between; align-items:center; padding:16px 24px; border-bottom:1px solid var(--line); gap:16px; } .panel-top .eyebrow { margin:0; } .model-badge { font-size:11px; color:var(--muted); } .controls { padding:24px 24px 12px; display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:18px; } .controls label { font-size:13px; font-weight:650; } .controls label span { display:block; font-size:11px; font-weight:400; color:var(--muted); margin:2px 0 8px; } select { width:100%; font-size:12px; padding:8px; } .presets { padding:0 24px 22px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:12px; } .presets>span { color:var(--muted); margin-right:5px; } .presets button { font-size:12px; min-height:36px; } .prediction { padding:20px 24px; background:var(--soft); border-block:1px solid var(--line); } .prediction label { display:block; font-size:14px; margin-bottom:12px; } .prediction>div { display:flex; gap:8px; flex-wrap:wrap; } .prediction input { width:85px; } .prediction button { font-size:12px; } .feedback { margin:0; padding:16px 24px; color:var(--accent); font-size:13px; min-height:56px; } .figure-label { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 24px 12px; } .figure-label>span { font-size:11px; color:var(--muted); } .lanes { display:grid; grid-template-columns:repeat(16,minmax(0,1fr)); gap:4px; padding:0 24px; } button.lane { min-width:0; padding:0; min-height:38px; border:1px solid var(--line); border-radius:4px; background:var(--accent-soft); color:var(--accent); font:12px ui-monospace,monospace; } button.lane[aria-pressed="true"] { outline:2px solid var(--accent); outline-offset:1px; } button.lane.inactive { background:var(--soft); color:var(--muted); text-decoration:line-through; } .lane-detail { margin:12px 24px 24px; font:12px/1.6 ui-monospace,monospace; color:var(--muted); } .metrics { display:grid; grid-template-columns:repeat(4,1fr); border-block:1px solid var(--line); background:var(--soft); margin-bottom:22px; } .metrics>div { padding:18px; border-right:1px solid var(--line); } .metrics>div:last-child { border:0; } .metrics span { display:block; font-size:11px; color:var(--muted); line-height:1.5; min-height:33px; } .metrics strong { font:500 30px/1.6 ui-monospace,monospace; color:var(--accent); } .figure-note { font-size:12px; color:var(--muted); padding:0 24px; } .sectors { padding:0 24px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 24px; } .sector { display:flex; gap:10px; align-items:center; } .sector-label { flex:0 0 90px; font:11px/1.5 ui-monospace,monospace; } .sector-label span { display:block; color:var(--muted); font-size:10px; } .words { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); flex:1; gap:2px; min-width:0; } .word { min-width:0; height:28px; display:flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:2px; color:var(--muted); font:9px ui-monospace,monospace; } .word.used { background:var(--accent-soft); color:var(--accent); border-color:var(--accent-soft); } .word.selected { border:2px solid var(--accent); font-weight:750; } .explanation { font-size:13px; margin:24px; } details { font-size:13px; } summary { cursor:pointer; font-weight:650; min-height:44px; padding:12px 0; } details p { margin:10px 0; }
.more-settings { margin:20px 0; padding:16px 20px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.more-settings summary { min-height:36px; padding:4px 0; font-size:14px; color:var(--accent); }
.more-settings > *:not(summary) { margin-top:14px; }
.named-choices { border:0; padding:0; margin:0 0 12px; }
.named-choices legend { font-size:14px; padding:0; margin-bottom:10px; }
.named-choice { display:flex; align-items:center; gap:10px; padding:10px 14px; border:1px solid var(--line); border-radius:6px; margin-bottom:8px; cursor:pointer; font-size:14px; min-height:44px; }
.named-choice:hover { border-color:var(--accent); background:var(--accent-soft); }
.named-choice input { accent-color:var(--accent); min-width:18px; min-height:18px; }
.named-choice span { flex:1; } .model-note { margin-top:20px; padding:6px 24px; border-top:1px solid var(--line); color:var(--muted); } .model-note a { display:inline-block; margin-bottom:16px; } .section-space { margin-top:58px; } .two-col { display:grid; grid-template-columns:1fr 1fr; gap:30px; align-items:start; } .two-col p { font-size:14px; } code { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:1em; overflow-wrap:anywhere; } .code-panel { border-radius:8px; background:var(--code); color:var(--code-ink); overflow:hidden; margin-top:32px; } .code-title { padding:10px 16px; border-bottom:1px solid #ffffff20; font:11px ui-monospace,monospace; display:flex; align-items:center; justify-content:space-between; gap:10px; } .code-title button { background:transparent; color:var(--code-ink); border-color:#ffffff30; font-size:11px; } pre { font-size:16px; margin:0; padding:20px 16px; overflow:auto; line-height:1.9; } pre code { font-size:inherit; } .code-footer { border-top:1px solid #ffffff20; padding:16px; font-size:11px; display:grid; gap:12px; color:#b7ccc1; } .code-footer a { color:#a3e6bb; } .challenge { border-left:3px solid var(--accent); background:var(--soft); padding:26px 30px; } .challenge ol { padding-left:20px; font-size:14px; } .challenge li { margin-bottom:12px; padding-left:8px; } .roadmap { margin-top:24px; border-top:1px solid var(--line); } .roadmap>a,.roadmap>div { display:flex; align-items:center; gap:20px; padding:20px 0; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; } .module-no { font:13px ui-monospace,monospace; color:var(--accent); } .roadmap p { font-size:13px; color:var(--muted); margin:5px 0 0; } .roadmap .tag { margin-left:auto; } footer { padding:30px 0; margin-top:50px; border-top:1px solid var(--line); display:flex; justify-content:space-between; gap:20px; font-size:11px; color:var(--muted); } [hidden] { display:none!important; }
@media(min-width:1400px) { .sectors { gap:12px 35px; } .word { font-size:11px; } }
@media(max-width:1100px) { .layout { grid-template-columns:200px minmax(0,1fr); } .sidebar { padding:30px 14px; } main { padding:40px 5% 0; } .sectors { grid-template-columns:1fr; } .word { font-size:11px; } .two-col { grid-template-columns:1fr; gap:0; } .code-panel { margin-top:10px; } }
@media(max-width:760px) { .topbar { padding:0 18px; height:64px; } .brand-note { display:none; } .top-actions { gap:14px; } .layout { display:block; } .sidebar { position:static; height:auto; border-right:0; border-bottom:1px solid var(--line); padding:12px 18px; } .sidebar>.eyebrow,.sidebar-title,.sidebar-bottom { display:none; } nav { display:flex; flex-wrap:wrap; gap:2px 10px; } nav a { padding:7px; min-height:40px; } nav a:nth-child(3),nav a:nth-child(4) { display:none; } main { padding:32px 20px 0; } h1 { font-size:42px; letter-spacing:-1.6px; } h2 { font-size:25px; } .lead { font-size:17px; } .intro { padding-bottom:26px; margin-bottom:28px; } .section-heading { align-items:start; flex-direction:column; gap:0; } .section-heading .tag { align-self:start; margin-bottom:20px; } .controls { grid-template-columns:1fr; gap:14px; } .controls label span { display:inline; margin-left:8px; } select { margin-top:6px; font-size:14px; min-height:44px; } .lanes { grid-template-columns:repeat(8,minmax(0,1fr)); } button.lane { min-height:42px; } .figure-label { align-items:start; flex-direction:column; gap:2px; } .metrics { grid-template-columns:repeat(2,1fr); } .metrics>div { border-bottom:1px solid var(--line); } .metrics>div:nth-child(2) { border-right:0; } .metrics span { min-height:0; } .metrics strong { font-size:28px; } .panel-top { align-items:start; } .panel-top .eyebrow { max-width:170px; } .presets button,button { min-height:44px; } .sector-label { flex-basis:80px; } .sector { gap:6px; } .words { gap:2px; } .word { font-size:9px; } .section-space { margin-top:38px; } .challenge { padding:22px; } .roadmap>a,.roadmap>div { gap:12px; align-items:start; flex-wrap:wrap; } .roadmap>div>div,.roadmap>a>div { flex:1; min-width:170px; } .roadmap .tag { margin-left:30px; } footer { flex-direction:column; gap:10px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
@media(max-width:390px) { .named-choice { padding:8px 10px; font-size:13px; } .more-settings { padding:12px 14px; } .prediction { padding:16px 18px; } .prediction>div { flex-direction:column; } .prediction input { width:100%; } .prediction button { width:100%; } }
.start-course { display:inline-block; padding:12px 18px; border-radius:6px; background:var(--accent); color:var(--bg); text-decoration:none; font-weight:650; }
.offline-status { margin:36px 0 0; padding:14px 18px; border:1px solid var(--line); border-radius:6px; background:var(--soft); color:var(--muted); font-size:13px; }
.offline-update { margin-top:12px; padding:18px; border:1px solid var(--line); border-radius:6px; background:var(--panel); font-size:14px; }
.offline-update p { margin-bottom:14px; }
.update-actions { display:flex; flex-wrap:wrap; gap:10px; }
#update-error { margin:14px 0 0; }
.brand-icon { border-radius:7px; flex-shrink:0; }
#install-dialog { width:min(520px,calc(100% - 32px)); max-height:calc(100% - 32px); overflow:auto; padding:28px; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:16px; }
#install-dialog::backdrop { background:#071612a6; }
.install-icon { border-radius:14px; margin-bottom:20px; }
#install-dialog p,#install-dialog li { font-size:14px; }
#install-dialog ul { padding-left:20px; }
#install-dialog li { margin-block:12px; }
.install-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:24px; }
@media(max-width:760px) { .top-actions>a { display:none; } .top-actions { gap:8px; } }
.sidebar { overflow-y:auto; }
footer { flex-wrap:wrap; }
.build-info { color:var(--muted); }
.version-status { display:block; margin-top:4px; }
.version-status[data-state="latest"] { color:var(--accent); }
@media(max-width:760px) { .course-nav a:nth-child(3),.course-nav a:nth-child(4) { display:flex; } }
@media(max-width:760px) { .sidebar { overflow:visible; } }
.course-contents-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 14px; font-size:14px; font-weight:650; text-align:left; }
.course-contents-toggle span { color:var(--accent); }
@media(max-width:760px) {
  .sidebar .course-nav,.sidebar .lesson-nav { display:grid; grid-template-columns:minmax(0,1fr); gap:3px; }
  .sidebar .course-nav a,.sidebar .lesson-nav a { display:flex; min-height:44px; padding:10px 14px; font-variant-numeric:tabular-nums; }
  .course-contents-toggle[aria-expanded="true"] { margin-bottom:10px; }
}

/* App status is available on every page, with the pending badge outside its dialog. */
#app-status-open { display:flex; flex-direction:column; align-items:start; line-height:1.4; text-align:left; max-width:230px; }
#app-status-summary { font-size:10px; color:var(--muted); overflow-wrap:anywhere; }
#app-status-dialog { background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:24px; width:min(600px,calc(100% - 24px)); max-height:calc(100dvh - 32px); overflow:auto; }
#app-status-dialog::backdrop { background:#0009; }
#app-status-dialog section { border-top:1px solid var(--line); padding-top:20px; margin-top:20px; }
#app-status-dialog h3 { font-size:20px; margin-bottom:10px; }
#app-status-dialog p { font-size:14px; overflow-wrap:anywhere; }
#app-status-dialog .build-info { display:inline; }
.status-heading,.status-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.status-heading h2 { margin:0; }
.status-actions { justify-content:start; }
#download-progress { margin-top:20px; }
#asset-progress { display:block; width:100%; accent-color:var(--accent); }
#app-status-error { margin-top:16px; }
.restore-notice { border:2px solid var(--accent); padding:16px; }
@media(max-width:760px) { .topbar { height:auto; min-height:74px; flex-wrap:wrap; gap:8px; padding:10px 16px; } .top-actions { gap:8px; flex-wrap:wrap; } #app-status-open { max-width:180px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* Small reference exercises share the course's native disclosure controls. */
.reference-task { max-width:760px; margin:24px 0; padding:18px 20px; border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; background:var(--accent-soft); overflow-wrap:anywhere; }
.reference-task h3 { display:flex; align-items:flex-start; gap:10px; color:var(--accent); margin:0 0 12px; font-size:16px; line-height:1.5; }
.reference-task p { font-size:inherit; margin:0 0 12px; }
.reference-task details { border-top:1px solid var(--line); margin-top:8px; }
.reference-task .reference-note { color:var(--muted); font-size:12px; margin:12px 0 0; }
.reference-new-tab { font-size:12px; }
.reference-goal { max-width:760px; margin-top:24px; }
@media(max-width:760px) { .reference-task { padding:16px; } }

/* Chapters, appendices and practice have distinct, accessible contents headings. */
.nav-section { display:grid; gap:6px; margin-top:14px; padding-top:16px; border-top:1px solid var(--line); }
.sidebar .nav-group { margin:0 10px 6px; color:var(--ink); font-size:13px; font-weight:700; line-height:1.5; text-transform:uppercase; letter-spacing:.08em; }

.reference-icon { width:22px; height:22px; flex:none; margin-top:1px; }
.reference-code { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:16px; margin:0 0 16px; font:16px/1.7 ui-monospace,monospace; }
.reference-code code { font:inherit; }

/* References use normal reading text; exercises retain their labelled action cards. */
.chapter-references,.documentation-exercises { max-width:900px; }
.chapter-reference-list { padding-left:22px; }
.chapter-reference-list li { margin:16px 0; padding-left:4px; }
.chapter-reference-list li>a { font-weight:650; }
.chapter-reference-list p { margin:4px 0 0; }
.reference-version { color:var(--muted); font-size:14px; line-height:1.65; margin:20px 0; }
.chapter-references a,.documentation-exercises a { overflow-wrap:anywhere; }

/* Optional desktop actions remain beside the complete code they download. */
.chapter-code-download { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; padding:0 1.2rem 1rem; }
.chapter-code-download button,.chapter-code-download a { font-size:.9rem; }
.chapter-code-download [role=status] { flex-basis:100%; font-size:.9rem; }
.chapter-code-download [role=status]:empty { display:none; }
.desktop-index details { margin-block:.75rem; }
.desktop-index li { margin-block:.5rem; }

/* Keep the concept map visible beside app controls, including on phones. */
.top-actions .gpu-map-link { display:inline-flex; align-items:center; min-height:44px; padding:8px 12px; border:1px solid var(--accent); border-radius:6px; color:var(--accent); font-weight:650; }
