:root{color-scheme:light}
html[data-theme=dark]{color-scheme:dark;--color-text:#e9e4df;--color-secondary:#c0b9b2;--color-muted:#aca49c;--color-accent:#ee9386;--color-link:#ee9386;--color-rule:#55504b}
html[data-theme=dark] body{background:#1b1b1b;color:var(--color-text)}
html[data-theme=dark] .home-section:nth-child(even){background:#252423}
html[data-theme=dark] .bio,html[data-theme=dark] .site-epigraph{background:#302725;border-color:#64544d;color:var(--color-text)}
html[data-theme=dark] .site-footer{background:#292725;color:var(--color-text);border-color:var(--color-rule)}
html[data-theme=dark] .site-menu details>div,html[data-theme=dark] .footnote-tip,html[data-theme=dark] .up,html[data-theme=dark] .lightbox aside{background:#302e2b;color:var(--color-text);border-color:var(--color-rule)}
html[data-theme=dark] .lightbox{color:var(--color-text)}
html[data-theme=dark] .prose blockquote{background:#292725;border-color:var(--color-rule)}
html[data-theme=dark] .prose .story-epigraph{background:transparent}
html[data-theme=dark] .site-menu summary:after{border-top-color:var(--color-text)}
html[data-theme=dark] .site a:hover{color:#c6bdb5}
html[data-theme=dark] .site a.section-title-link:hover,html[data-theme=dark] .site .site-head a:hover{color:inherit}
html[data-theme=dark] .footer-up{background:#a83c32;color:#fff}
html[data-theme=dark] .page-navigation .page-current{background:#a83c32;color:#fff}
html[data-theme=dark] .page-navigation a:hover,html[data-theme=dark] .poem-toggle:hover{background:#40332f}
html[data-theme=dark] .site :is(.home-section h2:after,.work,.literature-grid>section,.games-grid>div+div,.work-project:after,.consultation-heading,.page-navigation,.content-tags,.footer-tags,.about-links-column,#viral){border-color:var(--color-rule)}
html[data-theme=dark] .site :is(.work-book,.work-translation,.work-game,.work-project) .work-body>p,html[data-theme=dark] .bottom-link-list li>p{color:var(--color-secondary)}
html[data-theme=dark] .poem-date,html[data-theme=dark] .pranks-counter{color:var(--color-muted)}
html[data-theme=dark] .social-icons img{filter:brightness(0) invert(.85)}
html[data-theme=dark] .gallery-item span{background:#1b1b1bbf;color:var(--color-text)}
html[data-theme=dark] .comic-tile>span,html[data-theme=dark] .art-grid span,html[data-theme=dark] .art-directory span{background:#1b1b1bdc;color:var(--color-text)}
html[data-theme=dark] .important-star{color:#e8bc48}
html[data-theme=dark] .pranks-controls.over-picture button{color:#eee}
html[data-theme=dark] .pranks-controls.over-picture button svg{background:#242424df}

.art-day-image{display:contents}.art-night-image{display:none}html[data-theme=dark] a:has(>.art-night-image)>.art-day-image{display:none}html[data-theme=dark] .art-night-image{display:contents}
html[data-theme=dark] .site-head{background-size:cover;background-position:center 30%;background-repeat:no-repeat}
html[data-theme=dark] .art-grid>a::after,html[data-theme=dark] .art-directory a::after{background:#1b1b1b}
/* Compact theme toggle beside the epigraph, aligned with the menu. */
.theme-switch{display:inline-flex;align-items:center;justify-content:center;flex:none;align-self:center;border:0;border-radius:0;padding:0;gap:7px;min-height:20px;height:20px;background:transparent;color:var(--color-text);cursor:pointer}
.site-menu-bar>.theme-switch{position:absolute;right:350px;top:18px;z-index:2}
.theme-switch svg{flex:none}
.theme-switch:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.theme-switch-track{position:relative;display:block;flex:none;width:42px;height:20px;box-sizing:border-box;border:0;border-radius:999px;background:#999796;color:#fff;transition:background 180ms ease}
.theme-switch-track::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0002;transition:transform 180ms ease}
.theme-switch-track svg{position:absolute;top:4px;width:12px;height:12px}
.theme-switch-track .theme-sun{left:4px;display:none}
.theme-switch-track .theme-moon{right:4px;display:block}
html[data-theme=dark] .theme-switch-track{background:#45413f}
html[data-theme=dark] .theme-switch-track::after{transform:translateX(22px)}
html[data-theme=dark] .theme-switch-track .theme-sun{display:block}
html[data-theme=dark] .theme-switch-track .theme-moon{display:none}
.epigraph-theme-group{position:absolute;right:0;top:calc(50% + 32px);transform:translateY(-50%);display:flex;align-items:center;gap:14px;max-width:100%}
.epigraph-theme-group>.site-epigraph{position:static;transform:none;max-width:372px;padding:14px 32px}
@media(max-width:1100px){.site-menu-bar>.theme-switch{right:12px}.site-menu-bar>.site-menu{padding-right:90px}}
@media(max-width:1100px) and (min-width:741px){.epigraph-theme-group{top:auto;bottom:0;transform:none}}
@media(max-width:740px){.epigraph-theme-group{position:relative;top:auto;right:auto;transform:none;justify-content:flex-end;margin:0 0 18px auto;gap:12px}.epigraph-theme-group>.site-epigraph{max-width:calc(100% - 68px);padding:14px 20px}}
@media(prefers-reduced-motion:reduce){.theme-switch-track::after{transition:none}}
