:root {
  color-scheme: dark;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --ink-faint: rgba(255, 255, 255, 0.52);
  --accent: #ffd79a;
  --ground: #0b1228;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --spring: cubic-bezier(0.34, 1.36, 0.5, 1);
  --glide: cubic-bezier(0.22, 1, 0.36, 1);
  --grow: cubic-bezier(0.3, 1.16, 0.52, 1);             /* (a pane growing open, with the faintest overshoot) */
  --shrink: cubic-bezier(0.4, 0, 0.2, 1);
  /* every word on the glass wears a faint dark hairline round it, and a soft drop under it, so it reads over a bright sky */
  --edge: 0 0 1px rgba(6, 12, 26, 0.5), 0 0 1px rgba(6, 12, 26, 0.3), 0 1px 2px rgba(10, 16, 32, 0.3);
}
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--ground); color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: none; }
#scene { position: fixed; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; transform: scale(1.045); transition: transform 2.4s var(--glide); }
.revealed #scene { transform: none; }   /* the valley settles into place as the loading screen lifts */
#scene.locked { cursor: none; }
.hud { position: fixed; pointer-events: none; z-index: 2; text-shadow: var(--edge); }
.hud > *, .hud button, .hud input { pointer-events: auto; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }

/* liquid glass: a frosted, saturated pane with a fine hairline edge and no painted-on light. It's the one material
   for every surface, in the valley and on the menu alike (the time dial and viewpoint bar are the reference). */
.glass:not(.hud) { position: relative; }
.glass {
  isolation: isolate;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0.09)), var(--glass-tint, rgba(20, 28, 48, 0.1));
  backdrop-filter: blur(var(--glass-blur, 14px)) saturate(1.8) brightness(1.04); -webkit-backdrop-filter: blur(var(--glass-blur, 14px)) saturate(1.8) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 24px rgba(8, 16, 36, 0.2), 0 1px 3px rgba(8, 16, 36, 0.12);
}
/* glass that carries reading is frostier; out in the valley it's a shade deeper too, so white words hold up over a
   bright sky */
.pause-card { --glass-blur: 24px; --glass-tint: rgba(18, 28, 44, 0.3); }
.menu, .sheet { text-shadow: var(--edge); }   /* (as the valley's own controls carry it) */
/* out in the valley the renderer draws the glass itself, refracting and frosting the valley under each pane
   (src/render/glass.js); the page keeps only each pane's outline, its light and its shadow */
.gl-glass .hud .glass, .gl-glass .hud.glass { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255, 255, 255, 0.24); box-shadow: 0 8px 24px rgba(8, 16, 36, 0.18), 0 1px 3px rgba(8, 16, 36, 0.1); }
.gl-glass .lens { background: rgba(255, 255, 255, 0.1); }
/* a button on a pane of words: a light fill and a clear hairline edge, so it stands out from the pane it sits on */
.gl-glass .hud .pill, .gl-glass .help .play { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36), 0 2px 10px rgba(8, 16, 36, 0.18); }
.gl-glass .hud .pill:hover, .gl-glass .help .play:hover { background: rgba(255, 255, 255, 0.24); }
/* entrance: opacity and transform only, so it runs on the compositor alongside the first heavy frames */
.enter { opacity: 0; transform: translateY(18px) scale(0.96); transition: opacity 0.9s var(--glide), transform 0.9s var(--spring); will-change: opacity, transform; }
.ready .enter { opacity: 1; transform: none; }
.ready .enter.d1 { transition-delay: 0.08s; } .ready .enter.d2 { transition-delay: 0.18s; } .ready .enter.d3 { transition-delay: 0.3s; }

/* ------------------------------------------------------------------ one family of controls
   Every control is one of the two the valley's pickers are made of. A segmented pill, as the viewpoint bar is: words
   on the glass, and a soft lens that glides under whichever one the pointer is on and rests under the chosen one
   (on a glass surface it sits in a faint inset track). And a round button, as the dial's play button is. Beside a
   round button, words set as the dial sets the hour: a bold name over a small faint line. */
