/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }

/* Custom cursor helpers */
.cursor-hidden, .cursor-hidden * { cursor: none !important; }

/* Version switcher */
.vtt-switcher {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: inline-flex; gap: 2px;
  background: rgba(12,12,12,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px; padding: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 0 0 0.5px rgba(255,255,255,0.08) inset;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px; letter-spacing: 0.06em;
}
.vtt-switcher button {
  color: rgba(255,255,255,0.55);
  padding: 8px 16px;
  border-radius: 999px;
  text-transform: uppercase;
  transition: color 220ms ease, background 220ms ease;
}
.vtt-switcher button:hover { color: #fff; }
.vtt-switcher button.active { background: #fff; color: #000; }

/* Tweaks panel (shared shell) */
.tweaks-panel {
  position: fixed; right: 20px; top: 20px; bottom: 20px;
  width: 320px; z-index: 10000;
  background: #fafaf8; color: #0a0a0a;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 0.5px rgba(0,0,0,0.08);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform 320ms cubic-bezier(.2,.7,.2,1), opacity 220ms ease;
}
.tweaks-panel.hidden { transform: translateX(calc(100% + 40px)); opacity: 0; pointer-events: none; }
.tweaks-panel header {
  padding: 16px 18px; border-bottom: 0.5px solid rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.tweaks-panel header .dot { width: 6px; height: 6px; border-radius: 50%; background: #ff3a00; }
.tweaks-panel .body { overflow-y: auto; padding: 8px 0; flex: 1; }
.tweaks-panel section { padding: 12px 18px; border-bottom: 0.5px solid rgba(0,0,0,0.06); }
.tweaks-panel section:last-child { border-bottom: 0; }
.tweaks-panel h4 {
  margin: 0 0 10px; font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: rgba(0,0,0,0.55);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.tweaks-panel .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.tweaks-panel .row:last-child { margin-bottom: 0; }
.tweaks-panel .row label { color: rgba(0,0,0,0.7); font-size: 11px; }
.tweaks-panel .row .val { color: rgba(0,0,0,0.45); font-size: 10px; font-variant-numeric: tabular-nums; }
.tweaks-panel input[type=range] { width: 100%; accent-color: #0a0a0a; }
.tweaks-panel .swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks-panel .swatch {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform 180ms ease, border-color 180ms ease;
}
.tweaks-panel .swatch:hover { transform: scale(1.1); }
.tweaks-panel .swatch.active { border-color: #0a0a0a; }
.tweaks-panel .seg {
  display: inline-flex; background: rgba(0,0,0,0.05);
  border-radius: 8px; padding: 2px; width: 100%;
}
.tweaks-panel .seg button {
  flex: 1; padding: 6px 8px; border-radius: 6px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(0,0,0,0.55); transition: all 180ms ease;
}
.tweaks-panel .seg button.active { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Noise overlay (opt-in) */
.noise-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  opacity: 0.04; mix-blend-mode: multiply;
  background-image: url("noise.png");
}
