/* Light keeps the original Notex palette. Dark uses charcoal paper and muted accents. */
:root{color-scheme:light}.theme-toggle{width:32px;height:32px;flex:0 0 32px;padding:7px;border-radius:50%;display:inline-grid;place-items:center}.theme-toggle svg{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.theme-sun{display:none}:root[data-theme=dark] .theme-moon{display:none}:root[data-theme=dark] .theme-sun{display:block}
.chapter-video{display:flex;gap:20px;align-items:center;position:relative;padding:28px;background:linear-gradient(135deg,#edeaf2,#f8f7fa);border:1px solid #dfdbe5;border-radius:12px;min-height:200px;margin:0 0 36px;overflow:hidden}.chapter-video:after{content:'';position:absolute;right:-30px;bottom:-55px;width:210px;height:210px;border:1px solid #cdc7da;border-radius:50%;pointer-events:none}.video-play{display:grid;place-items:center;width:52px;height:52px;flex:0 0 52px;border:1px solid #c7c1d1;border-radius:50%;font-size:24px;background:#ffffff70}.chapter-video strong{display:block;font-size:19px;line-height:1.35;font-weight:500;margin:8px 0}.chapter-video p{font-size:12px;color:var(--muted);margin:0;max-width:280px}.video-coming{position:absolute;right:18px;top:16px;font:7px Departure;color:#756b88;letter-spacing:1px}.source-figure{margin:30px 0 12px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px}.prose .source-figure img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;border-radius:4px;margin:0}.prose .source-caption{font-size:12px;line-height:1.65;color:var(--muted);margin-bottom:28px}.prose .source-footnote{font-size:11px;line-height:1.65;color:var(--muted);padding-left:14px;border-left:1px solid var(--line);margin:10px 0}.source-page{scroll-margin-top:130px}:is(.course-distributed-systems,.course-system-design) .prose sup{font-size:.7em}.home .cover-distributed{background:url('books/distributed-systems-notebook.webp') center/contain no-repeat;transform:none}.home .path-card:has(.cover-distributed){filter:none}:is(.course-distributed-systems,.course-system-design) .course-book{filter:none}
:root[data-theme=dark]{color-scheme:dark;--bg:#18191c;--paper:#222429;--ink:#e8e7e4;--muted:#aaaab0;--line:#36383e;--blue:#8db9e9}
[data-theme=dark] .site-header{background:#18191ced}[data-theme=dark] .announcement{background:#202d38;border-color:#344555}[data-theme=dark] .tactile,[data-theme=dark] .pill{background:linear-gradient(#2b2e34,#25272d);border-color:#41444c;box-shadow:0 2px 2px #0005,0 0 0 1px #ffffff06}[data-theme=dark] .primary{background:linear-gradient(#e8e7e4,#cfcfca);color:#202125;border-color:#f0efea;box-shadow:0 2px 3px #0005}[data-theme=dark] .badge{background:#e1e1dc;color:#242527}[data-theme=dark] .live{background:#ad4644;color:#fff}
[data-theme=dark] :is(.hero-note,.floating-note,.excerpt-card,.trust-strip,.access-card,.course-start,.curriculum-structure,.demo-note,.course-access){background:#222429;border-color:var(--line)}[data-theme=dark] .home .hero{background:radial-gradient(circle at 50% 42%,#2b2c3488 0,transparent 62%)}[data-theme=dark] :is(.hero-chip,.course-overview-link.active,.sidebar details a.active,.filter-bar button.active,.curriculum-toolbar,.module-directory>a,.excerpt-avatar,.search-result:hover,.note-row:hover,.sidebar summary:hover,.sidebar details a:hover,.dropdown-panel a:hover){background:#2b2e35;color:var(--ink)}[data-theme=dark] .hero-chip{color:#a8c9e9;border-color:#364b61}[data-theme=dark] :is(.stack-name,.topic-strip>div,.floating-note p,.excerpt-quote p,.footer-links a,.footer-brand p,.about-grid p:not(.eyebrow)){color:var(--muted)}[data-theme=dark] :is(.hero-note,.floating-note,.excerpt-quote,.excerpt-bottom,.trust-strip span,.access-card>a,.reading-note .note-prompt,.lesson-row,.sidebar details a.syllabus-lesson){border-color:var(--line)}
[data-theme=dark] .home .gift-section{background:radial-gradient(circle at 72% 65%,#9d714320,transparent 42%),linear-gradient(90deg,#28251f,#302a20)}[data-theme=dark] .home .study-section{background:radial-gradient(circle at 18% 48%,#4977b61a,transparent 38%);border-color:var(--line)}[data-theme=dark] .study-board{border-color:#41404b;background-image:radial-gradient(#44444e 1px,transparent 1px)}[data-theme=dark] .home .access-strong{background:linear-gradient(#293a32,#222429 70%);border-color:#435c4d}[data-theme=dark] .access-strong .count{background:#293a32;border-color:#435c4d}[data-theme=dark] .access-card>.eyebrow{color:var(--muted)}[data-theme=dark] .course-start,[data-theme=dark] .curriculum-structure{border-color:var(--line)}[data-theme=dark] .curriculum-toolbar button.active{background:#454851;color:var(--ink)}[data-theme=dark] .module-directory>a:hover,[data-theme=dark] .lesson-row:hover{background:#30333b}[data-theme=dark] .course-curriculum[data-layout=grid] .lesson-row{background:var(--paper);border-color:var(--line)}[data-theme=dark] .lesson-completion button[aria-pressed=true],[data-theme=dark] .reference-callout{background:#293d35}[data-theme=dark] :is(.prose pre,.prose code,.course-page .prose pre,.prose th,.course-page .prose th,.course-page .prose blockquote){background:#24272e;border-color:#41454e;color:#e3e3e6}[data-theme=dark] :is(.prose p a,.prose li>a:not(.lesson-row),.search-hint kbd){color:#9ac3ed}[data-theme=dark] .codehilite :is(.c,.c1,.cm,.cs){color:#9da9b9}[data-theme=dark] .codehilite :is(.k,.kd,.kn,.kt,.nb){color:#c8a6ed}[data-theme=dark] .codehilite :is(.s,.s1,.s2,.sd){color:#b5cf9a}[data-theme=dark] .codehilite :is(.nf,.nc){color:#9fc8ed}
[data-theme=dark] .chapter-video{background:linear-gradient(135deg,#302c3c,#23242c);border-color:#474052}[data-theme=dark] .chapter-video:after{border-color:#494053}[data-theme=dark] .video-play{background:#ffffff08;border-color:#726680}[data-theme=dark] .video-coming{color:#b7a6d0}[data-theme=dark] .source-figure{background:#e4e3df;border-color:#4d4c50}[data-theme=dark] .source-figure img{mix-blend-mode:multiply}[data-theme=dark] :is(.search-trigger img,.menu-trigger img,.excerpt-avatar img,.demo-trigger img){filter:invert(.85)}
/* Colored notebooks and navigation tiles retain dark print on their pale stock. */
[data-theme=dark] :is(.path-card,.explore-tile,.cloud-card,.folder-front){color:#272727}[data-theme=dark] :is(.path-card .count,.path-card .eyebrow,.explore-tile .eyebrow){color:#39373d}[data-theme=dark] .tile-3{color:#fff}[data-theme=dark] .home .chalk{background:#bfc0c6}[data-theme=dark] .search-hint,[data-theme=dark] .search-top{border-color:var(--line)}[data-theme=dark] .search-hint{background:#222429}[data-theme=dark] dialog::backdrop{background:#0008}
@media(max-width:600px){.chapter-video{padding:24px 18px;gap:14px;min-height:190px}.chapter-video strong{font-size:16px}.chapter-video .eyebrow{font-size:8px}.video-play{width:40px;height:40px;flex-basis:40px;font-size:20px}.source-figure{padding:7px}.course-header{gap:8px}.course-header .dropdown>button{max-width:120px}.course-header .nav-actions{gap:5px}.course-header-divider{display:none}}
.home .path-card .cover-distributed{filter:none}
/* Readings use a calm measure; citations sit after the complete text. */
:is(.course-distributed-systems,.course-system-design) .prose>p,:is(.course-distributed-systems,.course-system-design) .prose>ul,:is(.course-distributed-systems,.course-system-design) .prose>ol{max-width:72ch}:is(.course-distributed-systems,.course-system-design) .prose p{line-height:1.85;margin-bottom:1.25em}:is(.course-distributed-systems,.course-system-design) .prose sup a{font-size:.85em;text-decoration:none;padding:0 2px}.lesson-references,.module-references{margin-top:48px;padding-top:24px;border-top:1px solid var(--line);scroll-margin-top:130px}.lesson-references ol,.module-references ol{padding-left:24px;font-size:13px;line-height:1.8}.lesson-references li,.module-references li{margin:0 0 16px;padding-left:7px;overflow-wrap:anywhere;scroll-margin-top:130px}.module-references details{padding:16px 0;border-bottom:1px solid var(--line)}.module-references summary{cursor:pointer;font-size:14px;font-weight:500}.module-references ol{margin-top:18px}:is(.course-distributed-systems,.course-system-design) .prose pre{line-height:1.7;tab-size:2}:is(.course-distributed-systems,.course-system-design) .prose h3{margin-top:36px}:is(.course-distributed-systems,.course-system-design) .prose a{overflow-wrap:anywhere}
:is(.course-distributed-systems,.course-system-design) .display-equation{padding:20px 24px;background:var(--paper);border:1px solid var(--line);border-radius:8px;font-family:Departure,monospace;text-align:center;font-size:14px}.module-references .lesson-references{margin-top:22px;padding-top:12px;border-top:0}

.home .cover-system-design{background:url(books/system-design-notebook.webp) center/contain no-repeat;transform:none;filter:none}
