/* =====================================================================
   INTERACTION-001 — WARP

   The chrome's job is to disappear. Everything here sits in a corner,
   small and quiet, so the frame belongs to the instrument. Deliberately
   a third visual world: chromatic indigo and a technical grotesk, rather
   than WEBGL-001's metal-on-ink or MOTION-001's paper editorial.
   ===================================================================== */

:root {
  --void: #0c0a1d;
  --ink: #efeaff;
  --dim: rgba(239, 234, 255, 0.58);
  --dimmer: rgba(239, 234, 255, 0.26);
  --line: rgba(239, 234, 255, 0.14);
  --grotesk: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --micro: 0.65rem;
  --edge: clamp(18px, 3vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  /* There is no scroll here at all — the mechanic is the pointer. */
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--grotesk);
  -webkit-font-smoothing: antialiased;
}

#warp {
  position: fixed;
  inset: 0;
  display: block;
  /* The whole surface is the instrument, so the pointer must never be
     interpreted as text selection, panning, or a browser gesture. */
  touch-action: none;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.micro {
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- corner chrome ---------- */
.chrome {
  position: fixed;
  z-index: 5;
  pointer-events: none;
}

.chrome--tl { top: var(--edge); left: var(--edge); }
.chrome--tr { top: var(--edge); right: var(--edge); text-align: right; }
.chrome--bl { bottom: var(--edge); left: var(--edge); }
.chrome--br { bottom: var(--edge); right: var(--edge); text-align: right; }

.wordmark {
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1;
  margin-bottom: 7px;
}

.tagline {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--dim);
  max-width: 22ch;
}

.readout { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.readout__n {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

/* ---------- hint: present until the first pluck, then gone ---------- */
.hint {
  position: fixed;
  left: 50%;
  bottom: clamp(30px, 7vh, 68px);
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.is-playing .hint { opacity: 0; transform: translateX(-50%) translateY(8px); }

@media (scripting: enabled) {
  .hint { animation: hint-in 1.1s ease-out 0.5s backwards; }
}
@keyframes hint-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

.hint__touch { display: none; }
@media (hover: none) {
  .hint__pointer { display: none; }
  .hint__touch { display: inline; }
}

/* ---------- sound toggle: the one real control ---------- */
.sound {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: var(--micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.sound:hover, .sound:focus-visible { border-color: var(--dim); color: var(--ink); }
.sound__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.sound[aria-pressed="true"] .sound__dot {
  background: #6ee7c8;
  box-shadow: 0 0 8px rgba(110, 231, 200, 0.8);
}

/* ---------- back link ---------- */
.back {
  pointer-events: auto;
  color: var(--dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.25s ease;
}
.back:hover, .back:focus-visible { color: var(--ink); }

/* ---------- no-JS ---------- */
.nojs {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--edge);
  background: var(--void);
  text-align: center;
}
.nojs p { max-width: 34ch; color: var(--dim); line-height: 1.6; }

@media (max-width: 720px) {
  .tagline { max-width: 17ch; font-size: 0.72rem; }
  .readout__n { font-size: 1.15rem; }
  .chrome--br { bottom: calc(var(--edge) + 44px); }
}