:root { --lens: rgba(255, 255, 255, 0.2); --lens-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(8, 16, 36, 0.16); }
.seg { position: relative; isolation: isolate; display: inline-flex; flex-wrap: wrap; justify-content: center; padding: 3px; border-radius: 999px; max-width: 100%; box-sizing: border-box; }
/* (its corners run round the lens's at an even distance: the lens's 12px radius and the 3px between them) */
.seg.inner { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16), inset 0 1px 2px rgba(8, 16, 36, 0.14); border-radius: 15px; }
/* the lens rests under the chosen word, where a pill has one, glides from there to whatever you point at, and back
   when you leave; where nothing is chosen it wells up right under the first word you point at and melts away there */
.seg-lens { position: absolute; left: 0; top: 0; z-index: 0; width: var(--w, 0px); height: var(--h, 0px); translate: var(--x, 0px) var(--y, 0px); border-radius: 999px; pointer-events: none; opacity: 0; scale: 0.86;
  background: var(--lens); box-shadow: var(--lens-shadow); transition: translate 0.45s var(--spring), width 0.45s var(--spring), height 0.4s var(--spring), opacity 0.25s var(--glide), scale 0.4s var(--spring); }
.seg.lensed .seg-lens { opacity: 1; scale: 1; }
.seg.lensed.pressing .seg-lens { scale: 0.95; }
.seg-item { all: unset; position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; box-sizing: border-box; cursor: pointer; white-space: nowrap;
  font: 500 11.5px var(--ui); color: var(--ink-soft); transition: color 0.25s, transform 0.3s var(--spring); -webkit-tap-highlight-color: transparent; }
.seg-item:hover, .seg-item.on { color: var(--ink); }
.seg-item.on { text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), var(--edge); }
.seg-item:active { transform: scale(0.94); }
.seg-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--spring); }
.seg-item:hover svg { transform: translateX(2px); }
.seg-item:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 1px; }
.seg.large { padding: 4px; }
.seg.large .seg-item { padding: 9px 18px; font-size: 14px; }
/* one action on its own: the lens, as a button */
.pill { all: unset; display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 999px; box-sizing: border-box; cursor: pointer; font: 500 12.5px var(--ui); color: var(--ink);
  background: var(--lens); box-shadow: var(--lens-shadow); transition: transform 0.35s var(--spring), filter 0.25s; -webkit-tap-highlight-color: transparent; }
.pill:hover { filter: brightness(1.12); transform: scale(1.03); }
.pill:active { transform: scale(0.95); }
.pill:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }
/* words beside a round button, as the dial names the hour */
.hl { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hl b { display: block; font: 600 15px/1.2 var(--ui); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.hl span { font: 500 11.5px/1.35 var(--ui); color: var(--ink-faint); white-space: nowrap; }

/* key caps; a key pressed twice wears a little glass bead with 2× on it, over its top corner */
kbd { position: relative; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 6px; font: 600 10.5px var(--ui); color: var(--ink);
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); text-shadow: 0 0 1px rgba(6, 12, 26, 0.45); }
.twice { position: absolute; top: -5px; right: -6px; width: 11px; height: 11px; border-radius: 50%; display: grid; place-items: center; font: 700 5px/1 var(--ui); letter-spacing: -0.02em; color: #fff;
  background: rgba(255, 255, 255, 0.24); border: 0.5px solid rgba(255, 255, 255, 0.6); box-shadow: inset 0 0.5px 1px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(8, 16, 36, 0.3);
  backdrop-filter: blur(4px) saturate(1.8); -webkit-backdrop-filter: blur(4px) saturate(1.8); }

/* rows of keys, as the valley's menu and the controls sheet list them */
.keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 12px; margin: 0; font: 500 12.5px/1.3 var(--ui); color: var(--ink-soft); align-items: center; }
.keys dt { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.keys dd { margin: 0; }
/* the words on the menus can be selected and copied (elsewhere a drag looks around, so nothing else selects) */
.menu h1, .sheet { -webkit-user-select: text; user-select: text; }
.sheet button { -webkit-user-select: none; user-select: none; }
::selection { background: rgba(255, 215, 154, 0.45); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01s !important; animation-duration: 0.01s !important; animation-delay: 0s !important; transition-delay: 0s !important; } }
