/* Interface palettes only; media, authored inks and export pixels are untouched. */
:root[data-theme="dark"] { color-scheme:dark; --paper:#171717; --ink:#f4f0ec; color:var(--ink); background:var(--paper); }
:root[data-theme="dark"] textarea::placeholder { color:#aaa5a0; }
:root[data-theme="dark"] #site-links { --link-color:#aaa5a0; }
:root[data-theme="dark"] :is(#home-privacy,#home-about):hover,
:root[data-theme="dark"] :is(#home-privacy,#home-about):focus-visible,
:root[data-theme="dark"] #site-links .site-link:hover,
:root[data-theme="dark"] #site-links .site-link:focus-visible { color:#f4f0ec; }
.atmosphere-dark { position:absolute; z-index:1; inset:0; background:#192331; opacity:0; transition:opacity .25s ease; }
:root[data-theme="dark"] .atmosphere-dark { opacity:1; }
.atmosphere-dark::before { background:radial-gradient(ellipse at 25% 25%,#363149 0%,transparent 60%),radial-gradient(ellipse at 75% 75%,#213e42 0%,transparent 65%); }
.atmosphere-dark::after { background:radial-gradient(ellipse at 70% 20%,#40382e 0%,transparent 60%),radial-gradient(ellipse at 20% 80%,#24324d 0%,transparent 65%); }
/* Draw is an authored paper surface; its existing inks never invert or disappear. */
.draw-page { --ink:#111; color:var(--ink); background:var(--paper); }
.draw-page #paper { background:var(--paper); }
.draw-page .back { color:#111; }
/* Shared atmosphere stays behind content; the canvas and media pixels are untouched. */
body { isolation:isolate; }
.atmosphere { position:fixed; z-index:-1; inset:0; overflow:hidden; pointer-events:none; opacity:0; background:#b9c9d2; transition:opacity 2.4s ease; }
.atmosphere::before, .atmosphere::after, .atmosphere-dark::before, .atmosphere-dark::after { content:""; position:absolute; inset:-25%; animation:atmosphere-drift 90s ease-in-out infinite alternate; animation-play-state:paused; animation-delay:var(--atmosphere-delay-a,0ms); }
.atmosphere::before { background:radial-gradient(ellipse at 25% 25%,#d6c4d9 0%,transparent 60%),radial-gradient(ellipse at 75% 75%,#93b7ba 0%,transparent 65%); }
.atmosphere::after { background:radial-gradient(ellipse at 70% 20%,#e2d4be 0%,transparent 60%),radial-gradient(ellipse at 20% 80%,#a0b5d3 0%,transparent 65%); animation-duration:117s; animation-direction:alternate-reverse; }
.atmosphere::after, .atmosphere-dark::after { animation-duration:117s; animation-direction:alternate-reverse; animation-delay:var(--atmosphere-delay-b,0ms); }
:root[data-atmosphere] .atmosphere { opacity:1; }
:root[data-atmosphere]:not([data-atmosphere-hidden]) .atmosphere::before,
:root[data-atmosphere]:not([data-atmosphere-hidden]) .atmosphere::after,
:root[data-atmosphere]:not([data-atmosphere-hidden]) .atmosphere-dark::before,
:root[data-atmosphere]:not([data-atmosphere-hidden]) .atmosphere-dark::after { animation-play-state:running; }
:root[data-atmosphere] #answer { background:transparent!important; }
@keyframes atmosphere-drift { from { transform:translate3d(-4%,-3%,0) rotate(-6deg); } to { transform:translate3d(5%,4%,0) rotate(7deg); } }
#appearance-controls { position:fixed; z-index:30; top:max(8px,env(safe-area-inset-top)); right:max(8px,env(safe-area-inset-right)); display:flex; }
#appearance-controls button { width:44px; height:44px; padding:0; display:flex; align-items:center; justify-content:center; border:0; border-radius:0; background:transparent; color:var(--ink); cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
#appearance-controls button[hidden], body:has(#asking[hidden]) #appearance-controls { display:none; }
#appearance-controls #color-scheme-label { display:flex; align-items:center; }
#appearance-controls #color-scheme-label[hidden] { display:none; }
#appearance-controls #color-scheme-label span { display:none; }
#appearance-controls #color-scheme { min-height:44px; padding:0 4px; font:inherit; font-size:11px; color:var(--ink); border:0; background:transparent; cursor:pointer; }
#appearance-controls #color-scheme:focus-visible { text-decoration:underline; text-underline-offset:4px; }
.atmosphere-orb { position:relative; width:10px; height:10px; border:1px solid currentColor; border-radius:50%; overflow:hidden; pointer-events:none; background:transparent; box-shadow:none; opacity:.55; transition:opacity .3s ease; }
.atmosphere-orb::before { content:""; position:absolute; inset:0; border-radius:inherit; background:linear-gradient(135deg,#79a4ff 0%,#65d7c0 50%,#b784e8 100%); opacity:0; transition:opacity .3s ease; }
#appearance-controls:has(:focus-visible) .atmosphere-orb { opacity:1; }
#appearance-controls:has(:focus-visible) .atmosphere-orb::before { opacity:1; }
@media(hover:hover) and (pointer:fine) {
  #appearance-controls:hover .atmosphere-orb { opacity:1; }
  #appearance-controls:hover .atmosphere-orb::before { opacity:1; }
}
#appearance-controls button:focus-visible { opacity:1; outline:1px solid currentColor; outline-offset:-8px; }
@media(hover:hover) and (pointer:fine) {
  /* Extra space responds as the pointer approaches, before it reaches a button. */
  #appearance-controls { top:calc(max(8px,env(safe-area-inset-top)) - 32px); right:calc(max(8px,env(safe-area-inset-right)) - 32px); padding:32px; }
  #appearance-controls:not(:hover):not(:focus-within) .atmosphere-orb { opacity:.15; }
}
:root[data-theme-transition],
:root[data-theme-transition] *,
:root[data-theme-transition] *::before,
:root[data-theme-transition] *::after,
:root[data-theme-transition] *::backdrop { transition-property:none!important; }
:root[data-theme-transition]::view-transition { pointer-events:none; }
:root[data-theme-transition]::view-transition-group(root) {
  animation-duration:280ms;
  animation-timing-function:cubic-bezier(.25,.1,.25,1);
}
@media(prefers-reduced-motion:reduce) {
  .atmosphere::before, .atmosphere::after, .atmosphere-dark::before, .atmosphere-dark::after { animation:none; }
  .atmosphere, .atmosphere-dark, #appearance-controls, .atmosphere-orb, .atmosphere-orb::before { transition:none; }
}

/* Site-wide focus: no enclosing boxes on click, tap or keyboard focus.
   Text fields keep their caret and existing baseline; keyboard actions underline. */
:focus { outline:none!important; }
:is(input,textarea,select):focus-visible { border-bottom-color:currentColor; }
:is(a,button,summary):focus-visible {
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:5px;
}
/* Native app menus follow the live surface; authored quiet/paper views retain theirs. */
:root:not([data-theme-fixed]):not([data-read-quiet]) :is(.read-options-panel,.recordings-panel,.practice-footer-step-menu>.practice-step-list){background:var(--site-surface,var(--paper))}
:root:not([data-workspace]) .paths-popup{background:var(--site-surface,var(--paper))}
/* Shared encounter typography for Paths and structured Practices. */
:root{--encounter-width:500px;--encounter-font:20px;--encounter-leading:1.6;--encounter-choice-font:16px;--encounter-mobile-font:18px}

/* Native selection also belongs to Desktop and its atmosphere-free app frames. */
::selection{background:var(--ink);color:var(--paper)}
:root[data-atmosphere]:is([data-desktop],[data-workspace-follow]):not([data-theme-fixed]):not([data-sketch-surface=paper]):not([data-read-quiet]):not([data-index-device-theme]) ::selection{background-color:var(--home-jelly-solid,var(--ink));color:var(--home-jelly-ink,var(--paper))}
