/* LLL — dial hero. Five plates, one rotary dial; each scroll turns the dial a
   notch and the next plate is wound in on thin concentric bands that turn
   about the dial's axle. Logic and every tunable: dial.js. */

:root {
  --ground: #0b0a09;
  --ink: #f4f1ec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* The hero does not scroll: each wheel gesture, swipe or arrow key turns the
   dial one stage (dial.js). Pull-to-refresh and rubber-banding are off. */
html, body { height: 100%; overflow: hidden; }
body { touch-action: none; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ground);
}

/* Poster and dial are placed in px by dial.js so they share the exact fit the
   shader uses — a CSS object-fit would round differently and the dial would
   drift off its painted position. */
.poster {
  position: absolute;
  display: block;
  max-width: none;
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}
.scene.is-ready { opacity: 1; }

.dial {
  position: absolute;
  pointer-events: auto;   /* grab the knob and turn it (dial.js) */
  cursor: var(--cur-grab, grab);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.dial.is-turning { cursor: var(--cur-grabbing, grabbing); }
.dial img { -webkit-user-drag: none; }
.dial-layer,
.dial-liquid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* The liquid is tinted INTO the glass tube rather than painted over it, so the
   tube's own highlights and rim stay visible through it. */
.dial-liquid { mix-blend-mode: multiply; }

/* Pivot = the knob's centre within the cropped dial layer (395.5, 407 of
   800 × 820 image units). */
.dial-knob {
  transform-origin: 49.44% 49.63%;
  will-change: transform;
}

.hint {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: calc(4vh + env(safe-area-inset-top));
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: .36em;
  text-indent: .36em;
  text-transform: uppercase;
  color: rgba(244,241,236,.7);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
  transition: opacity 600ms ease;
}
.hint.is-hidden { opacity: 0; }

/* How to turn the dial by hand: small letters on an arc round its lower
   edge, in the hint's voice. */
/* Its box holds the whole arc (client, 2026-11-20: "the hint gets cut when
   the mechanism moves" — Safari clips a filtered SVG to its own box, and the
   arc ran past the dial's): viewBox -70 0 940 880, the dial's 800 × 820
   drawing in the same place. */
.dial-hint {
  inset: auto;
  left: -8.75%;
  top: 0;
  width: 117.5%;
  height: 107.317%;
  pointer-events: none;
  overflow: visible;
  font-family: ui-monospace, Menlo, monospace;
  text-transform: uppercase;
  fill: rgba(244,241,236,.88);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.75));
  transition: opacity 600ms ease;
}
.dial-hint.is-hidden { opacity: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


/* Sound toggle — bottom right (client: at the top it pushed "let's talk"
   out of the corner), clear of the safe area. */
.sound {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  right: calc(12px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(11,10,9,.38);   /* no blur anywhere (client) */
  color: var(--ink);
  cursor: var(--cur-hand, pointer);
  z-index: 4;   /* over the header band */
}
.sound[hidden] { display: none; }
.sound svg { width: 20px; height: 20px; }
.sound .sound-mute { display: none; }
.sound.is-off .sound-waves { display: none; }
.sound.is-off .sound-mute { display: inline; }
.sound:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The client's keycaps (images: hers, untouched). They ride in on
   FAITH → HEAVEN from behind the edge of the picture: the box is the
   picture's size (set by dial.js) and clips them. Clickable once home. */
.keys { position: absolute; overflow: hidden; pointer-events: none; visibility: hidden; z-index: 2; }
.keys.is-shown { visibility: visible; }
.key {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  cursor: var(--cur-hand, pointer);
}
.keys.is-live .key { pointer-events: auto; }
.key img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.key-cap { position: absolute; inset: 0; transition: transform 140ms ease-out; }
.key-shadow { transition: opacity 140ms ease-out; }
/* Pressed: the cap travels down onto its shadow, like a real key. */
.key.is-pressed .key-cap { transform: translateY(3px) scale(.985); transition-duration: 50ms; }
.key.is-pressed .key-shadow { opacity: .45; transition-duration: 50ms; }
/* The LED on "let's talk", over her grey dot: lights green, like a MacBook's
   caps lock, when the key is pressed. */
.key-led {
  position: absolute;
  left: 85.55%;
  top: 6.35%;
  width: 4.7%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #c9ffd2 0%, #52e36b 45%, #22b347 100%);
  box-shadow: 0 0 6px 2px rgba(82, 227, 107, .75);
  opacity: 0;
  transition: opacity 80ms linear;
}
.key.is-lit .key-led { opacity: 1; }
.key:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .key-cap, .key-shadow { transition: none; } }

/* The header bar and shortcut panel: src/head.css (shared with the other pages). */
