/* HeartVibe v6.8 — Adaptive Performance Manager 2.0 rendering layer.
   No layout/content changes. Only render/compositor cost is adapted. */
html{--hv-glass-blur:10px}

/* Replace live SVG feTurbulence with a tiny pre-rasterized repeating grain texture. */
.noise{background-image:url('/assets/img/noise-64.png')!important;background-repeat:repeat!important;background-size:64px 64px!important}

/* Most button depth comes from optical gradients/shadows, not expensive live refraction. */
button.liquidGlass,.navLink.liquidGlass,.filterBtn.liquidGlass,.freqBtn.liquidGlass,.previewPlayButton.liquidGlass,.albumTrack.liquidGlass,.accessTrigger.liquidGlass,.voiceAction.liquidGlass,.vibeToggle.liquidGlass,.vibeMiniToggle.liquidGlass,.menuBtn.liquidGlass,.voiceClose.liquidGlass,.albumPanelClose.liquidGlass{
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
.streamDock.liquidGlass{backdrop-filter:blur(8px) saturate(155%)!important;-webkit-backdrop-filter:blur(8px) saturate(155%)!important}
.albumPanel{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.albumPanel.open{backdrop-filter:blur(10px) saturate(145%)!important;-webkit-backdrop-filter:blur(10px) saturate(145%)!important}

/* Offscreen sections keep layout exactly, but all CSS animation clocks sleep. */
.hv-perf-section:not(.hv-near-view) *,
.hv-perf-section:not(.hv-near-view) *::before,
.hv-perf-section:not(.hv-near-view) *::after{animation-play-state:paused!important}

/* Avoid permanent compositor promotion of large decorative layers. */
.vibeAurora,.vibeFlow,.vibePulseField,.vibeDust,.hvGlyph,.hvSectionAura{will-change:auto!important}

/* BALANCED — visually nearly identical, lower live blur/compositor cost. */
html.perf-balanced{--hv-glass-blur:7px}
html.perf-balanced .vibeDust{opacity:calc(var(--vibe-dust-opacity,.1)*.55)!important}
html.perf-balanced .vibeFlow.flowB{opacity:calc(var(--vibe-flow-opacity,.2)*.58)!important}
html.perf-balanced .nav{backdrop-filter:blur(12px) saturate(148%)!important;-webkit-backdrop-filter:blur(12px) saturate(148%)!important}
html.perf-balanced .mobilePanel,html.perf-balanced .voicePanel{backdrop-filter:blur(10px) saturate(140%)!important;-webkit-backdrop-filter:blur(10px) saturate(140%)!important}
html.perf-balanced .chapterRail,html.perf-balanced .accessTrigger,html.perf-balanced .voiceTrigger{backdrop-filter:blur(7px)!important;-webkit-backdrop-filter:blur(7px)!important}

/* LOW — preserve the complete site, reduce expensive live refraction and secondary glow. */
html.perf-low .vibeDust{display:none!important}
html.perf-low .vibeFlow.flowB{display:none!important}
html.perf-low .vibeAurora{filter:blur(var(--vibe-blur,32px)) saturate(1.32)!important}
html.perf-low .vibeFlow,html.perf-low .vibePulseField{filter:none!important}
html.perf-low .nav,html.perf-low .mobilePanel,html.perf-low .voicePanel,html.perf-low .chapterRail,html.perf-low .chapterRail .chapterName,html.perf-low .accessTrigger,html.perf-low .voiceTrigger,html.perf-low .previewToast,html.perf-low .streamDock.liquidGlass,html.perf-low .albumPanel.open{
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important
}
html.perf-low .vibePulseField{opacity:calc(var(--vibe-pulse-opacity,.2)*.56)!important}

/* SAFE — last-resort stability tier. Content, navigation, audio and core interaction remain. */
html.perf-safe .vibeDust,html.perf-safe .vibeFlow.flowB{display:none!important}
html.perf-safe .vibeBackdrop::before{animation:none!important;filter:none!important}
html.perf-safe .vibeAurora{filter:blur(18px) saturate(1.18)!important;transform:none!important}
html.perf-safe .vibeFlow,html.perf-safe .vibePulseField{filter:none!important}
html.perf-safe .vibePulseField{opacity:calc(var(--vibe-pulse-opacity,.2)*.42)!important}
html.perf-safe .nav,html.perf-safe .mobilePanel,html.perf-safe .voicePanel,html.perf-safe .chapterRail,html.perf-safe .chapterRail .chapterName,html.perf-safe .accessTrigger,html.perf-safe .voiceTrigger,html.perf-safe .previewToast,html.perf-safe .streamDock.liquidGlass,html.perf-safe .albumPanel.open,
html.perf-safe .quoteCard,html.perf-safe .storyCard,html.perf-safe .heroSignalWord{
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important
}
html.perf-safe .cta::before,html.perf-safe .flagRings,html.perf-safe .orbit{animation-play-state:paused!important}

/* Scroll-survival: only decorative animation clocks pause temporarily under measured pressure. */
html.hv-scroll-active.perf-low .vibeAurora,
html.hv-scroll-active.perf-low .vibeFlow path,
html.hv-scroll-active.perf-low .vibePulseField,
html.hv-scroll-active.perf-low .vibeDust,
html.hv-scroll-active.perf-safe .vibeAurora,
html.hv-scroll-active.perf-safe .vibeFlow path,
html.hv-scroll-active.perf-safe .vibePulseField,
html.hv-scroll-active.perf-safe .vibeDust,
html.hv-scroll-active.perf-safe .vibeBackdrop::before{animation-play-state:paused!important}

/* Hidden page: no decorative CSS clocks need to advance. */
html.hv-page-hidden .vibeBackdrop *,html.hv-page-hidden .vibeBackdrop *::before,html.hv-page-hidden .vibeBackdrop *::after,
html.hv-page-hidden main *::before,html.hv-page-hidden main *::after{animation-play-state:paused!important}

/* Coarse-pointer devices avoid persistent live backdrop compositing from the start. */
@media (hover:none),(pointer:coarse){
  .nav,.mobilePanel,.voicePanel,.chapterRail,.chapterRail .chapterName,.accessTrigger,.voiceTrigger,.previewToast,.streamDock.liquidGlass,.albumPanel.open,.quoteCard,.storyCard,.heroSignalWord{
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important
  }
}

/* Firefox benefits strongly from avoiding nested live blur. */
@supports (-moz-appearance:none){
  .liquidGlass{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .nav,.albumPanel.open,.mobilePanel,.voicePanel{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
}

/* Music focus remains, but constrained tiers avoid repainting several large CSS filter layers. */
html.perf-low body.musicDisco .releaseCard:not(.nowPlayingRelease),html.perf-low body.musicDisco .releaseHero:not(.nowPlayingRelease),
html.perf-safe body.musicDisco .releaseCard:not(.nowPlayingRelease),html.perf-safe body.musicDisco .releaseHero:not(.nowPlayingRelease){filter:none!important}
html.perf-low body.musicDisco .nowPlayingRelease,html.perf-safe body.musicDisco .nowPlayingRelease{will-change:transform!important}
html.perf-low .previewReady.previewPlaying img,html.perf-safe .previewReady.previewPlaying img{filter:none!important}

/* Startup safety before JavaScript has measured the device: coarse/touch layouts begin compositor-light. */
@media (hover:none),(pointer:coarse){
  .vibeDust{display:none!important}
  .vibeFlow.flowB{display:none!important}
  .vibeAurora{filter:blur(30px) saturate(1.28)!important}
  .vibeFlow,.vibePulseField{filter:none!important}
}
