/* perf-tiers.css — tier overrides for the Clear Glass / HUD stack
   ══════════════════════════════════════════════════════════════════════
   CONTRACT: additive override layer, loaded LAST (after theme-glass-clear.css).
   Keys off <html data-perf="ultra|balanced|lite"> set by perf-tiers.js.
   Nothing here touches layout or logic — only blur, shadows, animations
   and which decorative layers exist. ROLLBACK: drop the <link>.

   ultra     everything as designed (animated glass, dot grid, cursor glow)
   balanced  softer blur, breathing shadows frozen, dot grid off
   lite      no backdrop blur (solid tint instead), all decorative motion off,
             scanlines / dot grid / cursor glow / background video off
   ══════════════════════════════════════════════════════════════════════ */

/* Safety net: the page must be dark even before/without the video (Lite). */
html { background-color: #03060f; }

/* ── Atmosphere canvas (atmosphere.js): sits between the background video
      and #root; CSS-only fallback vignette when WebGL is unavailable. ── */
#atmosphere {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
#atmosphere.atmosphere-fallback {
  background:
    radial-gradient(ellipse at center, transparent 36%, rgba(0, 0, 0, 0.28) 76%, rgba(0, 0, 0, 0.64) 100%);
}

/* ── Performance toggle button (header, next to the audio toggle) ── */
.perf-btn {
  position: relative;
  font-size: 16px;
}
.perf-btn .perf-badge {
  position: absolute;
  inset-block-end: -6px;
  inset-inline-end: -6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.5px;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(5, 10, 21, 0.92);
  border: 1px solid rgba(56, 232, 255, 0.45);
  color: #38e8ff;
  text-transform: uppercase;
  pointer-events: none;
}
.perf-btn.perf-auto .perf-badge { color: #94a3b8; border-color: rgba(148, 163, 184, 0.45); }
.perf-btn.perf-lite .perf-badge { color: #ffc24b; border-color: rgba(255, 194, 75, 0.5); }
.perf-btn.perf-ultra .perf-badge { color: #e14eca; border-color: rgba(225, 78, 202, 0.5); }

/* ═══════════════ BALANCED ═══════════════ */
html[data-perf="balanced"] {
  --clear-blur: 10px;
  --clear-blur-strong: 14px;
}
/* Animated box-shadow / filter repaints every frame — freeze them. */
html[data-perf="balanced"] .panel,
html[data-perf="balanced"] .story-panel,
html[data-perf="balanced"] .header-frame,
html[data-perf="balanced"] .hud-section-shell,
html[data-perf="balanced"] .hud-panelized,
html[data-perf="balanced"] .panel-bevel.hud-panelized,
html[data-perf="balanced"] .score-display-v2.hud-panelized,
html[data-perf="balanced"] .story-panel.hud-panelized,
html[data-perf="balanced"] .evidence-panel.hud-panelized,
html[data-perf="balanced"] .object-selector-section.hud-panelized {
  animation: none !important;
}
html[data-perf="balanced"] #dot-mouse-canvas { display: none !important; }
html[data-perf="balanced"] .hud-scanlines { animation: none !important; }

/* ═══════════════ LITE ═══════════════ */
html[data-perf="lite"] {
  --clear-blur: 0px;
  --clear-blur-strong: 0px;
  /* No blur means the glass needs a denser tint to stay readable. */
  --clear-a-panel-1: 0.72;
  --clear-a-panel-2: 0.84;
  --clear-a-shell: 0.72;
  --clear-a-chrome: 0.78;
  --clear-a-menu: 0.94;
  --clear-a-modal: 0.96;
}
html[data-perf="lite"] *,
html[data-perf="lite"] *::before,
html[data-perf="lite"] *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-perf="lite"] .header-content-tall::before,
html[data-perf="lite"] .header-content-tall::after,
html[data-perf="lite"] .header-title-row::after,
html[data-perf="lite"] .panel,
html[data-perf="lite"] .story-panel,
html[data-perf="lite"] .header-frame,
html[data-perf="lite"] .hud-section-shell,
html[data-perf="lite"] .hud-panelized,
html[data-perf="lite"] .panel-bevel.hud-panelized,
html[data-perf="lite"] .score-display-v2.hud-panelized,
html[data-perf="lite"] .story-panel.hud-panelized,
html[data-perf="lite"] .evidence-panel.hud-panelized,
html[data-perf="lite"] .object-selector-section.hud-panelized,
html[data-perf="lite"] .hud-ring,
html[data-perf="lite"] .hud-ring-rev,
html[data-perf="lite"] .hud-command-bar {
  animation: none !important;
  filter: none !important;
}
html[data-perf="lite"] .story-panel::after { animation: none !important; opacity: 0.35; }
html[data-perf="lite"] .hud-scanlines,
html[data-perf="lite"] #dot-mouse-canvas,
html[data-perf="lite"] .cursor-glow,
html[data-perf="lite"] #bg-video {
  display: none !important;
}
