/* Illustrated handbook v0.003. */
:root{color-scheme:dark;--bg:#0d121b;--surface:#151e2c;--line:#304158;--text:#e6edf6;--muted:#adbed2;--blue:#88c6ff;--violet:#c5a5ff;font:16px/1.65 "Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0}a{color:var(--blue);text-underline-offset:4px}a:hover{color:#d1e7ff}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--violet);outline-offset:4px}
.book-header{max-width:1440px;margin:auto;display:flex;gap:22px;align-items:center;flex-wrap:wrap;padding:20px 28px;border-bottom:1px solid var(--line)}.book-header span{margin-left:auto;color:var(--muted);font-size:14px}.book-title{max-width:1440px;margin:auto;padding:36px 28px 28px}h1{font-size:clamp(32px,4vw,52px);letter-spacing:-.03em;line-height:1.13;margin:0 0 18px;max-width:1020px}.lead{font-size:20px;max-width:1030px;color:#c0d0e4;margin:12px 0}.scope{font-size:14px;color:var(--muted)}.jump-links{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.jump-links a{padding:5px 14px;border:1px solid var(--line);background:var(--surface);text-decoration:none}
.book-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:36px;max-width:1440px;margin:auto;padding:0 28px}.book-toc{position:sticky;top:18px;align-self:start;max-height:calc(100dvh - 36px);overflow:auto;padding:16px 12px 18px 0;scrollbar-width:thin}.book-toc summary{font-size:16px;color:#d2c2ed;cursor:pointer}.toc-list{padding:14px 0 0;margin:0;list-style:none;counter-reset:chapter}.toc-list li{margin:0;border-bottom:1px solid #243145}.toc-list a{display:block;padding:7px 5px;color:var(--muted);font-size:14px;text-decoration:none;line-height:1.4}.toc-list a:hover{color:#fff;background:#192433}.toc-list a::before{counter-increment:chapter;content:counter(chapter,decimal-leading-zero) ". ";font:12px/1.4 Consolas,monospace;color:#748ba7}.book-main{min-width:0}.book-main>section{padding:32px 0 38px;border-top:1px solid var(--line);scroll-margin-top:12px}.book-main>section:first-child{border-top:0;padding-top:15px}h2{font-size:29px;line-height:1.25;letter-spacing:-.02em;margin:0 0 21px;color:#d7c2ff}h3{font-size:20px;line-height:1.35;color:#d7e7fa;margin:28px 0 12px}p{margin:12px 0 18px}.section-lead{font-size:19px;color:#c4d8ee}li{margin:7px 0}code,kbd{font:14px/1.5 ui-monospace,Consolas,monospace;background:#1d2b3f;color:#c4e1ff;padding:2px 5px;border-radius:3px}strong,b{color:#f6f8fb}
figure{margin:24px 0;min-width:0}figure img{display:block;width:100%;height:auto;max-height:none;background:#0a0e15;border:1px solid var(--line)}figure>a{display:block}figure>a:hover img{border-color:#829fc1}figcaption{color:var(--muted);font-size:14px;line-height:1.5;margin-top:9px}.diagram{min-height:120px;background:#030507;border:1px solid var(--line)}.diagram svg{display:block;width:100%;height:auto}.comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.comparison figure{margin:14px 0}.mobile-hint{display:none}.legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.legend>div{padding:14px 17px;background:var(--surface);border-left:2px solid #8a71b4}dt{font-weight:700;color:#ddcefb}dd{margin:7px 0 0;color:#c0cde0}
.table-wrap{max-width:100%;overflow-x:auto;margin:20px 0;border:1px solid var(--line)}table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.5;text-align:left}th,td{padding:12px 14px;vertical-align:top;border-bottom:1px solid var(--line)}thead th{background:#1b293b;color:#d9e8fa;font-weight:600}tbody tr:last-child td{border-bottom:0}tbody tr:nth-child(even){background:#121c29}.compact{max-width:540px;text-align:center}.rgb-table td:not(:first-child){text-align:center;font-family:Consolas,monospace}.rgb-table td:first-child{white-space:nowrap}.colour{display:inline-block;vertical-align:middle;width:16px;height:16px;margin-right:9px;border:1px solid #8997ab}.black{background:#000}.red{background:#f00}.green{background:#0f0}.blue{background:#00f}.yellow{background:#ff0}.magenta{background:#f0f}.cyan{background:#0ff}.white{background:#fff}
.note{padding:17px 20px;border-left:3px solid #d0ab56;background:#242317;color:#dfdac7;margin:22px 0}.note b{color:#ffdf9b}.recipe{padding:18px 22px;margin:24px 0;background:#132333;border-left:3px solid #6caad9}.recipe h3{margin:0 0 12px}.recipe li:first-child{margin-top:0}.recipe li:last-child{margin-bottom:0}ol.recipe{padding-left:44px}details{margin:20px 0;border:1px solid var(--line);padding:14px 18px}summary{cursor:pointer;font-weight:600;color:#d4e8ff}details[open]>summary{margin-bottom:15px}details.recipe{border:0;border-left:3px solid #6caad9}.small{font-size:14px;color:var(--muted)}
button,select,input{font:inherit;color:var(--text);background:#19283a;border:1px solid #789bbb;padding:8px 12px;border-radius:0}button{cursor:pointer;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%,0 50%)}button:hover{background:#23374e}button[aria-pressed=true]{border-color:#d6b0ff;box-shadow:inset 0 0 0 1px #d6b0ff}input[type=number]{width:105px}button:disabled{opacity:.5;cursor:default}.controls{display:flex;flex-wrap:wrap;gap:14px;align-items:center}.controls label{display:flex;align-items:center;gap:10px}label[hidden]{display:none!important}
.demo{margin:26px 0;padding:20px;background:#101e2b;border:1px solid #365774}.demo h3{margin-top:0}.rgb-demo-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.demo-colour{display:inline-block;width:48px;height:48px;border:1px solid #91a6bf}output{font:15px/1.6 ui-monospace,Consolas,monospace}#rgbDemoValue{min-width:220px}#edgeWidthsDemo{display:block;margin-top:15px;color:#b9dcff}
footer{max-width:1440px;padding:24px 28px;margin:20px auto 0;border-top:1px solid var(--line);color:var(--muted);font-size:13px}.back-top{display:inline-block;margin-top:12px}.face-demo{display:flex;gap:20px;flex-wrap:wrap}.face-sample{display:block;padding:20px;background:#234459;color:#ffe8a8;font:700 24px/1.5 monospace;text-align:center}.face-sample.rotate{transform:rotate(180deg)}.face-sample.flip{transform:scaleY(-1)}
@media(max-width:1050px){.book-layout{grid-template-columns:210px minmax(0,1fr);gap:24px}h2{font-size:26px}.comparison,.legend{grid-template-columns:1fr}}
@media(max-width:760px){.book-header,.book-title{padding:20px 16px}.book-header{gap:14px}.book-header span{margin-left:0;width:100%}.book-layout{display:block;padding:0 16px}.book-toc{position:static;max-height:none;padding:0;margin:0 0 25px}.book-toc details{margin-top:0}.toc-list{columns:2;column-gap:22px;max-height:340px;overflow:auto}.toc-list li{break-inside:avoid}.toc-list a{font-size:13px}.lead{font-size:18px}.book-main>section{padding:28px 0}h2{font-size:25px}th,td{padding:10px}table{font-size:14px}.controls label{width:100%;justify-content:space-between}.controls select{max-width:67%}.diagram{overflow-x:auto}.diagram svg{min-width:650px}.mobile-hint{display:block;color:var(--muted);font-size:14px}.recipe{padding:15px}.demo{padding:15px}footer{padding:22px 16px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
/* Compact handbook on screen; print keeps its own full-resolution layout. */
@media screen{
 :root{font-size:14px;line-height:1.4}
 .book-header{padding-top:12px;padding-bottom:12px;gap:14px}.book-title{padding-top:24px;padding-bottom:18px}
 h1{font-size:clamp(28px,3.5vw,40px);margin-bottom:12px}.lead,.section-lead{font-size:16px;line-height:1.4;margin:8px 0}
 .book-main>section{padding:20px 0 24px}h2{font-size:22px;margin-bottom:12px}h3{font-size:18px;margin:16px 0 8px}
 p{margin:8px 0 10px}li{margin:4px 0}code,kbd{font-size:12px;line-height:1.3;padding:1px 4px}
 .table-wrap{margin:10px 0}table{font-size:14px;line-height:1.4}th,td{padding:6px 8px}
 .note,.recipe,.demo{margin:12px 0;padding:10px 12px}.note{line-height:1.4}.recipe h3{margin-bottom:8px}ol.recipe{padding-left:30px}
 details{margin:12px 0;padding:10px 12px}details[open]>summary{margin-bottom:8px}.legend{gap:8px}.legend>div{padding:10px 12px}dd{margin-top:4px}
 figure,.comparison figure{margin:12px 0}figure>a{width:fit-content;max-width:100%}.book-main figure img{width:auto;max-width:min(100%,560px);max-height:340px;object-fit:contain}figcaption{font-size:13px;line-height:1.35;margin-top:5px}
 .book-main .diagram{min-height:0}.book-main .diagram svg{display:block;width:100%;min-width:0;max-width:760px;max-height:340px;height:auto}.comparison{gap:12px}
 #shortcuts{font-size:13px;line-height:1.3}#shortcuts h3{font-size:16px;margin:14px 0 6px}#shortcuts p{margin:6px 0 8px}#shortcuts .small{font-size:13px;line-height:1.3}
 #shortcuts .table-wrap{margin:6px 0 10px}#shortcuts table{font-size:13px;line-height:1.3}#shortcuts th,#shortcuts td{padding:4px 6px}#shortcuts td:first-child{width:32%}#shortcuts kbd{font-size:12px;line-height:1.2}
}
@media print{html,body{background:#fff;color:#151515;font-size:11pt}.book-header,.book-toc,.jump-links,.no-print{display:none}.book-title,.book-layout,footer{display:block;max-width:none;padding:0}.book-main>section{break-inside:auto;padding:16pt 0}.book-main h2{break-after:avoid;color:#24334d}h3,b,strong,dt{color:#111}.table-wrap{overflow:visible}table{font-size:9pt}td,th{border-color:#bbb}figure{break-inside:avoid}figure img{max-height:550px}.note,.recipe,.demo,.legend>div,thead th,tbody tr:nth-child(even){background:#f1f3f7;color:#111}a{color:#253c69}figcaption,footer,.scope,.small{color:#444}details{border-color:#ccc}}
