/* Shared controls and light palette for the main site. Blog keeps its existing
   palette; both use the same preference in js/blog-theme.js. */
:root{--site-paper:#090909;--site-panel:#131313;--site-soft:#191919;--site-ink:#f4f3ee;--site-muted:#a5aaa0;--site-line:#34372f;--site-accent:#ffd700;--site-brand:#ffd700}
:root[data-theme="light"]{--site-paper:#fbfaf7;--site-panel:#fff;--site-soft:#f1efe7;--site-ink:#20251e;--site-muted:#5e6658;--site-line:#d9dccf;--site-accent:#806200}
:root .site-theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:10px;border:1px solid var(--site-line);border-radius:50%;background:var(--site-panel);color:var(--site-ink);cursor:pointer;line-height:1;transition:border-color .2s,background-color .2s}
.site-theme-toggle[hidden]{display:none!important}
:root .site-theme-toggle:hover{border-color:var(--site-accent);background:var(--site-soft)}
.site-theme-toggle:focus-visible{outline:2px solid var(--site-accent);outline-offset:4px}
.site-theme-toggle svg{display:block;width:20px;height:20px;stroke:currentColor;flex:none}
.site-theme-toggle .theme-icon-sun{display:none}
:root[data-theme="light"] .site-theme-toggle .theme-icon-sun{display:block}
:root[data-theme="light"] .site-theme-toggle .theme-icon-moon{display:none}
.site-primary-nav .site-primary-nav__actions{gap:12px}
:root .site-primary-nav .site-primary-nav__actions>*{margin-left:0;margin-right:0}
.site-theme-document .site-theme-toggle{float:right;margin:0 0 16px 16px}
.site-theme-document h1{clear:both;overflow-wrap:anywhere;hyphens:auto}
@media(min-width:1280px){
  .site-theme-page .site-primary-nav__links{display:flex;align-items:center;gap:24px;font-size:11px;letter-spacing:.14em}
  .site-theme-page .site-primary-nav .site-primary-nav__links>*{margin-left:0;margin-right:0}
}
@media(max-width:767px){.site-primary-nav .site-primary-nav__actions{gap:8px}.hdr__nav{gap:12px}.site-theme-home .hero-title{font-size:clamp(35px,10.3vw,3.6rem)}}
@media(max-width:380px){.site-theme-about .hdr__nav{gap:9px}.site-theme-about .hdr__nav .back{font-size:11px}.site-theme-about .hdr__nav .back:first-of-type{display:none}}
@media print{.site-theme-toggle{display:none!important}}

/* Legacy Tailwind pages retain their dark palette when dark is selected. */
@media screen {
  :root[data-theme="light"]{background:var(--site-paper)}
  :root[data-theme="light"] .site-theme-page{background:var(--site-paper);color:var(--site-ink)}
  :root[data-theme="light"] .site-theme-page ::selection{background:var(--site-brand);color:#20251e}
  :root[data-theme="light"] .site-theme-page :is(.bg-black,.bg-\[\#000\]){background-color:var(--site-paper)}
  :root[data-theme="light"] .site-theme-page :is(.bg-\[\#050505\],.bg-\[\#030303\]){background-color:var(--site-soft)}
  :root[data-theme="light"] .site-theme-page :is(.bg-\[\#0a0a0a\],.bg-\[\#0b0b0b\],.bg-neutral-900){background-color:var(--site-panel)}
  :root[data-theme="light"] .site-theme-page :is(.bg-white\/5,.bg-white\/10){background-color:var(--site-panel)}
  :root[data-theme="light"] .site-theme-page :is(.text-white,.text-gray-200,.text-gray-300){color:var(--site-ink)}
  :root[data-theme="light"] .site-theme-page :is(.text-gray-400,.text-gray-500,.text-gray-600,.text-white\/40){color:var(--site-muted)}
  :root[data-theme="light"] .site-theme-page :is(.gold-accent,.text-gold-accent,.text-\[\#FFD700\]){color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page :is(.border-white-10,.border-white,.border-white\/5,.border-white\/10,.border-white\/20,.border-white\/30){border-color:var(--site-line)}
  :root[data-theme="light"] .site-theme-page .outline-text{color:transparent;-webkit-text-stroke:1px #838b79}
  :root[data-theme="light"] .site-theme-page :is(.hover\:text-gold-accent,.hover\:text-\[\#FFD700\]):hover{color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page .group:hover .group-hover\:text-gold-accent{color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page :is(.hover\:bg-neutral-900,.hover\:bg-white\/5):hover{background-color:#e9e8df}
  :root[data-theme="light"] .site-theme-page :is(button,a).bg-white{background:var(--site-brand);color:#20251e}
  :root[data-theme="light"] .site-theme-page :is(button,a).bg-white:hover{background:#f2ca00}
  :root[data-theme="light"] .site-theme-page :is(input,textarea):not([type=checkbox]){background:var(--site-panel);color:var(--site-ink);border-color:#a7af9b}
  :root[data-theme="light"] .site-theme-page :is(input,textarea)::placeholder{color:#737d68;opacity:1}
  :root[data-theme="light"] .site-theme-page :is(input,textarea):focus{border-color:var(--site-accent);background:var(--site-panel)}
  :root[data-theme="light"] .site-theme-page :is(.site-primary-nav,.hdr){background:#fbfaf7f5;border-color:var(--site-line)}
  :root[data-theme="light"] .site-theme-page .site-primary-nav__links{color:var(--site-muted)}
  :root[data-theme="light"] .site-theme-page .hamburger-line{background:var(--site-ink)}
  :root[data-theme="light"] .site-theme-page .nav-dropdown__panel-inner{background:#fffffff7;border-color:var(--site-line);box-shadow:0 16px 35px -15px #20251e38}
  :root[data-theme="light"] .site-theme-page .nav-dropdown__item{color:var(--site-ink)}
  :root[data-theme="light"] .site-theme-page :is(.nav-dropdown:hover .nav-dropdown__trigger,.nav-dropdown:focus-within .nav-dropdown__trigger,.as-mnav__trigger:hover,.as-mnav__cb:checked~.as-mnav__trigger){color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page .nav-dropdown__item:hover{color:var(--site-accent);background:var(--site-soft)}
  :root[data-theme="light"] .site-theme-page #mobile-menu{background:#fbfaf7fa}
  :root[data-theme="light"] .site-theme-page .mobile-menu-contact{border-color:var(--site-line)}
  :root[data-theme="light"] .site-theme-page :is(.mobile-menu-social-link,.contact-social-link){color:var(--site-ink);border-color:var(--site-line);background:transparent}
  :root[data-theme="light"] .site-theme-page .contact-social-link:hover{background:var(--site-soft);color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page .contact-social-icon{background:var(--site-soft);border-color:var(--site-line)}
  :root[data-theme="light"] .site-theme-page .contact-social-subtitle{color:var(--site-muted)}
  :root[data-theme="light"] .site-theme-page svg :is([stroke="white"],[stroke^="rgba(255"]){stroke:var(--site-ink)}
  :root[data-theme="light"] .site-theme-page svg [stroke="#FFD700"]{stroke:var(--site-accent)}
  :root[data-theme="light"] .site-theme-page .marquee{background:var(--site-soft);border-color:#c9b464}
  :root[data-theme="light"] .site-theme-page .marquee-item{color:#474f40}
  :root[data-theme="light"] .site-theme-page .monitor-frame{box-shadow:0 24px 60px #444b3826,0 0 0 1px #8b917a33;border-color:#555c4e}
  :root[data-theme="light"] .site-theme-page .monitor-stand{background:linear-gradient(#6f7568,#bdc2b3);border-color:#858b7a}
  /* Keep the monitor and photographic project overlays legible as artwork. */
  :root[data-theme="light"] .site-theme-page .monitor-frame .text-gold-accent{color:#ffd700}
  :root[data-theme="light"] .site-theme-page .monitor-frame :is(.text-gray-500,.text-white\/40){color:#a4ad95}
  :root[data-theme="light"] .site-theme-page #portfolio a.group{background:#10110f;border-color:var(--site-line);box-shadow:0 8px 30px #20251e0a}
  :root[data-theme="light"] .site-theme-page #portfolio a.group :is(.text-white,.text-gray-300){color:#fff}
  :root[data-theme="light"] .site-theme-page #portfolio a.group :is(.text-gold-accent,.text-\[\#FFD700\],.group-hover\:text-gold-accent){color:#ffd700}
  :root[data-theme="light"] .site-theme-page #portfolio a.group>img{opacity:.82}
  :root[data-theme="light"] .site-theme-page #portfolio a.group:hover>img{opacity:1}
  :root[data-theme="light"] .site-theme-page #feedback-modal{background:#20251e99}
  :root[data-theme="light"] .site-theme-page #feedback-modal>div{background:var(--site-panel);box-shadow:0 28px 80px #20251e33}
  :root[data-theme="light"] .site-theme-page #close-project-zoom-modal{color:#fff;border-color:#ffffff66}

  /* The author's page uses its own variables and compact header. */
  :root[data-theme="light"] .site-theme-about{--bg:var(--site-paper);--card:var(--site-panel);--card2:var(--site-soft);--line:var(--site-line);--line2:#bfc6b3;--txt:var(--site-ink);--muted:var(--site-muted);--muted2:#6d765f;--gold:var(--site-accent);--ok:#237545}
  :root[data-theme="light"] .site-theme-about .photo{box-shadow:0 0 0 1px var(--line2),0 18px 40px #20251e22}
  :root[data-theme="light"] .site-theme-about :is(.role,.chip,.about,.about .hl,.pill){color:var(--site-ink)}
  :root[data-theme="light"] .site-theme-about .chip:hover{color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-about :is(.chip--gold,.btn--gold){background:var(--site-brand);color:var(--site-ink);border-color:var(--site-brand)}
  :root[data-theme="light"] .site-theme-about .tag{background:var(--site-soft);color:var(--site-muted)}
  :root[data-theme="light"] .site-theme-about :is(.cred__thumb,.cred__thumb img){background:var(--site-soft)}
  :root[data-theme="light"] .site-theme-about .cred:hover{box-shadow:0 18px 42px #20251e1a;border-color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-about .cred__seal em{color:var(--site-accent)}
  :root[data-theme="light"] .site-theme-about .cta{background:linear-gradient(135deg,#f5f3e8,#eeefe7)}
  :root[data-theme="light"] .site-theme-about .lb{background:#20251eeb}

  /* Adaptive checker: change the UI, keeping device frames and page previews. */
  :root[data-theme="light"] .as-page{--as-bg:var(--site-paper);--as-surface:var(--site-panel);--as-surface-2:var(--site-soft);--as-line:var(--site-line);--as-line-soft:#e5e7df;--as-muted:var(--site-muted);--as-error:#b42318;--as-warn:#946100;--as-info:#2364a5;--as-ok:#237545}
  :root[data-theme="light"] .as-page :is(.as-input,.as-select,.as-btn--ghost,.as-chip,.as-scale-value,.as-meta-line b,.as-check__detail,.as-check__fix,.as-loading__text){color:var(--site-ink)}
  :root[data-theme="light"] .as-page :is(.as-select,.as-input,.as-dt__panel,.as-dt__filter){background:var(--site-panel);border-color:var(--site-line)}
  :root[data-theme="light"] .as-page :is(.as-badge,.as-check__fix b,.as-device__reload:hover,.as-device__devtools:hover,.as-screen__error-retry){color:var(--site-accent)}
  :root[data-theme="light"] .as-page .as-badge{border-color:#b7a343;background:#fff8d9}
  :root[data-theme="light"] .as-page :is(.as-chip[aria-pressed="true"],.as-btn--ghost:hover){color:var(--site-ink);border-color:var(--site-accent)}
  :root[data-theme="light"] .as-page .as-range{background:#d7ddce}
  :root[data-theme="light"] .as-page :is(.as-chip__year,.as-toolbar__hint,.as-device__year,.as-screen__error-meta,.as-dt__empty,.as-dt-row__time,.as-dt-net__meta){color:var(--site-muted)}
  :root[data-theme="light"] .as-page .as-check__items code{color:var(--site-accent);background:var(--site-soft)}
  :root[data-theme="light"] .as-page :is(.as-device__os.is-ios,.as-device__os.is-mac,.as-device__cache){color:var(--site-muted);border-color:var(--site-line)}
  :root[data-theme="light"] .as-page :is(.as-device__os.is-desktop,.as-device__engine,.as-device__cache.is-miss){color:var(--as-info);border-color:#87a7c9}
  :root[data-theme="light"] .as-page :is(.as-device__os.is-android,.as-device__cache.is-hit){color:var(--as-ok);border-color:#86ae8c}
  :root[data-theme="light"] .as-page :is(.as-device__engine.is-fallback,.as-device__devtools.is-unavailable){color:var(--as-warn);border-color:#bba56c}
  :root[data-theme="light"] .as-page :is(.as-device__devtools.has-errors,.as-dt__chip.has-errors,.as-dt-net__err,.as-dt-net.is-bad .as-dt-net__status,.as-error-banner,.as-screen__error-title){color:var(--as-error)}
  :root[data-theme="light"] .as-page :is(.as-dt__body,.as-screen__overlay){background:var(--site-soft)}
  :root[data-theme="light"] .as-page :is(.as-dt__head,.as-dt__notice,.as-dt__btn,.as-dt__chip,.as-dt-row){border-color:var(--site-line)}
  :root[data-theme="light"] .as-page :is(.as-dt-row__text,.as-dt-net__url,.as-dt__tab:hover,.as-dt__btn:hover,.as-dt__chip:hover){color:var(--site-ink)}
  :root[data-theme="light"] .as-page :is(.as-dt__notice,.as-dt-row--info .as-dt-row__text,.as-dt-net__method){color:var(--as-info)}
  :root[data-theme="light"] .as-page :is(.as-dt__notice.is-ready,.as-dt-net__status){color:var(--as-ok)}
  :root[data-theme="light"] .as-page :is(.as-dt__notice.is-warning,.as-dt-row--warn .as-dt-row__text){color:var(--as-warn)}
  :root[data-theme="light"] .as-page .as-dt-row--error .as-dt-row__text{color:var(--as-error)}
  :root[data-theme="light"] .as-page :is(.as-dt__tab.is-active,.as-dt__chip.is-active){color:#20251e}
  :root[data-theme="light"] .as-page .as-dt__chip.has-errors.is-active{color:#fff}
  :root[data-theme="light"] .as-page .as-screen__overlay.is-error{background:#fff1ee}
  :root[data-theme="light"] .as-page .as-cwv__progress{background:#d7ddce}
}
