/* ==========================================================================
   Essence — motion tokens + device performance tiers
   ==========================================================================
   Loaded LAST so it can override component styles.

   Driven by three attributes on <html>, all set by JS:
     data-motion    auto | full | reduced | off   (js/motion_manager.js)
     data-perf      high | mid | low | minimal    (js/device_capability.js)
     data-ambience  on | off                      (js/motion_manager.js)

   The single reduced-motion contract itself lives in style_essence.css (§4.1),
   together with the html[data-app-hidden] pause rule.

   ---------------------------------------------------------------------------
   RULE FOR THIS FILE: a tier may only remove per-frame work and pinned GPU
   layers. It may never change what an element looks like while it sits still,
   and it may never hide content.

   Why: gradients and shadows are painted ONCE — they are not a per-frame cost.
   Removing them is not "degrading", it is redesigning, and it broke the Morning
   Brief hero (the aurora layer is the hero's background, and the vibe circle
   and name text carry the vibration number and the practitioner's name).
   What actually costs every frame is the aurora drift animation — and that is
   already covered by data-ambience below.
   ========================================================================== */

:root {
    --motion-fast: 150ms;
    --motion-base: 250ms;
    --motion-slow: 400ms;
    --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Ambience (Tier C) — the drifting aurora. Purely decorative, so it is opt-in:
   MotionManager turns it on only when the device measured 'high' AND motion is
   'full'.

   Switching it off STOPS THE DRIFT; it does not hide the layer. The orbs stay
   on screen as static colour, because `.aurora-bg-layer` inside the brief hero
   IS the hero's background — hiding it leaves a blank white card.
   -------------------------------------------------------------------------- */
html:not([data-ambience="on"]) .aurora-orb,
html:not([data-ambience="on"]) .aurora-vibe-circle {
    animation: none !important;
}

/* --------------------------------------------------------------------------
   Tier 3 — "low": release compositor layers. On a cheap GPU the pinned layers
   are the scarce resource, and nothing here is visible.
   -------------------------------------------------------------------------- */
html[data-perf="low"] *,
html[data-perf="minimal"] * {
    will-change: auto !important;
}

/* --------------------------------------------------------------------------
   Tier 4 — "minimal": flat surfaces.
   Shadows carry no layout, and focus is drawn with `outline` (not box-shadow),
   so removing every shadow cannot hide anything or break focus visibility.
   -------------------------------------------------------------------------- */
html[data-perf="minimal"] * {
    box-shadow: none !important;
}

/* The aurora orbs are the one thing safe to drop outright — they hold no
   content. The vibe circle holds the day's vibration number and the name text
   holds the practitioner's name, so both are FLATTENED, never hidden. */
html[data-perf="minimal"] .aurora-orb {
    display: none !important;
}

html[data-perf="minimal"] .aurora-vibe-circle {
    background: var(--primary-color, #97B881) !important;
}

/* Shadows are gone at this tier, and a few components use box-shadow as their
   focus indicator (inputs in particular also set `outline: none`). Restore an
   unambiguous focus ring — accessibility is never part of the downgrade. */
html[data-perf="minimal"] :focus-visible {
    outline: 2px solid var(--primary-color, #97B881) !important;
    outline-offset: 2px !important;
}
