/* Theme surfaces; artwork and per-project palettes retain their original colors. */
:root {
  color-scheme:dark;
  --header-bg:#000;--surface-raised:#000;--nav-text:#aaa;
  --body-secondary:#c5c5be;--description:#aaa9a2;--secondary-title:#777971;
  --menu-accent:#b9a2ff;--menu-shadow:#0005;
}
html[data-theme="light"] {
  color-scheme:light;
  --bg:#fff;--surface:#fff;--surface-raised:#fff;
  --text:#111;--muted:#666;--line:#ddd;--accent:#52681a;
  --header-bg:#fff;--nav-text:#555;
  --body-secondary:#444;--description:#666;--secondary-title:#777;
  --menu-accent:#5227ff;--menu-shadow:#2630181f;
}
body,.site-header,.motion-section,.motion-stage,.about,.project-dialog,.dialog-bar,.staggered-menu-panel {
  transition:background-color .28s ease,color .28s ease,border-color .28s ease;
}
.site-header,.dialog-bar {background:var(--header-bg)}
.site-header nav a {color:var(--nav-text)}
.site-header nav a:hover,.site-header nav a.current {color:var(--text)}
.identity-mark .logo-core,.identity-mark .logo-bar {fill:var(--text);transition:fill .28s ease}
.hero-art figcaption,.pending-label,.coming-label {color:var(--muted)}
.image-index {color:#fff}
.meta-divider {color:var(--muted)}
.motion-section {background:var(--surface)}
.motion-stage {background:var(--bg)}
.motion-placeholder {background:radial-gradient(ellipse at 50% 110%,color-mix(in srgb,var(--accent) 5%,transparent),transparent 66%)}
.motion-placeholder>p {color:var(--body-secondary)}
.frame-corner {border-color:var(--muted)}
.coming-label i {background:var(--muted)}
.about {background:var(--bg)}
.personal-details p,.timeline-role {color:var(--body-secondary)}
.timeline-description,.detail-summary>p {color:var(--description)}
.contact-main h2 span {color:var(--secondary-title)}
.contact-pending {color:var(--body-secondary)}
.contact-pending span {color:var(--muted)}
.project-dialog {border-color:var(--line)}
.year-select-frame option {background:var(--surface-raised)}
.featured-frame {box-shadow:inset 0 0 0 1px var(--line)}
.motion-stage.border-glow {border-color:var(--line)}
html[data-theme="light"] .personal-card {--personal-surface:#fff;--personal-ink:#111;--personal-muted:#666;--personal-border:var(--line)}
html[data-theme="light"] .motion-placeholder {background:none}
html[data-theme="light"] .project-dialog::backdrop {background:#0007}
html[data-theme="light"] .skip-link,html[data-theme="light"] .toast,html[data-theme="light"] ::selection {color:#fff}
.staggered-menu-wrapper {--sm-accent:var(--menu-accent)}
.staggered-menu-panel {background:var(--surface-raised);color:var(--text)}
.sm-toggle,.sm-panel-item {color:var(--text)}
.sm-panel-kicker,.sm-footer-signature {color:var(--muted)}
.sm-footer-line {color:var(--body-secondary)}
.sm-footer-title {color:var(--menu-accent)}
.directory-visible .identity {color:var(--text)}
.directory-visible .identity-cn {color:var(--muted)}
.directory-visible .identity-mark {filter:none}
.theme-control {position:relative;flex:none}
.theme-toggle {position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;min-width:64px;padding:8px 0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--text);font-size:12px;font-weight:500;line-height:1.15;white-space:nowrap;transition:color .2s}
.theme-toggle:hover,.theme-toggle:focus-visible {color:var(--accent)}
.theme-toggle:focus-visible {outline:none}
.theme-toggle:focus-visible::after {content:"";position:absolute;bottom:3px;left:25%;right:25%;height:2px;background:currentColor}
.theme-icon {display:grid;width:18px;height:18px;flex:none}
.theme-icon svg {grid-area:1/1;width:18px;height:18px;transition:opacity .25s,transform .35s cubic-bezier(.2,.8,.2,1)}
.theme-icon-sun {opacity:0;transform:rotate(-90deg) scale(.5)}
.theme-icon-moon {opacity:1;transform:rotate(0) scale(1)}
html[data-theme="light"] .theme-icon-sun {opacity:1;transform:rotate(0) scale(1)}
html[data-theme="light"] .theme-icon-moon {opacity:0;transform:rotate(90deg) scale(.5)}
.theme-menu {position:absolute;top:calc(100% + 12px);right:0;width:192px;padding:6px;background:var(--surface-raised);border:1px solid var(--line);border-radius:var(--ui-radius);box-shadow:0 14px 40px var(--menu-shadow);z-index:40}
.theme-menu-label {padding:9px 10px 8px;font-size:10px;color:var(--muted);letter-spacing:.06em}
.theme-choice {display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:10px;color:var(--text);font-size:12px;text-align:left;border-radius:var(--ui-radius)}
.theme-choice>svg {width:17px;height:17px;flex:none}
.theme-choice:hover,.theme-choice:focus-visible {color:var(--accent)}
.theme-choice:focus-visible {outline:none;text-decoration:underline;text-underline-offset:5px}
.theme-choice[aria-checked="true"] {color:var(--accent)}
.theme-choice .theme-check {width:15px;height:15px;margin-left:auto;opacity:0}
.theme-choice[aria-checked="true"] .theme-check {opacity:1}
@media(max-width:680px) {
  .header-actions {gap:12px}
  .theme-toggle {min-width:40px;width:40px;height:40px;padding:10px}
  .theme-label {display:none}
}
@media(prefers-reduced-motion:reduce) {
  body,.site-header,.motion-section,.motion-stage,.about,.project-dialog,.dialog-bar,.staggered-menu-panel,.theme-icon svg {transition:none}
}
