/*!
 * studio-fx 1.1.0 — the CSS half of the effects runtime (see API.md).
 * Nothing here hides content: start states are set by studio-fx.js, so a page without the script
 * (or with it failing) shows everything. Runtime-driven rules key on classes the script adds; the
 * hover presets also match the bare data-fx attribute, so they work with JavaScript off.
 * Tuning knobs are custom properties (--fx-*); set them on an element or on :root.
 * Effects loaded on demand bring their own stylesheet (fx/<name>.css, plus fx/common.css).
 */

/* ---- Split text ------------------------------------------------------------------------------ */
.fx-word, .fx-char { display: inline-block; }
.fx-word { white-space: nowrap; }
/* Visually hidden copy of the original text for screen readers (split text, counters). */
.fx-sr {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; user-select: none;
}

/* ---- Pin ------------------------------------------------------------------------------------- */
.fx-pin-spacer { pointer-events: none; }

/* ---- Marquee: one clipped row; items keep their own size, the element's gap spaces them.
   !important because the authored row should wrap (that is the no-JS / reduced-motion look). */
.fx-marquee-on { display: flex !important; flex-wrap: nowrap !important; overflow: hidden !important; overflow: clip !important; }
.fx-marquee-on > * { flex: none !important; }

/* ---- Hover presets ----------------------------------------------------------------------------
   Timing comes from --fx-duration / --fx-ease (set from data-fx-duration / data-fx-ease by the
   script). Hover styles only apply on devices that really hover; keyboard focus gets the same look.
   If an element has its own `transition`, the later rule wins — add translate/scale to yours. */

/* hover-lift: rises (translate) with a soft shadow. --fx-lift (default -4px), --fx-lift-shadow,
   --fx-lift-scale (unset = no scaling; data-fx-scale sets it). */
.fx-hover-lift, [data-fx~="hover-lift"] {
  transition: translate var(--fx-duration, 250ms) var(--fx-ease, cubic-bezier(.2,.7,.2,1)),
              scale var(--fx-duration, 250ms) var(--fx-ease, cubic-bezier(.2,.7,.2,1)),
              box-shadow var(--fx-duration, 250ms) var(--fx-ease, cubic-bezier(.2,.7,.2,1));
}
@media (hover: hover) {
  .fx-hover-lift:hover, [data-fx~="hover-lift"]:hover {
    translate: 0 var(--fx-lift, -4px); scale: var(--fx-lift-scale);
    box-shadow: var(--fx-lift-shadow, 0 14px 30px -14px rgb(0 0 0 / .4));
  }
}
.fx-hover-lift:focus-visible, [data-fx~="hover-lift"]:focus-visible {
  translate: 0 var(--fx-lift, -4px); scale: var(--fx-lift-scale);
  box-shadow: var(--fx-lift-shadow, 0 14px 30px -14px rgb(0 0 0 / .4));
}
.fx-hover-lift:has(:focus-visible) {
  translate: 0 var(--fx-lift, -4px); scale: var(--fx-lift-scale);
  box-shadow: var(--fx-lift-shadow, 0 14px 30px -14px rgb(0 0 0 / .4));
}

/* hover-zoom: the picture inside scales within its frame (or the element itself). --fx-zoom (1.06). */
.fx-zoom-frame { overflow: hidden; }
[data-fx~="hover-zoom"]:has(> img, > picture, > video) { overflow: hidden; }
.fx-zoom-target, [data-fx~="hover-zoom"] > :is(img, picture, video) {
  scale: 1; /* an explicit rest value (not `none`) so measuring tools read 1 → 1.06 */
  transition: scale var(--fx-duration, 600ms) var(--fx-ease, cubic-bezier(.2,.7,.2,1));
}
@media (hover: hover) {
  .fx-hover-zoom:hover .fx-zoom-target, .fx-hover-zoom.fx-zoom-target:hover,
  [data-fx~="hover-zoom"]:hover > :is(img, picture, video) { scale: var(--fx-zoom, 1.06); }
}
.fx-hover-zoom:focus-visible .fx-zoom-target, .fx-hover-zoom.fx-zoom-target:focus-visible,
[data-fx~="hover-zoom"]:focus-visible > :is(img, picture, video) { scale: var(--fx-zoom, 1.06); }
.fx-hover-zoom:has(:focus-visible) .fx-zoom-target { scale: var(--fx-zoom, 1.06); }

/* underline: a line draws in from the left on hover and leaves to the right.
   --fx-underline-size (1px), --fx-underline-color (currentColor). Works across line breaks. */
.fx-underline, [data-fx~="underline"] {
  text-decoration: none;
  background-image: linear-gradient(var(--fx-underline-color, currentColor), var(--fx-underline-color, currentColor));
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0% var(--fx-underline-size, 1px);
  transition: background-size var(--fx-duration, 300ms) var(--fx-ease, cubic-bezier(.2,.7,.2,1));
}
@media (hover: hover) {
  .fx-underline:hover, [data-fx~="underline"]:hover { background-position: 0 100%; background-size: 100% var(--fx-underline-size, 1px); }
}
.fx-underline:focus-visible, [data-fx~="underline"]:focus-visible { background-position: 0 100%; background-size: 100% var(--fx-underline-size, 1px); }

/* ---- Tilt glare ------------------------------------------------------------------------------ */
.fx-glare {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--fx-gx, 50%) var(--fx-gy, 50%), var(--fx-glare-color, rgb(255 255 255 / .55)), transparent 60%);
}

/* ---- Reading progress bar -------------------------------------------------------------------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2147482000; pointer-events: none;
  height: var(--fx-progress-size, 3px); background: var(--fx-progress-color, currentColor);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---- Smooth scrolling (Lenis) ---------------------------------------------------------------- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-fx-noscroll] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---- Reduced motion: hover states switch instantly (the runtime already skips the rest) ------ */
@media (prefers-reduced-motion: reduce) {
  .fx-hover-lift, [data-fx~="hover-lift"], .fx-zoom-target, [data-fx~="hover-zoom"] > *,
  .fx-underline, [data-fx~="underline"] { transition-duration: 0s !important; transition-delay: 0s !important; }
}

/* ---- Print: everything at rest ---------------------------------------------------------------- */
@media print {
  .fx-reveal-item { opacity: 1 !important; translate: none !important; scale: none !important; rotate: none !important; filter: none !important; transition: none !important; }
  .fx-progress, .fx-glare, .fx-clone { display: none !important; }
}
