/* Semantic colors: accent surfaces always retain dark ink in either theme. */
:root {
  color-scheme:light;
  --surface:#fff;--surface-soft:#f6f7f3;--surface-card:#f5f6f0;
  --text:#151714;--muted:#50594a;--edge:#cbd0c7;
  --header-surface:rgba(255,255,255,.94);--line:rgba(21,23,20,.25);
  --section-surface:#fff;--facts-surface:#eef1ea;--hover-surface:#e9efdf;
  --contrast-surface:#151714;--contrast-text:#b8ff2c;
  --intro-surface:#fff;--intro-filter:grayscale(1) invert(1) contrast(180%) brightness(95%);
  --art-overlay:linear-gradient(90deg,rgba(255,255,255,.96),rgba(255,255,255,.8) 48%,rgba(255,255,255,.18)),linear-gradient(0deg,#fff,transparent 70%);
  --fold-overlay:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.88) 48%,#fff 86%);
  --blue:#3c51d6;
}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --surface:#0d100d;--surface-soft:#121612;--surface-card:#171c16;
  --text:#eef3e8;--muted:#bdc7b7;--edge:#354032;
  --header-surface:rgba(13,16,13,.94);--line:rgba(238,243,232,.25);
  --section-surface:#080a08;--facts-surface:#080a08;--hover-surface:#25321e;
  --contrast-surface:#b8ff2c;--contrast-text:#151714;
  --intro-surface:#000;--intro-filter:grayscale(1) contrast(180%) brightness(110%);
  --art-overlay:linear-gradient(90deg,rgba(8,10,8,.94),rgba(8,10,8,.8) 48%,rgba(8,10,8,.4)),linear-gradient(0deg,#080a08,transparent 70%);
  --fold-overlay:linear-gradient(180deg,rgba(8,10,8,0),rgba(8,10,8,.88) 48%,#080a08 86%);
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --surface:#0d100d;--surface-soft:#121612;--surface-card:#171c16;
  --text:#eef3e8;--muted:#bdc7b7;--edge:#354032;
  --header-surface:rgba(13,16,13,.94);--line:rgba(238,243,232,.25);
  --section-surface:#080a08;--facts-surface:#080a08;--hover-surface:#25321e;
  --contrast-surface:#b8ff2c;--contrast-text:#151714;
  --intro-surface:#000;--intro-filter:grayscale(1) contrast(180%) brightness(110%);
  --art-overlay:linear-gradient(90deg,rgba(8,10,8,.94),rgba(8,10,8,.8) 48%,rgba(8,10,8,.4)),linear-gradient(0deg,#080a08,transparent 70%);
  --fold-overlay:linear-gradient(180deg,rgba(8,10,8,0),rgba(8,10,8,.88) 48%,#080a08 86%);
}
body,.news,.profile-statement,.news-hero,.news-archive{background:var(--surface);color:var(--text)}
.site-header{background:var(--header-surface);border-color:var(--line);color:var(--text)}
.site-header nav a:hover,.locale-indicator{border-color:currentColor}
.pill-dark{background:var(--contrast-surface);color:var(--contrast-text)}
.language-switcher>div{background:var(--surface-card);color:var(--text);border-color:currentColor;box-shadow:5px 5px 0 var(--edge)}
.language-switcher>div a:hover,.language-switcher>div a.is-current{color:var(--ink)}
.hero-byline,.float-one small,.news-list article p,.method-list p{color:var(--muted)}
.hero,.profile-hero,.news-hero,.news-layout>.theme-art{border-color:var(--text)}
.hero h1 em,.profile-title h1 em,.projects h2 em,.news-hero h1 em{-webkit-text-stroke-color:var(--text)}
.floating-card{background:var(--surface-card);color:var(--text);border-color:var(--text);box-shadow:8px 8px 0 var(--edge)}
.float-two{background:var(--yellow);color:var(--ink);border-color:var(--ink)}
.ticker{background:var(--contrast-surface);color:var(--contrast-text);border-color:var(--line)}
.jump-grid{background:var(--surface)}
.jump-card{background:var(--surface-card)}
.projects,.project-search,.project-grid-shell{background:var(--section-surface);color:var(--text)}
.projects-art::after{background:var(--art-overlay)}
.projects-head>p{color:var(--text);text-shadow:none}
.project-grid,.facts-grid{background:var(--edge)}
.project-paper{background:var(--surface-card)!important;color:var(--text)!important}
.project-green,.project-yellow{color:var(--ink)!important}
.project-search input{color:var(--text);border-color:var(--text)}
.project-search input::placeholder{color:var(--muted)}
.project-grid-shell.is-collapsed .project-fold-shade{background:var(--fold-overlay)}
.project-grid-shell.is-list .project-grid{background:var(--section-surface);color:var(--text)}
.is-list .project-icon{background:var(--contrast-surface);color:var(--contrast-text)}
.is-list .project-card:hover{background:var(--hover-surface)!important}
.news-list,.news-more,.method-list{border-color:var(--text)}
.news-list article>a,.round-arrow{background:var(--yellow);color:var(--ink)}
.news-list article>i{color:var(--muted)}
.news-filters button{color:var(--text);border-color:var(--text)}
.news-filters button.active,.news-filters button:hover{background:var(--contrast-surface);color:var(--contrast-text)}
.profile-facts{background:var(--facts-surface);color:var(--text)}
.profile-index,.profile-statement>p{color:var(--text)}
.fact{background:var(--surface-card)}
.fact-wide{background:var(--yellow);color:var(--ink)}
.profile-method{background:var(--surface-soft);color:var(--text)}
.news-contact,.closing,.social-strip{background:var(--yellow);color:var(--ink)}
.profile-statement blockquote em{background:none;text-decoration:underline;text-decoration-color:var(--contrast-surface);text-decoration-thickness:.12em;text-underline-offset:.12em}
.site-footer{background:var(--section-surface);color:var(--text);border-color:var(--line)}
#dialog-content{background:var(--surface);color:var(--text);border-color:var(--text)}
.dialog-close{color:var(--text);background:var(--surface)}
.intro,.intro-dark-logo-frame{background:var(--intro-surface)}
.intro-dark-logo-frame::after{box-shadow:inset 0 0 clamp(34px,7vw,92px) clamp(18px,4vw,54px) var(--intro-surface)}
.intro-dark-logo-frame .intro-dark-logo{filter:var(--intro-filter)}
.error-page{min-height:100vh;min-height:100svh;display:grid;place-items:center;padding:24px}
.error-page main{width:min(720px,100%);border:2px solid currentColor;background:var(--surface-card);padding:clamp(24px,7vw,72px);box-shadow:10px 10px 0 var(--edge)}
.error-page p{line-height:1.8;overflow-wrap:anywhere}
.error-page strong{display:block;font-size:clamp(64px,18vw,160px);line-height:1;letter-spacing:-.08em}
.error-page h1{font-size:clamp(28px,5vw,48px);margin:28px 0 12px}
.error-page a{display:inline-block;margin-top:22px;padding:14px 20px;border:2px solid var(--ink);background:var(--yellow);color:var(--ink);font-weight:800}
