/* The room has two moods, not an inverted colour filter. */
:root{--surface:#fbf7f1;--surface-raised:#e4ecfb;--on-action:#fbf7f1;--scene-shade:#111731}
:root[data-theme="dark"]{
  --rose:#171d38;--rose-light:#293251;--lilac:#222a48;
  --ink:#eff1ff;--shell:#141a30;--plum:#b8c7ff;
  --blue:#9bbdff;--cherry:#ffa5b9;--pink:#d5b7e5;
  --olive:#48585c;--line:#505c7c;
  --surface:#141a30;--surface-raised:#293251;--on-action:#141a30;
}
body,.site-header,.site-footer,.editorial,.home-lower,.shelf-page{transition:background-color .45s ease,color .35s ease}
.site-header{gap:24px}
#site-nav{margin-left:auto;gap:24px}
.lights-switch{display:inline-flex;align-items:center;gap:9px;flex-shrink:0;min-height:44px;padding:6px 0 6px 10px;border:0;background:transparent;color:var(--ink);font-size:12px;white-space:nowrap}
.switch-track{display:block;position:relative;width:42px;height:25px;border:1.5px solid var(--plum);border-radius:20px;background:var(--rose-light);transition:background .3s}
.switch-knob{position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:var(--plum);transition:transform .3s,background .3s;box-shadow:0 2px 3px #27294a20}
.lights-switch[aria-checked="true"] .switch-track{background:#394b75;border-color:#b8c7ff}
.lights-switch[aria-checked="true"] .switch-knob{transform:translateX(16px);background:#d6e4ff}
.lights-switch:hover .switch-track{outline:2px solid var(--cherry);outline-offset:3px}

/* Lights out: a short single dim, no strobe or long navigation delay. */
.room::after{content:'';position:absolute;inset:0;z-index:8;background:var(--scene-shade);pointer-events:none;opacity:0}
.changing-lights .room::after{animation:lights-out .65s ease-out both}
@keyframes lights-out{0%{opacity:.86}100%{opacity:0}}
.room-night{background:#171d38}
.room-night .room-hint{background:#12192ddd;color:#e6edff}
.night-phone .hotspot-label{bottom:calc(100% + 6px)}
.night-phone::before{border-color:#c6ddff77!important}
.night-phone::after{content:'';position:absolute;inset:6%;border-radius:12px;box-shadow:0 0 22px 3px #a2cfff33;pointer-events:none}

/* Dark surfaces and actions. Text roles are not coupled to background tokens. */
[data-theme="dark"] .button{background:#b8c7ff;border-color:#b8c7ff;color:#141a30}
[data-theme="dark"] .button:hover{background:#d3ddff}
[data-theme="dark"] .button.secondary{color:var(--ink);background:#293251;border-color:#9eafd9}
[data-theme="dark"] .button.secondary:hover{background:#354164}
[data-theme="dark"] .home-strip{background:#242f53;color:var(--ink)}
[data-theme="dark"] .home-strip a{border-left-color:var(--line)}
[data-theme="dark"] .filter{background:#293251;color:var(--ink)}
[data-theme="dark"] .filter[aria-pressed="true"]{background:#b8c7ff;color:#141a30}
[data-theme="dark"] .filter:hover{border-color:#ffa5b9}
[data-theme="dark"] .hotspot-label{background:#293251;color:#eff1ff;border-color:#b8c7ff;box-shadow:0 4px 12px #05091855}
[data-theme="dark"] .hotspot:hover::before,[data-theme="dark"] .hotspot:focus-visible::before{border-color:#c6ddff;background:#c6ddff14}
[data-theme="dark"] .shelf-case{background:#182a2e;border-color:#41595e;box-shadow:inset 0 0 0 2px #071417,4px 7px 0 #101e23}
[data-theme="dark"] .shelf-case::before{background:radial-gradient(ellipse at 50% 0,#41595e 70%,transparent 72%) 0 0/28px 16px repeat-x}
[data-theme="dark"] .book-slot{border-bottom-color:#41595e;box-shadow:0 3px 0 #101e23}
[data-theme="dark"] .book-button[aria-pressed="true"]{outline-color:#c7d8ff}
[data-theme="dark"] .shelf-note{background:#222a48;border-color:#64739b;box-shadow:5px 6px 0 #090f2180}
[data-theme="dark"] .shelf-note::before{background:#766b9f;border-color:#a295c5}
[data-theme="dark"] .note-holes{background:radial-gradient(circle,#151c35 4px,#6d7ba3 4px,#6d7ba3 5px,transparent 5px) 0 0/12px 54px repeat-y}
[data-theme="dark"] .shelf-empty{color:var(--ink)}
[data-theme="dark"] .shelf-empty button{background:#b8c7ff;color:#141a30}
[data-theme="dark"] .journal-nook{border-color:var(--line)}
[data-theme="dark"] .place-ning{background:#322b49}
[data-theme="dark"] .role-chips li:nth-child(3){color:#141a30}
[data-theme="dark"] .built-card{background:#202944;box-shadow:5px 6px 0 #080e2080;border-color:#6879a5}
[data-theme="dark"] .built-type{background:#334267;color:#eff1ff}
[data-theme="dark"] .type-system .built-type{background:#394a75}
[data-theme="dark"] .type-workflow .built-type{background:#54354c}
[data-theme="dark"] .type-template .built-type{background:#354d45}[data-theme="dark"] .type-business .built-type{background:#5a3a36}
[data-theme="dark"] .type-skill .built-type{background:#50432a}
[data-theme="dark"] .post-cards a{background:#263251}
[data-theme="dark"] .article-figure a{background:#dbe2f3}
[data-theme="dark"] .book-cover,[data-theme="dark"] .journal-nook img{filter:brightness(.86) saturate(.88)}
[data-theme="dark"] .book-button:hover .book-cover,[data-theme="dark"] .book-button:focus-visible .book-cover{filter:none}
[data-theme="dark"] .skip-link,[data-theme="dark"] .toast{background:#293251;color:#eff1ff}
[data-theme="dark"] .cover-designed{color:#f7e9e3}

@media(max-width:1050px){
  .site-header{height:73px;padding:0 22px;gap:15px}
  .wordmark{font-size:2rem;margin-right:auto}
  .menu-toggle{display:block;order:3;padding:10px 0 10px 4px}
  .lights-switch{order:2}
  #site-nav{display:none;position:absolute;top:72px;left:0;right:0;background:var(--shell);border-bottom:1px solid var(--plum);padding:15px 24px;box-shadow:0 6px 10px #27294a14;margin:0}
  #site-nav.open{display:flex;flex-direction:column;gap:2px;align-items:stretch}
  #site-nav a{padding:11px 5px;font-size:17px}
  #site-nav a[aria-current=page]::after{right:auto;width:25px}
}
@media(max-width:420px){.site-header{padding:0 16px;gap:11px}.lights-switch{gap:6px;font-size:10px;padding-left:0}.wordmark{font-size:1.8rem}.menu-toggle{font-size:13px}}
@media(prefers-reduced-motion:reduce){body,.site-header,.site-footer,.editorial,.home-lower,.shelf-page,.switch-knob{transition:none}.changing-lights .room::after{animation:none}}

/* New viewpoint: these targets follow the bedtime illustration, never the desk layout. */
.night-journal{left:9%;top:73%;width:20%;height:18%}
.night-phone{left:48.5%;top:40%;width:8%;height:17%;min-width:44px;min-height:44px}
.night-books{left:88%;top:15%;width:11%;height:15%;min-width:44px;min-height:44px}
.night-cat{left:70%;top:69%;width:23%;height:22%;min-width:44px;min-height:44px}
.night-books .hotspot-label{left:auto;right:0;transform:translateY(6px)}
.night-books:hover .hotspot-label,.night-books:focus-visible .hotspot-label{transform:translateY(0)}
