/* Colour tokens + light/dark themes. Light values equal the original hard-coded colours (zero visual change). */
:root{--ring-media:rgba(0,0,0,.08);--c-strong:#111;--c-paper:#fff;--c-grid:#eeeeee;--c-label:#333;--cap:rgba(23,23,23,.56);--c-slot:#F8F8F8;--c-dot:#cfcfcf;--c-res:var(--ink);--red-text:#c62828}
.poster-svg circle{fill:var(--c-grid)}
html[data-theme=dark]{color-scheme:dark;
  --page:#111;--card:#1a1a1a;--sheet:#1a1a1a;--ink:#f2f2f2;--body:#dcdcdc;--mute:#a6a6a6;--faint:#999;--line:#2a2a2a;--frame:#161616;--frame-line:#2a2a2a;
  --ring-media:rgba(255,255,255,.12);--c-strong:#f2f2f2;--c-paper:#1a1a1a;--c-grid:#2a2a2a;--c-label:#cfcfcf;--cap:rgba(242,242,242,.56);--c-slot:#202020;--c-dot:#555;--red-text:#ff5151}
html[data-theme=dark] .media.dark,html[data-theme=dark] .media.draw{border-color:var(--frame-line)!important}
html[data-theme=dark] .res{background:#0b0b0b;border:1px solid #2a2a2a}
html[data-theme=dark] .skip{color:#111}
/* themed image pairs: <img class="theme-light"> + <img class="theme-dark"> side by side; only the one matching html[data-theme] (the toggle) shows */
html:not([data-theme=dark]) .theme-dark,html[data-theme=dark] .theme-light{display:none!important}
/* smooth colour change only when toggled (class added by js/theme.js), never on load */
html.theme-anim,html.theme-anim *,html.theme-anim *::before,html.theme-anim *::after{transition:background-color .3s ease,color .3s ease,border-color .3s ease,fill .3s ease,stroke .3s ease,box-shadow .3s ease!important}
/* intro card surface + its grid-line knockouts (CTA/hint background+box-shadow, svg .ko fills) switch instantly, together: Chrome runs the card's
   background-color transition on the compositor, so the main-thread-painted knockouts drifted out of sync and showed as a grey box mid-fade */
html.theme-anim .intro .media-wrap.surface,html.theme-anim .poster-svg .ko,html.theme-anim .poster-cap::before{transition:none!important}
/* (the CTA's knockout moved to .poster-cap::before with the CTA rise: it must switch with the card too, or its .3s background fade shows as a box) */
html.theme-anim .poster-title,html.theme-anim .poster-hint{transition:color .3s ease!important}
/* toggle */
.theme-btn .i-sun{display:none}html[data-theme=dark] .theme-btn .i-sun{display:block}html[data-theme=dark] .theme-btn .i-moon{display:none}
.home .bot{align-items:center}
@media (max-width:640px),(orientation:portrait) and (max-width:1024px){.home .bot{flex-direction:row;justify-content:space-between}}
/* project pages: floating bottom-left, same inset as the header corners */
html[data-theme=dark] .bar{background:var(--page)}
html[data-theme=dark] .badge{background:rgba(20,20,20,.75);color:#bbb;border-color:rgba(255,255,255,.08)}
/* toggle must not change footer height (keeps stage/card position identical) */
html[data-theme=dark] .toc a:not([aria-current="true"]):not(:hover){color:#8f8f8f!important}
/* toggle v2: ring = active gauge ring (24.2px outer, 2px, --c-strong); filled icons; ring ink inset equal left/bottom = corner inset */
.home .bot{position:relative}
.home .bot .theme-btn{position:absolute;bottom:calc(var(--tb-x) - var(--tb-oy,0px))}
.home .bot{justify-content:flex-end!important}

.home .top nav a[href='#work']::after{transform-origin:right} /* CASE STUDIES always enters/exits at its right edge */
.theme-btn,.theme-btn *{user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
/* toggle v4 = v1 circle (32px = the .mbtn media buttons; 16px icon as in .mbtn, 1px --line ring, v1 fills) + v3 filled icons (no stroke, --c-strong); circle edge at the corner inset */
/* toggle circle fill = intro card surface token (--c-paper) in both themes, home + project pages */
.theme-btn{appearance:none;display:grid;place-items:center;width:32px;height:32px;padding:0;margin:0;border:1px solid var(--line);border-radius:50%;box-sizing:border-box;background:var(--c-paper);color:var(--ink);cursor:pointer}
/* one position for the light/dark toggle everywhere (pages, gate, Studio presentation layer): fixed offsets + safe-area insets.
   html keeps a stable scrollbar gutter so locking scroll (presentation) never changes the viewport width, 3vw or the toggle's x */
html{scrollbar-gutter:stable}
/* embedded prototypes / demos (html.embed, ?embed=1): the document never scrolls, so no gutter (it narrowed the document by the scrollbar
   width on classic-scrollbar browsers, off-centring the device and clipping its drop shadow in a hard vertical edge) */
html.embed{scrollbar-gutter:auto}
/* site-wide, every page and embed (Hang: the audience never uses a keyboard): no focus outline, focus ring or tap highlight on anything,
   pointer or keyboard, no exceptions (the homepage rail included) */
*,*:focus,*:focus-visible,*:active{outline:none;-webkit-tap-highlight-color:transparent}
.theme-btn{--tb-x:clamp(16px,3vw,32px);position:fixed;left:calc(var(--tb-x) + env(safe-area-inset-left,0px));bottom:calc(var(--tb-x) + env(safe-area-inset-bottom,0px));z-index:60}
/* one hover ring for every round control: the 1px border at 40% of its ink (currentColor), both themes. Hover only: no focus ring */
:root{--ring-hover:color-mix(in srgb,currentColor 40%,transparent)}
.theme-btn:hover,.mbtn:hover,.car-dots:hover{border-color:var(--ring-hover)}
/* buttons on media (videos, carousels, the Studio deck): frosted glass = theme surface at 44% + 24px blur, saturate 1.6; resting edge
   --ring-media (black 8% light / white 12% dark: a soft edge a touch off the fill, not an outline). The theme toggle stays opaque on --line */
.mbtn,.car-dots{border-color:var(--ring-media);background:color-mix(in srgb,var(--c-paper) 44%,transparent);-webkit-backdrop-filter:blur(24px) saturate(1.6);backdrop-filter:blur(24px) saturate(1.6);box-shadow:0 1px 4px rgba(0,0,0,.06)}
.theme-btn svg{width:16px;height:16px;fill:var(--c-strong);stroke:none!important;display:block}
.theme-btn.theme-float{box-shadow:0 1px 4px rgba(0,0,0,.06)}
footer.bot>span{display:block;height:32px;align-content:center} /* copyright line = the toggle's 32px row on the same bottom inset (the row has no top padding, so the footer keeps its height) */
@supports (text-box:trim-end text alphabetic){footer.bot>span{align-content:end;padding-bottom:12px;text-box:trim-end text alphabetic}} /* glyph-box centring: the ink runs from the ©'s .1em descent to the .6em cap height (9.8px) and the browser snaps the baseline to a whole px, so the ink centre always lands on a half px; a baseline 12px above the row bottom (4px under the toggle centre) puts it on the same half px on every page, whatever fraction of a px the page height leaves the footer off the fixed toggle */

