/*
  ZOVA website: the finishing touches (fx.js turns each one on): a slim branded scrollbar, a reading-progress line, a round
  "back to top" button that shows how far down the page you are, a soft blue light that follows the ordinary mouse pointer in the
  dark banners, buttons that shine, and a spotlight on cards.
  The mouse pointer itself is never replaced or hidden.
  Each one is a class on <html> (fx-scrollbar, fx-progress-on, fx-top-on, fx-glow-on, fx-hover-on, fx-spot-on) so
  any of them can be switched off, and every moving part stands down for anyone who has asked their device for less motion.
*/

/* ---------- scrollbar ---------- */
html.fx-scrollbar::-webkit-scrollbar { width: 12px; height: 12px; }
html.fx-scrollbar::-webkit-scrollbar-track { background: var(--bg); }
html.fx-scrollbar::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-radius: 999px; border: 3px solid var(--bg); min-height: 48px; }
html.fx-scrollbar::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent-ink), var(--accent)); border-width: 2px; }
/* Firefox has no gradient scrollbar, so it gets the same colours in a thin bar */
@supports not selector(::-webkit-scrollbar) {
  html.fx-scrollbar { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg); }
}

/* ---------- reading progress ---------- */
.fx-progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 250; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; }
html.fx-progress-on .fx-progress { opacity: 1; }
.fx-progress span { display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); background: linear-gradient(90deg, var(--accent-deep), var(--accent), color-mix(in srgb, var(--accent) 65%, #ffffff)); border-radius: 0 3px 3px 0; will-change: transform; }

/* ---------- back to top ---------- */
.fx-top { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--accent-ink); box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.2,.8,.3,1), background 0.2s ease, color 0.2s ease; }
.fx-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { background: var(--accent); color: #fff; transform: translateY(-3px); }
.fx-top:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.fx-top svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-top .fx-ring-track { fill: none; stroke: color-mix(in srgb, var(--accent) 18%, transparent); stroke-width: 3; }
.fx-top .fx-ring-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 138.2; stroke-dashoffset: 138.2; transition: stroke-dashoffset 0.12s linear, stroke 0.2s; }
.fx-top:hover .fx-ring-fill { stroke: #fff; }
.fx-top .fx-arrow { position: relative; width: 20px; height: 20px; transform: none; inset: auto; }
body.auth-open .fx-top { opacity: 0; pointer-events: none; }
html:not(.fx-top-on) .fx-top { display: none; }

/* ---------- the pointer glow in the dark banners ----------
   The real mouse pointer stays exactly as it is. In the navy banners a soft blue light follows it, and a field of tiny dots
   shows up only around that light, so the banner feels alive under your hand. (fx.js moves --gx / --gy; --ga fades it in and out.) */
.fx-glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; --gx: 50%; --gy: 50%; --ax: 50%; --ay: 50%; --gr: 520px; --dr: 270px; --gi: 30; --ga: 0; opacity: var(--ga); transition: opacity 0.5s ease; display: none; }
html.fx-glow-on .fx-glow { display: block; }
/* two lights: a wide, slow, faint one (it trails far behind) and a brighter, quicker one under the pointer */
.fx-glow::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(var(--gr) circle at var(--gx) var(--gy), color-mix(in srgb, var(--accent) calc(var(--gi) * 1%), transparent), color-mix(in srgb, var(--accent-deep) calc(var(--gi) * 0.5%), transparent) 45%, transparent 70%),
  radial-gradient(900px circle at var(--ax) var(--ay), color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%); }
.fx-glow::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1.2px, transparent 1.7px); background-size: 30px 30px; -webkit-mask-image: radial-gradient(var(--dr) circle at var(--gx) var(--gy), #000 0%, transparent 72%); mask-image: radial-gradient(var(--dr) circle at var(--gx) var(--gy), #000 0%, transparent 72%); }
.fx-glow-host { position: relative; }

/* ---------- hover: buttons shine ---------- */
html.fx-hover-on .btn-primary { position: relative; overflow: hidden; transition: transform 0.18s ease, box-shadow 0.25s ease; }
html.fx-hover-on .btn-primary::after { content: ''; position: absolute; top: 0; left: -80%; width: 55%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.38), transparent); transform: skewX(-18deg); pointer-events: none; }
html.fx-hover-on .btn-primary:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 14px 34px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
html.fx-hover-on .btn-primary:hover::after { left: 130%; transition: left 0.7s ease; }
html.fx-hover-on .btn:active { transform: scale(0.97); }
/* the two big buttons lean a few pixels toward the pointer (fx.js sets --bx / --by), and settle back when it leaves */
html.fx-hover-on .btn-primary, html.fx-hover-on .btn-ghost { translate: var(--bx, 0px) var(--by, 0px); transition: transform 0.18s ease, box-shadow 0.25s ease, translate 0.35s cubic-bezier(.2,.8,.3,1), border-color 0.18s ease, color 0.18s ease; }
html.fx-hover-on .btn-primary:hover, html.fx-hover-on .btn-ghost:hover { transition: transform 0.18s ease, box-shadow 0.25s ease, translate 0.08s linear, border-color 0.18s ease, color 0.18s ease; }
html.fx-hover-on .btn-ghost:hover { box-shadow: 0 10px 26px -14px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------- spotlight on cards ---------- */
html.fx-spot-on .eco-card { position: relative; isolation: isolate; }
html.fx-spot-on .eco-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
html.fx-spot-on .eco-card:hover::before { opacity: 1; }

/* ---------- the demo's switch panel (only on the demo page) ---------- */
.fx-panel { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 9000; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: calc(100vw - 100px); padding: 10px 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); font-family: var(--font-body); }
.fx-panel strong { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.fx-chip { font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.fx-chip[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: transparent; }

@media (hover: none), (pointer: coarse) { .fx-glow { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .fx-top, .fx-progress, .fx-glow { transition: none; }
  html.fx-hover-on .btn-primary::after { display: none; }
  html.fx-hover-on .btn-primary, html.fx-hover-on .btn-ghost { translate: none; }
}
