/* ==========================================================================
   BASE — reset, body, and the reusable pieces: .glass, .icon-btn, .mono
   ========================================================================== */

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-ui);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
button:focus { outline: none; }
button:focus-visible,
[tabindex]:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

svg { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }

.visually-hidden {
  position: fixed; left: 0; top: 0;
  width: 2px; height: 2px;
  opacity: 0; pointer-events: none;
}

/* Small uppercase data text, like an instrument readout */
.mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Glass material: smoky, matte, one hairline ---------- */
.glass {
  background: linear-gradient(160deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

/* ---------- Round hairline icon button ---------- */
.icon-btn {
  position: relative;
  width: var(--btn);
  height: var(--btn);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform 0.35s var(--spring), color 0.3s, border-color 0.3s, opacity 0.3s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.is-off { color: var(--ink-faint); }
.icon-btn.is-on { border-color: var(--hairline-strong); }
.icon-btn.is-on::before {
  content: "";
  position: absolute; top: 7px; right: 7px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.is-empty { visibility: hidden; pointer-events: none; }

/* Live sound-level ring (hear-through button). --lvl is 0…1, set from JS. */
.icon-btn--level::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: calc(var(--lvl, 0) * 0.9);
  transform: scale(calc(1 + var(--lvl, 0) * 0.3));
  transition: transform 0.08s linear, opacity 0.08s linear;
  pointer-events: none;
}

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