/* The daylight skin stays intact. After dusk: charcoal, stone, a little copper. */
.site-header .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .45rem .8rem; margin-left: .5rem;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font: inherit; white-space: nowrap; cursor: pointer;
}
.theme-toggle::before {
  content: ''; width: .85rem; height: .85rem; border: 1px solid currentColor;
  border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.site-header .theme-toggle:hover { background: var(--surface); border-color: var(--accent); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1d1b; --surface: #252623; --ink: #eee8de;
  --muted: #bdb7ac; --dim: #aaa399; --line: #454640;
  --accent: #d4a480; --blue: #d4a480; --coral: #d4a480;
  --pink: #38332f; --yellow: #373129; --green: #30342d;
}
html[data-theme="dark"] body::before { background: #9b795e; }
html[data-theme="dark"] ::selection { background: #d4a480; color: #1c1d1b; }
html[data-theme="dark"] a:hover { color: #edc4a3; }
html[data-theme="dark"] :is(button, a, input, select) { -webkit-tap-highlight-color: #d4a48030; }
html[data-theme="dark"] :is(.wordmark, .hero h1, .work-main h1, .about h2, .room-invitation h2, .hope-garden h2, .error-page h1) { color: var(--ink); }
html[data-theme="dark"] :is(.wordmark span, .hero h1 .full-stop, .hero-note, .essay-label, .about-copy .about-coda, .hope-garden .eyebrow, .curiosities h3, .room-colophon h2, .player-note) { color: var(--accent); }
html[data-theme="dark"] :is(.lede, .prose, .note-row p, .margin-notes p, .places p, .curiosities p, .hope-garden p, .score-caption, .range-ends, .cairn-caption, .hope-garden .stone-note),
html[data-theme="dark"] .room-sketch::after { color: var(--muted); }
html[data-theme="dark"] .footer-note { color: var(--accent) !important; }
html[data-theme="dark"] nav a[href='/rooms/chair'] { background: #332e27; border-color: #74604d; }
html[data-theme="dark"] nav a:hover { background: #373129; color: var(--ink); }
html[data-theme="dark"] .button-link { background: var(--accent); border-color: var(--accent); color: #211f1b; }
html[data-theme="dark"] .button-link:hover { background: #edc4a3; border-color: #edc4a3; color: #211f1b; }
html[data-theme="dark"] .hero-art { background: #292a26; border-color: #53534b; box-shadow: 8px 10px 0 #131411; }
html[data-theme="dark"] .ticker { background: #242521; border-color: #41443a; }
html[data-theme="dark"] .ticker-track { color: #bdb7ac; }
html[data-theme="dark"] .ticker-track b { color: #b08b6e; }
html[data-theme="dark"] .room-invitation { background: #292722; border-color: #51493d; }
html[data-theme="dark"] .room-invitation .button-link { box-shadow: 4px 4px 0 #161612; }
html[data-theme="dark"] .sketch-floor { background: #77776b; border-color: #b9b7a5; }
html[data-theme="dark"] .sketch-floor::before { color: #d9d4c4; }
html[data-theme="dark"] .sketch-glass { background: #566a70; border-color: #a6b7b8; }
html[data-theme="dark"] .sketch-glass::before { color: #d5dfdc; }
html[data-theme="dark"] .sketch-chair { background: #bb8c69; border-color: #d4a480; }
html[data-theme="dark"] .sketch-chair::before, html[data-theme="dark"] .sketch-chair::after { background: #d4a480; }
html[data-theme="dark"] .essay:hover { background: var(--surface); }
html[data-theme="dark"] .essay:hover .essay-open { color: #211f1b; }
html[data-theme="dark"] .art-section { background: #252623; }
html[data-theme="dark"] .art-section::before { background: radial-gradient(circle at 10px 0, transparent 9px, #252623 9.5px) 0 0 / 20px 10px repeat-x; }
html[data-theme="dark"] .art-grid figure { background: #2d2e29; border-color: #51524a; box-shadow: 7px 8px 0 #191a17; }
html[data-theme="dark"] .art-grid figure:nth-child(2) { background: #2d2e29; }
html[data-theme="dark"] :is(.curiosities, .places > a, .places > a:nth-child(2), .places > a:nth-child(3), .note-row, .note-row:nth-child(2), .note-row:nth-child(3)) { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .motion-toggle { border-color: #75766b; }
html[data-theme="dark"] .motion-toggle[aria-pressed=true] { background: #373b31; }
html[data-theme="dark"] .entry-layout article { background: #242521; border-color: var(--line); box-shadow: 6px 6px 0 #12130f; }
html[data-theme="dark"] .margin-notes { background: #2d2b24; }
html[data-theme="dark"] .margin-notes li { border-color: #504b3e; }
html[data-theme="dark"] .edition { background: #34392e; color: #d0d7be; }
html[data-theme="dark"] .comparison-column { background: #292722; border-color: var(--line); }
html[data-theme="dark"] .comparison-column + .comparison-column { background: #272a23; }
html[data-theme="dark"] .comparison .prose .earlier-paragraph { border-color: #9b795e; }
html[data-theme="dark"] .comparison .prose .later-paragraph { border-color: #c3c5ac; }
html[data-theme="dark"] .instrument { background: #242521; border-color: #786550; box-shadow: 7px 8px 0 #12130f; }
html[data-theme="dark"] .room-stage { background: #30322d; border-color: #4b4e42; }
html[data-theme="dark"] .stage-label { color: #c4bba8; }
html[data-theme="dark"] .stage-state { color: #d9dacb; background: #3e4438; }
html[data-theme="dark"] .bar-line { stroke: #4b4d44; }
html[data-theme="dark"] .bar-label { fill: #aaa399; }
html[data-theme="dark"] .voice-chair { fill: #d4a480; }
html[data-theme="dark"] .voice-glass { fill: #a6b7b8; }
html[data-theme="dark"] .voice-floor { fill: #bab7a4; }
html[data-theme="dark"] .legend-chair { color: #d4a480; }
html[data-theme="dark"] .legend-glass { color: #a6b7b8; }
html[data-theme="dark"] .legend-floor { color: #bab7a4; }
html[data-theme="dark"] #score-map .is-sounding { fill: #f2dfbd; stroke: #f2dfbd; }
html[data-theme="dark"] audio { color-scheme: dark; }
html[data-theme="dark"] .recipe-form { background: #2b2d26; border-color: #4b4e42; }
html[data-theme="dark"] .recipe-form::before, html[data-theme="dark"] .control label { color: var(--ink); }
html[data-theme="dark"] :is(.control output, #room-status) { color: var(--accent); }
html[data-theme="dark"] :is(button, select, input[type=number], input[type=search]) { background: #20211d; border-color: #747669; color: var(--ink); }
html[data-theme="dark"] button:hover { background: #373b31; border-color: var(--accent); }
html[data-theme="dark"] .primary-button { background: var(--accent); border-color: var(--accent); color: #211f1b; box-shadow: 3px 3px 0 #151610; }
html[data-theme="dark"] .primary-button:hover { background: #edc4a3; color: #211f1b; }
html[data-theme="dark"] .primary-button:disabled { background: #8b7b67; color: #171813; }
html[data-theme="dark"] .arrangement-actions .primary-button { background: #d4a480; color: #211f1b; border-color: #d4a480; box-shadow: 3px 3px 0 #12130f; }
html[data-theme="dark"] .arrangement-actions .primary-button:hover { background: #edc4a3; }
html[data-theme="dark"] .arrangement-actions .primary-button:disabled { background: #8b7b67; color: #171813; }
html[data-theme="dark"] #room-status[data-error=true] { color: #f0afa0; }
html[data-theme="dark"] .room-colophon { border-color: #666656; }
html[data-theme="dark"] :is(.agent-docs pre, pre) { background: #252821; border-color: #484e3e; color: #d9dfcb; }
html[data-theme="dark"] th { color: var(--accent); background: #2e3029; }
html[data-theme="dark"] .studio-table td { background: #242521; }
html[data-theme="dark"] .hope-garden { background: #272825; border-color: #4a4b43; }
html[data-theme="dark"] #stone-button { background: #30312b; color: var(--ink); border-color: #858574; }
html[data-theme="dark"] #stone-button:hover { background: #3c3e35; border-color: var(--accent); }
html[data-theme="dark"] .cairn-patch::before { border-color: #626454; }
html[data-theme="dark"] .little-cairn::after { background: #0e100b70; }
/* Weathered faces and quartz seams. Color belongs to the stones, not every panel. */
html[data-theme="dark"] .stone {
  background: linear-gradient(156deg, #ffffff24, transparent 43%, #10151145),
    repeating-linear-gradient(12deg, transparent 0 9px, #ede6d90a 10px, transparent 11px 19px), var(--mineral);
  border-color: #eee5d329; box-shadow: inset 0 -3px 0 #151b1838, 0 3px 2px #10130e50;
}
html[data-theme="dark"] .stone::after { background: #f1eada70; }
html[data-theme="dark"] .hero-cairn { --mineral: #8e8879; filter: drop-shadow(4px 6px 3px #10120b80); }
html[data-theme="dark"] .hero-cairn .stone-cap { --mineral: #a3a496; }
html[data-theme="dark"] .hero-cairn .stone-middle { --mineral: #b69c7e; }
html[data-theme="dark"] .cairn-ochre { --mineral: #aa9276; }
html[data-theme="dark"] .cairn-ochre .stone-middle { --mineral: #c1ac8c; }
html[data-theme="dark"] .cairn-ochre .stone-lower { --mineral: #927e64; }
html[data-theme="dark"] .cairn-slate { --mineral: #808b89; }
html[data-theme="dark"] .cairn-slate .stone-cap { --mineral: #afb5a9; }
html[data-theme="dark"] .cairn-slate .stone-lower { --mineral: #6f7a76; }
html[data-theme="dark"] .cairn-rose { --mineral: #96877a; }
html[data-theme="dark"] .cairn-rose .stone-middle { --mineral: #b8a79a; }
html[data-theme="dark"] .cairn-rose .stone-lower { --mineral: #7f7c70; }
html[data-theme="dark"] .site-header .theme-toggle { background: transparent; border-color: var(--line); }
html[data-theme="dark"] .site-header .theme-toggle:hover { background: var(--surface); border-color: var(--accent); }
@media(max-width:700px) { .site-header .theme-toggle { font-size: .75rem; margin-left: .2rem; padding-inline: .65rem; } }
