:root { --ink:#002f42; --muted:#48616c; --paper:#fcfbf8; --surface:#fcfbf8; --surface-2:#f0ede5; --line:#cbd3d3; --orange:#f27636; --orange-dark:#bd4e22; --blue:#002f42; }
::selection { background:#f8d3bd; color:#002f42; }
body { background:var(--paper); }
body.night { --paper:#002f42; --surface:#07394d; --surface-2:#104659; --ink:#fcfbf8; --muted:#c3d1d5; --line:#557582; }
.topbar { height:80px; padding-block:10px; }
.brand { align-items:center; gap:20px; }
.brand-asset { display:block; width:112px; height:44px; object-fit:contain; flex:none; }
.brand small { margin-left:0; }
.footer-brand { display:flex; align-items:center; gap:20px; }
.footer-brand strong { font-size:.75rem; font-weight:600; }
.footer-inner { align-items:center; }
.controls { gap:18px; }
.icon-button { border-radius:0; border:0; border-bottom:1px solid var(--line); min-height:44px; box-shadow:none; padding:8px 10px; }
.icon-button:hover { background:var(--surface-2); border-color:var(--orange-dark); }
#themeToggle { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-width:104px; font:400 16px/1.2 Georgia,'Times New Roman',serif; }
.theme-icon { width:16px; font:18px/1 Georgia,serif; }
.theme-accent { color:var(--orange-dark); letter-spacing:1px; font-weight:700; align-self:center; }
.idea-band { background:#002f42; }
.hero { isolation:isolate; }
.brand-backdrop { position:absolute; width:min(1100px,90vw); aspect-ratio:14 / 5; right:-115px; bottom:-38px; pointer-events:none; z-index:0; }
.brand-backdrop img { width:100%; height:100%; display:block; object-fit:contain; opacity:.045; }
.brand-backdrop canvas { position:absolute; inset:0; width:100%; height:100%; opacity:.20; }
body.night .brand-backdrop img { opacity:.10; filter:brightness(0) invert(1); }
body.night .brand-backdrop canvas { display:none; }
.progress { color:#f27636; }
.progress .progress-empty { color:#a9b8bc; }
.progress .progress-filled { color:#f27636; }
.progress output { color:var(--ink); }
.article h2, summary { position:relative; }
.edge-motion { position:absolute; top:-25px; left:0; font:12px/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:4px; color:var(--orange-dark); pointer-events:none; white-space:pre; }
summary .edge-motion { top:3px; left:22px; }
@media (max-width:850px) {
  .page-grid { display:flex; flex-direction:column; }
  .article { order:0; }
  .toc { order:1; margin-top:48px; margin-bottom:0; }
  .right-rail { order:2; margin-top:24px; }
}
@media (max-width:760px) {
  .topbar { height:68px; }
  .brand-asset { width:96px; height:40px; }
  .brand-backdrop { width:660px; right:-180px; bottom:-32px; }
  .brand-backdrop img { opacity:.035; }
  .brand-backdrop canvas { opacity:.17; }
  .footer-brand { gap:15px; }
  .footer-brand strong { max-width:165px; }
  .footer-inner { gap:15px; }
}
@media (prefers-reduced-motion:reduce) { .brand-backdrop canvas,.edge-motion { display:none!important; } }
@media print { .brand-backdrop,.edge-motion { display:none!important; } }
