@layer velora.reset, velora.tokens, velora.layout, velora.motion, velora.components, velora.transitions, velora.utilities, velora.overrides;

/* Velora motion core + extended
 * Assembled from @velora/css sources at 5a0b82b (2026-11-18). Do not edit by hand: run tools/build_css.py. */

/* ---- 01-motion-tokens.css ---- */
@layer velora.tokens {
    /*
     * Motion engine knobs — host-agnostic.
     * Safe to import with motion-core without Velora brand/visual tokens.
     */
    :root {
        --vl-ease-cinematic: cubic-bezier(0.2, 0.8, 0.2, 1);
        --vl-ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
        --vl-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        --vl-ease-in-out-smooth: cubic-bezier(0.45, 0, 0.55, 1);
        --vl-ease-fluid: cubic-bezier(0.25, 0.8, 0.25, 1);
        --vl-ease-impact: cubic-bezier(0.0, 0.0, 0.2, 1);
        --vl-ease-silk: cubic-bezier(0.4, 0.0, 0.2, 1);
        --vl-ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
        --vl-ease-smooth-out: cubic-bezier(0, 0.55, 0.45, 1);
        /* A natural, hand-tuned decay expressed with the native linear() syntax. */
        --vl-ease-natural: linear(
            0,
            0.012 1.1%,
            0.052 2.4%,
            0.18 5%,
            0.41 9.2%,
            0.68 15%,
            0.86 22%,
            0.95 31%,
            0.99 45%,
            1
        );

        --vl-duration-instant: 80ms;
        --vl-duration-fast: 150ms;
        --vl-duration-normal: 300ms;
        --vl-duration-slow: 500ms;
        --vl-duration-slower: 800ms;

        --vl-stagger-step: 45ms;
        --vl-beats: 8;
        --vl-beat: 120ms;

        --vl-motion-duration: var(--vl-duration-normal);
        --vl-motion-distance: 1.25rem;
        /*
         * P4 distance parameters (authoring aliases).
         * Prefer --vl-distance-x / --vl-distance-y in new markup.
         * --vl-motion-distance remains the legacy bridge written by vl-depth
         * and vl-motion profiles. Keyframes resolve:
         *   var(--vl-distance-y, var(--vl-motion-distance, …))
         *   var(--vl-distance-x, var(--vl-motion-distance, …))
         * These aliases stay unset on :root so preset-specific defaults
         * (e.g. glide-in 3rem) are preserved until an author opts in.
         */
        --vl-motion-ease: var(--vl-ease-cinematic);

        --vl-state-duration: var(--vl-duration-normal);
        --vl-state-distance: 0.75rem;
        --vl-state-ease: var(--vl-ease-natural, var(--vl-ease-cinematic));
        --vl-state-exit-scale: 0.975;
        --vl-path: none;
        --vl-path-distance: 100%;
        --vl-path-rotate: auto;

        --vl-motion-mode: standard;
        --vl-motion-preference: auto;
        --vl-motion-speed-scale: 1;
        --vl-motion-intensity: 1;
        --vl-motion-depth: 1;
        --vl-motion-blur: 0px;
        /*
         * P4 soft-enter / 3d-enter parameters (optional overrides):
         *   --vl-blur-from / --vl-scale-from
         *   --vl-perspective / --vl-rotate-x / --vl-depth-z-from
         */
        --vl-motion-mode-ease: var(--vl-ease-cinematic);

        --vl-vt-root-duration: 0.55s;
        --vl-vt-shared-duration: 0.58s;

        --vl-transition-fast: var(--vl-duration-fast) var(--vl-ease-out-soft);
        --vl-transition-normal: var(--vl-duration-normal) var(--vl-ease-cinematic);
        --vl-transition-slow: var(--vl-duration-slow) var(--vl-ease-cinematic);

        --vl-z-base: 0;
        --vl-z-dropdown: 100;
        --vl-z-sticky: 200;
        --vl-z-modal: 500;
        --vl-z-toast: 800;
    }
}

/* ---- 03-motion.css ---- */
@layer velora.motion {
    /*
     * Velora Motion System  declarative attribute grammar
     *
     * Public API:
     *   vl-effect    Named motion preset (primitive, interaction, state, scene)
     *   vl-timeline  Progress model: view | scroll | auto | state | hover
     *   vl-range     Animation range for scroll-driven motion
        *   vl-duration  Direct duration override (e.g. "1200ms")
        *   vl-delay     Entry/exit delay override (e.g. "120ms")
     *   vl-pin       Boolean  sticky scene behavior
     *   vl-scrub     Boolean  continuous scroll-linked motion
     *   vl-once      Boolean  one-shot reveal
    *   vl-in-view   Viewport gate for descendant motion
     *   vl-children  Child choreography: stagger | cascade | sequence
     *   vl-stagger   Stagger interval override (e.g. "120ms")
     *   vl-depth     Parallax depth multiplier: 1 | 2 | 3 | 4
     *   vl-speed     Duration category: slow | normal | fast
     *   vl-loop      Loop count: -1 (infinite), 0+ (iteration count)
     *   vl-loop-effect Loop keyframe preset (e.g. "float", "wobble", "spin")
     *   vl-direction Playback direction: normal | reverse | alternate | alternate-reverse
     *   vl-scene     Scene container marker
     *   vl-targets   Descendant selector hint (limited CSS-only support)
     *
     * CSS custom properties used by the attribute system:
     *   --vl-motion-duration   Duration for current effect
     *   --vl-motion-distance   Translation distance (legacy bridge)
     *   --vl-distance-x/y      P4 canonical distance parameters (optional overrides)
     *   --vl-motion-ease       Easing function
     *   --vl-stagger-step      Delay between staggered children
     *   --vl-range             Animation range value
     *
     * All animations: zero JavaScript. Modern CSS only.
     */

    /* =========================================================================
       KEYFRAMES — cinematic entrance grammar
       ========================================================================= */

    @keyframes vl-blur-lift {
        from {
            opacity: 0;
            filter: blur(calc(var(--vl-blur-from, 12px) + var(--vl-motion-blur, 0px)));
            transform: translate3d(0, var(--vl-distance-y, 1.5rem), 0) scale(var(--vl-scale-from, 1));
        }
        to {
            opacity: 1;
            filter: blur(0);
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    @keyframes vl-opacity-reveal {
        from { opacity: 0; }
        60%  { opacity: 0.7; }
        to   { opacity: 1; }
    }

    @keyframes vl-cinematic-mask {
        from {
            clip-path: inset(100% 0 0 0);
            opacity: 0;
        }
        to {
            clip-path: inset(0 0 0 0);
            opacity: 1;
        }
    }

    @keyframes vl-parallax-depth-enter {
        from {
            opacity: 0;
            transform: translate3d(0, 3rem, -100px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    @keyframes vl-stagger-wave {
        0%   { opacity: 0; transform: translate3d(0, 1rem, 0); }
        50%  { opacity: 0.8; transform: translate3d(0, -0.15rem, 0); }
        100% { opacity: 1; transform: translate3d(0, 0, 0); }
    }

    /* =========================================================================
       KEYFRAMES  entrance
       ========================================================================= */
    @keyframes vl-fade-in {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    @keyframes vl-fade-out {
        from { opacity: 1; }
        to   { opacity: 0; }
    }

    @keyframes vl-fade-out-up {
        from {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        to {
            opacity: 0;
            transform: translate3d(0, calc(-1 * var(--vl-distance-y, var(--vl-motion-distance, 1.25rem))), 0);
        }
    }

    @keyframes vl-fade-out-down {
        from {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        to {
            opacity: 0;
            transform: translate3d(0, var(--vl-distance-y, var(--vl-motion-distance, 1.25rem)), 0);
        }
    }

    /* =========================================================================
       KEYFRAMES — cinematic exit grammar
       ========================================================================= */

    @keyframes vl-dissolve-out {
        from {
            opacity: 1;
            filter: blur(0);
        }
        to {
            opacity: 0;
            filter: blur(8px);
        }
    }

    @keyframes vl-depth-collapse {
        from {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
        to {
            opacity: 0;
            transform: translate3d(0, 0, -200px) scale(0.85);
        }
    }

    @keyframes vl-fade-velocity {
        from {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        to {
            opacity: 0;
            transform: translate3d(0, -3rem, 0);
        }
    }

    @keyframes vl-blur-exit {
        from {
            opacity: 1;
            filter: blur(0);
            transform: scale(1);
        }
        to {
            opacity: 0;
            filter: blur(16px);
            transform: scale(1.05);
        }
    }

    @keyframes vl-fade-up {
        from {
            opacity: 0;
            transform: translate3d(0, var(--vl-distance-y, var(--vl-motion-distance, 1.25rem)), 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-fade-down {
        from {
            opacity: 0;
            transform: translate3d(0, calc(-1 * var(--vl-distance-y, var(--vl-motion-distance, 1.25rem))), 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-slide-left {
        from {
            opacity: 0;
            transform: translate3d(var(--vl-distance-x, var(--vl-motion-distance, 1.5rem)), 0, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-slide-right {
        from {
            opacity: 0;
            transform: translate3d(calc(-1 * var(--vl-distance-x, var(--vl-motion-distance, 1.5rem))), 0, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-scale-in {
        from {
            opacity: 0;
            transform: scale(0.94) translate3d(0, 0.5rem, 0);
        }
        to {
            opacity: 1;
            transform: scale(1) translate3d(0, 0, 0);
        }
    }

    @keyframes vl-pop-in {
        0% {
            opacity: 0;
            transform: scale(0.82);
        }
        55% {
            opacity: 1;
            transform: scale(1.04);
        }
        100% {
            transform: scale(1);
        }
    }

    @keyframes vl-shrink-out {
        from {
            opacity: 1;
            transform: scale(1);
        }
        to {
            opacity: 0;
            transform: scale(0.82);
        }
    }

    @keyframes vl-blur-in {
        from {
            opacity: 0;
            clip-path: inset(5% 5% 5% 5%);
            transform: translate3d(0, 0.75rem, 0) scale(0.98);
        }
        to {
            opacity: 1;
            clip-path: inset(0 0 0 0);
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    @keyframes vl-3d-entry {
        from {
            opacity: 0;
            transform: perspective(var(--vl-perspective, 1200px))
                rotateX(var(--vl-rotate-x, 12deg))
                translate3d(0, var(--vl-distance-y, 2rem), var(--vl-depth-z-from, 0px));
        }
        to {
            opacity: 1;
            transform: perspective(var(--vl-perspective, 1200px)) rotateX(0deg) translate3d(0, 0, 0);
        }
    }

    @keyframes vl-flow-in {
        from {
            opacity: 0;
            filter: blur(calc(var(--vl-blur-from, 6px) + var(--vl-motion-blur, 0px)));
            transform: translate3d(0, var(--vl-distance-y, var(--vl-motion-distance, 1.5rem)), 0) scale(var(--vl-scale-from, 0.97));
        }
        to {
            opacity: 1;
            filter: blur(0);
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    @keyframes vl-tilt-in {
        from {
            opacity: 0;
            transform: perspective(900px) rotateY(-8deg) translate3d(0, 1rem, 0);
        }
        to {
            opacity: 1;
            transform: perspective(900px) rotateY(0deg) translate3d(0, 0, 0);
        }
    }

    @keyframes vl-clip-rise {
        from {
            opacity: 0.2;
            clip-path: inset(112% -6% -14% -6%);
            transform: translate3d(0, 0.16em, 0);
        }
        to {
            opacity: 1;
            clip-path: inset(-14% -6% -14% -6%);
            transform: translate3d(0, 0, 0);
        }
    }

    /* =========================================================================
       KEYFRAMES  continuous / ambient
       ========================================================================= */
    @keyframes vl-shimmer {
        to { background-position: 200% center; }
    }

    @keyframes vl-float {
        0%, 100% { transform: translate3d(0, 0, 0); }
        50%      { transform: translate3d(0, -0.35rem, 0); }
    }

    @keyframes vl-glow-breathe {
        0%, 100% {
            opacity: 0.55;
            box-shadow: 0 0 0.35rem color-mix(in oklch, var(--vl-color-primary) 40%, transparent);
        }
        50% {
            opacity: 1;
            box-shadow: 0 0 0.85rem 0.2rem color-mix(in oklch, var(--vl-color-primary) 55%, transparent);
        }
    }

    @keyframes vl-parallax-shift {
        from { transform: translate3d(0, var(--vl-parallax-from, -12%), 0); }
        to   { transform: translate3d(0, var(--vl-parallax-to, 12%), 0); }
    }

    @keyframes vl-scroll-scale {
        from { opacity: 0.35; transform: scale(0.92); }
        to   { opacity: 1; transform: scale(1); }
    }

    @keyframes vl-tilt-wobble {
        0%, 100% { transform: rotate(-2.5deg); }
        50%      { transform: rotate(2.5deg); }
    }

    @keyframes vl-orbit-spin {
        from { transform: rotate(0deg) translateX(var(--vl-orbit-radius, 2.5rem)) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(var(--vl-orbit-radius, 2.5rem)) rotate(-360deg); }
    }

    @keyframes vl-sway {
        from { rotate: y calc(var(--vl-sway-angle, 20deg) * -1); }
        to   { rotate: y var(--vl-sway-angle, 20deg); }
    }

    @keyframes vl-rock {
        0%, 100% { transform: rotate(-4deg); }
        50%      { transform: rotate(4deg); }
    }

    @keyframes vl-rotate-flat {
        to { transform: rotate(360deg); }
    }

    /* =========================================================================
       KEYFRAMES  text reveal (clip-path based)
       ========================================================================= */
    @keyframes vl-clip-reveal-ltr {
        from { clip-path: inset(0 100% 0 0); }
        to   { clip-path: inset(0 0 0 0); }
    }

    @keyframes vl-clip-reveal-up {
        from {
            clip-path: inset(100% 0 0 0);
            transform: translate3d(0, 0.5rem, 0);
        }
        to {
            clip-path: inset(0 0 0 0);
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-clip-reveal-down {
        from {
            clip-path: inset(0 0 100% 0);
            transform: translate3d(0, -0.5rem, 0);
        }
        to {
            clip-path: inset(0 0 0 0);
            transform: translate3d(0, 0, 0);
        }
    }

    /* =========================================================================
       KEYFRAMES  cinema / scroll-driven
       ========================================================================= */
    @keyframes vl-cinema-zoom {
        from { transform: scale(1); filter: brightness(1); }
        to   { transform: scale(1.15); filter: brightness(0.85); }
    }

    @keyframes vl-scroll-horizontal {
        from { transform: translate3d(0, 0, 0); }
        to   { transform: translate3d(var(--vl-scroll-x-distance, -200%), 0, 0); }
    }

    @keyframes vl-morph {
        0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
        25%  { border-radius: 58% 42% 45% 55% / 55% 30% 70% 45%; }
        50%  { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
        75%  { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
        100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    }

    @keyframes vl-elastic-in {
        0%   { opacity: 0; transform: scale(0.3); }
        50%  { opacity: 1; transform: scale(1.05); }
        70%  { transform: scale(0.97); }
        100% { transform: scale(1); }
    }

    @keyframes vl-typewriter {
        from { width: 0; }
        to   { width: min(var(--vl-type-chars, 21ch), 100%); }
    }

    /* Auto-fit: the reveal ends at the real text width (calc-size(max-content)), so the last word is never cut.
       --vl-type-chars still sets an explicit width. Without calc-size() the 21ch default above applies. */
    @supports (width: calc-size(max-content, size)) {
        @keyframes vl-typewriter {
            from { width: 0; }
            to   { width: var(--vl-type-chars, calc-size(max-content, size)); }
        }
    }

    /* Looping variant: types in the first 75% of each pass, then HOLDS the complete text (the steps() easing
       applies per keyframe interval). The target width adds 1ch of slack so letter-spacing/caret never clip the last glyph. */
    @keyframes vl-typewriter-loop {
        from { width: 0; }
        75%, to { width: min(var(--vl-type-chars, 36ch), 100%); }
    }

    @supports (width: calc-size(max-content, size)) {
        @keyframes vl-typewriter-loop {
            from { width: 0; }
            75%, to { width: var(--vl-type-chars, calc-size(max-content, size + 1ch)); }
        }
    }

    @keyframes vl-blink-caret {
        0%, 100% { border-right-color: var(--vl-type-caret-color, var(--vl-color-primary)); }
        50%      { border-right-color: transparent; }
    }

    @keyframes vl-word-rise {
        from {
            opacity: 0;
            transform: translate3d(0, 0.7em, 0);
            filter: blur(4px);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
            filter: blur(0);
        }
    }

    @keyframes vl-line-wipe {
        from {
            opacity: 0;
            clip-path: inset(-14% 100% -14% -6%);
            transform: translate3d(-0.08em, 0, 0);
        }
        to {
            opacity: 1;
            clip-path: inset(-14% -6% -14% -6%);
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-depth-drift {
        from {
            transform: translate3d(0, var(--vl-depth-from, 6%), 0) scale(var(--vl-depth-scale-from, 0.96));
            opacity: 0.38;
        }
        to {
            transform: translate3d(0, var(--vl-depth-to, -6%), 0) scale(var(--vl-depth-scale-to, 1.04));
            opacity: 1;
        }
    }

    @keyframes vl-aurora-drift {
        0% {
            background-position: 0% 50%;
            filter: hue-rotate(0deg);
        }
        50% {
            background-position: 100% 50%;
            filter: hue-rotate(12deg);
        }
        100% {
            background-position: 0% 50%;
            filter: hue-rotate(0deg);
        }
    }

    @keyframes vl-crossfade-scrub {
        from {
            opacity: 0.25;
            transform: scale(0.985);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    @keyframes vl-text-highlight-sweep {
        from {
            background-size: 0% var(--vl-highlight-height, 100%);
            color: color-mix(in oklch, var(--vl-text-primary) 82%, transparent);
        }
        to {
            background-size: 100% var(--vl-highlight-height, 100%);
            color: var(--vl-text-primary);
        }
    }

    /* =========================================================================
       PRIMITIVE EFFECTS  [vl-effect="<name>"]
       Each preset sets tokenized variables per handbook
       ========================================================================= */

    /* --- Base: any element with vl-effect gets composable defaults ---
     * Duration and easing route through the Conditional Motion Engine knobs
     * (--vl-motion-speed-scale / --vl-motion-mode-ease). Both default to the
     * neutral baseline (scale 1 / cinematic), so behavior is unchanged unless a
     * vl-motion mode is present on the element or an ancestor. See
     * 03a-motion-conditions.css. */
    [vl-effect] {
        --vl-motion-duration: calc(var(--vl-duration-slow) * var(--vl-motion-speed-scale, 1));
        --vl-motion-ease: var(--vl-motion-mode-ease, var(--vl-ease-cinematic));
        animation-fill-mode: both;
    }

    /* --- v2 channels: base -> enter -> scroll -> loop -> hover -> state -> exit --- */
    [vl-base],
    [vl-enter],
    [vl-scroll],
    [vl-loop],
    [vl-hover],
    [vl-state],
    [vl-exit] {
        --vl-motion-duration: calc(var(--vl-duration-slow) * var(--vl-motion-speed-scale, 1));
        --vl-motion-ease: var(--vl-motion-mode-ease, var(--vl-ease-cinematic));
    }

    [vl-enter] {
        animation-name: var(--vl-enter-name, none);
        animation-duration: var(--vl-enter-duration, var(--vl-motion-duration));
        animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s));
        animation-timing-function: var(--vl-enter-ease, var(--vl-motion-ease));
        animation-direction: var(--vl-enter-direction, var(--vl-motion-direction, normal));
        animation-fill-mode: both;
    }

    [vl-base~="subtle"] {
        --vl-motion-duration: var(--vl-duration-fast);
        --vl-motion-distance: 0.6rem;
        --vl-motion-ease: var(--vl-ease-out-soft);
    }

    [vl-base~="balanced"] {
        --vl-motion-duration: var(--vl-duration-normal);
        --vl-motion-distance: 1rem;
        --vl-motion-ease: var(--vl-ease-cinematic);
    }

    [vl-base~="dramatic"] {
        --vl-motion-duration: var(--vl-duration-slower);
        --vl-motion-distance: 2.2rem;
        --vl-motion-ease: var(--vl-ease-spring);
    }

    :is([vl-enter~="fade-in"], [vl-effect~="fade-in"]) { --vl-enter-name: vl-fade-in; }
    :is([vl-enter~="fade-up"], [vl-effect~="fade-up"]) { --vl-enter-name: vl-fade-up; }
    :is([vl-enter~="fade-down"], [vl-effect~="fade-down"]) { --vl-enter-name: vl-fade-down; }
    :is([vl-enter~="slide-left"], [vl-effect~="slide-left"]) {
        --vl-enter-name: vl-slide-left;
        --vl-enter-ease: var(--vl-ease-out-soft);
    }
    :is([vl-enter~="slide-right"], [vl-effect~="slide-right"]) {
        --vl-enter-name: vl-slide-right;
        --vl-enter-ease: var(--vl-ease-out-soft);
    }
    :is([vl-enter~="scale-in"], [vl-effect~="scale-in"]) {
        --vl-enter-name: vl-scale-in;
        --vl-enter-ease: var(--vl-ease-spring);
    }
    :is([vl-enter~="pop-in"], [vl-effect~="pop-in"]) {
        --vl-enter-name: vl-pop-in;
        --vl-enter-ease: var(--vl-ease-spring);
    }
    :is([vl-enter~="blur-in"], [vl-effect~="blur-in"]) {
        --vl-enter-name: vl-blur-in;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-out-soft);
    }
    :is([vl-enter~="reveal-3d"], [vl-effect~="reveal-3d"], [vl-enter~="3d-entry"], [vl-effect~="3d-entry"]) {
        --vl-enter-name: vl-3d-entry;
    }
    :is([vl-enter~="flow-in"], [vl-effect~="flow-in"]) {
        --vl-enter-name: vl-flow-in;
        --vl-enter-duration: var(--vl-duration-slower);
    }
    :is([vl-enter~="blur-lift"], [vl-effect~="blur-lift"]) {
        --vl-enter-name: vl-blur-lift;
    }
    :is([vl-enter~="clip-rise"], [vl-effect~="clip-rise"]) {
        --vl-enter-name: vl-clip-rise;
        --vl-enter-duration: var(--vl-duration-slower);
    }
    :is([vl-enter~="text-reveal"], [vl-effect~="text-reveal"]) {
        --vl-enter-name: vl-clip-reveal-ltr;
    }
    :is([vl-enter~="text-reveal-up"], [vl-effect~="text-reveal-up"]) {
        --vl-enter-name: vl-clip-reveal-up;
    }
    :is([vl-enter~="text-reveal-down"], [vl-effect~="text-reveal-down"]) {
        --vl-enter-name: vl-clip-reveal-down;
    }
    :is([vl-enter~="tilt-in"], [vl-effect~="tilt-in"]) {
        --vl-enter-name: vl-tilt-in;
        --vl-enter-duration: var(--vl-duration-slower);
    }

    [vl-scroll] {
        animation-name: var(--vl-scroll-name, none);
        animation-duration: 1ms;
        animation-timing-function: linear;
        animation-direction: var(--vl-scroll-direction, var(--vl-motion-direction, normal));
        animation-fill-mode: both;
        animation-timeline: var(--vl-scroll-timeline, view(block));
        animation-range: var(--vl-scroll-range, entry 5% cover 42%);
    }

    :is([vl-scroll~="parallax"], [vl-effect~="parallax"]) {
        --vl-scroll-name: vl-parallax-shift;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: var(--vl-range, var(--vl-range-start, cover 0%) var(--vl-range-end, cover 100%));
    }

    :is([vl-scroll~="cinema-zoom"], [vl-effect~="cinema-zoom"]) {
        --vl-scroll-name: vl-cinema-zoom;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: entry 0% exit 100%;
    }

    :is([vl-scroll~="depth-drift"], [vl-effect~="depth-drift"]) {
        --vl-scroll-name: vl-depth-drift;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: var(--vl-range, var(--vl-range-start, entry 0%) var(--vl-range-end, cover 85%));
    }

    :is([vl-scroll~="scroll-marquee"], [vl-effect~="scroll-marquee"], [vl-scroll~="scroll-horizontal"], [vl-effect~="scroll-horizontal"]) {
        --vl-scroll-name: vl-scroll-horizontal;
        --vl-scroll-timeline: scroll(root);
        --vl-scroll-range: var(--vl-marquee-range, cover 0% cover 100%);
        --vl-scroll-x-distance: var(--vl-marquee-distance, -36%);
    }

    :is([vl-scroll~="scroll-scale"], [vl-effect~="scroll-scale"]) {
        --vl-scroll-name: vl-scroll-scale;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: entry 0% cover 70%;
    }

    :is([vl-scroll~="rotate-scroll"], [vl-effect~="rotate-scroll"]) {
        --vl-scroll-name: vl-rotate-flat;
        --vl-scroll-timeline: scroll(root);
        --vl-scroll-range: cover 0% cover 100%;
    }

    :is([vl-scroll~="crossfade"], [vl-effect~="crossfade"]) {
        --vl-scroll-name: vl-crossfade-scrub;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: entry 5% cover 55%;
    }

    /* text-highlight paints its own marker: a one-colour gradient whose background-size the animation sweeps.
       Layered, so an author's own background-image (or background shorthand) wins and the sweep still drives
       background-size. Parameters: --vl-highlight-color (default: the accent at 35%), --vl-highlight-height
       (default 100%, e.g. 0.4em for an underline marker). At rest, and with reduced motion, the marker is full.
       The timeline is view(block): the previous view(inline) never advanced on a vertically scrolling page, so
       the sweep was stuck at one fixed progress. The sweep now completes about mid-viewport; --vl-range overrides. */
    :is([vl-scroll~="text-highlight"], [vl-effect~="text-highlight"]) {
        --vl-scroll-name: vl-text-highlight-sweep;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: var(--vl-range, entry 10% cover 45%);
        --_hl: var(--vl-highlight-color, color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary, currentColor)) 35%, transparent));
        /* At rest the text has the colour the sweep ends on (so a <mark> is not left with the UA marktext). */
        color: var(--vl-text-primary);
        background-color: transparent;
        background-image: linear-gradient(var(--_hl), var(--_hl));
        background-repeat: no-repeat;
        background-position: left bottom;
        background-size: 100% var(--vl-highlight-height, 100%);
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-scroll~="text-highlight"], [vl-effect~="text-highlight"]) {
            animation: none;
        }
    }

    [vl-loop],
    [vl-loop-effect] {
        animation-name: var(--vl-loop-name, none);
        animation-duration: var(--vl-loop-duration, var(--vl-motion-duration, 4s));
        animation-timing-function: var(--vl-loop-ease, var(--vl-ease-in-out-smooth));
        animation-direction: var(--vl-loop-direction, var(--vl-motion-direction, normal));
        animation-iteration-count: var(--vl-loop-count, infinite);
    }

    /* Channels compose: enter, loop and exit on one element run as separate animations.
       Each channel sets animation-name, so without these rules the last one in source order
       replaces the others (the loop used to erase the entrance, the exit the loop).
       Priority is the list order, later wins on a shared property: enter < loop < exit.
       Longhand lists stay index-aligned, one entry per animation. cut-reveal is two animations
       and has its own lists in 03e-cut.css. */
    [vl-enter]:is([vl-loop], [vl-loop-effect]):not([vl-exit]) {
        animation-name: var(--vl-enter-name, none), var(--vl-loop-name, none);
        animation-duration: var(--vl-enter-duration, var(--vl-motion-duration)), var(--vl-loop-duration, var(--vl-motion-duration, 4s));
        animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), 0s;
        animation-timing-function: var(--vl-enter-ease, var(--vl-motion-ease)), var(--vl-loop-ease, var(--vl-ease-in-out-smooth));
        animation-direction: var(--vl-enter-direction, var(--vl-motion-direction, normal)), var(--vl-loop-direction, var(--vl-motion-direction, normal));
        animation-iteration-count: 1, var(--vl-loop-count, infinite);
        animation-fill-mode: both, none;
    }

    [vl-enter][vl-exit]:not([vl-loop]):not([vl-loop-effect]) {
        animation-name: var(--vl-enter-name, none), var(--vl-exit-name, none);
        animation-duration: var(--vl-enter-duration, var(--vl-motion-duration)), var(--vl-exit-duration, var(--vl-duration-fast));
        animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), var(--vl-exit-delay, var(--vl-motion-delay, 0s));
        animation-timing-function: var(--vl-enter-ease, var(--vl-motion-ease)), var(--vl-exit-ease, var(--vl-ease-out-soft));
        animation-direction: var(--vl-enter-direction, var(--vl-motion-direction, normal)), var(--vl-exit-direction, var(--vl-motion-direction, normal));
        animation-iteration-count: 1, 1;
        animation-fill-mode: both, forwards;
    }

    [vl-exit]:is([vl-loop], [vl-loop-effect]):not([vl-enter]) {
        animation-name: var(--vl-loop-name, none), var(--vl-exit-name, none);
        animation-duration: var(--vl-loop-duration, var(--vl-motion-duration, 4s)), var(--vl-exit-duration, var(--vl-duration-fast));
        animation-delay: 0s, var(--vl-exit-delay, var(--vl-motion-delay, 0s));
        animation-timing-function: var(--vl-loop-ease, var(--vl-ease-in-out-smooth)), var(--vl-exit-ease, var(--vl-ease-out-soft));
        animation-direction: var(--vl-loop-direction, var(--vl-motion-direction, normal)), var(--vl-exit-direction, var(--vl-motion-direction, normal));
        animation-iteration-count: var(--vl-loop-count, infinite), 1;
        animation-fill-mode: none, forwards;
    }

    [vl-enter][vl-exit]:is([vl-loop], [vl-loop-effect]) {
        animation-name: var(--vl-enter-name, none), var(--vl-loop-name, none), var(--vl-exit-name, none);
        animation-duration: var(--vl-enter-duration, var(--vl-motion-duration)), var(--vl-loop-duration, var(--vl-motion-duration, 4s)), var(--vl-exit-duration, var(--vl-duration-fast));
        animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), 0s, var(--vl-exit-delay, var(--vl-motion-delay, 0s));
        animation-timing-function: var(--vl-enter-ease, var(--vl-motion-ease)), var(--vl-loop-ease, var(--vl-ease-in-out-smooth)), var(--vl-exit-ease, var(--vl-ease-out-soft));
        animation-direction: var(--vl-enter-direction, var(--vl-motion-direction, normal)), var(--vl-loop-direction, var(--vl-motion-direction, normal)), var(--vl-exit-direction, var(--vl-motion-direction, normal));
        animation-iteration-count: 1, var(--vl-loop-count, infinite), 1;
        animation-fill-mode: both, none, forwards;
    }

    /* shimmer and aurora-drift paint their own gradient, so they work on any element with no author CSS.
       The gradient is declared in @layer velora.motion: an author background-image or background shorthand wins and
       is still moved by the same animation. Both animate background-position (paint only: no layout, no compositor
       layer). Parameters: --vl-shimmer-color (the moving band, default the accent at 30%); --vl-aurora-from and
       --vl-aurora-to (the two drifting glows, default primary and accent at 45%). Reduced motion: shimmer shows the plain
       element, aurora-drift keeps its gradient at rest. */
    :is([vl-loop~="shimmer"], [vl-loop-effect~="shimmer"], [vl-effect~="shimmer"]) {
        --vl-loop-name: vl-shimmer;
        --vl-loop-duration: 2.5s;
        --_shimmer: var(--vl-shimmer-color, color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary, currentColor)) 30%, transparent));
        background-image: linear-gradient(105deg, transparent 35%, var(--_shimmer) 50%, transparent 65%);
        background-size: 200% 100%;
        background-repeat: repeat-x;
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-loop~="shimmer"], [vl-loop-effect~="shimmer"], [vl-effect~="shimmer"]) {
            background-image: none;
        }
    }

    :is([vl-loop~="float"], [vl-loop-effect~="float"], [vl-effect~="float"]) {
        --vl-loop-name: vl-float;
        --vl-loop-duration: 5.5s;
    }

    :is([vl-loop~="glow-breathe"], [vl-loop-effect~="glow-breathe"], [vl-effect~="glow-breathe"]) {
        --vl-loop-name: vl-glow-breathe;
        --vl-loop-duration: 3.5s;
    }

    :is([vl-loop~="wobble"], [vl-loop-effect~="wobble"], [vl-effect~="wobble"]) {
        --vl-loop-name: vl-tilt-wobble;
        --vl-loop-duration: 2.8s;
    }

    :is([vl-loop~="rock"], [vl-loop-effect~="rock"], [vl-effect~="rock"]) {
        --vl-loop-name: vl-rock;
        --vl-loop-duration: 4s;
    }

    /* sway: a 3D swing about the Y axis (Experimental). Animates only the individual `rotate`
       property, so it composes with an author `transform` (a static tilt) and with enter/exit.
       Needs a perspective ancestor to read as depth (.vl-3d-stage).
       --vl-sway-angle  half-swing, default 20deg */
    :is([vl-loop~="sway"], [vl-loop-effect~="sway"]) {
        --vl-loop-name: vl-sway;
        --vl-loop-duration: 9s;
        --vl-loop-direction: alternate;
    }

    :is([vl-loop~="morph"], [vl-loop-effect~="morph"], [vl-effect~="morph"]) {
        --vl-loop-name: vl-morph;
        --vl-loop-duration: 8s;
    }

    :is([vl-loop~="spin"], [vl-loop-effect~="spin"], [vl-effect~="spin"]) {
        --vl-loop-name: vl-rotate-flat;
        --vl-loop-duration: 8s;
        --vl-loop-ease: linear;
    }

    :is([vl-loop~="orbit"], [vl-loop-effect~="orbit"], [vl-effect~="orbit"], [vl-loop~="orbit-spin"], [vl-loop-effect~="orbit-spin"], [vl-effect~="orbit-spin"]) {
        --vl-loop-name: vl-orbit-spin;
        --vl-loop-duration: 14s;
        --vl-loop-ease: linear;
        display: inline-block;
        transform-origin: center center;
    }

    :is([vl-loop~="aurora-drift"], [vl-loop-effect~="aurora-drift"], [vl-effect~="aurora-drift"]) {
        --vl-loop-name: vl-aurora-drift;
        --vl-loop-duration: 12s;
        --vl-loop-ease: var(--vl-ease-in-out-smooth);
        --_aurora-a: color-mix(in oklch, var(--vl-aurora-from, var(--vl-color-primary, currentColor)) 45%, transparent);
        --_aurora-b: color-mix(in oklch, var(--vl-aurora-to, var(--vl-color-accent, var(--vl-color-primary, currentColor))) 45%, transparent);
        background-image:
            radial-gradient(ellipse 60% 80% at 20% 30%, var(--_aurora-a), transparent 70%),
            radial-gradient(ellipse 55% 70% at 80% 65%, var(--_aurora-b), transparent 70%);
        background-repeat: no-repeat;
        background-position: 50% 50%;
        background-size: 300% 300%;
    }

    /* Generic loop count: vl-loop="-1" = infinite, vl-loop="N" = N iterations.
       Uses attr() with type() for modern browsers, common values as fallback. */
    [vl-loop="-1"] { --vl-loop-count: infinite; }
    [vl-loop]:not([vl-loop="-1"]) {
        --vl-loop-count: attr(vl-loop type(<number>), 1);
    }
    /* Fallback for browsers without attr() type support */
    @supports not (--x: attr(x type(<number>))) {
        [vl-loop="0"]  { --vl-loop-count: 0; }
        [vl-loop="1"]  { --vl-loop-count: 1; }
        [vl-loop="2"]  { --vl-loop-count: 2; }
        [vl-loop="3"]  { --vl-loop-count: 3; }
        [vl-loop="4"]  { --vl-loop-count: 4; }
        [vl-loop="5"]  { --vl-loop-count: 5; }
        [vl-loop="6"]  { --vl-loop-count: 6; }
        [vl-loop="8"]  { --vl-loop-count: 8; }
        [vl-loop="10"] { --vl-loop-count: 10; }
        [vl-loop="12"] { --vl-loop-count: 12; }
        [vl-loop="20"] { --vl-loop-count: 20; }
    }

    :is([vl-hover~="hover-lift"], [vl-effect~="hover-lift"]) {
        /* translate, not transform: transform belongs to enter/exit/loop, so the lift composes with them. */
        transition: translate var(--vl-transition-normal), box-shadow var(--vl-transition-normal);
    }

    :is([vl-hover~="hover-lift"], [vl-effect~="hover-lift"]):hover {
        translate: 0 -4px;
        box-shadow: var(--vl-shadow-float);
    }

    :is([vl-hover~="hover-glow"], [vl-effect~="hover-glow"]) {
        transition: box-shadow var(--vl-transition-normal);
    }

    :is([vl-hover~="hover-glow"], [vl-effect~="hover-glow"]):hover {
        box-shadow: var(--vl-shadow-glow);
    }

    :is([vl-hover~="underline-expand"], [vl-effect~="underline-expand"]) {
        position: relative;
    }

    :is([vl-hover~="underline-expand"], [vl-effect~="underline-expand"])::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: currentColor;
        transition: width var(--vl-transition-normal), left var(--vl-transition-normal);
    }

    :is([vl-hover~="underline-expand"], [vl-effect~="underline-expand"]):hover::after {
        width: 100%;
        left: 0;
    }

    :is([vl-hover~="icon-shift"], [vl-effect~="icon-shift"]) {
        transition: transform var(--vl-transition-fast);
        display: inline-flex;
        align-items: center;
        gap: 0.5em;
    }

    :is([vl-hover~="icon-shift"], [vl-effect~="icon-shift"]):hover > :last-child {
        transform: translateX(4px);
    }

    :is([vl-hover~="icon-shift"], [vl-effect~="icon-shift"]) > :last-child {
        transition: transform var(--vl-transition-fast);
    }

    [vl-exit] {
        animation-name: var(--vl-exit-name, none);
        animation-duration: var(--vl-exit-duration, var(--vl-duration-fast));
        animation-delay: var(--vl-exit-delay, var(--vl-motion-delay, 0s));
        animation-timing-function: var(--vl-exit-ease, var(--vl-ease-out-soft));
        animation-direction: var(--vl-exit-direction, var(--vl-motion-direction, normal));
        animation-fill-mode: forwards;
    }

    :is([vl-exit~="fade-out"], [vl-effect~="fade-out"]) {
        --vl-exit-name: vl-fade-out;
    }

    :is([vl-exit~="fade-out-up"], [vl-effect~="fade-out-up"]) {
        --vl-exit-name: vl-fade-out-up;
    }

    :is([vl-exit~="fade-out-down"], [vl-effect~="fade-out-down"]) {
        --vl-exit-name: vl-fade-out-down;
    }

    :is([vl-exit~="shrink-out"], [vl-effect~="shrink-out"]) {
        --vl-exit-name: vl-shrink-out;
    }

    /* --- Entrance primitives --- */
    [vl-effect="fade-in"] {
        animation: vl-fade-in var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="fade-up"] {
        animation: vl-fade-up var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="fade-down"] {
        animation: vl-fade-down var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="slide-left"] {
        animation: vl-slide-left var(--vl-motion-duration) var(--vl-ease-out-soft) both;
    }

    [vl-effect="slide-right"] {
        animation: vl-slide-right var(--vl-motion-duration) var(--vl-ease-out-soft) both;
    }

    [vl-effect="scale-in"] {
        animation: vl-scale-in var(--vl-motion-duration) var(--vl-ease-spring) both;
    }

    [vl-effect="blur-in"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-blur-in var(--vl-motion-duration) var(--vl-ease-out-soft) both;
    }

    [vl-effect="reveal-3d"] {
        animation: vl-3d-entry var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="flow-in"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-flow-in var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="clip-rise"] {
        --vl-motion-duration: var(--vl-duration-slower);
        overflow: visible;
        animation: vl-clip-rise var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    [vl-effect="tilt-in"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-tilt-in var(--vl-motion-duration) var(--vl-motion-ease) both;
    }

    /* --- Interaction effects --- */
    [vl-effect="hover-lift"] {
        transition: translate var(--vl-transition-normal), box-shadow var(--vl-transition-normal);
    }

    [vl-effect="hover-lift"]:hover {
        translate: 0 -4px;
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-glow"] {
        transition: box-shadow var(--vl-transition-normal);
    }

    [vl-effect="hover-glow"]:hover {
        box-shadow: var(--vl-shadow-glow);
    }

    [vl-effect="underline-expand"] {
        position: relative;
    }

    [vl-effect="underline-expand"]::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: currentColor;
        transition: width var(--vl-transition-normal), left var(--vl-transition-normal);
    }

    [vl-effect="underline-expand"]:hover::after {
        width: 100%;
        left: 0;
    }

    [vl-effect="icon-shift"] {
        transition: transform var(--vl-transition-fast);
        display: inline-flex;
        align-items: center;
        gap: 0.5em;
    }

    [vl-effect="icon-shift"]:hover > :last-child {
        transform: translateX(4px);
    }

    [vl-effect="icon-shift"] > :last-child {
        transition: transform var(--vl-transition-fast);
    }

    [vl-effect="hover-tilt-3d"] {
        transform-style: preserve-3d;
        transform-origin: center;
        transition:
            transform var(--vl-transition-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic),
            border-color var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-tilt-3d"]:hover,
    [vl-effect="hover-tilt-3d"]:focus-visible {
        transform: perspective(1200px) rotateX(4deg) rotateY(-4deg) translate3d(0, -6px, 0);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-depth-stack"] {
        transition:
            transform var(--vl-transition-normal) var(--vl-ease-cinematic),
            filter var(--vl-transition-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-depth-stack"]:hover,
    [vl-effect="hover-depth-stack"]:focus-visible {
        transform: translate3d(0, -8px, 0) scale(1.01);
        filter: saturate(1.06);
        box-shadow: var(--vl-shadow-float), var(--vl-shadow-glow);
    }

    [vl-effect="hover-spotlight"] {
        position: relative;
        isolation: isolate;
        overflow: clip;
    }

    [vl-effect="hover-spotlight"]::after {
        content: "";
        position: absolute;
        inset: -20%;
        background: radial-gradient(circle at center, color-mix(in oklch, var(--vl-color-primary) 22%, transparent), transparent 58%);
        opacity: 0;
        transform: scale(0.88);
        transition:
            opacity var(--vl-transition-normal) var(--vl-ease-cinematic),
            transform var(--vl-transition-normal) var(--vl-ease-cinematic);
        z-index: -1;
        pointer-events: none;
    }

    [vl-effect="hover-spotlight"]:hover::after,
    [vl-effect="hover-spotlight"]:focus-visible::after {
        opacity: 1;
        transform: scale(1);
    }

    [vl-effect="hover-card-stack"] {
        transform-style: preserve-3d;
        transition:
            transform var(--vl-transition-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic),
            border-color var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-card-stack"]:hover,
    [vl-effect="hover-card-stack"]:focus-visible {
        transform: perspective(1300px) rotateX(5deg) rotateY(-5deg) translate3d(0, -10px, 0);
        box-shadow: var(--vl-shadow-float), 0 24px 48px rgba(0, 0, 0, 0.26);
    }

    [vl-effect="hover-card-stack"] > * {
        transition: transform var(--vl-transition-normal) var(--vl-ease-cinematic), opacity var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-card-stack"]:hover > *:nth-child(1),
    [vl-effect="hover-card-stack"]:focus-visible > *:nth-child(1) {
        transform: translate3d(0, -2px, 0);
    }

    [vl-effect="hover-card-stack"]:hover > *:nth-child(2),
    [vl-effect="hover-card-stack"]:focus-visible > *:nth-child(2) {
        transform: translate3d(0, -4px, 0);
    }

    [vl-effect="hover-card-stack"]:hover > *:nth-child(3),
    [vl-effect="hover-card-stack"]:focus-visible > *:nth-child(3) {
        transform: translate3d(0, -6px, 0);
    }

    [vl-effect="hover-card-fan"] {
        --vl-hover-fan-angle: 30deg;
        --vl-hover-fan-perspective: 880px;
        --vl-hover-fan-card-width: 9.25rem;
        --vl-hover-fan-card-height: 12rem;
        --vl-hover-fan-gap: 0.5rem;
        --vl-hover-fan-accent: var(--vl-color-primary);
        --vl-hover-fan-surface: color-mix(in oklch, var(--vl-bg-surface-elevated) 88%, transparent);
        --vl-hover-fan-surface-hover: color-mix(in oklch, var(--vl-hover-fan-accent) 16%, var(--vl-bg-surface-elevated));
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--vl-hover-fan-gap);
        transform-style: preserve-3d;
    }

    [vl-effect="hover-card-fan"] > * {
        width: min(100%, var(--vl-hover-fan-card-width));
        min-height: var(--vl-hover-fan-card-height);
        border-radius: 0.7rem;
        border: 1px solid color-mix(in oklch, var(--vl-border-subtle) 68%, transparent);
        background: var(--vl-hover-fan-surface);
        color: var(--vl-text-primary);
        box-shadow: 0 5px 15px color-mix(in oklch, black 14%, transparent);
        display: grid;
        place-content: center;
        gap: 0.38rem;
        padding: 0.75rem;
        text-align: center;
        cursor: pointer;
        transform-style: preserve-3d;
        transition:
            background-color var(--vl-transition-normal) var(--vl-ease-cinematic),
            color var(--vl-transition-normal) var(--vl-ease-cinematic),
            transform var(--vl-transition-normal) var(--vl-ease-cinematic),
            border-color var(--vl-transition-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-card-fan"]:is(:hover, :focus-within, :active) > * {
        transform: perspective(var(--vl-hover-fan-perspective)) rotateY(var(--vl-hover-fan-angle));
    }

    [vl-effect="hover-card-fan"] > *:is(:hover, :focus-visible, :focus-within, :active) {
        transform: perspective(var(--vl-hover-fan-perspective)) rotateY(0deg);
        background: var(--vl-hover-fan-surface-hover);
        border-color: color-mix(in oklch, var(--vl-hover-fan-accent) 46%, transparent);
        box-shadow: var(--vl-shadow-float);
        z-index: 1;
    }

    [vl-effect="hover-card-fan"] > *:is(:hover, :focus-visible, :focus-within, :active) ~ * {
        transform: perspective(var(--vl-hover-fan-perspective)) rotateY(calc(var(--vl-hover-fan-angle) * -1));
    }

    [vl-effect="hover-card-fan"] > *:focus-visible {
        outline: var(--vl-focus-ring-width) solid var(--vl-focus-ring-color);
        outline-offset: 2px;
    }

    [vl-effect="hover-card-fan"] > * .vl-hover-fan-index {
        width: 4.6rem;
        min-width: 4.6rem;
        aspect-ratio: 1;
        border-radius: 50%;
        display: grid;
        place-content: center;
        margin: 0 auto;
        font-family: var(--vl-font-family-display);
        font-size: 2rem;
        line-height: 1;
        color: var(--vl-text-inverse, oklch(98% 0.01 95));
        background: color-mix(in oklch, var(--vl-hover-fan-accent) 72%, transparent);
        transition:
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic),
            background-color var(--vl-transition-normal) var(--vl-ease-cinematic),
            color var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-card-fan"] > * .vl-hover-fan-label {
        margin: 0;
        font-family: var(--vl-font-family-mono);
        font-size: 0.62rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--vl-text-secondary);
    }

    [vl-effect="hover-card-fan"] > *:is(:hover, :focus-visible, :focus-within, :active) .vl-hover-fan-index {
        background: var(--vl-hover-fan-surface);
        color: color-mix(in oklch, var(--vl-hover-fan-accent) 82%, var(--vl-text-primary));
        box-shadow: 0 0 0 120px color-mix(in oklch, var(--vl-hover-fan-accent) 66%, transparent);
    }

    [vl-effect="hover-shell-lift"] {
        position: relative;
        overflow: clip;
        transition:
            transform var(--vl-transition-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-shell-lift"]::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, color-mix(in oklch, var(--vl-color-primary) 14%, transparent), transparent 52%);
        opacity: 0;
        transition: opacity var(--vl-transition-normal) var(--vl-ease-cinematic);
        pointer-events: none;
    }

    [vl-effect="hover-shell-lift"]:hover,
    [vl-effect="hover-shell-lift"]:focus-visible {
        transform: translate3d(0, -6px, 0) scale(1.01);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-shell-lift"]:hover::before,
    [vl-effect="hover-shell-lift"]:focus-visible::before {
        opacity: 1;
    }

    [vl-effect="hover-cross-swap"] {
        --vl-hover-cross-peek: clamp(0.72rem, 10%, 1.1rem);
        --vl-hover-cross-surface: color-mix(in oklch, var(--vl-bg-main) 90%, transparent);
        position: relative;
        display: block;
        overflow: hidden;
        isolation: isolate;
        padding: 0;
        background:
            radial-gradient(circle at 50% 18%, color-mix(in oklch, var(--vl-color-primary) 10%, transparent), transparent 58%),
            color-mix(in oklch, var(--vl-bg-main) 94%, transparent);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel] {
        position: absolute;
        inset: 0;
        display: grid;
        place-content: center;
        gap: 0.32rem;
        width: 100%;
        height: 100%;
        padding: 0.85rem;
        margin: 0;
        border: 1px solid color-mix(in oklch, var(--vl-border-subtle) 64%, transparent);
        background: var(--vl-hover-cross-surface);
        color: var(--vl-text-primary);
        text-align: center;
        text-decoration: none;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        transition:
            transform 320ms var(--vl-ease-out-soft),
            border-color 320ms var(--vl-ease-out-soft),
            box-shadow 320ms var(--vl-ease-out-soft),
            filter 320ms var(--vl-ease-out-soft);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel]::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0.9;
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel="center"] {
        z-index: 1;
        cursor: default;
        background:
            radial-gradient(circle at 50% 0%, color-mix(in oklch, var(--vl-color-primary) 16%, transparent), transparent 62%),
            color-mix(in oklch, var(--vl-bg-surface-elevated) 88%, transparent);
        box-shadow: inset 0 1px 0 color-mix(in oklch, white 10%, transparent);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel="top"] {
        z-index: 2;
        transform: translate3d(0, calc(-100% + var(--vl-hover-cross-peek)), 0);
        background:
            linear-gradient(180deg, color-mix(in oklch, var(--vl-color-primary) 20%, transparent), transparent 58%),
            color-mix(in oklch, var(--vl-bg-surface-elevated) 92%, transparent);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel="right"] {
        z-index: 2;
        transform: translate3d(calc(100% - var(--vl-hover-cross-peek)), 0, 0);
        background:
            linear-gradient(270deg, color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 20%, transparent), transparent 58%),
            color-mix(in oklch, var(--vl-bg-surface-elevated) 92%, transparent);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel="bottom"] {
        z-index: 2;
        transform: translate3d(0, calc(100% - var(--vl-hover-cross-peek)), 0);
        background:
            linear-gradient(0deg, color-mix(in oklch, var(--vl-color-primary) 16%, transparent), transparent 58%),
            color-mix(in oklch, var(--vl-bg-surface-elevated) 92%, transparent);
    }

    [vl-effect="hover-cross-swap"] > [data-vl-panel="left"] {
        z-index: 2;
        transform: translate3d(calc(-100% + var(--vl-hover-cross-peek)), 0, 0);
        background:
            linear-gradient(90deg, color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 14%, transparent), transparent 58%),
            color-mix(in oklch, var(--vl-bg-surface-elevated) 92%, transparent);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="top"]:is(:hover, :focus-visible)) > [data-vl-panel="top"] {
        z-index: 4;
        transform: translate3d(0, 0, 0);
        border-color: color-mix(in oklch, var(--vl-color-primary) 42%, transparent);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="top"]:is(:hover, :focus-visible)) > [data-vl-panel="center"] {
        transform: translate3d(0, calc(100% - var(--vl-hover-cross-peek)), 0);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="right"]:is(:hover, :focus-visible)) > [data-vl-panel="right"] {
        z-index: 4;
        transform: translate3d(0, 0, 0);
        border-color: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 42%, transparent);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="right"]:is(:hover, :focus-visible)) > [data-vl-panel="center"] {
        transform: translate3d(calc(-100% + var(--vl-hover-cross-peek)), 0, 0);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="bottom"]:is(:hover, :focus-visible)) > [data-vl-panel="bottom"] {
        z-index: 4;
        transform: translate3d(0, 0, 0);
        border-color: color-mix(in oklch, var(--vl-color-primary) 38%, transparent);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="bottom"]:is(:hover, :focus-visible)) > [data-vl-panel="center"] {
        transform: translate3d(0, calc(-100% + var(--vl-hover-cross-peek)), 0);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="left"]:is(:hover, :focus-visible)) > [data-vl-panel="left"] {
        z-index: 4;
        transform: translate3d(0, 0, 0);
        border-color: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 36%, transparent);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-cross-swap"]:has(> [data-vl-panel="left"]:is(:hover, :focus-visible)) > [data-vl-panel="center"] {
        transform: translate3d(calc(100% - var(--vl-hover-cross-peek)), 0, 0);
    }

    [vl-effect="hover-orb-grid"] {
        --mouse-x: 50%;
        --mouse-y: 50%;
        --vl-orb-grid-bg: color-mix(in oklch, var(--vl-color-primary) 14%, var(--vl-bg-main));
        --vl-orb-grid-ink: color-mix(in oklch, var(--vl-color-primary) 74%, var(--vl-text-primary));
        --vl-orb-grid-blend-a: color-mix(in oklch, var(--vl-color-primary) 18%, white);
        --vl-orb-grid-blend-b: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 56%, transparent);
        --vl-orb-grid-size-a: clamp(1.8rem, 11vw, 3.8rem);
        --vl-orb-grid-size-b: clamp(1.4rem, 8vw, 3rem);
        background: var(--vl-orb-grid-bg);
        border-color: color-mix(in oklch, var(--vl-color-primary) 42%, transparent);
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    [vl-effect="hover-orb-grid"] > .vl-orb-zones {
        position: absolute;
        inset: 0;
        z-index: 3;
        display: grid;
        grid-template-columns: repeat(10, minmax(0, 1fr));
        grid-template-rows: repeat(10, minmax(0, 1fr));
        pointer-events: none;
    }

    [vl-effect="hover-orb-grid"] > .vl-orb-zones > span {
        display: block;
        pointer-events: auto;
    }

    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 1):hover) { --mouse-x: 5%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 2):hover) { --mouse-x: 15%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 3):hover) { --mouse-x: 25%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 4):hover) { --mouse-x: 35%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 5):hover) { --mouse-x: 45%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 6):hover) { --mouse-x: 55%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 7):hover) { --mouse-x: 65%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 8):hover) { --mouse-x: 75%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n + 9):hover) { --mouse-x: 85%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(10n):hover) { --mouse-x: 95%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 1):nth-child(-n + 10):hover) { --mouse-y: 5%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 11):nth-child(-n + 20):hover) { --mouse-y: 15%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 21):nth-child(-n + 30):hover) { --mouse-y: 25%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 31):nth-child(-n + 40):hover) { --mouse-y: 35%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 41):nth-child(-n + 50):hover) { --mouse-y: 45%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 51):nth-child(-n + 60):hover) { --mouse-y: 55%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 61):nth-child(-n + 70):hover) { --mouse-y: 65%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 71):nth-child(-n + 80):hover) { --mouse-y: 75%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 81):nth-child(-n + 90):hover) { --mouse-y: 85%; }
    [vl-effect="hover-orb-grid"]:has(> .vl-orb-zones > span:nth-child(n + 91):nth-child(-n + 100):hover) { --mouse-y: 95%; }

    [vl-effect="hover-orb-grid"]:has(> ul > li:nth-child(1):hover) { --mouse-x: 25%; --mouse-y: 25%; }
    [vl-effect="hover-orb-grid"]:has(> ul > li:nth-child(2):hover) { --mouse-x: 75%; --mouse-y: 25%; }
    [vl-effect="hover-orb-grid"]:has(> ul > li:nth-child(3):hover) { --mouse-x: 25%; --mouse-y: 75%; }
    [vl-effect="hover-orb-grid"]:has(> ul > li:nth-child(4):hover) { --mouse-x: 75%; --mouse-y: 75%; }

    [vl-effect="hover-orb-grid"] > ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        min-height: 100%;
    }

    [vl-effect="hover-orb-grid"] > ul > li {
        position: relative;
        overflow: hidden;
    }

    [vl-effect="hover-orb-grid"] > ul > li > :is(a, button, span) {
        color: var(--vl-orb-grid-ink);
        display: flex;
        width: 100%;
        min-height: 100%;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-family: var(--vl-font-family-mono);
        font-size: clamp(0.76rem, 1.3vw, 1rem);
        font-weight: 700;
        position: relative;
        z-index: 1;
    }

    [vl-effect="hover-orb-grid"]::after,
    [vl-effect="hover-orb-grid"]::before {
        content: "";
        position: absolute;
        pointer-events: none;
        opacity: 0.8;
        transition: opacity var(--vl-transition-normal);
    }

    [vl-effect="hover-orb-grid"]::after {
        width: var(--vl-orb-grid-size-a);
        height: var(--vl-orb-grid-size-a);
        background: var(--vl-orb-grid-blend-a);
        mix-blend-mode: exclusion;
        top: var(--mouse-y);
        left: var(--mouse-x);
        transform: translate(-50%, -50%);
    }

    [vl-effect="hover-orb-grid"]::before {
        width: var(--vl-orb-grid-size-b);
        height: var(--vl-orb-grid-size-b);
        background: var(--vl-orb-grid-blend-b);
        mix-blend-mode: color-dodge;
        top: calc(var(--mouse-y) - 4%);
        left: calc(var(--mouse-x) + 8%);
        transform: translate(-50%, -50%);
    }

    [vl-effect="hover-orb-grid"]:not(:hover)::after,
    [vl-effect="hover-orb-grid"]:not(:hover)::before {
        opacity: 0;
    }

    @media (max-width: 40rem) {
        [vl-effect="hover-orb-grid"] > ul {
            grid-template-columns: 1fr;
            grid-template-rows: repeat(4, minmax(0, 1fr));
        }
    }

    @media (hover: none) {
        [vl-effect="hover-lift"]:hover,
        [vl-effect="hover-glow"]:hover {
            translate: none;
            box-shadow: none;
        }

        [vl-effect="hover-orb-grid"]::after,
        [vl-effect="hover-orb-grid"]::before {
            opacity: 0;
            clip-path: circle(0);
            -webkit-clip-path: circle(0);
        }
    }

    /* --- State effects --- */
    [vl-effect="accordion"] {
        overflow: hidden;
        transition: height var(--vl-transition-normal), opacity var(--vl-transition-normal);
    }

    [vl-effect="drawer"] {
        transition:
            transform var(--vl-transition-normal),
            opacity var(--vl-transition-normal),
            visibility var(--vl-transition-normal) allow-discrete,
            display var(--vl-transition-normal) allow-discrete;
    }

    [vl-effect="panel-swap"] {
        transition: opacity var(--vl-transition-normal), transform var(--vl-transition-fast);
    }

    /* --- Continuous / ambient effects --- */
    [vl-effect="shimmer"] {
        animation: vl-shimmer 2.5s var(--vl-ease-in-out-smooth) infinite;
        background-size: 200% auto;
    }

    [vl-effect="float"] {
        animation: vl-float 5.5s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="glow-breathe"] {
        animation: vl-glow-breathe 3.5s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="wobble"] {
        animation: vl-tilt-wobble 2.8s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="orbit"] {
        display: inline-block;
        transform-origin: center center;
        animation: vl-orbit-spin 14s linear infinite;
    }

    [vl-effect="rock"] {
        animation: vl-rock 4s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="morph"] {
        animation: vl-morph 8s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="elastic-in"] {
        animation: vl-elastic-in 0.7s var(--vl-ease-spring) both;
    }

    /* --- Text reveals --- */
    [vl-effect="text-reveal"] {
        animation: vl-clip-reveal-ltr 0.8s var(--vl-ease-cinematic) both;
    }

    [vl-effect="text-reveal-up"] {
        animation: vl-clip-reveal-up 0.8s var(--vl-ease-cinematic) both;
    }

    [vl-effect="text-reveal-down"] {
        animation: vl-clip-reveal-down 0.8s var(--vl-ease-cinematic) both;
    }

    /* --- Cinema / scroll-specific --- */
    [vl-effect="cinema-zoom"] {
        animation: vl-cinema-zoom linear both;
        animation-timeline: view(block);
        animation-range: entry 0% exit 100%;
        will-change: transform, filter;
    }

    [vl-effect="parallax"] {
        animation: vl-parallax-shift both linear;
        animation-timeline: view(block);
        animation-range: var(--vl-range, var(--vl-range-start, cover 0%) var(--vl-range-end, cover 100%));
    }

    [vl-effect="typewriter"] {
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
        max-width: 100%;
        border-right: 2px solid var(--vl-type-caret-color, var(--vl-color-primary));
        width: 0;
        animation:
            vl-typewriter var(--vl-type-duration, 2s) steps(var(--vl-type-steps, 21), end) forwards,
            vl-blink-caret var(--vl-type-caret-blink, 0.5s) step-end infinite alternate;
        font-family: var(--vl-font-family-mono);
    }

    [vl-effect="typewriter-soft"] {
        overflow: hidden;
        white-space: nowrap;
        --vl-type-caret-color: color-mix(in oklch, var(--vl-color-primary) 55%, transparent);
        border-right: 1px solid var(--vl-type-caret-color);
        width: 0;
        display: inline-block;
        max-width: 100%;
        animation:
            vl-typewriter var(--vl-type-duration, 2.4s) steps(var(--vl-type-steps, 26), end) forwards,
            vl-blink-caret 0.95s step-end 4 alternate;
        font-family: var(--vl-font-family-mono);
        letter-spacing: 0.04em;
    }

    /*
     * Looping typewriter: types each character forward then reverses (erases),
     * repeating indefinitely. Uses alternate direction so step count matches
     * the character count in both directions. Cursor blinks throughout.
     */
    :is([vl-effect="typewriter-loop"], [vl-loop~="typewriter-loop"], [vl-loop-effect~="typewriter-loop"]) {
        overflow: hidden;
        white-space: nowrap;
        --vl-type-caret-color: color-mix(in oklch, var(--vl-color-primary) 60%, transparent);
        border-right: 1px solid var(--vl-type-caret-color);
        width: 0;
        display: inline-block;
        max-width: 100%;
        font-family: var(--vl-font-family-mono);
        letter-spacing: 0.04em;
    }

    [vl-effect="typewriter-loop"] {
        animation:
            vl-typewriter-loop var(--vl-type-duration, 2.6s) steps(var(--vl-type-steps, 36), end) infinite alternate,
            vl-blink-caret 0.9s step-end infinite alternate;
    }

    /* Two animations (type, caret): every --vl-loop-* list has two entries, so the loop also
       composes after vl-enter (one entry for the entrance, then these two). */
    :is([vl-loop~="typewriter-loop"], [vl-loop-effect~="typewriter-loop"]) {
        --vl-loop-name: vl-typewriter-loop, vl-blink-caret;
        --vl-loop-duration: var(--vl-type-duration, 2.6s), 0.9s;
        --vl-loop-ease: steps(var(--vl-type-steps, 36), end), step-end;
        --vl-loop-direction: alternate, alternate;
        --vl-loop-count: infinite, infinite;
    }

    [vl-effect="text-line-reveal"] {
        display: inline-block;
        overflow: visible;
        animation: vl-line-wipe var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    [vl-effect="text-word-rise"] {
        display: inline-block;
        animation: vl-word-rise var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-out-soft) both;
    }

    [vl-effect="scroll-marquee"] {
        animation: vl-scroll-horizontal both linear;
        animation-timeline: scroll(root);
        animation-range: var(--vl-marquee-range, cover 0% cover 100%);
        --vl-scroll-x-distance: var(--vl-marquee-distance, -36%);
        will-change: transform;
    }

    [vl-effect="depth-drift"] {
        animation: vl-depth-drift both linear;
        animation-timeline: view(block);
        animation-range: var(--vl-range, var(--vl-range-start, entry 0%) var(--vl-range-end, cover 85%));
        transform-origin: center center;
    }

    /* =========================================================================
       TIMELINE BINDINGS  [vl-timeline="<value>"]
       ========================================================================= */
    [vl-timeline="view"] {
        animation-timeline: view();
        animation-range: entry 5% cover 42%;
        animation-timing-function: linear;
    }

    [vl-timeline="view"][vl-effect="clip-rise"] {
        animation-name: vl-clip-rise;
        animation-duration: var(--vl-motion-duration, var(--vl-duration-slower));
        animation-fill-mode: both;
        animation-timeline: view();
        animation-range: var(--vl-range, entry 5% cover 42%);
    }

    [vl-timeline="view"][vl-effect="text-line-reveal"] {
        animation-name: vl-line-wipe;
        animation-duration: var(--vl-motion-duration, var(--vl-duration-slow));
        animation-fill-mode: both;
        animation-timeline: view();
        animation-range: var(--vl-range, entry 8% cover 48%);
    }

    [vl-timeline="scroll"] {
        animation-timeline: scroll(root);
        animation-timing-function: linear;
    }

    [vl-timeline="auto"] {
        animation-timeline: auto;
    }

    [vl-timeline="hover"] {
        animation-play-state: paused;
    }

    [vl-timeline="hover"]:hover {
        animation-play-state: running;
    }

    /* =========================================================================
       RANGE PRESETS  [vl-range="<value>"]
       ========================================================================= */
    [vl-range="entry"] {
        animation-range: entry 0% entry 100%;
    }

    [vl-range="entry-short"] {
        animation-range: entry 15% cover 35%;
    }

    [vl-range="entry-long"] {
        animation-range: entry 0% cover 70%;
    }

    [vl-range="cover"] {
        animation-range: cover 0% cover 100%;
    }

    [vl-range="contain"] {
        animation-range: contain 0% contain 100%;
    }

    [vl-range="custom"] {
        animation-range: var(--vl-range, var(--vl-range-start, entry 5%) var(--vl-range-end, cover 42%));
    }

    [vl-range="scene-soft"] {
        animation-range: entry 0% cover 82%;
    }

    [vl-range="scene-focus"] {
        animation-range: entry 20% cover 65%;
    }

    /* =========================================================================
       BOOLEAN ATTRIBUTES
       ========================================================================= */
    [vl-pin] {
        position: sticky;
        top: 0;
        z-index: var(--vl-z-sticky);
    }

    [vl-scrub] {
        animation-fill-mode: both;
        animation-timing-function: linear;
    }

    [vl-once] {
        animation-fill-mode: forwards;
        animation-iteration-count: 1;
    }

    [vl-once][vl-timeline="view"] {
        animation-range: entry 10% cover 36%;
    }

    /* =====================================================================
       IN-VIEW GATE  [vl-in-view]
       The wrapper owns viewport detection; descendants own their presets.
       This keeps view() as a trigger for temporal motion instead of making
       every preset itself progress continuously with scroll.
       ===================================================================== */
    @property --vl-in-view-state {
        syntax: "<integer>";
        inherits: false;
        initial-value: 0;
    }

    @keyframes vl-in-view-gate {
        0% { --vl-in-view-state: 0; }
        2% { --vl-in-view-state: 1; }
        98% { --vl-in-view-state: 1; }
        100% { --vl-in-view-state: 0; }
    }

    [vl-in-view] {
        container-name: vl-in-view;
        container-type: style;
        animation: vl-in-view-gate 1ms both;
        animation-timeline: view(block);
        animation-range: entry exit;
    }

    [vl-in-view] :is([vl-effect], [vl-enter], [vl-scroll], [vl-loop], [vl-loop-effect], [vl-hover], [vl-state], [vl-exit]) {
        /* Safe baseline: absent style queries must not freeze visible content. */
        animation-play-state: running;
    }

    /* A matching style query proves the gate is available. Reset temporal
       motion outside the gate, while scroll-linked channels keep their clock.
       CSS.supports(container-type: style) cannot detect style-query support. */
    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            @container vl-in-view style(--vl-in-view-state: 0) {
                [vl-in-view] :is([vl-effect], [vl-enter], [vl-loop], [vl-loop-effect], [vl-hover], [vl-state], [vl-exit]):not([vl-scroll]):not([vl-timeline="view"]):not([vl-timeline="scroll"]):not([vl-motion="still"], [vl-motion="still"] *) {
                    opacity: 0;
                    animation-name: none;
                }
            }
        }
    }

    @container vl-in-view style(--vl-in-view-state: 1) {
        [vl-in-view] :is([vl-effect], [vl-enter], [vl-scroll], [vl-loop], [vl-loop-effect], [vl-hover], [vl-state], [vl-exit]) {
            animation-play-state: running;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        [vl-in-view] { animation: none; }
        [vl-in-view] :is([vl-effect], [vl-enter], [vl-scroll], [vl-loop], [vl-loop-effect], [vl-hover], [vl-state], [vl-exit]) {
            animation-play-state: running;
        }
    }

    [vl-enter="focus"] {
        animation-fill-mode: both;
    }

    [vl-enter="focus"][vl-timeline="view"] {
        animation-range: entry 12% cover 34%;
    }

    /* =========================================================================
       CHILD CHOREOGRAPHY  [vl-children="<mode>"]
       ========================================================================= */
    [vl-children="stagger"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-fade-up var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-cinematic)) both;
    }


    [vl-children="cascade"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-flow-in var(--vl-duration-slower) var(--vl-ease-out-soft) both;
    }


    [vl-children="sequence"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        --vl-seq-duration: var(--vl-motion-duration, var(--vl-duration-slow));
        animation: vl-fade-up var(--vl-seq-duration) var(--vl-motion-ease, var(--vl-ease-cinematic)) both;
    }


    [vl-children="orchestrate"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-flow-in var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-cinematic)) both;
    }

    [vl-children="orchestrate"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])):nth-child(odd) {
        animation-name: vl-fade-up;
    }


    /* Stagger with no child limit. Index and count come from the tree (sibling-index / sibling-count), so any number of
       children keeps its order. The step is --vl-stagger-step (vl-stagger sets it); the whole sequence never takes
       longer than --vl-stagger-fit (default 2s), so a long list tightens instead of dragging. sequence waits for the
       previous child to finish (its step is that duration) and fits within 10s; grid-wave keeps its 80ms step. */
    @supports (width: calc(sibling-index() * 1px)) {
        :is([vl-children="stagger"], [vl-children="cascade"], [vl-children="orchestrate"], [vl-children="wave"],
            [vl-children="blur-cascade"], [vl-children="zoom-stagger"], [vl-children="cinema-stagger"],
            [vl-children="spiral-stagger"]) > * {
            --_stagger-delay: calc((sibling-index() - 1) * min(var(--vl-stagger-step), var(--vl-stagger-fit, 2s) / max(sibling-count() - 1, 1)));
            animation-delay: var(--_stagger-delay);
        }

        [vl-children="grid-wave"] > * {
            --_stagger-delay: calc((sibling-index() - 1) * min(80ms, var(--vl-stagger-fit, 2s) / max(sibling-count() - 1, 1)));
            animation-delay: var(--_stagger-delay);
        }

        [vl-children="sequence"] > * {
            animation-delay: calc((sibling-index() - 1) * min(var(--vl-seq-duration), var(--vl-stagger-fit, 10s) / max(sibling-count() - 1, 1)));
        }
    }

    /* Fallback without sibling-index(): a fixed ladder for the first children. */
    @supports not (width: calc(sibling-index() * 1px)) {
        [vl-children="stagger"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(9)  { animation-delay: calc(8  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(10) { animation-delay: calc(9  * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(11) { animation-delay: calc(10 * var(--vl-stagger-step)); }
        [vl-children="stagger"] > *:nth-child(12) { animation-delay: calc(11 * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step)); }
        [vl-children="cascade"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step)); }
        [vl-children="sequence"] > *:nth-child(1)  { animation-delay: calc(0 * var(--vl-seq-duration)); }
        [vl-children="sequence"] > *:nth-child(2)  { animation-delay: calc(1 * var(--vl-seq-duration)); }
        [vl-children="sequence"] > *:nth-child(3)  { animation-delay: calc(2 * var(--vl-seq-duration)); }
        [vl-children="sequence"] > *:nth-child(4)  { animation-delay: calc(3 * var(--vl-seq-duration)); }
        [vl-children="sequence"] > *:nth-child(5)  { animation-delay: calc(4 * var(--vl-seq-duration)); }
        [vl-children="sequence"] > *:nth-child(6)  { animation-delay: calc(5 * var(--vl-seq-duration)); }
        [vl-children="orchestrate"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step)); }
        [vl-children="orchestrate"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step)); }
    }

    [vl-stagger="60ms"]  { --vl-stagger-step: 60ms; }
    [vl-stagger="80ms"]  { --vl-stagger-step: 80ms; }
    [vl-stagger="100ms"] { --vl-stagger-step: 100ms; }
    [vl-stagger="120ms"] { --vl-stagger-step: 120ms; }
    [vl-stagger="140ms"] { --vl-stagger-step: 140ms; }
    [vl-stagger="150ms"] { --vl-stagger-step: 150ms; }
    [vl-stagger="180ms"] { --vl-stagger-step: 180ms; }
    [vl-stagger="200ms"] { --vl-stagger-step: 200ms; }
    [vl-stagger="220ms"] { --vl-stagger-step: 220ms; }
    [vl-stagger="240ms"] { --vl-stagger-step: 240ms; }
    [vl-stagger="280ms"] { --vl-stagger-step: 280ms; }
    [vl-stagger="320ms"] { --vl-stagger-step: 320ms; }

    /* =========================================================================
       DEPTH  [vl-depth="1-4"]
       P4f semantics: enter/exit travel distance only.
       Writes --vl-motion-distance (legacy) and --vl-distance-y (canonical).
       Does NOT control scroll parallax intensity (--vl-motion-depth) or
       --vl-parallax-from/to / --vl-depth-from/to endpoints.
       ========================================================================= */
    [vl-depth="1"] {
        --vl-motion-distance: 0.75rem;
        --vl-distance-y: 0.75rem;
    }
    [vl-depth="2"] {
        --vl-motion-distance: 1.5rem;
        --vl-distance-y: 1.5rem;
    }
    [vl-depth="3"] {
        --vl-motion-distance: 2.5rem;
        --vl-distance-y: 2.5rem;
    }
    [vl-depth="4"] {
        --vl-motion-distance: 4rem;
        --vl-distance-y: 4rem;
    }

    /* =========================================================================
       SPEED  [vl-speed="slow|normal|fast"]
       ========================================================================= */
    [vl-speed="fast"]   { --vl-motion-duration: var(--vl-duration-fast); }
    [vl-speed="normal"] { --vl-motion-duration: var(--vl-duration-normal); }
    [vl-speed="slow"]   { --vl-motion-duration: var(--vl-duration-slow); }
    [vl-speed="cinema"] { --vl-motion-duration: var(--vl-duration-slower); }

    /* Generic duration: any value of vl-duration is propagated.
       Uses attr() with type() for modern browsers, common values as fallback. */
    [vl-duration] {
        --vl-motion-duration: attr(vl-duration type(<time>), var(--vl-duration-slow));
        --vl-enter-duration: attr(vl-duration type(<time>), var(--vl-duration-slow));
        --vl-exit-duration: attr(vl-duration type(<time>), var(--vl-duration-fast));
        --vl-loop-duration: attr(vl-duration type(<time>), 4s);
    }

    /* Element-level delay shared by entry and exit channels. */
    [vl-delay] {
        --vl-motion-delay: attr(vl-delay type(<time>), 0s);
    }

    @supports not (--x: attr(x type(<time>))) {
        [vl-delay="80ms"] { --vl-motion-delay: 80ms; }
        [vl-delay="120ms"] { --vl-motion-delay: 120ms; }
        [vl-delay="160ms"] { --vl-motion-delay: 160ms; }
        [vl-delay="240ms"] { --vl-motion-delay: 240ms; }
        [vl-delay="300ms"] { --vl-motion-delay: 300ms; }
        [vl-delay="500ms"] { --vl-motion-delay: 500ms; }
        [vl-delay="0s"] { --vl-motion-delay: 0s; }
    }
    /* Fallback for browsers without attr() type support */
    @supports not (--x: attr(x type(<time>))) {
        [vl-duration="120ms"] { --vl-motion-duration: 120ms; --vl-enter-duration: 120ms; --vl-exit-duration: 120ms; --vl-loop-duration: 120ms; }
        [vl-duration="200ms"] { --vl-motion-duration: 200ms; --vl-enter-duration: 200ms; --vl-exit-duration: 200ms; --vl-loop-duration: 200ms; }
        [vl-duration="300ms"] { --vl-motion-duration: 300ms; --vl-enter-duration: 300ms; --vl-exit-duration: 300ms; --vl-loop-duration: 300ms; }
        [vl-duration="500ms"] { --vl-motion-duration: 500ms; --vl-enter-duration: 500ms; --vl-exit-duration: 500ms; --vl-loop-duration: 500ms; }
        [vl-duration="800ms"] { --vl-motion-duration: 800ms; --vl-enter-duration: 800ms; --vl-exit-duration: 800ms; --vl-loop-duration: 800ms; }
        [vl-duration="1000ms"] { --vl-motion-duration: 1000ms; --vl-enter-duration: 1000ms; --vl-exit-duration: 1000ms; --vl-loop-duration: 1000ms; }
        [vl-duration="1200ms"] { --vl-motion-duration: 1200ms; --vl-enter-duration: 1200ms; --vl-exit-duration: 1200ms; --vl-loop-duration: 1200ms; }
        [vl-duration="1500ms"] { --vl-motion-duration: 1500ms; --vl-enter-duration: 1500ms; --vl-exit-duration: 1500ms; --vl-loop-duration: 1500ms; }
        [vl-duration="2000ms"] { --vl-motion-duration: 2000ms; --vl-enter-duration: 2000ms; --vl-exit-duration: 2000ms; --vl-loop-duration: 2000ms; }
        [vl-duration="3000ms"] { --vl-motion-duration: 3000ms; --vl-enter-duration: 3000ms; --vl-exit-duration: 3000ms; --vl-loop-duration: 3000ms; }
        [vl-duration="4000ms"] { --vl-motion-duration: 4000ms; --vl-enter-duration: 4000ms; --vl-exit-duration: 4000ms; --vl-loop-duration: 4000ms; }
        [vl-duration="0.3s"] { --vl-motion-duration: 0.3s; --vl-enter-duration: 0.3s; --vl-exit-duration: 0.3s; --vl-loop-duration: 0.3s; }
        [vl-duration="0.5s"] { --vl-motion-duration: 0.5s; --vl-enter-duration: 0.5s; --vl-exit-duration: 0.5s; --vl-loop-duration: 0.5s; }
        [vl-duration="0.8s"] { --vl-motion-duration: 0.8s; --vl-enter-duration: 0.8s; --vl-exit-duration: 0.8s; --vl-loop-duration: 0.8s; }
        [vl-duration="1s"] { --vl-motion-duration: 1s; --vl-enter-duration: 1s; --vl-exit-duration: 1s; --vl-loop-duration: 1s; }
        [vl-duration="1.5s"] { --vl-motion-duration: 1.5s; --vl-enter-duration: 1.5s; --vl-exit-duration: 1.5s; --vl-loop-duration: 1.5s; }
        [vl-duration="2s"] { --vl-motion-duration: 2s; --vl-enter-duration: 2s; --vl-exit-duration: 2s; --vl-loop-duration: 2s; }
        [vl-duration="3s"] { --vl-motion-duration: 3s; --vl-enter-duration: 3s; --vl-exit-duration: 3s; --vl-loop-duration: 3s; }
        [vl-duration="4s"] { --vl-motion-duration: 4s; --vl-enter-duration: 4s; --vl-exit-duration: 4s; --vl-loop-duration: 4s; }
    }

     /* =========================================================================
         DIRECTION  [vl-direction="normal|reverse|alternate|alternate-reverse"]
         ========================================================================= */
     [vl-direction="normal"] { --vl-motion-direction: normal; }
     [vl-direction="reverse"] { --vl-motion-direction: reverse; }
     [vl-direction="alternate"] { --vl-motion-direction: alternate; }
     [vl-direction="alternate-reverse"] { --vl-motion-direction: alternate-reverse; }

    /* =========================================================================
       SCENE SYSTEM  [vl-scene="<name>"]
       ========================================================================= */
    [vl-scene] {
        position: relative;
        container-type: inline-size;
        container-name: vl-scene;
        contain: layout style;
    }

    [vl-effect="scene-hero-reveal"] {
        --vl-motion-duration: var(--vl-duration-slower);
    }

    [vl-effect="scene-hero-reveal"] > *:nth-child(1) {
        animation: vl-fade-up var(--vl-duration-slower) var(--vl-ease-cinematic) both;
    }

    [vl-effect="scene-hero-reveal"] > *:nth-child(2) {
        animation: vl-scale-in var(--vl-duration-slower) var(--vl-ease-spring) both;
        animation-delay: 120ms;
    }

    [vl-effect="scene-hero-reveal"] > *:nth-child(3) {
        animation: vl-blur-in var(--vl-duration-slower) var(--vl-ease-out-soft) both;
        animation-delay: 240ms;
    }

    [vl-effect="scene-hero-reveal"] > *:nth-child(n+4) {
        animation: vl-fade-up var(--vl-duration-slow) var(--vl-ease-cinematic) both;
        animation-delay: calc(240ms + (var(--vl-stagger-step) * 2));
    }

    [vl-effect="scene-feature-flow"] {
        --vl-motion-duration: var(--vl-duration-slower);
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > * {
        animation: vl-flow-in both linear;
        animation-timeline: view(block);
        animation-range: entry 5% cover 40%;
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > *:nth-child(1) {
        animation-range: entry 0% cover 35%;
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > *:nth-child(2) {
        animation-range: entry 5% cover 40%;
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > *:nth-child(3) {
        animation-range: entry 10% cover 45%;
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > *:nth-child(4) {
        animation-range: entry 15% cover 50%;
    }

    [vl-effect="scene-feature-flow"][vl-timeline="view"] > *:nth-child(n+5) {
        animation-range: entry 20% cover 55%;
    }

    [vl-effect="scene-story-pin"] {
        position: sticky;
        top: 0;
        min-height: 100vh;
        overflow: hidden;
    }

    [vl-effect="scene-story-pin"] > * {
        animation: vl-fade-up both linear;
        animation-timeline: view(block);
        animation-range: entry 10% cover 50%;
    }

    [vl-effect="scene-layer-stack"] {
        perspective: 1200px;
    }

    [vl-effect="scene-layer-stack"] > * {
        animation: vl-3d-entry both linear;
        animation-timeline: view(block);
        animation-range: entry 5% cover 42%;
    }

    [vl-effect="scene-layer-stack"] > *:nth-child(1) { --vl-motion-distance: 1rem; }
    [vl-effect="scene-layer-stack"] > *:nth-child(2) { --vl-motion-distance: 2rem; }
    [vl-effect="scene-layer-stack"] > *:nth-child(3) { --vl-motion-distance: 3rem; }
    [vl-effect="scene-layer-stack"] > *:nth-child(4) { --vl-motion-distance: 4rem; }

    /* =========================================================================
       SCENE TRIGGERS (CSS-only gate)
       - Baseline: host :hover / :focus-within
       - Advanced: :has() trigger zone with baseline fallback
       ========================================================================= */
    [vl-scene][vl-scene-trigger]:not(:is(:hover, :focus-within))
    :is([vl-scroll], [vl-timeline="view"], [vl-timeline="scroll"]) {
        animation-play-state: paused;
    }

    [vl-scene][vl-scene-trigger]:is(:hover, :focus-within)
    :is([vl-scroll], [vl-timeline="view"], [vl-timeline="scroll"]) {
        animation-play-state: running;
    }

    @supports selector(:has(*)) {
        [vl-scene][vl-scene-trigger="zone"]:not(:has(> [vl-scene-trigger-zone]:is(:hover, :focus-visible, :focus-within)))
        :is([vl-scroll], [vl-timeline="view"], [vl-timeline="scroll"]) {
            animation-play-state: paused;
        }

        [vl-scene][vl-scene-trigger="zone"]:has(> [vl-scene-trigger-zone]:is(:hover, :focus-visible, :focus-within))
        :is([vl-scroll], [vl-timeline="view"], [vl-timeline="scroll"]) {
            animation-play-state: running;
        }
    }

    /* =========================================================================
       GPU / composition hints — targeted for expensive animations only
       ========================================================================= */
    [vl-timeline="view"],
    [vl-timeline="scroll"],
    [vl-loop]:not([vl-loop="0"]):not([vl-loop="1"]),
    [vl-effect="cinema-zoom"],
    [vl-effect="parallax"],
    [vl-effect="scroll-marquee"],
    [vl-effect="depth-drift"],
    [vl-effect="scene-hero-reveal"],
    [vl-effect="scene-feature-flow"],
    [vl-effect="scene-story-pin"],
    [vl-effect="scene-layer-stack"],
    .vl-scroll-horizontal-track {
        will-change: transform, opacity;
    }

    @media (prefers-reduced-motion: reduce) {
        [vl-effect],
        [vl-timeline],
        [vl-loop] {
            will-change: auto;
        }
    }

    /* =========================================================================
       SPECIAL LAYOUT HELPERS (kept as classes  structural, not motion intent)
       ========================================================================= */
    .vl-scroll-snap-sections {
        scroll-snap-type: y mandatory;
        overflow-y: auto;
        height: 100dvh;
    }

    .vl-scroll-snap-sections > * {
        scroll-snap-align: start;
        min-height: 100dvh;
    }

    .vl-scroll-horizontal-track {
        animation: vl-scroll-horizontal linear both;
        animation-timeline: view(block);
        animation-range: contain 0% contain 100%;
        display: flex;
        gap: var(--vl-space-lg);
        width: max-content;
        will-change: transform;
    }

    /* =========================================================================
       FALLBACK  browsers without scroll-driven animations
       ========================================================================= */
    @supports not (animation-timeline: view()) {
        [vl-timeline="view"],
        [vl-timeline="scroll"] {
            animation-timeline: auto;
            animation-range: normal;
        }

        [vl-timeline="view"][vl-effect="fade-up"],
        [vl-timeline="view"][vl-effect="fade-in"],
        [vl-timeline="view"][vl-effect="fade-down"] {
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-timeline="view"][vl-effect="reveal-3d"] {
            animation-name: vl-3d-entry;
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-timeline="view"][vl-effect="blur-in"] {
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-out-soft);
        }

        [vl-timeline="view"][vl-effect="flow-in"] {
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-timeline="view"][vl-effect="clip-rise"] {
            animation-name: vl-clip-rise;
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-timeline="view"][vl-effect="text-line-reveal"] {
            animation-name: vl-line-wipe;
            animation-duration: var(--vl-duration-slow);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-effect="scene-feature-flow"][vl-timeline="view"] > *,
        [vl-effect="scene-story-pin"] > *,
        [vl-effect="scene-layer-stack"] > *,
        [vl-effect="cinema-zoom"],
        [vl-effect="parallax"],
        [vl-effect="scroll-marquee"],
        [vl-effect="depth-drift"],
        .vl-scroll-horizontal-track {
            animation-timeline: auto;
            animation-range: normal;
            animation-duration: var(--vl-duration-slower);
            animation-timing-function: var(--vl-ease-cinematic);
        }

        [vl-effect][vl-direction] {
            animation-direction: var(--vl-motion-direction, normal);
        }
    }

    /* =========================================================================
       KEYFRAMES  cinematic enter & mask
       ========================================================================= */
    @keyframes vl-reveal-cinematic {
        from {
            opacity: 0;
            transform: perspective(1400px) translate3d(0, 3rem, -80px) scale(0.94);
            filter: blur(calc(8px + var(--vl-motion-blur, 0px))) brightness(0.72);
        }
        to {
            opacity: 1;
            transform: perspective(1400px) translate3d(0, 0, 0) scale(1);
            filter: blur(0) brightness(1);
        }
    }

    @keyframes vl-depth-enter {
        from {
            opacity: 0;
            transform: perspective(var(--vl-perspective, 1000px))
                rotateX(var(--vl-rotate-x, 18deg))
                translate3d(0, var(--vl-distance-y, 2.5rem), var(--vl-depth-z-from, -60px));
        }
        to {
            opacity: 1;
            transform: perspective(var(--vl-perspective, 1000px)) rotateX(0deg) translate3d(0, 0, 0);
        }
    }

    @keyframes vl-mask-sweep {
        from {
            opacity: 0.1;
            clip-path: inset(0 100% 0 0 round 0.25rem);
        }
        to {
            opacity: 1;
            clip-path: inset(0 0% 0 0 round 0.25rem);
        }
    }

    /* =========================================================================
       ENTER PRESETS  extended (cinematic, depth, mask)
       ========================================================================= */
    :is([vl-enter~="reveal-cinematic"], [vl-effect~="reveal-cinematic"]) {
        --vl-enter-name: vl-reveal-cinematic;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-cinematic);
    }

    :is([vl-enter~="depth-enter"], [vl-effect~="depth-enter"]) {
        --vl-enter-name: vl-depth-enter;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-spring);
    }

    :is([vl-enter~="mask-sweep"], [vl-effect~="mask-sweep"]) {
        --vl-enter-name: vl-mask-sweep;
        --vl-enter-duration: var(--vl-duration-slow);
        --vl-enter-ease: var(--vl-ease-cinematic);
    }

    [vl-effect="reveal-cinematic"] {
        animation: vl-reveal-cinematic var(--vl-enter-duration, var(--vl-duration-slower)) var(--vl-enter-ease, var(--vl-ease-cinematic)) both;
    }

    [vl-effect="depth-enter"] {
        animation: vl-depth-enter var(--vl-enter-duration, var(--vl-duration-slower)) var(--vl-enter-ease, var(--vl-ease-spring)) both;
    }

    [vl-effect="mask-sweep"] {
        animation: vl-mask-sweep var(--vl-enter-duration, var(--vl-duration-slow)) var(--vl-enter-ease, var(--vl-ease-cinematic)) both;
    }

    /* --- Cinematic entrance grammar --- */
    [vl-effect="blur-lift"] {
        animation: vl-blur-lift var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-silk)) both;
    }
    [vl-effect="opacity-reveal"] {
        animation: vl-opacity-reveal var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-fluid)) both;
    }
    [vl-effect="cinematic-mask"] {
        animation: vl-cinematic-mask var(--vl-motion-duration, var(--vl-duration-slower)) var(--vl-motion-ease, var(--vl-ease-cinematic)) both;
    }
    [vl-effect="parallax-depth"] {
        animation: vl-parallax-depth-enter var(--vl-motion-duration, var(--vl-duration-slower)) var(--vl-motion-ease, var(--vl-ease-impact)) both;
    }
    [vl-effect="stagger-wave"] {
        animation: vl-stagger-wave var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-fluid)) both;
    }

    /* --- Cinematic exit grammar --- */
    [vl-effect="dissolve-out"] {
        animation: vl-dissolve-out var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-silk)) both;
    }
    [vl-effect="depth-collapse"] {
        animation: vl-depth-collapse var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-impact)) both;
    }
    [vl-effect="fade-velocity"] {
        animation: vl-fade-velocity var(--vl-motion-duration, var(--vl-duration-fast)) var(--vl-motion-ease, var(--vl-ease-cinematic)) both;
    }
    [vl-effect="blur-exit"] {
        animation: vl-blur-exit var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-motion-ease, var(--vl-ease-silk)) both;
    }

    /* =========================================================================
       SCROLL PRESETS  extended (reveal, media-zoom)
       ========================================================================= */
    :is([vl-scroll~="reveal"], [vl-effect~="scroll-reveal"]) {
        --vl-scroll-name: vl-fade-up;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: entry 5% cover 42%;
    }

    :is([vl-scroll~="media-zoom"], [vl-effect~="media-zoom"]) {
        --vl-scroll-name: vl-scroll-scale;
        --vl-scroll-timeline: view(block);
        --vl-scroll-range: entry 0% cover 70%;
    }

    /* =========================================================================
       HOVER PRESETS  extended (gradient-sweep, border-trace)
       ========================================================================= */
    :is([vl-hover~="gradient-sweep"], [vl-effect~="gradient-sweep"]) {
        position: relative;
        isolation: isolate;
        overflow: clip;
    }

    :is([vl-hover~="gradient-sweep"], [vl-effect~="gradient-sweep"])::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            105deg,
            transparent 25%,
            color-mix(in oklch, var(--vl-color-primary) 18%, transparent) 50%,
            transparent 75%
        );
        background-size: 200% 100%;
        background-position: 100% 0;
        opacity: 0;
        transition:
            background-position var(--vl-duration-slow) var(--vl-ease-cinematic),
            opacity var(--vl-transition-fast);
        pointer-events: none;
        z-index: 0;
    }

    :is([vl-hover~="gradient-sweep"], [vl-effect~="gradient-sweep"]):hover::before,
    :is([vl-hover~="gradient-sweep"], [vl-effect~="gradient-sweep"]):focus-visible::before {
        background-position: 0% 0;
        opacity: 1;
    }

    :is([vl-hover~="border-trace"], [vl-effect~="border-trace"]) {
        position: relative;
        isolation: isolate;
        transition: box-shadow var(--vl-transition-normal) var(--vl-ease-cinematic);
    }

    :is([vl-hover~="border-trace"], [vl-effect~="border-trace"])::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        border: 2px solid transparent;
        background:
            linear-gradient(var(--vl-bg-main, oklch(14% 0.01 95)), var(--vl-bg-main, oklch(14% 0.01 95))) padding-box,
            linear-gradient(
                135deg,
                color-mix(in oklch, var(--vl-color-primary) 72%, transparent),
                color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 56%, transparent),
                color-mix(in oklch, var(--vl-color-primary) 38%, transparent)
            ) border-box;
        opacity: 0;
        z-index: -1; /* behind the element's own content: the label stays readable in every state */
        transition: opacity var(--vl-transition-normal) var(--vl-ease-cinematic);
        pointer-events: none;
    }

    /* Ring only: mask out the interior, so the trace never paints over the element's background or text. */
    @supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
        :is([vl-hover~="border-trace"], [vl-effect~="border-trace"])::after {
            border: 0;
            padding: 2px;
            background: linear-gradient(
                135deg,
                color-mix(in oklch, var(--vl-color-primary) 72%, transparent),
                color-mix(in oklch, var(--vl-color-accent, var(--vl-color-primary)) 56%, transparent),
                color-mix(in oklch, var(--vl-color-primary) 38%, transparent)
            );
            -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
        }
    }

    :is([vl-hover~="border-trace"], [vl-effect~="border-trace"]):hover::after,
    :is([vl-hover~="border-trace"], [vl-effect~="border-trace"]):focus-visible::after {
        opacity: 1;
    }

    /* Named scene presets (look + choreography) live in scene-recipes.css (theme). */

    /* =========================================================================
       ACCESSIBILITY  reduced motion
       ========================================================================= */
    @media (prefers-reduced-motion: reduce) {
        [vl-effect],
        [vl-enter],
        [vl-exit],
        [vl-loop-effect],
        [vl-scroll~="parallax"],
        [vl-scroll~="depth-drift"],
        [vl-scroll~="depth-push"],
        [vl-scene],
        [vl-children="stagger"] > *,
        [vl-children="cascade"] > *,
        [vl-children="sequence"] > * {
            animation: none !important;
            opacity: 1 !important;
            transform: none !important;
            filter: none !important;
        }

        [vl-effect="hover-lift"]:hover,
        [vl-effect="hover-glow"]:hover {
            translate: none;
            box-shadow: none;
        }

        [vl-effect="underline-expand"]::after {
            transition: none;
        }

        [vl-effect="typewriter"] {
            width: auto;
            border-right: none;
            white-space: normal;
            animation: none;
        }

        [vl-effect="typewriter-soft"] {
            width: auto;
            border-right: none;
            white-space: normal;
            animation: none;
        }

        :is([vl-effect="typewriter-loop"], [vl-loop~="typewriter-loop"], [vl-loop-effect~="typewriter-loop"]) {
            width: auto;
            border-right: none;
            white-space: normal;
            animation: none;
        }

        .vl-scroll-horizontal-track {
            animation: none;
            will-change: auto;
        }

        [vl-effect="hover-tilt-3d"]:hover,
        [vl-effect="hover-tilt-3d"]:focus-visible,
        [vl-effect="hover-depth-stack"]:hover,
        [vl-effect="hover-depth-stack"]:focus-visible {
            transform: none;
            box-shadow: none;
            filter: none;
        }

        [vl-effect="hover-spotlight"]::after {
            display: none;
        }

        [vl-effect="hover-card-stack"]:hover,
        [vl-effect="hover-card-stack"]:focus-visible,
        [vl-effect="hover-shell-lift"]:hover,
        [vl-effect="hover-shell-lift"]:focus-visible {
            transform: none;
            box-shadow: none;
        }

        [vl-effect="hover-shell-lift"]::before {
            display: none;
        }

        [vl-effect="hover-cross-swap"] > [data-vl-panel] {
            transition: none;
        }

        [vl-effect="hover-orb-grid"] > ul > li:last-child::after,
        [vl-effect="hover-orb-grid"] > ul > li:last-child::before {
            transition: none;
            opacity: 0;
            clip-path: circle(0);
            -webkit-clip-path: circle(0);
            transform: translate3d(-50%, -50%, 0);
        }
    }
}

/* ---- 03a-motion-conditions.css ---- */
@layer velora.motion {
    /*
     * Velora — Conditional Motion Engine (v1)
     * =========================================================================
     * Zero JavaScript. A single declarative attribute — vl-motion — selects a
     * motion *mode* that centrally re-scales the shared engine knobs defined in
     * 01-tokens.css. Existing presets already consume those knobs
     * (--vl-motion-duration, --vl-motion-distance, --vl-motion-ease, ...), so
     * one attribute adapts timing, travel, depth, blur and easing across the
     * whole subtree without scattering hardcoded values into every selector.
     *
     * Public grammar:
     *   vl-motion="standard"    Balanced, default cinematic feel.
     *   vl-motion="subtle"      Quieter, faster, shorter travel.
     *   vl-motion="cinematic"   Grander, slower, deeper, with entrance blur.
     *   vl-motion="still"       Author-driven reduced motion — resting state, no movement.
     *
     * Progressive enhancement:
     *   - BASELINE (works everywhere): plain [vl-motion="…"] attribute selectors
     *     assign the engine knobs. No CSS if() required.
     *   - ENHANCEMENT (@supports if()): a single [vl-motion] rule re-derives the
     *     same knobs with CSS if() using media(), style() and supports() so the
     *     mode additionally adapts to prefers-reduced-motion, pointer type and
     *     scroll-timeline availability. If if() is unsupported the whole block is
     *     ignored and the baseline values above remain in effect.
     *
     * Accessibility: prefers-reduced-motion is honored here (knobs collapse) and
     * globally in 03-motion.css (animations are fully disabled).
     */

    /* =========================================================================
       BASELINE — mode → engine knobs (no if() required)
       ========================================================================= */
    [vl-motion="standard"] {
        --vl-motion-mode: standard;
        --vl-motion-speed-scale: 1;
        --vl-motion-intensity: 1;
        --vl-motion-depth: 1;
        --vl-motion-blur: 0px;
        --vl-motion-mode-ease: var(--vl-ease-cinematic);
        --vl-motion-distance: calc(1.25rem * var(--vl-motion-intensity));
    }

    [vl-motion="subtle"] {
        --vl-motion-mode: subtle;
        --vl-motion-speed-scale: 0.62;
        --vl-motion-intensity: 0.45;
        --vl-motion-depth: 0.4;
        --vl-motion-blur: 0px;
        --vl-motion-mode-ease: var(--vl-ease-out-soft);
        --vl-motion-distance: calc(1.25rem * var(--vl-motion-intensity));
    }

    [vl-motion="cinematic"] {
        --vl-motion-mode: cinematic;
        --vl-motion-speed-scale: 1.5;
        --vl-motion-intensity: 1.6;
        --vl-motion-depth: 1.8;
        --vl-motion-blur: 6px;
        --vl-motion-mode-ease: var(--vl-ease-cinematic);
        --vl-motion-distance: calc(1.25rem * var(--vl-motion-intensity));
    }

    [vl-motion="still"] {
        --vl-motion-mode: still;
        --vl-motion-speed-scale: 1;
        --vl-motion-intensity: 0;
        --vl-motion-depth: 0;
        --vl-motion-blur: 0px;
        --vl-motion-mode-ease: var(--vl-ease-out-soft);
        --vl-motion-distance: 0rem;
    }

    /*
     * "still" presents the composed resting state with no movement, regardless of
     * the OS reduced-motion setting. The descendant combinator raises specificity
     * above the (0,1,0) per-preset animation rules so nested effects settle without
     * a runtime. Content stays visible (fill state) — only motion is removed.
     */
    [vl-motion="still"],
    [vl-motion="still"] :is([vl-effect], [vl-enter], [vl-exit], [vl-scroll], [vl-loop], [vl-loop-effect]),
    [vl-motion="still"] :is([vl-children="stagger"], [vl-children="cascade"], [vl-children="sequence"], [vl-children="orchestrate"]) > * {
        animation: none;
        transition-duration: var(--vl-duration-instant);
        opacity: 1;
        transform: none;
        filter: none;
    }

    /* =========================================================================
       DEPTH ADAPTATION — scroll / parallax presets scale by --vl-motion-depth
       Kept central: the depth multiplier flows into the existing parallax and
       depth-drift custom properties rather than being redefined per page.
       ========================================================================= */
    [vl-motion] :is([vl-scroll~="parallax"], [vl-effect~="parallax"]) {
        --vl-parallax-from: calc(-12% * var(--vl-motion-depth, 1));
        --vl-parallax-to: calc(12% * var(--vl-motion-depth, 1));
    }

    [vl-motion] :is([vl-scroll~="depth-drift"], [vl-effect~="depth-drift"]) {
        --vl-depth-from: calc(6% * var(--vl-motion-depth, 1));
        --vl-depth-to: calc(-6% * var(--vl-motion-depth, 1));
    }

    /* =========================================================================
       BASELINE device refinement — soften heavy depth on touch/coarse pointers
       ========================================================================= */
    @media (pointer: coarse) {
        [vl-motion="cinematic"] {
            --vl-motion-depth: 1.15;
        }
    }

    /* =========================================================================
       ACCESSIBILITY — reduced motion collapses the engine knobs (baseline)
       Global 03-motion.css additionally disables animations outright; here we
       neutralize travel/depth/blur so even transition-based motion stays calm.
       ========================================================================= */
    @media (prefers-reduced-motion: reduce) {
        [vl-motion] {
            --vl-motion-preference: reduce;
            --vl-motion-speed-scale: 1;
            --vl-motion-intensity: 0;
            --vl-motion-depth: 0;
            --vl-motion-blur: 0px;
            --vl-motion-distance: 0rem;
        }
    }

    /* =========================================================================
       PROGRESSIVE ENHANCEMENT — CSS if() (Baseline 2025+)
       Everything above is the guaranteed fallback. When if() is supported, one
       rule re-derives the knobs, folding in live media()/style()/supports()
       conditions. Same or later cascade position than the baseline attribute
       selectors, so this wins where available and is dropped where it is not.
       ========================================================================= */
    @supports (width: if(style(--vl-probe: 1): 1px; else: 2px)) {
        [vl-motion] {
            /* Duration multiplier: mode via style(), untouched under reduced motion. */
            --vl-motion-speed-scale: if(
                media(prefers-reduced-motion: reduce): 1;
                style(--vl-motion-mode: cinematic): 1.5;
                style(--vl-motion-mode: subtle): 0.62;
                else: 1
            );

            /* Travel: reduced motion → 0; cinematic eases off on coarse pointers. */
            --vl-motion-intensity: if(
                media(prefers-reduced-motion: reduce): 0;
                style(--vl-motion-mode: still): 0;
                style(--vl-motion-mode: cinematic): if(media(pointer: coarse): 1.2; else: 1.6);
                style(--vl-motion-mode: subtle): 0.45;
                else: 1
            );

            /* Depth: only when scroll-driven timelines exist, else flat (0). */
            --vl-motion-depth: if(
                media(prefers-reduced-motion: reduce): 0;
                supports(animation-timeline: view()): if(
                    style(--vl-motion-mode: cinematic): if(media(pointer: coarse): 1.15; else: 1.8);
                    style(--vl-motion-mode: subtle): 0.4;
                    style(--vl-motion-mode: still): 0;
                    else: 1
                );
                else: 0
            );

            /* Entrance blur: cinematic only, never under reduced motion. */
            --vl-motion-blur: if(
                media(prefers-reduced-motion: reduce): 0px;
                style(--vl-motion-mode: cinematic): 6px;
                else: 0px
            );

            --vl-motion-distance: calc(1.25rem * var(--vl-motion-intensity));
        }
    }
}

/* ---- 03c-scene-engine.css ---- */
/**
 * Scene engine — track / stage / acts (host-agnostic).
 * Shared clock for pin+scrub multi-act choreography. Zero JS.
 *
 * Markup:
 *   <section vl-scene vl-timeline="view" vl-pin="3" vl-scrub>
 *     <div vl-stage>
 *       <h1 vl-enter="fade-up" vl-act="1">…</h1>
 *     </div>
 *   </section>
 *
 * Channels must be direct children of [vl-stage]. vl-range overrides
 * act-derived animation-range only — the named --vl-scene clock stays.
 */
@layer velora.motion {
    /* --- Track: named view timeline + optional pin height ----------------- */
    [vl-scene] {
        --vl-clock: auto;
        width: 100%;
        position: relative;
        isolation: isolate;
        container-type: inline-size;
        container-name: vl-scene;
        /* style-only: layout containment can break sticky [vl-stage] */
        contain: style;
        view-timeline-name: --vl-scene;
        view-timeline-axis: block;
        timeline-scope: --vl-scene;
    }

    [vl-scene][vl-timeline="view"] {
        --vl-clock: view;
    }

    [vl-scene][vl-timeline="auto"] {
        --vl-clock: auto;
    }

    /*
     * Pin height only on view-clock tracks. On auto clock, vl-pin is a no-op
     * (spec: pin/scrub ignored for time film).
     */
    [vl-scene][vl-timeline="view"][vl-pin] {
        --vl-pin-factor: 1;
        min-block-size: calc(var(--vl-pin-factor) * 100svh);
    }

    [vl-scene][vl-timeline="view"][vl-pin="1"] { --vl-pin-factor: 1; }
    [vl-scene][vl-timeline="view"][vl-pin="2"] { --vl-pin-factor: 2; }
    [vl-scene][vl-timeline="view"][vl-pin="3"] { --vl-pin-factor: 3; }
    [vl-scene][vl-timeline="view"][vl-pin="4"] { --vl-pin-factor: 4; }
    [vl-scene][vl-timeline="view"][vl-pin="5"] { --vl-pin-factor: 5; }
    [vl-scene][vl-timeline="view"][vl-pin="6"] { --vl-pin-factor: 6; }
    [vl-scene][vl-timeline="view"][vl-pin="7"] { --vl-pin-factor: 7; }
    [vl-scene][vl-timeline="view"][vl-pin="8"] { --vl-pin-factor: 8; }
    [vl-scene][vl-timeline="view"][vl-pin="9"] { --vl-pin-factor: 9; }
    [vl-scene][vl-timeline="view"][vl-pin="10"] { --vl-pin-factor: 10; }

    @supports (min-block-size: attr(vl-pin type(<number>))) {
        [vl-scene][vl-timeline="view"][vl-pin] {
            --vl-pin-factor: attr(vl-pin type(<number>), 1);
            min-block-size: calc(var(--vl-pin-factor) * 100svh);
        }
    }

    /* --- Stage: sticky viewport while track scrolls ----------------------- */
    [vl-stage] {
        position: sticky;
        inset-block-start: 0;
        min-block-size: 100svh;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- Act / span mapping on stage children ----------------------------- */
    [vl-stage] > * {
        --vl-act: 1;
        --vl-span: 1;
        --vl-act-start: calc((var(--vl-act) - 1) / var(--vl-beats) * 100%);
        --vl-act-end: calc((var(--vl-act) + var(--vl-span) - 1) / var(--vl-beats) * 100%);
    }

    /* Baseline act from DOM order */
    [vl-stage] > *:nth-child(1) { --vl-act: 1; }
    [vl-stage] > *:nth-child(2) { --vl-act: 2; }
    [vl-stage] > *:nth-child(3) { --vl-act: 3; }
    [vl-stage] > *:nth-child(4) { --vl-act: 4; }
    [vl-stage] > *:nth-child(5) { --vl-act: 5; }
    [vl-stage] > *:nth-child(6) { --vl-act: 6; }
    [vl-stage] > *:nth-child(7) { --vl-act: 7; }
    [vl-stage] > *:nth-child(8) { --vl-act: 8; }
    [vl-stage] > *:nth-child(9) { --vl-act: 9; }
    [vl-stage] > *:nth-child(10) { --vl-act: 10; }
    [vl-stage] > *:nth-child(11) { --vl-act: 11; }
    [vl-stage] > *:nth-child(12) { --vl-act: 12; }

    [vl-stage] > *[vl-act="1"] { --vl-act: 1; }
    [vl-stage] > *[vl-act="2"] { --vl-act: 2; }
    [vl-stage] > *[vl-act="3"] { --vl-act: 3; }
    [vl-stage] > *[vl-act="4"] { --vl-act: 4; }
    [vl-stage] > *[vl-act="5"] { --vl-act: 5; }
    [vl-stage] > *[vl-act="6"] { --vl-act: 6; }
    [vl-stage] > *[vl-act="7"] { --vl-act: 7; }
    [vl-stage] > *[vl-act="8"] { --vl-act: 8; }
    [vl-stage] > *[vl-act="9"] { --vl-act: 9; }
    [vl-stage] > *[vl-act="10"] { --vl-act: 10; }
    [vl-stage] > *[vl-act="11"] { --vl-act: 11; }
    [vl-stage] > *[vl-act="12"] { --vl-act: 12; }

    [vl-stage] > *[vl-span="1"] { --vl-span: 1; }
    [vl-stage] > *[vl-span="2"] { --vl-span: 2; }
    [vl-stage] > *[vl-span="3"] { --vl-span: 3; }
    [vl-stage] > *[vl-span="4"] { --vl-span: 4; }

    @supports (z-index: sibling-index()) {
        [vl-stage] > *:not([vl-act]) {
            --vl-act: sibling-index();
        }
    }

    @supports (opacity: attr(vl-act type(<number>))) {
        [vl-stage] > *[vl-act] {
            --vl-act: attr(vl-act type(<number>), 1);
        }

        [vl-stage] > *[vl-span] {
            --vl-span: attr(vl-span type(<number>), 1);
        }
    }

    /*
     * View clock: always bind to the named track timeline (including vl-range).
     * Act-derived range applies only when vl-range is absent (escape hatch).
     */
    [vl-scene][vl-timeline="view"] [vl-stage] > :is([vl-enter], [vl-scroll], [vl-effect], [vl-exit]) {
        --vl-scroll-timeline: --vl-scene;
        animation-timeline: --vl-scene;
        animation-duration: 1ms;
        animation-timing-function: linear;
        animation-fill-mode: both;
    }

    [vl-scene][vl-timeline="view"] [vl-stage] > :is([vl-enter], [vl-scroll], [vl-effect], [vl-exit]):not([vl-range]) {
        animation-range: var(--vl-act-start) var(--vl-act-end);
    }

    /* Auto clock: act → delay (pin height / scrub are no-ops) */
    [vl-scene][vl-timeline="auto"] [vl-stage] > :is([vl-enter], [vl-effect], [vl-exit]),
    [vl-scene]:not([vl-timeline]) [vl-stage] > :is([vl-enter], [vl-effect], [vl-exit]) {
        animation-delay: calc((var(--vl-act) - 1) * var(--vl-beat));
    }

    /* Scrub: only meaningful on view-clock tracks */
    [vl-scene][vl-timeline="view"][vl-scrub] [vl-stage] > :is([vl-enter], [vl-scroll], [vl-effect], [vl-exit]) {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-duration: 1ms;
    }

    /*
     * Progressive enhancement: if() clock switch with the same specificity
     * as the baseline view/auto selectors so the enhancement can win.
     */
    @supports (width: if(style(--vl-probe: 1): 1px; else: 2px)) {
        [vl-scene][vl-timeline="view"] [vl-stage] > :is([vl-enter], [vl-scroll], [vl-effect], [vl-exit]) {
            --vl-scroll-timeline: --vl-scene;
            animation-timeline: --vl-scene;
            animation-duration: 1ms;
            animation-delay: 0s;
        }

        [vl-scene][vl-timeline="view"] [vl-stage] > :is([vl-enter], [vl-scroll], [vl-effect], [vl-exit]):not([vl-range]) {
            animation-range: var(--vl-act-start) var(--vl-act-end);
        }

        [vl-scene][vl-timeline="auto"] [vl-stage] > :is([vl-enter], [vl-effect], [vl-exit]),
        [vl-scene]:not([vl-timeline]) [vl-stage] > :is([vl-enter], [vl-effect], [vl-exit]) {
            animation-timeline: auto;
            animation-range: normal;
            animation-delay: calc((var(--vl-act) - 1) * var(--vl-beat));
        }
    }

    /* Unsupported scroll clocks must not leave a long, pinned static stage
     * or execute an exit on the document clock and hide usable content. */
    @supports not (animation-timeline: view()) {
        [vl-scene][vl-timeline="view"][vl-pin] { min-block-size: auto; }
        [vl-scene][vl-timeline="view"] [vl-stage] {
            position: relative;
            min-block-size: auto;
        }
        [vl-scene][vl-timeline="view"] :is([vl-enter], [vl-exit], [vl-scroll], [vl-effect]) {
            animation: none;
            opacity: 1;
            transform: none;
            filter: none;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        [vl-scene][vl-timeline="view"][vl-pin] { min-block-size: auto; }
        [vl-scene][vl-timeline="view"] [vl-stage] {
            position: relative;
            min-block-size: auto;
        }
        [vl-scene] [vl-stage] > * {
            animation: none !important;
            animation-delay: 0s !important;
            opacity: 1;
            transform: none;
            filter: none;
        }
    }
}

/* ---- 03d-state-transitions.css ---- */
@layer velora.motion {
    /**
     * Native element transitions.
     *
     * vl-state="smooth"      compatible visual-state interpolation
     * vl-state="enter-exit"  display/content-visibility entry and exit
     * vl-state="expand"      intrinsic block-size changes
     * vl-state="top-layer"   dialog/popover/select picker entry and exit
     * vl-scroll="path"       scroll-linked motion along --vl-path
     *
     * Every advanced feature is an enhancement: unsupported declarations are
     * ignored while content remains visible and operable.
     */

    :is([vl-state~="smooth"], [vl-state="smooth"]) {
        transition:
            transform var(--vl-state-duration) var(--vl-state-ease),
            translate var(--vl-state-duration) var(--vl-state-ease),
            rotate var(--vl-state-duration) var(--vl-state-ease),
            scale var(--vl-state-duration) var(--vl-state-ease),
            opacity var(--vl-state-duration) var(--vl-state-ease),
            background-color var(--vl-state-duration) var(--vl-state-ease),
            color var(--vl-state-duration) var(--vl-state-ease),
            box-shadow var(--vl-state-duration) var(--vl-state-ease),
            border-color var(--vl-state-duration) var(--vl-state-ease);
    }

    /*
     * vl-state="enter-exit": discrete display / content-visibility entry and exit.
     *
     * Triggers (no JavaScript is needed for the last two; the first stays for authors who already toggle it):
     *   [hidden]                          toggle the attribute from any script (unchanged)
     *   popover + popovertarget           the open state is :popover-open; overlay keeps it in the top layer while it leaves
     *   "enter-exit on-checked" after a   shown while a preceding sibling checkbox or radio is :checked, e.g.
     *   checkbox or radio                 <input type="checkbox" id="t"> <label for="t">Toggle</label> <div vl-state="enter-exit on-checked">
     * Decision: the popover trigger is the default behaviour of the existing value (a popover is unambiguous); the checkbox
     * trigger needs the one modifier token on-checked, because a checkbox sibling cannot be detected from the element alone
     * without hijacking [hidden]-driven users. :target is not supported (it moves the URL and the scroll position).
     * Limit: the exited state is display: none from this layer, so an author rule that sets display on the element (a class
     * with display: grid) beats it, exactly as it beats [hidden]; on-checked also sets visibility: hidden, so the element stays
     * out of the accessibility tree and the tab order even then.
     */
    [vl-state~="enter-exit"] {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        content-visibility: visible;
        transition:
            opacity var(--vl-state-duration) var(--vl-state-ease),
            transform var(--vl-state-duration) var(--vl-state-ease),
            content-visibility var(--vl-state-duration) allow-discrete,
            display var(--vl-state-duration) allow-discrete,
            overlay var(--vl-state-duration) allow-discrete,
            visibility var(--vl-state-duration) allow-discrete;
        transition-behavior: allow-discrete;
    }

    [vl-state~="enter-exit"][hidden],
    [vl-state~="enter-exit"][vl-state~="on-checked"] {
        display: none;
        opacity: 0;
        transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
        content-visibility: hidden;
    }

    [vl-state~="enter-exit"][vl-state~="on-checked"] {
        visibility: hidden;
    }

    :is(input[type="checkbox"], input[type="radio"]):checked ~ [vl-state~="enter-exit"][vl-state~="on-checked"] {
        display: revert-layer;
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        content-visibility: visible;
        visibility: visible;
    }

    /* A popover is display: none from the UA while closed; only the leaving values are needed. */
    [popover][vl-state~="enter-exit"]:not(:popover-open) {
        opacity: 0;
        transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
    }

    /* The checked rule outranks the plain one, so its entry values are repeated at its own specificity. */
    @starting-style {
        [vl-state~="enter-exit"]:not([hidden]),
        :is(input[type="checkbox"], input[type="radio"]):checked ~ [vl-state~="enter-exit"][vl-state~="on-checked"] {
            opacity: 0;
            transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
        }
    }

    [vl-state~="expand"] {
        block-size: auto;
        opacity: 1;
        overflow: clip;
        transition:
            block-size var(--vl-state-duration) var(--vl-state-ease),
            opacity var(--vl-duration-fast) var(--vl-state-ease),
            content-visibility var(--vl-state-duration) allow-discrete,
            display var(--vl-state-duration) allow-discrete;
        transition-behavior: allow-discrete;
    }

    [vl-state~="expand"][hidden] {
        display: none;
        block-size: 0;
        opacity: 0;
        content-visibility: hidden;
    }

    @supports (block-size: calc-size(auto, size)) {
        [vl-state~="expand"] {
            block-size: calc-size(auto, size);
        }
    }

    /**
     * Native <details>. Opt in with vl-state="expand".
     * Panel interpolates ::details-content; children stagger; marker rotates.
     */
    details[vl-state~="expand"]::details-content {
        block-size: 0;
        opacity: 0;
        overflow: clip;
        content-visibility: hidden;
        transform: translate3d(0, var(--vl-state-distance), 0);
        transition:
            block-size var(--vl-state-duration) var(--vl-state-ease),
            opacity var(--vl-duration-fast) var(--vl-state-ease),
            transform var(--vl-state-duration) var(--vl-state-ease),
            content-visibility var(--vl-state-duration) allow-discrete;
        transition-behavior: allow-discrete;
    }

    details[open][vl-state~="expand"]::details-content {
        block-size: auto;
        opacity: 1;
        content-visibility: visible;
        transform: none;
    }

    @supports (block-size: calc-size(auto, size)) {
        details[open][vl-state~="expand"]::details-content {
            block-size: calc-size(auto, size);
        }
    }

    details[vl-state~="expand"] > summary::marker,
    details[vl-state~="expand"] > summary::-webkit-details-marker {
        transition: rotate var(--vl-duration-fast, 180ms) var(--vl-state-ease);
    }

    details[open][vl-state~="expand"] > summary::marker,
    details[open][vl-state~="expand"] > summary::-webkit-details-marker {
        rotate: 90deg;
    }

    details[vl-state~="expand"] > :not(summary) {
        opacity: 0;
        transform: translate3d(0, 0.35em, 0);
        transition:
            opacity var(--vl-state-duration) var(--vl-state-ease),
            transform var(--vl-state-duration) var(--vl-state-ease);
    }

    details[open][vl-state~="expand"] > :not(summary) {
        opacity: 1;
        transform: none;
    }

    /* Expand stagger with no child limit: the first child after the summary starts at 0. Same fit as vl-children. */
    @supports (width: calc(sibling-index() * 1px)) {
        details[open][vl-state~="expand"] > :not(summary) {
            transition-delay: calc(max(sibling-index() - 2, 0) * min(var(--vl-stagger-step), var(--vl-stagger-fit, 2s) / max(sibling-count() - 2, 1)));
        }
    }

    /* Fallback without sibling-index(): a fixed ladder for the first children. */
    @supports not (width: calc(sibling-index() * 1px)) {
        details[open][vl-state~="expand"] > :not(summary):nth-child(2) { transition-delay: calc(0 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(3) { transition-delay: calc(1 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(4) { transition-delay: calc(2 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(5) { transition-delay: calc(3 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(6) { transition-delay: calc(4 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(7) { transition-delay: calc(5 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(8) { transition-delay: calc(6 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(9) { transition-delay: calc(7 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(10) { transition-delay: calc(8 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(11) { transition-delay: calc(9 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(12) { transition-delay: calc(10 * var(--vl-stagger-step)); }
        details[open][vl-state~="expand"] > :not(summary):nth-child(13) { transition-delay: calc(11 * var(--vl-stagger-step)); }
    }


    @starting-style {
        details[open][vl-state~="expand"]::details-content {
            block-size: 0;
            opacity: 0;
            content-visibility: hidden;
            transform: translate3d(0, var(--vl-state-distance), 0);
        }

        details[open][vl-state~="expand"] > :not(summary) {
            opacity: 0;
            transform: translate3d(0, 0.35em, 0);
        }
    }

    :is(dialog, [popover])[vl-state~="top-layer"] {
        opacity: 0;
        transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
        transition:
            opacity var(--vl-state-duration) var(--vl-state-ease),
            transform var(--vl-state-duration) var(--vl-state-ease),
            overlay var(--vl-state-duration) allow-discrete,
            display var(--vl-state-duration) allow-discrete;
        transition-behavior: allow-discrete;
    }

    :is(dialog[open], [popover]:popover-open)[vl-state~="top-layer"] {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    :is(dialog, [popover])[vl-state~="top-layer"]::backdrop {
        opacity: 0;
        transition:
            opacity var(--vl-state-duration) var(--vl-state-ease),
            overlay var(--vl-state-duration) allow-discrete,
            display var(--vl-state-duration) allow-discrete;
        transition-behavior: allow-discrete;
    }

    :is(dialog[open], [popover]:popover-open)[vl-state~="top-layer"]::backdrop {
        opacity: 1;
    }

    @starting-style {
        :is(dialog[open], [popover]:popover-open)[vl-state~="top-layer"] {
            opacity: 0;
            transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
        }

        :is(dialog[open], [popover]:popover-open)[vl-state~="top-layer"]::backdrop {
            opacity: 0;
        }
    }

    /**
     * Native customizable <select>. Opt in with vl-state="top-layer".
     * Without appearance:base-select the OS picker stays; items still choose values.
     */
    @supports (appearance: base-select) {
        select[vl-state~="top-layer"],
        select[vl-state~="top-layer"]::picker(select) {
            appearance: base-select;
        }

        select[vl-state~="top-layer"] {
            background-image: none;
        }

        select[vl-state~="top-layer"]::picker-icon {
            transition: rotate var(--vl-duration-fast, 180ms) var(--vl-state-ease);
        }

        select[vl-state~="top-layer"]:open::picker-icon {
            rotate: 180deg;
        }

        select[vl-state~="top-layer"]::picker(select) {
            opacity: 0;
            transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
            transition:
                opacity var(--vl-state-duration) var(--vl-state-ease),
                transform var(--vl-state-duration) var(--vl-state-ease),
                overlay var(--vl-state-duration) allow-discrete,
                display var(--vl-state-duration) allow-discrete;
            transition-behavior: allow-discrete;
        }

        select[vl-state~="top-layer"]:open::picker(select) {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }

        select[vl-state~="top-layer"] option {
            opacity: 0;
            transform: translate3d(0, 0.35em, 0);
            transition:
                opacity var(--vl-state-duration) var(--vl-state-ease),
                transform var(--vl-state-duration) var(--vl-state-ease);
        }

        select[vl-state~="top-layer"]:open option {
            opacity: 1;
            transform: none;
        }

        select[vl-state~="top-layer"]:open option:nth-of-type(1) { transition-delay: calc(0 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(2) { transition-delay: calc(1 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(3) { transition-delay: calc(2 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(4) { transition-delay: calc(3 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(5) { transition-delay: calc(4 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(6) { transition-delay: calc(5 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(7) { transition-delay: calc(6 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(8) { transition-delay: calc(7 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(9) { transition-delay: calc(8 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(10) { transition-delay: calc(9 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(11) { transition-delay: calc(10 * var(--vl-stagger-step)); }
        select[vl-state~="top-layer"]:open option:nth-of-type(12) { transition-delay: calc(11 * var(--vl-stagger-step)); }

        @starting-style {
            select[vl-state~="top-layer"]:open::picker(select) {
                opacity: 0;
                transform: translate3d(0, var(--vl-state-distance), 0) scale(var(--vl-state-exit-scale));
            }

            select[vl-state~="top-layer"]:open option {
                opacity: 0;
                transform: translate3d(0, 0.35em, 0);
            }
        }
    }

    @keyframes vl-path-travel {
        from { offset-distance: 0%; }
        to { offset-distance: var(--vl-path-distance); }
    }

    :is([vl-scroll~="path"], [vl-effect~="path-travel"]) {
        offset-path: var(--vl-path);
        offset-distance: 0%;
        offset-rotate: var(--vl-path-rotate);
        animation-name: vl-path-travel;
        animation-duration: 1ms;
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: view(block);
        animation-range: var(--vl-range, entry 0% exit 100%);
    }

    /* One selector list per engine-specific pseudo-element: an engine that does not know one drops the whole rule,
       and a combined list here stopped the [vl-state] reset from applying in Firefox (500ms transitions under
       prefers-reduced-motion). */
    @media (prefers-reduced-motion: reduce) {
        [vl-state],
        :is(dialog, [popover])[vl-state],
        :is(dialog, [popover])[vl-state]::backdrop,
        details[vl-state] > :not(summary),
        details[vl-state] > summary::marker {
            transition-duration: 0.01ms;
            transition-delay: 0ms;
        }

        select[vl-state]::picker(select),
        select[vl-state] option,
        select[vl-state]::picker-icon {
            transition-duration: 0.01ms;
            transition-delay: 0ms;
        }

        details[vl-state]::details-content {
            transition-duration: 0.01ms;
            transition-delay: 0ms;
        }

        details[vl-state] > summary::-webkit-details-marker {
            transition-duration: 0.01ms;
            transition-delay: 0ms;
        }

        :is([vl-scroll~="path"], [vl-effect~="path-travel"]) {
            animation: none;
            offset-distance: var(--vl-path-distance);
        }
    }
}

/* Unlayered opt-in: beat host `appearance: none` so the picker can animate. */
@supports (appearance: base-select) {
    select[vl-state~="top-layer"],
    select[vl-state~="top-layer"]::picker(select) {
        appearance: base-select;
    }

    select[vl-state~="top-layer"] {
        background-image: none;
    }
}

/* ---- 03e-cut.css ---- */
/*
 * Cut Reveal (A2, #120): vl-enter="cut-reveal". Status: Experimental.
 *
 * The element resolves through parallel diagonal slices instead of opening from one edge.
 * One registered number, --vl-cut-t (0 -> 1), drives three mask layers:
 *
 *   wave   a soft front that travels across the element         (intersected)
 *   solid  the area the front has already passed, fully opaque  (added)
 *   blinds repeating slices that widen with --vl-cut-t         (added)
 *
 *   mask = wave x (solid U blinds)   via mask-composite: intersect, add
 *
 * Only mask and opacity change. No layout, no transform, no JavaScript.
 *
 * Parameters (set on the element or any ancestor):
 *   --vl-cut-count   number of slices, default 8
 *   --vl-cut-angle   slice tilt from vertical, default 18.4deg (a Skin may set it; at 0deg the slices are straight)
 *   --vl-enter-duration / --vl-enter-ease / --vl-enter-delay   the usual enter knobs
 *
 * Rest state: --vl-cut-t ends at 1, where every layer is fully opaque (the finished element looks unmasked).
 * Without mask-composite support the reveal is a plain opacity fade.
 * Reduced motion is owned by 03-motion.css: all vl-enter animation is removed, the element is shown at once.
 * Works time-based and with vl-timeline="view" (+ vl-range), where --vl-cut-t is scrubbed by scroll.
 */

/* Outside the layer: @property is global. */
@property --vl-cut-t {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@property --vl-cut-count {
    syntax: "<number>";
    inherits: true;
    initial-value: 8;
}

@layer velora.motion {
    @keyframes vl-cut-fade {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes vl-cut-reveal {
        from { --vl-cut-t: 0; }
        to { --vl-cut-t: 1; }
    }

    /* Kept as a second, inert animation so the animation lists below stay aligned with loop and exit.
       It used to animate mask-image to none at the end, but Chromium resolves that keyframe's implicit start from
       the base style, where --vl-cut-t is not yet animated, so the mask stayed frozen at "closed" for the whole
       reveal and the element popped in at the end. The mask now simply ends fully open at --vl-cut-t: 1. */
    @keyframes vl-cut-settle {
        to { --vl-cut-settled: 1; }
    }

    :is([vl-enter~="cut-reveal"], [vl-effect~="cut-reveal"]) {
        --vl-enter-name: vl-cut-fade;
        --vl-enter-duration: calc(var(--vl-duration-slower) * 1.75);
        --vl-enter-ease: var(--vl-ease-cinematic);
    }

    [vl-effect~="cut-reveal"]:not([vl-enter]) {
        animation: vl-cut-fade var(--vl-enter-duration) var(--vl-enter-ease) both;
    }

    @supports (mask-composite: intersect) or (-webkit-mask-composite: source-in) {
        :is([vl-enter~="cut-reveal"], [vl-effect~="cut-reveal"]) {
            /* --vl-cut-t keeps its registered initial value 1 (fully open), so without the animation (reduced motion,
               or no animation support) the element is simply shown. The reveal animation starts from 0. */
            --_cut-angle: var(--vl-cut-angle, 18.4deg);
            --_cut-axis: calc(90deg + var(--_cut-angle));
            --_cut-n: var(--vl-cut-count, 8);
            --_cut-p: clamp(0.04, calc(var(--vl-cut-t) * 1.2 - 0.1), 1.04);
            --_cut-w: calc(var(--vl-cut-t) * 160% - 10%);
            --_cut-wave: linear-gradient(var(--_cut-axis), #000 calc(var(--_cut-w) - 28%), transparent var(--_cut-w));
            --_cut-solid: linear-gradient(var(--_cut-axis), #000 calc(var(--_cut-w) - 70%), transparent calc(var(--_cut-w) - 45%));
            --_cut-blinds: repeating-linear-gradient(
                var(--_cut-axis),
                #000 0,
                #000 calc(var(--_cut-p) * 100% / var(--_cut-n)),
                transparent calc(var(--_cut-p) * 100% / var(--_cut-n)),
                transparent calc(100% / var(--_cut-n))
            );
            --vl-enter-name: vl-cut-reveal, vl-cut-settle;
            -webkit-mask-image: var(--_cut-wave), var(--_cut-solid), var(--_cut-blinds);
            mask-image: var(--_cut-wave), var(--_cut-solid), var(--_cut-blinds);
            -webkit-mask-composite: source-in, source-over, source-over;
            mask-composite: intersect, add, add;
            animation-timing-function: var(--vl-enter-ease), steps(1, jump-end);
        }

        /* cut-reveal is two animations (reveal, settle). With a loop and/or an exit on the same element
           they are followed by those, in the order enter < loop < exit (see 03-motion.css). */
        [vl-enter~="cut-reveal"]:is([vl-loop], [vl-loop-effect]):not([vl-exit]) {
            animation-name: vl-cut-reveal, vl-cut-settle, var(--vl-loop-name, none);
            animation-duration: var(--vl-enter-duration), var(--vl-enter-duration), var(--vl-loop-duration, var(--vl-motion-duration, 4s));
            animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), var(--vl-enter-delay, var(--vl-motion-delay, 0s)), 0s;
            animation-timing-function: var(--vl-enter-ease), steps(1, jump-end), var(--vl-loop-ease, var(--vl-ease-in-out-smooth));
            animation-direction: normal, normal, var(--vl-loop-direction, var(--vl-motion-direction, normal));
            animation-iteration-count: 1, 1, var(--vl-loop-count, infinite);
            animation-fill-mode: both, both, none;
        }

        [vl-enter~="cut-reveal"][vl-exit]:not([vl-loop]):not([vl-loop-effect]) {
            animation-name: vl-cut-reveal, vl-cut-settle, var(--vl-exit-name, none);
            animation-duration: var(--vl-enter-duration), var(--vl-enter-duration), var(--vl-exit-duration, var(--vl-duration-fast));
            animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), var(--vl-enter-delay, var(--vl-motion-delay, 0s)), var(--vl-exit-delay, var(--vl-motion-delay, 0s));
            animation-timing-function: var(--vl-enter-ease), steps(1, jump-end), var(--vl-exit-ease, var(--vl-ease-out-soft));
            animation-direction: normal, normal, var(--vl-exit-direction, var(--vl-motion-direction, normal));
            animation-iteration-count: 1, 1, 1;
            animation-fill-mode: both, both, forwards;
        }

        [vl-enter~="cut-reveal"][vl-exit]:is([vl-loop], [vl-loop-effect]) {
            animation-name: vl-cut-reveal, vl-cut-settle, var(--vl-loop-name, none), var(--vl-exit-name, none);
            animation-duration: var(--vl-enter-duration), var(--vl-enter-duration), var(--vl-loop-duration, var(--vl-motion-duration, 4s)), var(--vl-exit-duration, var(--vl-duration-fast));
            animation-delay: var(--vl-enter-delay, var(--vl-motion-delay, 0s)), var(--vl-enter-delay, var(--vl-motion-delay, 0s)), 0s, var(--vl-exit-delay, var(--vl-motion-delay, 0s));
            animation-timing-function: var(--vl-enter-ease), steps(1, jump-end), var(--vl-loop-ease, var(--vl-ease-in-out-smooth)), var(--vl-exit-ease, var(--vl-ease-out-soft));
            animation-direction: normal, normal, var(--vl-loop-direction, var(--vl-motion-direction, normal)), var(--vl-exit-direction, var(--vl-motion-direction, normal));
            animation-iteration-count: 1, 1, var(--vl-loop-count, infinite), 1;
            animation-fill-mode: both, both, none, forwards;
        }

        [vl-effect~="cut-reveal"]:not([vl-enter]) {
            animation: vl-cut-reveal var(--vl-enter-duration) var(--vl-enter-ease) both,
                vl-cut-settle var(--vl-enter-duration) steps(1, jump-end) both;
        }

        [vl-timeline="view"]:is([vl-enter~="cut-reveal"], [vl-effect~="cut-reveal"]) {
            animation-timing-function: linear, steps(1, jump-end);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-enter~="cut-reveal"], [vl-effect~="cut-reveal"]) {
            -webkit-mask-image: none;
            mask-image: none;
        }
    }
}

/* ---- 03f-cinema.css ---- */
/*
 * Cinema primitives (A14, #141). Status: Experimental. One file, one section per primitive.
 *
 * Section 1: vl-scroll="ring-scroll"
 *   A cylindrical 3D ring (a turntable) turned about the Y axis by scroll.
 *   Decision: a new vl-scroll value, not a parameter on rotate-scroll. rotate-scroll writes
 *   `transform: rotate()` on one element; a ring is a container contract (preserve-3d, faces
 *   placed on a circle, radius derived from the face count). rotate-scroll, text-ring-orbit and
 *   circle-text-scroll are untouched.
 *
 *   The drum rotates with the individual `rotate` property (rotate: y <angle>). Each face is
 *   placed with the individual `rotate` and `translate` properties, so author `transform`
 *   values on drum or faces keep working. Only `rotate` animates (compositor friendly).
 *   The individual properties apply translate before rotate, so a face is moved to its point on
 *   the circle explicitly (x = r sin a, z = r cos a) instead of rotateY(a) translateZ(r).
 *
 *   radius = (width + gap) / (2 * tan(pi / count))     (faces touch edge to edge when gap is 0)
 *
 * Parameters (set on the drum or any ancestor):
 *   --vl-ring-count   number of faces, default 8
 *   --vl-ring-width   face width as a length, default clamp(9rem, 20vw, 15rem)
 *   --vl-ring-gap     extra space between neighbouring faces as a length, default 0px
 *   --vl-ring-turn    total rotation across the scroll range, default 360deg (negative reverses)
 *   --vl-ring-i       per-face index (0 based), overrides the automatic index
 *   --vl-perspective  perspective of the wrapper, default 1600px
 *   --vl-scroll-timeline / --vl-range   the usual scroll channel knobs (use a named timeline from a tall
 *                     parent when the drum sits in a sticky stage)
 *
 * Face index: sibling-index() where supported, otherwise :nth-child for the first 12 faces
 * (set --vl-ring-i on a face to go beyond 12 in older engines).
 * Fallback: without scroll-driven animations the ring is static, first face to the front.
 * Reduced motion: no animation, the ring rests at its first face.
 *
 * Section 2: vl-hover="hover-slice"
 *   Diagonal slices open in the SAME element on hover. No cloned content, no extra DOM.
 *   Decision: a new vl-hover value (nothing in the hover channel masks), reusing the cut geometry
 *   parameters of cut-reveal (--vl-cut-count, --vl-cut-angle) so the whole system cuts the same way.
 *   mask = solid minus gaps (mask-composite: subtract). A registered number, --vl-slice-open (0 -> 1),
 *   widens the gaps; a transition on that number runs the hover. Only mask changes (no layout, no transform).
 *
 *   --vl-cut-count     number of slices, default 8
 *   --vl-cut-angle     slice tilt from vertical, default 18.4deg
 *   --vl-slice-gap     share of each slice pitch that opens on hover, 0 to 1, default 0.22
 *   --vl-slice-duration / --vl-slice-ease   default --vl-duration-normal / --vl-ease-out-soft
 *   Triggers: :hover and :focus-within, so keyboard users get the same state.
 *   Cost: an opted-in element always carries a mask layer (it is fully opaque at rest); use it on a few cards, not on lists.
 *   Fallback: without mask-composite the element simply does not slice. Without @property the state changes at once.
 *   Reduced motion: no mask at all, the element stays whole.
 *
 * Section 3: vl-scroll="text-scrub"
 *   Words (or a whole line) go from a light to a heavy font-weight as the text scrolls into view.
 *   Decision: a new vl-scroll value; the knobs are --vl-scrub-* parameters. Word-by-word needs the words as
 *   direct child elements (author-wrapped <span>s: the same text, nothing is duplicated). Without child
 *   elements the element itself scrubs.
 *   The element is a named view timeline (--vl-scrub-t); each word reads it with its own animation-range,
 *   offset by its index.
 *
 *   --vl-scrub-from      start weight, a number, default 200
 *   --vl-scrub-to        end weight, a number, default 800
 *   --vl-scrub-rest      the static weight shown without scroll-driven animation and with reduced motion,
 *                        default = --vl-scrub-to
 *   --vl-scrub-fit       how much of the range the whole text takes, default 60%; the offset between words is
 *                        derived from it and the word count, so any length fits (needs sibling-index())
 *   --vl-scrub-stagger   explicit offset between words as a percentage of the range; overrides --vl-scrub-fit.
 *                        Without sibling-index() it is the only spacing, default 3%
 *   --vl-scrub-span      how much of the range one word takes, default 35%
 *   --vl-scrub-phase     the view range phase (entry | contain | cover), default cover
 *
 *   Cost, honestly: font-weight is NOT compositor friendly. Changing weight changes glyph advance widths, so
 *   every frame of the scrub re-runs style and layout for the text (and it can re-wrap lines). It is the one
 *   documented exception to "only compositor friendly properties animate". Keep it to a headline or a short
 *   paragraph, and give the block a stable size (min-height) so reflow does not move the page.
 *   Variable fonts: weights between the faces of a static font cannot be interpolated. The browser snaps to
 *   the nearest available face; CSS cannot detect whether a loaded font is variable. font-synthesis-weight is
 *   set to none so a font with a single face stays at that weight (the static fallback) instead of being
 *   faux-bolded. Declare the weight range in your @font-face (font-weight: 100 900).
 *   Word index: sibling-index() where supported, otherwise :nth-child for the first 24 words.
 *   Fallback: without scroll-driven animations the text is shown at --vl-scrub-rest. Reduced motion: same.
 *
 * Section 4: vl-scroll-markers="buttons"
 *   Previous / next buttons on a scroll-marker carousel, from ::scroll-button().
 *   Decision: a value (parameter) on the existing vl-scroll-markers attribute, not a new attribute or class:
 *   the boolean form is unchanged, "buttons" adds the buttons to the same scroller that already owns the markers.
 *   The element must be the scroll container; the core now declares that contract at zero specificity, so an author
 *   rule replaces any part of it: overflow-x: auto, overscroll-behavior-inline: contain and scroll-snap-type: x mandatory
 *   on every vl-scroll-markers (boolean form included), scroll-snap-align on its children, and, for "buttons", the
 *   children as one row of columns (grid), smooth scrolling unless reduced motion, and a focus ring. The browser scrolls
 *   the element by one page when a button is activated, and disables a button at either end. The buttons are real,
 *   focusable controls with an accessible name given by the alternative text of `content`.
 *
 *   --vl-scroll-item      column width of a child, default 100% of the scroller ("buttons" only)
 *   --vl-scroll-gap       gap between children, default 0px ("buttons" only)
 *   --vl-scroll-snap-align   snap alignment of the children, default start
 *   --vl-sbtn-size        button size, default 2.5rem
 *   --vl-sbtn-inset       distance from the scroller edge, default 0.5rem
 *   --vl-sbtn-prev / --vl-sbtn-next   accessible names, defaults "Previous" and "Next" (string values)
 *
 *   Behind @supports (selector(::scroll-button(inline-start)) and anchor positioning). Without them there are no buttons:
 *   the scrollbar stays visible (it is hidden only where the buttons exist), the scroller stays keyboard scrollable
 *   and the markers, where supported, still work. Keyboard: Chromium makes a scroller focusable by itself; elsewhere
 *   give it tabindex="0" and an aria-label (HTML, CSS cannot add it). The generated buttons are focusable themselves.
 *   Reduced motion: scroll-behavior stays auto, the buttons keep working (they are navigation); only their hover
 *   transition is removed.
 *
 * Section 5: vl-scroll="ink-scrub"
 *   Words fill with colour, one after the other, as the text scrolls through the viewport (a "reading" sweep).
 *   Decision: a new vl-scroll value, not a mode of text-scrub. text-scrub animates font-weight; a colour pair on it
 *   would either also reflow the text (the default weight 200 to 800 would still run) or need a "no weight"
 *   switch. ink-scrub animates colour only (paint, no layout) and shares the structure and the timing knobs:
 *   author-wrapped word <span>s (the same text, nothing duplicated), a named view timeline (--vl-ink-t), each word
 *   with its own animation-range offset by its index, --vl-scrub-stagger / --vl-scrub-span / --vl-scrub-phase.
 *
 *   --vl-ink-from        colour before the fill, default currentColor at 30% (a dim of the text colour)
 *   --vl-ink-to          colour after the fill, default currentColor (the text colour)
 *   --vl-ink-rest        the static colour without scroll-driven animation and with reduced motion,
 *                        default = --vl-ink-to
 *   --vl-scrub-fit / --vl-scrub-stagger / --vl-scrub-span / --vl-scrub-phase   as text-scrub (60%, derived, 35%, cover)
 *   Cost: colour is a paint-only property (no layout, no reflow); it is not compositor-only, so keep it to text blocks.
 *   Accessibility: the unfilled colour is a dim of the text. Choose --vl-ink-from with enough contrast for text that
 *   is read before it fills; the final colour is the normal text colour. Word index as text-scrub (24 words without
 *   sibling-index()). Without wrappers the element fills as one (needs :has()).
 *   Fallback: without scroll-driven animations the text shows --vl-ink-rest. Reduced motion: same.
 */

/* Outside the layer: @property is global. */
@property --vl-slice-open {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

@layer velora.motion {
    @keyframes vl-ring-spin {
        from { rotate: y 0deg; }
        to { rotate: y var(--vl-ring-turn, 360deg); }
    }

    :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) {
        --_ring-w: var(--vl-ring-width, clamp(9rem, 20vw, 15rem));
        --_ring-n: var(--vl-ring-count, 8);
        --_ring-r: calc((var(--_ring-w) + var(--vl-ring-gap, 0px)) / (2 * tan(pi / var(--_ring-n))));
        position: relative;
        inline-size: var(--_ring-w);
        aspect-ratio: var(--vl-ring-aspect, 3 / 4);
        margin-inline: auto;
        transform-style: preserve-3d;
    }

    /* The perspective belongs on the parent: perspective on the rotating element would be rotated with it. */
    :where(:has(> :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]))) {
        perspective: var(--vl-perspective, 1600px);
    }

    :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > * {
        --_ring-i: var(--vl-ring-i, var(--_ring-nth, 0));
        position: absolute;
        inset: 0;
        --_ring-a: calc(var(--_ring-i) * 360deg / var(--_ring-n));
        rotate: y var(--_ring-a);
        translate: calc(var(--_ring-r) * sin(var(--_ring-a))) 0 calc(var(--_ring-r) * cos(var(--_ring-a)));
        backface-visibility: hidden;
    }

    @supports not (width: calc(sibling-index() * 1px)) {
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(1) { --_ring-nth: 0; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(2) { --_ring-nth: 1; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(3) { --_ring-nth: 2; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(4) { --_ring-nth: 3; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(5) { --_ring-nth: 4; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(6) { --_ring-nth: 5; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(7) { --_ring-nth: 6; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(8) { --_ring-nth: 7; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(9) { --_ring-nth: 8; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(10) { --_ring-nth: 9; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(11) { --_ring-nth: 10; }
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > :nth-child(12) { --_ring-nth: 11; }
    }

    @supports (width: calc(sibling-index() * 1px)) {
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) > * {
            --_ring-nth: calc(sibling-index() - 1);
        }
    }

    @supports (animation-timeline: view()) {
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) {
            --vl-scroll-name: vl-ring-spin;
            --vl-scroll-timeline: view(block);
            --vl-scroll-range: var(--vl-range, cover 0% cover 100%);
        }

        [vl-effect~="ring-scroll"]:not([vl-scroll]) {
            animation: vl-ring-spin linear both;
            animation-timeline: var(--vl-scroll-timeline);
            animation-range: var(--vl-scroll-range);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-scroll~="ring-scroll"], [vl-effect~="ring-scroll"]) {
            animation: none;
            rotate: none;
        }
    }

    @supports (mask-composite: subtract) or (-webkit-mask-composite: source-out) {
        :is([vl-hover~="hover-slice"], [vl-effect~="hover-slice"]) {
            --_slice-n: var(--vl-cut-count, 8);
            --_slice-axis: calc(90deg + var(--vl-cut-angle, 18.4deg));
            --_slice-a: calc((1 - var(--vl-slice-gap, 0.22) * var(--vl-slice-open)) * 100% / var(--_slice-n));
            --_slice-gaps: repeating-linear-gradient(
                var(--_slice-axis),
                transparent 0,
                transparent var(--_slice-a),
                #000 var(--_slice-a),
                #000 calc(100% / var(--_slice-n))
            );
            -webkit-mask-image: linear-gradient(#000, #000), var(--_slice-gaps);
            mask-image: linear-gradient(#000, #000), var(--_slice-gaps);
            -webkit-mask-composite: source-out;
            mask-composite: subtract;
            transition: --vl-slice-open var(--vl-slice-duration, var(--vl-duration-normal)) var(--vl-slice-ease, var(--vl-ease-out-soft));
        }

        :is([vl-hover~="hover-slice"], [vl-effect~="hover-slice"]):is(:hover, :focus-within) {
            --vl-slice-open: 1;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-hover~="hover-slice"], [vl-effect~="hover-slice"]) {
            -webkit-mask-image: none;
            mask-image: none;
            transition: none;
        }
    }

    @keyframes vl-scrub-weight {
        from { font-weight: var(--vl-scrub-from, 200); }
        to { font-weight: var(--vl-scrub-to, 800); }
    }

    :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]) {
        font-weight: var(--vl-scrub-rest, var(--vl-scrub-to, 800));
        font-synthesis-weight: none;
    }

    @supports (animation-timeline: view()) {
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]) {
            view-timeline: --vl-scrub-t block;
        }

        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]) > * {
            animation: vl-scrub-weight linear both;
            animation-timeline: --vl-scrub-t;
            animation-range:
                var(--vl-scrub-phase, cover) calc(var(--_scrub-i, 0) * var(--_scrub-step, var(--vl-scrub-stagger, 3%)))
                var(--vl-scrub-phase, cover) calc(var(--_scrub-i, 0) * var(--_scrub-step, var(--vl-scrub-stagger, 3%)) + var(--vl-scrub-span, 35%));
        }

        /* No word wrappers: the element scrubs as one. Needs :has(); without it only wrapped words scrub. */
        @supports selector(:has(*)) {
            :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]):not(:has(> *)) {
                --vl-scroll-name: vl-scrub-weight;
                --vl-scroll-timeline: view(block);
                --vl-scroll-range: var(--vl-range, cover 0% cover 40%);
            }

            [vl-effect~="text-scrub"]:not([vl-scroll]):not(:has(> *)) {
                animation: vl-scrub-weight linear both;
                animation-timeline: view(block);
                animation-range: var(--vl-range, cover 0% cover 40%);
            }
        }
    }

    @supports not (width: calc(sibling-index() * 1px)) {
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(1) { --_scrub-i: 0; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(2) { --_scrub-i: 1; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(3) { --_scrub-i: 2; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(4) { --_scrub-i: 3; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(5) { --_scrub-i: 4; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(6) { --_scrub-i: 5; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(7) { --_scrub-i: 6; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(8) { --_scrub-i: 7; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(9) { --_scrub-i: 8; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(10) { --_scrub-i: 9; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(11) { --_scrub-i: 10; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(12) { --_scrub-i: 11; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(13) { --_scrub-i: 12; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(14) { --_scrub-i: 13; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(15) { --_scrub-i: 14; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(16) { --_scrub-i: 15; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(17) { --_scrub-i: 16; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(18) { --_scrub-i: 17; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(19) { --_scrub-i: 18; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(20) { --_scrub-i: 19; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(21) { --_scrub-i: 20; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(22) { --_scrub-i: 21; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(23) { --_scrub-i: 22; }
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > :nth-child(24) { --_scrub-i: 23; }
    }

    @supports (width: calc(sibling-index() * 1px)) {
        /* Index and step come from the tree, so a paragraph of any length fits: the whole text takes --vl-scrub-fit of the
           range (default 60%), each word --vl-scrub-span. An explicit --vl-scrub-stagger still wins. */
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"], [vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > * {
            --_scrub-i: calc(sibling-index() - 1);
            --_scrub-step: var(--vl-scrub-stagger, max(0%, calc((var(--vl-scrub-fit, 60%) - var(--vl-scrub-span, 35%)) / max(sibling-count() - 1, 1))));
        }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]),
        :is([vl-scroll~="text-scrub"], [vl-effect~="text-scrub"]) > * {
            animation: none;
            font-weight: var(--vl-scrub-rest, var(--vl-scrub-to, 800));
        }
    }

    @keyframes vl-ink-fill {
        from { color: var(--vl-ink-from, color-mix(in oklch, currentColor 30%, transparent)); }
        to { color: var(--vl-ink-to, currentColor); }
    }

    :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) {
        color: var(--vl-ink-rest, var(--vl-ink-to, currentColor));
    }

    :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > * {
        color: var(--vl-ink-rest, var(--vl-ink-to, currentColor));
    }

    @supports (animation-timeline: view()) {
        :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) {
            view-timeline: --vl-ink-t block;
        }

        :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > * {
            animation: vl-ink-fill linear both;
            animation-timeline: --vl-ink-t;
            animation-range:
                var(--vl-scrub-phase, cover) calc(var(--_scrub-i, 0) * var(--_scrub-step, var(--vl-scrub-stagger, 3%)))
                var(--vl-scrub-phase, cover) calc(var(--_scrub-i, 0) * var(--_scrub-step, var(--vl-scrub-stagger, 3%)) + var(--vl-scrub-span, 35%));
        }

        /* No word wrappers: the element fills as one. Needs :has(); without it only wrapped words fill. */
        @supports selector(:has(*)) {
            :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]):not(:has(> *)) {
                --vl-scroll-name: vl-ink-fill;
                --vl-scroll-timeline: view(block);
                --vl-scroll-range: var(--vl-range, cover 0% cover 40%);
            }

            [vl-effect~="ink-scrub"]:not([vl-scroll]):not(:has(> *)) {
                animation: vl-ink-fill linear both;
                animation-timeline: view(block);
                animation-range: var(--vl-range, cover 0% cover 40%);
            }
        }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]),
        :is([vl-scroll~="ink-scrub"], [vl-effect~="ink-scrub"]) > * {
            animation: none;
            color: var(--vl-ink-rest, var(--vl-ink-to, currentColor));
        }
    }

    /* The scroller contract. A marker or button strip needs a horizontal scroll container with snap points, so the core
       declares it at zero specificity: any author rule (including display: flex rows) replaces it without a fight.
       Every vl-scroll-markers gets overflow-x, scroll-snap-type and a snap point per child. "buttons" also lays the
       children out as one row of columns (--vl-scroll-item, default 100% of the scroller; --vl-scroll-gap) and gets the
       focus ring a keyboard-focusable scroller needs. Smooth scrolling only when the user has not asked for less motion. */
    :where([vl-scroll-markers]) {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
    }

    :where([vl-scroll-markers]) > * {
        scroll-snap-align: var(--vl-scroll-snap-align, start);
    }

    :where([vl-scroll-markers~="buttons"]) {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: var(--vl-scroll-item, 100%);
        gap: var(--vl-scroll-gap, 0px);
        scroll-behavior: auto;
    }

    @media (prefers-reduced-motion: no-preference) {
        :where([vl-scroll-markers~="buttons"]) {
            scroll-behavior: smooth;
        }
    }

    :where([vl-scroll-markers~="buttons"]):focus-visible {
        outline: 2px solid var(--vl-color-primary, currentColor);
        outline-offset: 3px;
    }

    /* ::scroll-button() sits in the scroller, so it is placed against the scroller with anchor positioning. */
    @supports (selector(::scroll-button(inline-start)) and (anchor-name: --vl-a)) {
        [vl-scroll-markers~="buttons"] {
            anchor-name: --vl-sbtn-scroller;
            anchor-scope: --vl-sbtn-scroller;
            /* The buttons replace the scrollbar as the pointer affordance, so it can go; where they do not exist it stays. */
            scrollbar-width: none;
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-start),
        [vl-scroll-markers~="buttons"]::scroll-button(inline-end) {
            position: fixed;
            position-anchor: --vl-sbtn-scroller;
            inset-block-start: anchor(center);
            translate: 0 -50%;
            inline-size: var(--vl-sbtn-size, 2.5rem);
            block-size: var(--vl-sbtn-size, 2.5rem);
            display: grid;
            place-items: center;
            padding: 0;
            border: 1px solid color-mix(in oklch, var(--vl-color-primary, currentColor) 45%, transparent);
            border-radius: 999px;
            background: color-mix(in oklch, var(--vl-bg-surface, transparent) 88%, transparent);
            color: var(--vl-color-primary, currentColor);
            font: inherit;
            font-size: calc(var(--vl-sbtn-size, 2.5rem) * 0.6);
            line-height: 1;
            cursor: pointer;
            transition:
                background var(--vl-duration-fast, 150ms) var(--vl-ease-out-soft),
                opacity var(--vl-duration-fast, 150ms) var(--vl-ease-out-soft);
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-start) {
            inset-inline-start: calc(anchor(start) + var(--vl-sbtn-inset, 0.5rem));
            content: "\2039" / var(--vl-sbtn-prev, "Previous");
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-end) {
            inset-inline-end: calc(anchor(end) + var(--vl-sbtn-inset, 0.5rem));
            content: "\203A" / var(--vl-sbtn-next, "Next");
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-start):is(:hover, :focus-visible),
        [vl-scroll-markers~="buttons"]::scroll-button(inline-end):is(:hover, :focus-visible) {
            background: var(--vl-color-primary, currentColor);
            color: var(--vl-bg-surface, Canvas);
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-start):focus-visible,
        [vl-scroll-markers~="buttons"]::scroll-button(inline-end):focus-visible {
            outline: 2px solid var(--vl-color-primary, currentColor);
            outline-offset: 3px;
        }

        [vl-scroll-markers~="buttons"]::scroll-button(inline-start):disabled,
        [vl-scroll-markers~="buttons"]::scroll-button(inline-end):disabled {
            opacity: 0.3;
            cursor: default;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        [vl-scroll-markers~="buttons"]::scroll-button(inline-start),
        [vl-scroll-markers~="buttons"]::scroll-button(inline-end) {
            transition: none;
        }
    }

    /* ---------------------------------------------------------------------
     * Section: vl-scroll="letterbox" | "defocus" | "refocus"  (Experimental)
     *   letterbox  clip-path inset opens from --vl-letterbox-from (default 12.8%) to 0.
     *   defocus    filter blur 0 -> --vl-blur-from (default 12px).
     *   refocus    filter blur --vl-blur-from -> 0.
     * Pair defocus on one element with refocus on another over the same --vl-scroll-timeline
     * and --vl-range for a rack focus. Only declared under scroll-driven animation support, so
     * an unsupported engine never ends on a blurred or cropped frame. Reduced motion: none.
     * ------------------------------------------------------------------- */
    @keyframes vl-letterbox {
        from { clip-path: inset(var(--vl-letterbox-from, 12.8%) 0); }
        to { clip-path: inset(0 0); }
    }

    @keyframes vl-defocus {
        from { filter: blur(0); }
        to { filter: blur(var(--vl-blur-from, 12px)); }
    }

    @keyframes vl-refocus {
        from { filter: blur(var(--vl-blur-from, 12px)); }
        to { filter: blur(0); }
    }

    @supports (animation-timeline: view()) {
        :is([vl-scroll~="letterbox"], [vl-scroll~="defocus"], [vl-scroll~="refocus"]) {
            --vl-scroll-range: var(--vl-range, cover 20% cover 80%);
        }

        [vl-scroll~="letterbox"] { --vl-scroll-name: vl-letterbox; }
        [vl-scroll~="defocus"] { --vl-scroll-name: vl-defocus; }
        [vl-scroll~="refocus"] { --vl-scroll-name: vl-refocus; }
    }

    @media (prefers-reduced-motion: reduce) {
        :is([vl-scroll~="letterbox"], [vl-scroll~="defocus"], [vl-scroll~="refocus"]) {
            animation: none;
            clip-path: none;
            filter: none;
        }
    }

}

/* ---- 03g-world.css ---- */
/*
 * World (3D set) — vl-world. Status: Experimental. Chromium is the only engine checked so far.
 *
 * A page can be a sequence of locations: ordinary 2D sections and sections that are a 3D set.
 * A set has a width, a height and a depth in world units, children placed in that space,
 * and a camera that moves with the page scroll through scroll-driven animations (no JavaScript).
 *
 * Structure (classes name the three structural elements; everything else is attributes):
 *   <section vl-world vl-cam-1="foreground" vl-cam-2="midground left" ...>
 *     <div class="vl-world__stage">          sticky viewport, owns the perspective
 *       <div class="vl-world__rig">          the camera runs on this element
 *         <div class="vl-world__floor"></div> ...optional room planes...
 *         <h2 vl-at="top left" vl-plane="foreground" vl-in="1" vl-out="2">...</h2>
 *       </div>
 *       ...2D overlays (title, controls) as siblings of the rig: they must not flatten the 3D context...
 *     </div>
 *   </section>
 *
 * Coordinates: 1 world unit = 1 CSS px at the lens plane. Origin = centre of the room.
 * x in [-W/2, W/2], y in [-H/2, H/2] (down is positive), z from 0 to -D (negative = away).
 *
 * Parameters (set on the set or an ancestor; unitless unless noted):
 *   --vl-world-w / -h / -d     room size, default 1400 / 800 / 3300
 *   --vl-world-perspective     lens, a length, default 900px
 *   --vl-world-act-length      scroll length of one act, a length, default 650px (520px on narrow screens)
 *   --vl-world-standoff        distance the camera stops in front of a plane it frames, default 600
 *   --vl-world-weave           1 = the camera yaws 3deg between acts, 0 = straight path
 *   --vl-world-budget          plane-area budget in M u2, default 24 (8 on narrow or dense screens)
 * Per object (on the child):
 *   --vl-x / --vl-y / --vl-z   position; the numbers win over words (an inline style beats the layer)
 *   --vl-dx / --vl-dy / --vl-dz   fine offset added to the result
 *   --vl-ry                    yaw, an angle
 *   vl-at     words: top | bottom | left | right | center   (x = -/+32% of W, y = -/+25% of H)
 *   vl-plane  word: foreground (16% of D) | midground (40%) | background (64%) | end (back wall - 300)
 *   vl-in="N" / vl-out="N"     the object appears when act N begins / is gone when act N begins
 * On the set:
 *   vl-world="full" | "lite"   force the mode; without a value the safety rule decides
 *   vl-cam-1 .. vl-cam-4       framing of each act: a plane word plus an optional at word.
 *                              An unset act keeps the framing of the previous one. Four acts, fixed
 *                              timing (each act is a quarter of the stretch the stage is pinned).
 *
 * Safety rule (part of the contract): plane area A = 2WD + 2HD + WH (in M u2) against the budget.
 * Above it the set goes "lite" by itself: no ceiling or side walls, a narrow floor. The numbers
 * are provisional and need calibration on real devices.
 *
 * Without scroll-driven animation, and with reduced motion: no camera path. The camera rests on the
 * framing of act 2, objects that belong to act 2 show (vl-out="2" and vl-in="3"/"4" are hidden).
 */

/* The fade of vl-solid. Animating opacity on a preserve-3d group would flatten it, so the fade runs on
   this number and lands as opacity on the planes themselves (the object, or the planes inside a group). */
@property --vl-lights-a {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@property --vl-solid-a {
    syntax: "<number>";
    inherits: true;
    initial-value: 1;
}

@property --vl-world-progress {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

@property --vl-world-in {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@property --vl-world-out {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@layer velora.motion {
    [vl-world] {
        --_w-w: var(--vl-world-w, 1400);
        --_w-h: var(--vl-world-h, 800);
        --_w-d: var(--vl-world-d, 3300);
        --_w-stop: 800;
        --_w-travel-n: calc(var(--_w-d) - var(--_w-stop));
        --_w-weave: var(--vl-world-weave, 1);
        --_w-area: calc((2 * var(--_w-w) * var(--_w-d) + 2 * var(--_w-h) * var(--_w-d) + var(--_w-w) * var(--_w-h)) / 1000000);
        --_w-lite: clamp(0, calc((var(--_w-area) - var(--vl-world-budget, 24)) * 1000), 1);
        --_w-keep: calc(1 - var(--_w-lite));
        position: relative;
        block-size: calc(100svh + var(--vl-world-act-length, 650px) * 4);
        view-timeline: --vl-world block;
    }

    /* Composed with vl-scene: the scene owns the height (vl-pin) and the clock (--vl-scene). */
    [vl-world][vl-scene] {
        block-size: auto;
        view-timeline-name: --vl-scene;   /* keep the scene clock: the shorthand above would replace it */
        view-timeline-axis: block;
    }

    [vl-world="full"] { --_w-lite: 0; }
    [vl-world="lite"] { --_w-lite: 1; }

    /* Quality of the whole set: 1 = lite, 0 = full. Auto (nothing set) is lite on narrow screens.
       --vl-world-lite on the world or any ancestor (a settings control) or vl-world="lite|full" decide. */
    [vl-world] { --_w-q: var(--vl-world-lite, 0); }
    @media (max-width: 820px) { [vl-world] { --_w-q: var(--vl-world-lite, 1); } }
    [vl-world="lite"] { --_w-q: 1; }
    [vl-world="full"] { --_w-q: 0; }

    /* A host-level hint (vl-quality="lite" on <html>, written by an optional guard, never by CSS):
       it only fills in the default. A value the person chose on the world or an ancestor wins. */
    [vl-quality="lite"] [vl-world] { --vl-world-lite: 1; }

    @media (max-width: 560px), (min-resolution: 2.5dppx) {
        [vl-world] { --vl-world-budget: 8; }
    }

    @media (max-width: 560px) {
        [vl-world] { --vl-world-act-length: 520px; }
        [vl-world]:not([vl-world-path]) .vl-world__rig { scale: 0.62; }   /* a path keeps its own framing */
    }

    /* ---- Camera framing per act (words resolve to numbers) ---- */
    [vl-world] {
        --_w-c1p: 0;
        --_w-c1x: 0;
        --_w-c1y: 0;
    }
    [vl-world] { --_w-c1z: min(var(--_w-travel-n), max(0, calc(var(--_w-c1p) * var(--_w-d) - var(--vl-world-standoff, 600)))); }
    [vl-world][vl-cam-1~="foreground"] { --_w-c1p: 0.16; }
    [vl-world][vl-cam-1~="midground"] { --_w-c1p: 0.4; }
    [vl-world][vl-cam-1~="background"] { --_w-c1p: 0.64; }
    [vl-world][vl-cam-1~="end"] { --_w-c1p: calc(1 - 300 / var(--_w-d)); }
    [vl-world][vl-cam-1~="left"] { --_w-c1x: calc(var(--_w-w) * -0.32); }
    [vl-world][vl-cam-1~="right"] { --_w-c1x: calc(var(--_w-w) * 0.32); }
    [vl-world][vl-cam-1~="top"] { --_w-c1y: calc(var(--_w-h) * -0.25); }
    [vl-world][vl-cam-1~="bottom"] { --_w-c1y: calc(var(--_w-h) * 0.25); }

    [vl-world] {
        --_w-c2p: var(--_w-c1p);
        --_w-c2x: var(--_w-c1x);
        --_w-c2y: var(--_w-c1y);
    }
    [vl-world] { --_w-c2z: min(var(--_w-travel-n), max(0, calc(var(--_w-c2p) * var(--_w-d) - var(--vl-world-standoff, 600)))); }
    [vl-world][vl-cam-2~="foreground"] { --_w-c2p: 0.16; }
    [vl-world][vl-cam-2~="midground"] { --_w-c2p: 0.4; }
    [vl-world][vl-cam-2~="background"] { --_w-c2p: 0.64; }
    [vl-world][vl-cam-2~="end"] { --_w-c2p: calc(1 - 300 / var(--_w-d)); }
    [vl-world][vl-cam-2~="left"] { --_w-c2x: calc(var(--_w-w) * -0.32); }
    [vl-world][vl-cam-2~="right"] { --_w-c2x: calc(var(--_w-w) * 0.32); }
    [vl-world][vl-cam-2~="top"] { --_w-c2y: calc(var(--_w-h) * -0.25); }
    [vl-world][vl-cam-2~="bottom"] { --_w-c2y: calc(var(--_w-h) * 0.25); }

    [vl-world] {
        --_w-c3p: var(--_w-c2p);
        --_w-c3x: var(--_w-c2x);
        --_w-c3y: var(--_w-c2y);
    }
    [vl-world] { --_w-c3z: min(var(--_w-travel-n), max(0, calc(var(--_w-c3p) * var(--_w-d) - var(--vl-world-standoff, 600)))); }
    [vl-world][vl-cam-3~="foreground"] { --_w-c3p: 0.16; }
    [vl-world][vl-cam-3~="midground"] { --_w-c3p: 0.4; }
    [vl-world][vl-cam-3~="background"] { --_w-c3p: 0.64; }
    [vl-world][vl-cam-3~="end"] { --_w-c3p: calc(1 - 300 / var(--_w-d)); }
    [vl-world][vl-cam-3~="left"] { --_w-c3x: calc(var(--_w-w) * -0.32); }
    [vl-world][vl-cam-3~="right"] { --_w-c3x: calc(var(--_w-w) * 0.32); }
    [vl-world][vl-cam-3~="top"] { --_w-c3y: calc(var(--_w-h) * -0.25); }
    [vl-world][vl-cam-3~="bottom"] { --_w-c3y: calc(var(--_w-h) * 0.25); }

    [vl-world] {
        --_w-c4p: var(--_w-c3p);
        --_w-c4x: var(--_w-c3x);
        --_w-c4y: var(--_w-c3y);
    }
    [vl-world] { --_w-c4z: min(var(--_w-travel-n), max(0, calc(var(--_w-c4p) * var(--_w-d) - var(--vl-world-standoff, 600)))); }
    [vl-world][vl-cam-4~="foreground"] { --_w-c4p: 0.16; }
    [vl-world][vl-cam-4~="midground"] { --_w-c4p: 0.4; }
    [vl-world][vl-cam-4~="background"] { --_w-c4p: 0.64; }
    [vl-world][vl-cam-4~="end"] { --_w-c4p: calc(1 - 300 / var(--_w-d)); }
    [vl-world][vl-cam-4~="left"] { --_w-c4x: calc(var(--_w-w) * -0.32); }
    [vl-world][vl-cam-4~="right"] { --_w-c4x: calc(var(--_w-w) * 0.32); }
    [vl-world][vl-cam-4~="top"] { --_w-c4y: calc(var(--_w-h) * -0.25); }
    [vl-world][vl-cam-4~="bottom"] { --_w-c4y: calc(var(--_w-h) * 0.25); }

    /* ---- Stage and camera ---- */
    .vl-world__stage {
        position: sticky;
        top: 0;
        block-size: 100svh;
        overflow: hidden;
        perspective: var(--vl-world-perspective, 900px);
        perspective-origin: 50% var(--vl-world-horizon, 48%);
    }

    /* Inside a scene the stage is already pinned by [vl-stage]: fill it, do not pin twice. */
    [vl-world][vl-scene] .vl-world__stage {
        position: absolute;
        inset: 0;
        block-size: auto;
    }

    .vl-world__rig {
        position: absolute;
        inset: 0;
        transform-style: preserve-3d;
    }

    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            .vl-world__rig {
                animation: vl-world-dolly linear both;
                animation-timeline: --vl-world;
                animation-range: contain;
            }
        }
    }

    @keyframes vl-world-dolly {
        0% { transform: rotateY(0deg) translate3d(calc(var(--_w-c1x) * -1px), calc(var(--_w-c1y) * -1px), calc(var(--_w-c1z) * 1px)); }
        25% { transform: rotateY(0deg) translate3d(calc(var(--_w-c1x) * -1px), calc(var(--_w-c1y) * -1px), calc(var(--_w-c1z) * 1px)); animation-timing-function: ease-in; }
        29.75% { transform: rotateY(calc(var(--_w-weave) * +3deg)) translate3d(calc((var(--_w-c1x) + 0.85 * (var(--_w-c2x) - var(--_w-c1x))) * -1px), calc((var(--_w-c1y) + 0.85 * (var(--_w-c2y) - var(--_w-c1y))) * -1px), calc((var(--_w-c1z) + 0.2 * (var(--_w-c2z) - var(--_w-c1z))) * 1px)); animation-timing-function: ease-out; }
        34.5% { transform: rotateY(0deg) translate3d(calc(var(--_w-c2x) * -1px), calc(var(--_w-c2y) * -1px), calc(var(--_w-c2z) * 1px)); }
        50% { transform: rotateY(0deg) translate3d(calc(var(--_w-c2x) * -1px), calc(var(--_w-c2y) * -1px), calc(var(--_w-c2z) * 1px)); animation-timing-function: ease-in; }
        54.75% { transform: rotateY(calc(var(--_w-weave) * -3deg)) translate3d(calc((var(--_w-c2x) + 0.85 * (var(--_w-c3x) - var(--_w-c2x))) * -1px), calc((var(--_w-c2y) + 0.85 * (var(--_w-c3y) - var(--_w-c2y))) * -1px), calc((var(--_w-c2z) + 0.2 * (var(--_w-c3z) - var(--_w-c2z))) * 1px)); animation-timing-function: ease-out; }
        59.5% { transform: rotateY(0deg) translate3d(calc(var(--_w-c3x) * -1px), calc(var(--_w-c3y) * -1px), calc(var(--_w-c3z) * 1px)); }
        75% { transform: rotateY(0deg) translate3d(calc(var(--_w-c3x) * -1px), calc(var(--_w-c3y) * -1px), calc(var(--_w-c3z) * 1px)); animation-timing-function: ease-in; }
        79.75% { transform: rotateY(calc(var(--_w-weave) * +3deg)) translate3d(calc((var(--_w-c3x) + 0.85 * (var(--_w-c4x) - var(--_w-c3x))) * -1px), calc((var(--_w-c3y) + 0.85 * (var(--_w-c4y) - var(--_w-c3y))) * -1px), calc((var(--_w-c3z) + 0.2 * (var(--_w-c4z) - var(--_w-c3z))) * 1px)); animation-timing-function: ease-out; }
        84.5% { transform: rotateY(0deg) translate3d(calc(var(--_w-c4x) * -1px), calc(var(--_w-c4y) * -1px), calc(var(--_w-c4z) * 1px)); }
        100% { transform: rotateY(0deg) translate3d(calc(var(--_w-c4x) * -1px), calc(var(--_w-c4y) * -1px), calc(var(--_w-c4z) * 1px)); }
    }

    /* ---- Objects ---- */
    [vl-world] :is([vl-at], [vl-plane], [vl-in], [vl-out]) {
        position: absolute;
        inset: 0;
        margin: auto;
        inline-size: fit-content;
        block-size: fit-content;
        transform:
            translate3d(
                calc((var(--vl-x, 0) + var(--vl-dx, 0)) * 1px),
                calc((var(--vl-y, 0) + var(--vl-dy, 0)) * 1px),
                calc((var(--vl-z, 0) + var(--vl-dz, 0)) * 1px)
            )
            rotateX(var(--vl-rx, 0deg))
            rotateY(var(--vl-ry, 0deg))
            rotateZ(var(--vl-rz, 0deg));
    }

    /* Position variables inherit, so every object resets them: a group's --vl-z or --vl-ry must not
       be applied a second time to the objects inside it. */
    [vl-world] :is([vl-at], [vl-plane]) {
        --vl-x: 0;
        --vl-y: 0;
        --vl-z: 0;
        --vl-rx: 0deg;
        --vl-ry: 0deg;
        --vl-rz: 0deg;
        --vl-dx: 0;
        --vl-dy: 0;
        --vl-dz: 0;
    }
    [vl-world] [vl-at~="left"] { --vl-x: calc(var(--_w-w) * -0.32); }
    [vl-world] [vl-at~="right"] { --vl-x: calc(var(--_w-w) * 0.32); }
    [vl-world] [vl-at~="top"] { --vl-y: calc(var(--_w-h) * -0.25); }
    [vl-world] [vl-at~="bottom"] { --vl-y: calc(var(--_w-h) * 0.25); }
    [vl-world] [vl-plane="foreground"] { --vl-z: calc(var(--_w-d) * -0.16); }
    [vl-world] [vl-plane="midground"] { --vl-z: calc(var(--_w-d) * -0.4); }
    [vl-world] [vl-plane="background"] { --vl-z: calc(var(--_w-d) * -0.64); }
    [vl-world] [vl-plane="end"] { --vl-z: calc(var(--_w-d) * -1 + 300); }

    /* ---- Entering and leaving per act ----
       Two registered numbers are animated on the set's timeline; opacity is their product. */
    [vl-world] :is([vl-in], [vl-out]) {
        opacity: calc(var(--vl-world-in, 1) * var(--vl-world-out, 1));
        translate: 0 calc((1 - var(--vl-world-in, 1)) * 70px);
        scale: calc(0.94 + 0.06 * var(--vl-world-in, 1));
    }

    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            [vl-world] :is([vl-in], [vl-out]) {
                animation: var(--_w-ain, none) linear both, var(--_w-aout, none) linear both;
                animation-timeline: --vl-world, --vl-world;
                animation-range: contain, contain;
            }

            [vl-world] [vl-in="2"] { --_w-ain: vl-world-in-2; }
            [vl-world] [vl-in="3"] { --_w-ain: vl-world-in-3; }
            [vl-world] [vl-in="4"] { --_w-ain: vl-world-in-4; }
            [vl-world] [vl-out="2"] { --_w-aout: vl-world-out-2; }
            [vl-world] [vl-out="3"] { --_w-aout: vl-world-out-3; }
            [vl-world] [vl-out="4"] { --_w-aout: vl-world-out-4; }
        }
    }

    @keyframes vl-world-in-2 { 0%, 21% { --vl-world-in: 0; } 29%, 100% { --vl-world-in: 1; } }
    @keyframes vl-world-in-3 { 0%, 46% { --vl-world-in: 0; } 54%, 100% { --vl-world-in: 1; } }
    @keyframes vl-world-in-4 { 0%, 71% { --vl-world-in: 0; } 79%, 100% { --vl-world-in: 1; } }
    @keyframes vl-world-out-2 { 0%, 25% { --vl-world-out: 1; } 31%, 100% { --vl-world-out: 0; } }
    @keyframes vl-world-out-3 { 0%, 50% { --vl-world-out: 1; } 56%, 100% { --vl-world-out: 0; } }
    @keyframes vl-world-out-4 { 0%, 75% { --vl-world-out: 1; } 81%, 100% { --vl-world-out: 0; } }

    /* ---- Optional room: planes sized by the declared world ---- */
    :is(.vl-world__floor, .vl-world__ceiling, .vl-world__wall-left, .vl-world__wall-right, .vl-world__wall-back) {
        --_w-zc: calc((var(--_w-travel-n) * 1px) / -2 - 200px);
        --_w-len: calc(var(--_w-travel-n) * 1px + 1200px);
        position: absolute;
        left: 50%;
        top: 50%;
        inline-size: var(--_pw);
        block-size: var(--_ph);
        margin: calc(var(--_ph) / -2) 0 0 calc(var(--_pw) / -2);
        background: var(--vl-world-plane, color-mix(in oklab, currentColor 6%, transparent));
        outline: 1px solid color-mix(in oklab, currentColor 18%, transparent);
        outline-offset: -1px;
    }

    .vl-world__floor {
        --_pw: calc(var(--_w-w) * 1px - (var(--_w-w) * 1px - min(var(--_w-w) * 0.5px, 700px)) * var(--_w-lite));
        --_ph: var(--_w-len);
        transform: translate3d(0, calc(var(--_w-h) * 0.5px), var(--_w-zc)) rotateX(90deg);
    }

    .vl-world__ceiling {
        --_pw: calc(var(--_w-w) * 1px);
        --_ph: calc(var(--_w-len) * var(--_w-keep));
        transform: translate3d(0, calc(var(--_w-h) * -0.5px), var(--_w-zc)) rotateX(90deg);
    }

    .vl-world__wall-left,
    .vl-world__wall-right {
        --_pw: var(--_w-len);
        --_ph: calc(var(--_w-h) * 1px * var(--_w-keep));
    }

    .vl-world__wall-left { transform: translate3d(calc(var(--_w-w) * -0.5px), 0, var(--_w-zc)) rotateY(90deg); }
    .vl-world__wall-right { transform: translate3d(calc(var(--_w-w) * 0.5px), 0, var(--_w-zc)) rotateY(90deg); }

    .vl-world__wall-back {
        --_pw: calc(var(--_w-w) * 1px);
        --_ph: calc(var(--_w-h) * 1px);
        transform: translate3d(0, 0, calc(var(--_w-d) * -1px));
    }

    /* ---- Free objects: placed by numbers, sized by --vl-w / --vl-h (world units) ----
       vl-plane="free" has no depth word: position comes from --vl-x/-y/-z, orientation from
       --vl-rx/-ry/-rz. An object can hold other free objects (a group); a 0 x 0 group is a pivot. */
    [vl-world] [vl-plane="free"] {
        position: absolute;
        inset: auto;
        left: 50%;
        top: 50%;
        inline-size: calc(var(--vl-w, 0) * 1px);
        block-size: calc(var(--vl-h, 0) * 1px);
        margin: calc(var(--vl-h, 0) * -0.5px) 0 0 calc(var(--vl-w, 0) * -0.5px);
        transform-style: preserve-3d;
    }

    /* ---- Camera paths: one continuous move instead of four acts ----
       vl-world-path="dolly"  the rig travels --vl-world-travel units toward the lens (with a slight sway)
       vl-world-path="orbit"  the rig turns --vl-world-turn degrees around the camera (pivot --vl-world-pivot)
       The move runs on the set's own timeline, or on the --vl-scene clock when the set is also a vl-scene.
       --vl-world-from / --vl-world-to  part of that timeline the move uses, in percent (default 0 and 100). */
    [vl-world] {
        --_w-tl: --vl-world;
        --_w-rp: contain;
        --_w-pf: var(--vl-world-from, 0);
        --_w-pt: var(--vl-world-to, 100);
        --_w-travel: var(--vl-world-travel, 3000);
        --_w-turn: var(--vl-world-turn, 360);
        --_w-pivot: var(--vl-world-pivot, 900);
        --_w-far: var(--vl-world-far, 5700);
        --_w-near: var(--vl-world-near, 1600);
        --_w-rest: var(--vl-world-rest, 0);
        --_w-fov: var(--vl-world-fov, 78);
    }

    [vl-world][vl-scene] {
        --_w-tl: --vl-scene;
        --_w-rp: cover;
    }

    @media (max-width: 820px) {
        [vl-world] {
            --_w-far: var(--vl-world-far, 3900);
            --_w-fov: var(--vl-world-fov, 48);
        }
    }

    /* Detail that a small screen can do without: dropped on narrow screens and in lite mode. */
    @media (max-width: 820px) {
        @container not style(--vl-world-lite: 0) {
            [vl-world]:not([vl-world="full"]) [vl-lod~="detail"] { display: none; }
        }
    }

    @container style(--vl-world-lite: 1) {
        [vl-world]:not([vl-world="full"]) [vl-lod~="detail"] { display: none; }
    }

    [vl-world="lite"] [vl-lod~="detail"] { display: none; }

    /* Lite thins a drawn grid: every second line is dropped, so a big floor or wall costs half the layers. */
    @container style(--vl-world-lite: 1) {
        [vl-world]:not([vl-world="full"]) [vl-grid] > i:nth-child(even) { display: none; }
    }

    [vl-world="lite"] [vl-grid] > i:nth-child(even) { display: none; }

    /* A grid drawn as thin lines. Lines are tiny compositor layers; one big plane with a gradient
       costs the memory of its whole area. Children are <i style="--k: N">: the first cols are the
       lines along the height, the rest the lines along the width. */
    [vl-world] [vl-grid] {
        --_g-step: var(--vl-grid-step, 70);
        --_g-cols: round(up, calc(var(--vl-w, 0) / var(--_g-step)), 1);
        --_g-rows: round(up, calc(var(--vl-h, 0) / var(--_g-step)), 1);
        transform-style: preserve-3d;
    }

    [vl-world] [vl-grid] > i {
        --_g-v: clamp(0, calc(var(--_g-cols) - var(--k, 1) + 1), 1);
        position: absolute;
        display: block;
        left: calc(var(--_g-v) * (var(--k, 1) - 1) * var(--_g-step) * 1px);
        top: calc((1 - var(--_g-v)) * (var(--k, 1) - var(--_g-cols) - 1) * var(--_g-step) * 1px);
        --_g-on: clamp(0, calc(var(--_g-cols) + var(--_g-rows) - var(--k, 1) + 1), 1);   /* spare lines collapse */
        inline-size: calc(var(--_g-on) * (var(--_g-v) * 1px + (1 - var(--_g-v)) * var(--vl-w, 0) * 1px));
        block-size: calc(var(--_g-on) * (var(--_g-v) * var(--vl-h, 0) * 1px + (1 - var(--_g-v)) * 1px));
        background: var(--vl-world-line, currentColor);
    }

    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            /* Only an element that asks (vl-world-readout) animates the progress: an inherited registered
               property would restyle every object of the set on every scroll frame. */
            [vl-world-path] [vl-world-readout] {
                animation: vl-world-progress linear both;
                animation-duration: 1ms;
                animation-timeline: var(--_w-tl);
                animation-range: var(--_w-rp) calc(var(--_w-pf) * 1%) var(--_w-rp) calc(var(--_w-pt) * 1%);
            }

            [vl-world-path] .vl-world__rig {
                animation-duration: 1ms;
                animation-timeline: var(--_w-tl);
                animation-range: var(--_w-rp) calc(var(--_w-pf) * 1%) var(--_w-rp) calc(var(--_w-pt) * 1%);
            }

            [vl-world-path="dolly"] .vl-world__rig { animation-name: vl-world-path-dolly; animation-timing-function: linear; animation-fill-mode: both; }

            [vl-world-path="orbit"] .vl-world__rig {
                transform-origin: 50% 50% calc(var(--_w-pivot) * 1px);
                animation-name: vl-world-path-orbit;
                animation-timing-function: linear;
                animation-fill-mode: both;
            }

            @media (min-width: 821px) {
                [vl-world-path] .vl-world__rig { will-change: transform; }
            }

            /* Off screen, the whole set paints nothing. Fail open: the base state is visible. */
            [vl-world-path] .vl-world__stage {
                animation: vl-world-stage-visibility linear both;
                animation-duration: 1ms;
                animation-timeline: var(--_w-tl);
                animation-range: cover 0% cover 100%;
            }

            /* Culling: an object exists only while the camera can see it. Fail open: only a browser that
               runs this animation ever hides anything. A window is a part of the path, in percent.
               dolly  the window comes from the object's depth (--vl-z) and --vl-world-far / --vl-world-near.
               orbit  the window comes from the object's heading (--vl-heading, degrees) and the field of view
                      --vl-world-fov (half angle) plus the object's own --vl-reach (degrees).
               --vl-from / --vl-to replace the first window. An orbit window that crosses the start or the
               end of the turn is cut into three pieces, so there are three animations. */
            [vl-world-path] .vl-world__rig > [vl-plane] {
                --_w-z: calc(var(--vl-z, 0) + var(--vl-dz, 0));
                --_w-s1: var(--vl-from, clamp(0, calc((-1 * var(--vl-far, var(--_w-far)) - var(--_w-z)) / var(--_w-travel) * 100), 100));
                --_w-e1: var(--vl-to, clamp(0, calc((var(--vl-near, var(--_w-near)) - var(--_w-z)) / var(--_w-travel) * 100), 100));
                --_w-s2: 0;
                --_w-e2: 0;
                --_w-s3: 0;
                --_w-e3: 0;
                visibility: hidden;
                animation: vl-world-show linear, vl-world-show linear, vl-world-show linear;
                animation-duration: 1ms, 1ms, 1ms;
                animation-timeline: var(--_w-tl), var(--_w-tl), var(--_w-tl);
                animation-range:
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s1) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e1) / 100 + round(down, calc(var(--_w-e1) / 100), 1) * round(up, calc((100 - var(--_w-s1)) / 100), 1) * (100 - var(--_w-pt))) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s2) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e2) / 100 + round(down, calc(var(--_w-e2) / 100), 1) * round(up, calc((100 - var(--_w-s2)) / 100), 1) * (100 - var(--_w-pt))) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s3) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e3) / 100 + round(down, calc(var(--_w-e3) / 100), 1) * round(up, calc((100 - var(--_w-s3)) / 100), 1) * (100 - var(--_w-pt))) * 1%);
            }

            [vl-world-path="orbit"] .vl-world__rig > [vl-plane] {
                --_w-half: calc(var(--vl-fov, var(--_w-fov)) + var(--vl-reach, 8));
                --_w-lo: calc(var(--vl-heading, 0) - var(--_w-half));
                --_w-hi: calc(var(--vl-heading, 0) + var(--_w-half));
                --_w-s1: var(--vl-from, calc(clamp(0, var(--_w-lo), var(--_w-turn)) / var(--_w-turn) * 100));
                --_w-e1: var(--vl-to, calc(clamp(0, var(--_w-hi), var(--_w-turn)) / var(--_w-turn) * 100));
                --_w-s2: calc(clamp(0, var(--_w-lo) + var(--_w-turn), var(--_w-turn)) / var(--_w-turn) * 100);
                --_w-e2: calc(clamp(0, var(--_w-hi) + var(--_w-turn), var(--_w-turn)) / var(--_w-turn) * 100);
                --_w-s3: calc(clamp(0, var(--_w-lo) - var(--_w-turn), var(--_w-turn)) / var(--_w-turn) * 100);
                --_w-e3: calc(clamp(0, var(--_w-hi) - var(--_w-turn), var(--_w-turn)) / var(--_w-turn) * 100);
            }

            /* A solid face has no 3D children: keep it out of the 3D sorting of the set. Big textured faces in the
               shared context are split by the compositor and lose tiles (holes) on high-density screens. */
            [vl-world-path] [vl-solid][vl-plane]:not(:has(> :is([vl-plane], [vl-at]))),
            [vl-world-path] [vl-solid] > [vl-plane]:not(:has(> :is([vl-plane], [vl-at]))) { transform-style: flat; }

            [vl-world-path] [vl-solid]:not(:has(> [vl-plane])),
            [vl-world-path] [vl-solid] > [vl-plane] { opacity: var(--vl-solid-a); }

            /* vl-solid: matter that exists only close to the camera. A narrower window (--vl-solid-far /
               --vl-solid-near on a dolly, a narrower --vl-fov on an orbit) and a fade at each end
               (--vl-solid-fade, percent of the path). --vl-solid-from / --vl-solid-to replace both fades
               with one fade-in that then holds (the build-up of an orbit). */
            [vl-world-path] .vl-world__rig > [vl-solid] {
                --_w-fade: var(--vl-solid-fade, 4);
                --vl-far: var(--vl-solid-far, calc(2400 - 1000 * var(--_w-q)));
                --vl-near: var(--vl-solid-near, calc(600 - 200 * var(--_w-q)));
                --vl-fov: var(--vl-solid-fov, calc(50 - 10 * var(--_w-q)));
                --_w-fi-s: var(--vl-solid-from, var(--_w-s1));
                --_w-fi-e: var(--vl-solid-to, min(var(--_w-e1), calc(var(--_w-s1) + var(--_w-fade))));
                --_w-hold: round(down, calc(var(--_w-e1) / 100), 1);
                --_w-fo-s: calc(max(var(--_w-s1), var(--_w-e1) - var(--_w-fade)) + var(--_w-hold) * 1000);
                --_w-fo-e: calc(var(--_w-e1) + var(--_w-hold) * 1000);
                animation:
                    vl-world-show linear, vl-world-show linear, vl-world-show linear,
                    vl-world-solid-in linear, vl-world-solid-out linear;
                animation-duration: 1ms, 1ms, 1ms, 1ms, 1ms;
                animation-fill-mode: none, none, none, backwards, forwards;
                animation-timeline: var(--_w-tl), var(--_w-tl), var(--_w-tl), var(--_w-tl), var(--_w-tl);
                animation-range:
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s1) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e1) / 100 + round(down, calc(var(--_w-e1) / 100), 1) * round(up, calc((100 - var(--_w-s1)) / 100), 1) * (100 - var(--_w-pt))) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s2) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e2) / 100 + round(down, calc(var(--_w-e2) / 100), 1) * round(up, calc((100 - var(--_w-s2)) / 100), 1) * (100 - var(--_w-pt))) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-s3) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-e3) / 100 + round(down, calc(var(--_w-e3) / 100), 1) * round(up, calc((100 - var(--_w-s3)) / 100), 1) * (100 - var(--_w-pt))) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-fi-s) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-fi-e) / 100) * 1%),
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-fo-s) / 100) * 1%)
                    var(--_w-rp) calc((var(--_w-pf) + (var(--_w-pt) - var(--_w-pf)) * var(--_w-fo-e) / 100) * 1%);
            }
        }
    }

    @keyframes vl-world-progress { from { --vl-world-progress: 0; } to { --vl-world-progress: 1; } }
    @keyframes vl-world-show { from, to { visibility: visible; } }
    @keyframes vl-world-solid-in { from { --vl-solid-a: 0; } to { --vl-solid-a: 1; } }
    @keyframes vl-world-solid-out { from { --vl-solid-a: 1; } to { --vl-solid-a: 0; } }
    @keyframes vl-world-stage-visibility {
        0% { content-visibility: hidden; }
        0.1%, 99.9% { content-visibility: visible; }
        100% { content-visibility: hidden; }
    }

    @keyframes vl-world-path-dolly {
        0% { transform: rotateY(calc(var(--_w-weave) * -3deg)) rotateZ(0deg) translate3d(0, 0, 0); }
        30% { transform: rotateY(calc(var(--_w-weave) * 2.5deg)) rotateZ(calc(var(--_w-weave) * 0.8deg)) translate3d(0, 0, calc(var(--_w-travel) * 0.3px)); }
        62% { transform: rotateY(calc(var(--_w-weave) * -2deg)) rotateZ(calc(var(--_w-weave) * -0.6deg)) translate3d(0, 0, calc(var(--_w-travel) * 0.62px)); }
        100% { transform: rotateY(0deg) rotateZ(0deg) translate3d(0, 0, calc(var(--_w-travel) * 1px)); }
    }

    @keyframes vl-world-path-orbit {
        from { transform: rotateY(0deg); }
        to { transform: rotateY(calc(var(--_w-turn) * 1deg)); }
    }

    /* ---- vl-lights (Experimental): the set's lights, as one overlay on the stage ----
       vl-lights="on|off" on the world. CSS has no 3D lighting, so this is not light: it is one layer over the stage
       (a warm glow plus a dark vignette), drawn by the stage's ::after. It adds no objects and no 3D layers.
       on   lit (default amount 1). With --vl-lights-from / --vl-lights-to (percent of the world's clock) the set is
            dark before that window and the lights come up inside it, then hold.
       off  dark. With a window the set is lit before it and the lights go down inside it, then hold.
       --vl-lights-dark colour of the dark (#000)   --vl-lights-dim how dark "off" is, 0..1 (.85)
       --vl-lights-color glow colour (#ffd9a0)       --vl-lights-glow glow strength, percent (22)
       --vl-lights-x / --vl-lights-y glow centre (50%, 52%)   --vl-lights-vignette edge darkness, percent (0)
       Reduced motion: no animation; the lights sit in the state the attribute names (on = lit). */
    [vl-world][vl-lights] .vl-world__stage::after {
        --_l-d: calc((1 - var(--vl-lights-a)) * var(--vl-lights-dim, 0.85) * 100);
        --_l-dark: var(--vl-lights-dark, #000);
        content: "";
        position: absolute;
        inset: 0;
        z-index: 2;
        pointer-events: none;
        background:
            radial-gradient(ellipse 60% 65% at var(--vl-lights-x, 50%) var(--vl-lights-y, 52%),
                color-mix(in oklab, var(--vl-lights-color, #ffd9a0) calc(var(--vl-lights-a) * var(--vl-lights-glow, 22) * 1%), transparent), transparent 75%),
            radial-gradient(ellipse 80% 75% at var(--vl-lights-x, 50%) var(--vl-lights-y, 52%),
                color-mix(in oklab, var(--_l-dark) calc(var(--_l-d) * 1%), transparent) 40%,
                color-mix(in oklab, var(--_l-dark) calc(max(var(--vl-lights-vignette, 0), var(--_l-d)) * 1%), transparent) 100%);
    }

    [vl-world][vl-lights="off"] .vl-world__stage::after { --vl-lights-a: 0; }

    @keyframes vl-lights-on { from { --vl-lights-a: 0; } to { --vl-lights-a: 1; } }
    @keyframes vl-lights-off { from { --vl-lights-a: 1; } to { --vl-lights-a: 0; } }

    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            [vl-world][vl-lights] .vl-world__stage::after {
                animation-duration: 1ms;
                animation-timing-function: linear;
                animation-fill-mode: both;
                animation-timeline: var(--_w-tl);
                animation-range:
                    var(--_w-rp) calc(var(--vl-lights-from, -100) * 1%)
                    var(--_w-rp) calc(var(--vl-lights-to, -100) * 1%);
            }
            [vl-world][vl-lights="on"] .vl-world__stage::after { animation-name: vl-lights-on; }
            [vl-world][vl-lights="off"] .vl-world__stage::after { animation-name: vl-lights-off; }
        }
    }

    /* ---- No camera path: reduced motion, or no scroll-driven animation ---- */
    @media (prefers-reduced-motion: reduce) {
        [vl-world] { block-size: auto; }
        .vl-world__rig {
            animation: none;
            transform: translate3d(calc(var(--_w-c2x) * -1px), calc(var(--_w-c2y) * -1px), calc(var(--_w-c2z) * 1px));
        }
        [vl-world] :is([vl-in], [vl-out]) { animation: none; }
        [vl-world] :is([vl-in="3"], [vl-in="4"]) { --vl-world-in: 0; }
        [vl-world] [vl-out="2"] { --vl-world-out: 0; }
        [vl-world-path] [vl-world-readout] { --vl-world-progress: var(--_w-rest); }
        [vl-world-path="dolly"] .vl-world__rig { transform: translate3d(0, 0, calc(var(--_w-travel) * var(--_w-rest) * 1px)); }
        [vl-world-path="orbit"] .vl-world__rig { transform-origin: 50% 50% calc(var(--_w-pivot) * 1px); transform: rotateY(calc(var(--_w-turn) * var(--_w-rest) * 1deg)); }
        /* At rest only the objects marked vl-rest are drawn: a set must never paint everything at once. */
        [vl-world-path] .vl-world__rig > [vl-plane]:not([vl-rest]) { display: none; }
    }

    @supports not (animation-timeline: view()) {
        [vl-world] { block-size: auto; }
        .vl-world__rig { transform: translate3d(calc(var(--_w-c2x) * -1px), calc(var(--_w-c2y) * -1px), calc(var(--_w-c2z) * 1px)); }
        [vl-world] :is([vl-in="3"], [vl-in="4"]) { --vl-world-in: 0; }
        [vl-world] [vl-out="2"] { --vl-world-out: 0; }
        [vl-world-path] [vl-world-readout] { --vl-world-progress: var(--_w-rest); }
        [vl-world-path="dolly"] .vl-world__rig { transform: translate3d(0, 0, calc(var(--_w-travel) * var(--_w-rest) * 1px)); }
        [vl-world-path="orbit"] .vl-world__rig { transform-origin: 50% 50% calc(var(--_w-pivot) * 1px); transform: rotateY(calc(var(--_w-turn) * var(--_w-rest) * 1deg)); }
        [vl-world-path] .vl-world__rig > [vl-plane]:not([vl-rest]) { display: none; }
    }
}

/* ---- 03b-motion-extended.css ---- */
@layer velora.motion {
    /*
     * Velora Motion Extended — v2
     * Additional effects, 3D systems, text reveals, scroll-driven patterns,
     * ambient loops, and interaction primitives.
     *
     * New public API additions:
     *   vl-effect="spring-up"        Spring physics entrance
     *   vl-effect="glide-in"         High-momentum glide
     *   vl-effect="zoom-blur"        Zoom + blur combo reveal
     *   vl-effect="slice-in"         Clip-path slice from left
     *   vl-effect="unfold"           Height unfold from top clip
     *   vl-effect="slide-diagonal"   Corner diagonal entry
     *   vl-effect="flip-in"          3D card flip reveal
     *   vl-effect="spring-3d"        Spring 3D perspective entry
     *   vl-effect="rise-3d"          Dramatic 3D perspective rise
     *   vl-effect="pulse-ring"       Expanding sonar ring
     *   vl-effect="spin-slow"        Slow continuous rotation
     *   vl-effect="pendulum"         Pendulum swing loop
     *   vl-effect="breathe"          Subtle scale breathe
     *   vl-effect="drift"            Slow ambient horizontal drift
     *   vl-effect="aurora"           Aurora background shift
     *   vl-effect="border-beam"      Animated gradient border beam
     *   vl-effect="spotlight"        Radial spotlight on hover
     *   vl-effect="press"            Physical press feedback
     *   vl-effect="bounce"           Elastic bounce loop
     *   vl-effect="shimmer-text"     Text gradient shimmer
    *   vl-effect="gradient-text-color" Animated gradient color interpolation on text
    *   vl-effect="circle-text-scroll" Scroll-reactive circular text scene
    *   vl-effect="code-greeting-stack" Code-style greeting cycler with hover word swap
    *   (cube-triad-stage lives in scene-recipes.css: Showcase/Skin demo recipe)
     *   vl-effect="gradient-slide"   Background gradient position shift
    *   vl-effect="duotone"          Duotone image blend treatment
    *   vl-effect="text-ring-orbit"  3D rotating text ring scene
     *   vl-effect="mesh-pan"         Background mesh drift
     *   vl-effect="hover-prism"      Prism-like hover tilt + glow
     *   vl-effect="hover-depth-press"Lift on hover, press on active
     *   vl-effect="rotate-scroll"    Rotation tied to scroll (+ vl-timeline="scroll")
     *   vl-effect="wipe-reveal"      Scroll-driven clip wipe
     *   vl-effect="depth-push"       Perspective depth on scroll
     *   vl-children="wave"           Wave-pattern stagger
     *   vl-children="blur-cascade"   Blur cascade mode
     *   vl-children="zoom-stagger"   Scale-in stagger
     *   vl-children="cinema-stagger" Cinematic stagger with mixed motion
     *   vl-stagger="20ms|30ms|40ms|250ms|300ms"   Extra stagger values
     *   vl-speed="slower|fastest"    Extra speed buckets
     *   vl-range="exit|center|full"  Extra scroll ranges
     *   vl-range="exit-short"        Smooth exit range
     *   .vl-3d-stage                 Perspective scene container
     *   .vl-cube / .vl-cube__face-* CSS 3D cube system
     *   .vl-flip-card / inner/front/back  CSS 3D flip card
     *   .vl-text-wave > span         Per-character wave text
     *   .vl-text-split > span        Per-word split reveal
     *   .vl-gradient-text            Animated gradient text clip
     */

    /* =========================================================================
       EASING EXTENSIONS  (additional easing tokens)
       ========================================================================= */
    :root {
        --vl-ease-bounce:      cubic-bezier(0.34, 1.72, 0.64, 1);
        --vl-ease-elastic:     cubic-bezier(0.68, -0.55, 0.265, 1.55);
        --vl-ease-smooth:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
        --vl-ease-expo-out:    cubic-bezier(0.19, 1, 0.22, 1);
        --vl-ease-back-in:     cubic-bezier(0.36, 0, 0.66, -0.56);
        --vl-ease-back-out:    cubic-bezier(0.34, 1.56, 0.64, 1);
        --vl-duration-slowest: 1200ms;
        --vl-duration-fastest: 80ms;
    }

    /* =========================================================================
       KEYFRAMES  entrance — advanced
       ========================================================================= */

    /* Spring physics: overshoot then settle */
    @keyframes vl-spring-up {
        0%   { opacity: 0; transform: translate3d(0, 2rem, 0) scale(0.96); }
        55%  { opacity: 1; transform: translate3d(0, -0.35rem, 0) scale(1.01); }
        75%  { transform: translate3d(0, 0.12rem, 0) scale(0.995); }
        100% { transform: translate3d(0, 0, 0) scale(1); }
    }

    /* High-momentum glide — ease-expo-out */
    @keyframes vl-glide-in {
        from {
            opacity: 0;
            transform: translate3d(0, var(--vl-distance-y, 3rem), 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    /* Zoom blur: scale from slightly large + soft reveal (GPU-friendly, no filter:blur) */
    @keyframes vl-zoom-blur {
        from {
            opacity: 0;
            transform: scale(1.06);
            clip-path: inset(4% round 2px);
        }
        to {
            opacity: 1;
            transform: scale(1);
            clip-path: inset(0);
        }
    }

    /* Slice: clip-path wipe from left edge */
    @keyframes vl-slice-in {
        from {
            clip-path: inset(0 100% 0 0 round 4px);
            opacity: 0.4;
        }
        to {
            clip-path: inset(0 0% 0 0 round 0px);
            opacity: 1;
        }
    }

    /* Unfold: reveals from a collapsed top state */
    @keyframes vl-unfold {
        from {
            clip-path: inset(0 0 100% 0);
            transform: translate3d(0, -0.5rem, 0);
            opacity: 0;
        }
        to {
            clip-path: inset(0 0 0% 0);
            transform: translate3d(0, 0, 0);
            opacity: 1;
        }
    }

    /* Diagonal: comes from bottom-left corner */
    @keyframes vl-slide-diagonal {
        from {
            opacity: 0;
            transform: translate3d(-1.5rem, 1.5rem, 0) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    /* 3D card flip reveal (rotateY 90deg → 0deg) */
    @keyframes vl-flip-in {
        from {
            opacity: 0;
            transform: perspective(800px) rotateY(-90deg) translateZ(-40px);
        }
        to {
            opacity: 1;
            transform: perspective(800px) rotateY(0deg) translateZ(0);
        }
    }

    /* Spring 3D: perspective entry with spring overshoot */
    @keyframes vl-spring-3d {
        0%   {
            opacity: 0;
            transform: perspective(var(--vl-perspective, 900px))
                rotateX(var(--vl-rotate-x, 22deg))
                translate3d(0, var(--vl-distance-y, 2rem), var(--vl-depth-z-from, -60px))
                scale(var(--vl-scale-from, 0.92));
        }
        60%  { opacity: 1; transform: perspective(var(--vl-perspective, 900px)) rotateX(-2deg) translate3d(0, -0.2rem, 4px) scale(1.01); }
        80%  { transform: perspective(var(--vl-perspective, 900px)) rotateX(1deg) translate3d(0, 0.1rem, 0) scale(0.99); }
        100% { transform: perspective(var(--vl-perspective, 900px)) rotateX(0deg) translate3d(0, 0, 0) scale(1); }
    }

    /* Rise 3D: dramatic overhead perspective entry */
    @keyframes vl-rise-3d {
        from {
            opacity: 0;
            transform: perspective(var(--vl-perspective, 1600px))
                rotateX(var(--vl-rotate-x, 35deg))
                translate3d(0, var(--vl-distance-y, 4rem), var(--vl-depth-z-from, -120px));
        }
        to {
            opacity: 1;
            transform: perspective(var(--vl-perspective, 1600px)) rotateX(0deg) translate3d(0, 0, 0);
        }
    }

    /* =========================================================================
       KEYFRAMES  continuous / ambient loops
       ========================================================================= */

    /* Pulse ring: expanding transparent ring */
    @keyframes vl-pulse-ring {
        0%   { transform: scale(0.85); opacity: 0.8; }
        70%  { transform: scale(1.3); opacity: 0; }
        100% { transform: scale(0.85); opacity: 0; }
    }

    /* Slow continuous 360 spin */
    @keyframes vl-spin-slow {
        to { transform: rotate(360deg); }
    }

    /* Pendulum swing */
    @keyframes vl-pendulum {
        0%, 100% { transform: rotate(-12deg); transform-origin: top center; }
        50%      { transform: rotate(12deg);  transform-origin: top center; }
    }

    /* Breathe: subtle scale pulse */
    @keyframes vl-breathe {
        0%, 100% { transform: scale(1); }
        50%      { transform: scale(1.04); }
    }

    /* Drift: slow horizontal ambient float */
    @keyframes vl-drift {
        0%, 100% { transform: translate3d(0, 0, 0); }
        33%      { transform: translate3d(0.5rem, -0.25rem, 0); }
        66%      { transform: translate3d(-0.25rem, 0.3rem, 0); }
    }

    /* Aurora: animate gradient background-position */
    @keyframes vl-aurora {
        0%   { background-position: 0% 50%; }
        50%  { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    /* Border beam: rotating conic gradient border */
    @keyframes vl-border-beam {
        to { --vl-beam-angle: 360deg; }
    }

    /* Bounce: elastic bounce on loop */
    @keyframes vl-bounce {
        0%, 100% { transform: translate3d(0, 0, 0); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
        50%      { transform: translate3d(0, -0.6rem, 0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
    }

    /* Shimmer text: gradient sweep across text */
    @keyframes vl-shimmer-text {
        0%   { background-position: -200% center; }
        100% { background-position: 200% center; }
    }

    @keyframes vl-gradient-text-color-shift {
        to {
            --vl-gradient-text-color-1: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 72%, var(--vl-color-primary));
            --vl-gradient-text-color-2: color-mix(in oklch, var(--vl-color-secondary) 74%, var(--vl-color-primary));
        }
    }

    @keyframes vl-circle-text-scroll-sync {
        to {
            --vl-circle-rotate: 1;
            --vl-circle-delayed-rotate: 1;
        }
    }

    @keyframes vl-code-greeting-cycle {
        0%, 20% {
            transform: translateY(0);
        }
        25%, 45% {
            transform: translateY(-1.18em);
        }
        50%, 70% {
            transform: translateY(-2.36em);
        }
        75%, 100% {
            transform: translateY(-3.54em);
        }
    }

    /* Gradient slide: slow position drift for hero backgrounds */
    @keyframes vl-gradient-slide {
        0%   { background-position: 0% 50%; }
        50%  { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    @keyframes vl-mesh-pan {
        0%   { background-position: 0% 0%, 100% 100%; }
        50%  { background-position: 100% 0%, 0% 100%; }
        100% { background-position: 0% 0%, 100% 100%; }
    }

    @keyframes vl-halo-pulse {
        0%, 100% { opacity: 0.25; transform: scale(0.98); }
        50%      { opacity: 0.55; transform: scale(1.04); }
    }

    @keyframes vl-glitch-lite {
        0%, 100% { transform: translate3d(0, 0, 0); opacity: 1; }
        20% { transform: translate3d(-1px, 0, 0); }
        40% { transform: translate3d(1px, 0, 0); }
        60% { transform: translate3d(0, -1px, 0); }
        80% { transform: translate3d(0, 1px, 0); }
    }

    @keyframes vl-scanline-sweep {
        from { background-position: 0 -120%; }
        to { background-position: 0 220%; }
    }

    @keyframes vl-ripple-pulse {
        0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--vl-color-primary) 45%, transparent); }
        70% { box-shadow: 0 0 0 14px transparent; }
        100% { box-shadow: 0 0 0 0 transparent; }
    }

    @keyframes vl-levitate-x {
        0%, 100% { transform: translate3d(0, 0, 0); }
        25% { transform: translate3d(0.35rem, -0.15rem, 0); }
        50% { transform: translate3d(0.6rem, 0, 0); }
        75% { transform: translate3d(0.25rem, 0.18rem, 0); }
    }

    @keyframes vl-sweep-border {
        from { background-position: 0% 50%; }
        to { background-position: 200% 50%; }
    }

    @keyframes vl-text-ring-scene {
        from { transform: rotateZ(0deg) rotateX(20deg) rotateZ(360deg); }
        to { transform: rotateZ(360deg) rotateX(20deg) rotateZ(0deg); }
    }

    @keyframes vl-text-ring-track {
        to { transform: translate(-50%, -50%) rotateY(-1turn); }
    }

    @keyframes vl-grid-wave {
        0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
        50% { transform: translate3d(0, -0.25rem, 0) scale(1.02); }
    }

    @keyframes vl-spiral-stagger {
        from {
            opacity: 0;
            transform: rotate(-12deg) scale(0.85) translate3d(0, 0.8rem, 0);
        }
        to {
            opacity: 1;
            transform: rotate(0deg) scale(1) translate3d(0, 0, 0);
        }
    }

    /* Text wave: per-character vertical wave (use on child spans) */
    @keyframes vl-wave-char {
        0%, 100% { transform: translateY(0); }
        50%      { transform: translateY(-0.35em); }
    }

    /* Text split: vl-word-rise — canonical keyframe lives in 03-motion.css */

    /* =========================================================================
       KEYFRAMES  scroll-driven
       ========================================================================= */

    /* Rotate on scroll */
    @keyframes vl-rotate-scroll {
        from { transform: rotate(var(--vl-rotate-from, 0deg)); }
        to   { transform: rotate(var(--vl-rotate-to, 360deg)); }
    }

    /* Wipe reveal on scroll */
    @keyframes vl-wipe-scroll {
        from { clip-path: inset(0 100% 0 0); opacity: 0.3; }
        to   { clip-path: inset(0 0% 0 0); opacity: 1; }
    }

    /* Depth push on scroll: zooms out from front */
    @keyframes vl-depth-push {
        from {
            transform: perspective(var(--vl-depth-perspective, 1000px))
                translateZ(var(--vl-depth-z-from, 80px))
                scale(var(--vl-depth-scale-from, 1.08));
            opacity: var(--vl-opacity-from, 0.3);
        }
        to {
            transform: perspective(var(--vl-depth-perspective, 1000px))
                translateZ(var(--vl-depth-z-to, 0px))
                scale(var(--vl-depth-scale-to, 1));
            opacity: var(--vl-opacity-to, 1);
        }
    }

    /* Skew slide: skewed lateral reveal */
    @keyframes vl-skew-slide {
        from {
            opacity: 0;
            transform: skewX(-8deg) translate3d(2rem, 0, 0);
        }
        to {
            opacity: 1;
            transform: skewX(0deg) translate3d(0, 0, 0);
        }
    }

    /* Drop in: falls from above with spring */
    @keyframes vl-drop-in {
        0%   { opacity: 0; transform: translate3d(0, -2.5rem, 0) scale(0.94); }
        55%  { opacity: 1; transform: translate3d(0, 0.3rem, 0) scale(1.01); }
        75%  { transform: translate3d(0, -0.1rem, 0); }
        100% { transform: translate3d(0, 0, 0) scale(1); }
    }

    /* Hinge: swings on top edge like a door opening */
    @keyframes vl-hinge-down {
        from {
            opacity: 0;
            transform: perspective(600px) rotateX(-70deg);
            transform-origin: top center;
        }
        to {
            opacity: 1;
            transform: perspective(600px) rotateX(0deg);
            transform-origin: top center;
        }
    }

    /* Stagger blur: for use on individual children */
    @keyframes vl-blur-cascade {
        from {
            opacity: 0;
            filter: blur(20px);
            transform: scale(0.92);
        }
        to {
            opacity: 1;
            filter: blur(0);
            transform: scale(1);
        }
    }

    /* Zoom stagger: scale-in for children */
    @keyframes vl-zoom-stagger {
        from {
            opacity: 0;
            transform: scale(0.75) translate3d(0, 1rem, 0);
        }
        to {
            opacity: 1;
            transform: scale(1) translate3d(0, 0, 0);
        }
    }

    /* =========================================================================
       KEYFRAMES  scroll-driven — advanced layout patterns
       ========================================================================= */

    /* Parallax: compatibility alias of vl-parallax-shift (P4d unified defaults ±12%). */
    @keyframes vl-parallax {
        from { transform: translate3d(0, var(--vl-parallax-from, -12%), 0); }
        to   { transform: translate3d(0, var(--vl-parallax-to, 12%), 0); }
    }

    /* Counter-scroll: element moves in the opposite horizontal direction to page scroll */
    @keyframes vl-counter-scroll {
        from { transform: translateX(var(--vl-counter-from, -20%)); }
        to   { transform: translateX(var(--vl-counter-to,   20%)); }
    }

    /* Image reveal: inset clip expands from centre + subtle scale — more dimensional than wipe-reveal */
    @keyframes vl-img-reveal {
        from {
            clip-path: inset(8% 12% round 6px);
            opacity: 0.2;
            transform: scale(1.05);
        }
        to {
            clip-path: inset(0% 0% round 0px);
            opacity: 1;
            transform: scale(1);
        }
    }

    /* Header shrink: fixed header condenses as page scrolls past threshold */
    @keyframes vl-header-shrink {
        from {
            padding-block: var(--vl-header-pad-start, var(--vl-space-md));
            box-shadow: none;
        }
        to {
            padding-block: var(--vl-header-pad-end, 0.3rem);
            box-shadow: 0 2px 20px color-mix(in oklch, black 36%, transparent);
        }
    }

    /* Stacking card push: behind-card scales + dims as next card covers it */
    @keyframes vl-stack-push {
        to {
            scale: var(--vl-stack-scale-to, 0.90);
            filter: brightness(var(--vl-stack-dim-to, 0.78));
        }
    }

    /* Cover-flow tilt: off-centre items angle in 3D */
    @keyframes vl-coverflow-tilt {
        from {
            transform: perspective(1000px) rotateY(var(--vl-coverflow-rot, -30deg)) scale(0.86);
            opacity: 0.55;
        }
        to {
            transform: perspective(1000px) rotateY(0deg) scale(1);
            opacity: 1;
        }
    }

    /* Horizontal travel: track slides left as outer section scrolls */
    @keyframes vl-horizontal-travel {
        from { transform: translateX(0); }
        to   { transform: translateX(var(--vl-h-travel-end, -60vw)); }
    }

    /* List enter: individual item slides + fades in on its own view-timeline */
    @keyframes vl-list-enter {
        from {
            opacity: 0;
            transform: translate3d(var(--vl-list-enter-x, -1.5rem), 0, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    /* =========================================================================
       PRIMITIVE EFFECTS — entrance advanced
       ========================================================================= */
    [vl-effect="spring-up"] {
        animation: vl-spring-up var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-bounce) both;
    }

    [vl-enter~="glide-in"] {
        --vl-enter-name: vl-glide-in;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-expo-out);
    }

    [vl-effect="glide-in"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-glide-in var(--vl-motion-duration) var(--vl-ease-expo-out) both;
    }

    [vl-effect="zoom-blur"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-zoom-blur var(--vl-motion-duration) var(--vl-ease-out-soft) both;
    }

    [vl-effect="slice-in"] {
        animation: vl-slice-in var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    [vl-enter~="unfold"] {
        --vl-enter-name: vl-unfold;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-cinematic);
    }

    [vl-effect="unfold"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-unfold var(--vl-motion-duration) var(--vl-ease-cinematic) both;
    }

    [vl-effect="slide-diagonal"] {
        animation: vl-slide-diagonal var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    [vl-effect="flip-in"] {
        animation: vl-flip-in var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-back-out) both;
    }

    [vl-effect="spring-3d"] {
        animation: vl-spring-3d var(--vl-motion-duration, var(--vl-duration-slower)) var(--vl-ease-bounce) both;
    }

    :is([vl-enter~="spring-3d"], [vl-effect~="spring-3d"]) {
        --vl-enter-name: vl-spring-3d;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-bounce);
    }

    [vl-effect="rise-3d"] {
        --vl-motion-duration: var(--vl-duration-slower);
        animation: vl-rise-3d var(--vl-motion-duration) var(--vl-ease-expo-out) both;
    }

    :is([vl-enter~="rise-3d"], [vl-effect~="rise-3d"]) {
        --vl-enter-name: vl-rise-3d;
        --vl-enter-duration: var(--vl-duration-slower);
        --vl-enter-ease: var(--vl-ease-expo-out);
    }

    [vl-effect="drop-in"] {
        animation: vl-drop-in var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-bounce) both;
    }

    [vl-effect="skew-slide"] {
        animation: vl-skew-slide var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-out-soft) both;
    }

    [vl-effect="hinge-down"] {
        animation: vl-hinge-down var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
        transform-origin: top center;
    }

    /* =========================================================================
       PRIMITIVE EFFECTS — continuous / ambient
       ========================================================================= */
    [vl-effect="pulse-ring"] {
        animation: vl-pulse-ring 2.4s var(--vl-ease-out-soft) infinite;
    }

    [vl-effect="spin-slow"] {
        animation: vl-spin-slow 12s linear infinite;
        transform-origin: center;
    }

    [vl-effect="pendulum"] {
        animation: vl-pendulum 2.2s var(--vl-ease-in-out-smooth) infinite;
        transform-origin: top center;
    }

    [vl-effect="breathe"] {
        animation: vl-breathe 4s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="drift"] {
        animation: vl-drift 8s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="bounce"] {
        animation: vl-bounce 1.4s infinite;
    }

    :is([vl-effect="aurora"], [vl-loop~="aurora"], [vl-loop-effect~="aurora"]) {
        background: linear-gradient(
            135deg,
            color-mix(in oklch, var(--vl-color-primary) 60%, var(--vl-bg-surface)),
            color-mix(in oklch, var(--vl-color-secondary) 55%, var(--vl-bg-main)),
            color-mix(in oklch, var(--vl-color-accent) 50%, var(--vl-bg-surface)),
            color-mix(in oklch, var(--vl-color-primary) 40%, var(--vl-bg-inset))
        );
        background-size: 300% 300%;
    }

    [vl-effect="aurora"] {
        animation: vl-aurora 12s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="gradient-slide"] {
        background-size: 300% 300%;
        animation: vl-gradient-slide 8s var(--vl-ease-in-out-smooth) infinite;
    }

    :is([vl-effect="mesh-pan"], [vl-loop~="mesh-pan"], [vl-loop-effect~="mesh-pan"]) {
        background-image:
            radial-gradient(circle at 15% 20%, color-mix(in oklch, var(--vl-color-primary) 20%, transparent), transparent 45%),
            radial-gradient(circle at 85% 80%, color-mix(in oklch, var(--vl-color-secondary) 22%, transparent), transparent 45%);
        background-size: 180% 180%, 200% 200%;
    }

    [vl-effect="mesh-pan"] {
        animation: vl-mesh-pan 14s var(--vl-ease-in-out-smooth) infinite;
    }

    /* ---- vl-loop / vl-loop-effect channel rules for the ambient effects above ----
       The legacy vl-effect rules set the `animation` shorthand. The channel only sets the
       --vl-loop-* parameters, so the loop composes with vl-enter and vl-exit (03-motion.css).
       Paint (aurora, mesh-pan, shimmer-text, halo-breathe) is shared with the legacy rule. */
    :is([vl-loop~="pulse-ring"], [vl-loop-effect~="pulse-ring"]) {
        --vl-loop-name: vl-pulse-ring;
        --vl-loop-duration: 2.4s;
        --vl-loop-ease: var(--vl-ease-out-soft);
    }

    :is([vl-loop~="spin-slow"], [vl-loop-effect~="spin-slow"]) {
        --vl-loop-name: vl-spin-slow;
        --vl-loop-duration: 12s;
        --vl-loop-ease: linear;
        transform-origin: center;
    }

    :is([vl-loop~="pendulum"], [vl-loop-effect~="pendulum"]) {
        --vl-loop-name: vl-pendulum;
        --vl-loop-duration: 2.2s;
        transform-origin: top center;
    }

    :is([vl-loop~="breathe"], [vl-loop-effect~="breathe"]) {
        --vl-loop-name: vl-breathe;
        --vl-loop-duration: 4s;
    }

    :is([vl-loop~="drift"], [vl-loop-effect~="drift"]) {
        --vl-loop-name: vl-drift;
        --vl-loop-duration: 8s;
    }

    :is([vl-loop~="bounce"], [vl-loop-effect~="bounce"]) {
        --vl-loop-name: vl-bounce;
        --vl-loop-duration: 1.4s;
        --vl-loop-ease: ease;
    }

    :is([vl-loop~="ripple"], [vl-loop-effect~="ripple"]) {
        --vl-loop-name: vl-ripple-pulse;
        --vl-loop-duration: 1.8s;
        --vl-loop-ease: var(--vl-ease-out-soft);
    }

    :is([vl-loop~="levitate-x"], [vl-loop-effect~="levitate-x"]) {
        --vl-loop-name: vl-levitate-x;
        --vl-loop-duration: 4.8s;
    }

    :is([vl-loop~="aurora"], [vl-loop-effect~="aurora"]) {
        --vl-loop-name: vl-aurora;
        --vl-loop-duration: 12s;
    }

    :is([vl-loop~="mesh-pan"], [vl-loop-effect~="mesh-pan"]) {
        --vl-loop-name: vl-mesh-pan;
        --vl-loop-duration: 14s;
    }

    :is([vl-loop~="shimmer-text"], [vl-loop-effect~="shimmer-text"]) {
        --vl-loop-name: vl-shimmer-text;
        --vl-loop-duration: 3s;
    }

    [vl-effect="circle-text-scroll"] {
        --vl-circle-size: clamp(12rem, 34vmin, 20rem);
        --vl-circle-spacing: clamp(0.35rem, 1.2vmin, 0.9rem);
        --vl-circle-font-size: clamp(0.88rem, 2.25vmin, 1.5rem);
        --vl-circle-ease-speed: 52ms;
        --vl-circle-rotate: 0;
        --vl-circle-delayed-rotate: 0;
        position: relative;
        display: grid;
        place-items: center;
        min-height: clamp(14rem, 30vmin, 18rem);
        overflow: hidden;
        isolation: isolate;
        color: var(--vl-text-primary);
        font-family: var(--vl-font-family-display);
        font-size: var(--vl-circle-font-size);
        animation: vl-circle-text-scroll-sync linear both;
        animation-timeline: scroll(root block);
        animation-range: cover 0% cover 100%;
    }

    [vl-effect="circle-text-scroll"] > ul {
        position: relative;
        display: block;
        width: var(--vl-circle-size);
        height: var(--vl-circle-size);
        margin: 0;
        padding: 0;
        list-style: none;
        border-radius: 50%;
        transform: rotate(calc(var(--vl-circle-rotate) * 1turn));
    }

    [vl-effect="circle-text-scroll"] > ul > li {
        position: absolute;
        top: 50%;
        left: 50%;
        line-height: 0;
        text-wrap: nowrap;
        transform-origin: 0 0;
        rotate: var(--vl-circle-item-angle, 0deg);
    }

    [vl-effect="circle-text-scroll"] > ul > li:nth-child(1) { --vl-circle-item-angle: 18deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(2) { --vl-circle-item-angle: 36deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(3) { --vl-circle-item-angle: 54deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(4) { --vl-circle-item-angle: 72deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(5) { --vl-circle-item-angle: 90deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(6) { --vl-circle-item-angle: 108deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(7) { --vl-circle-item-angle: 126deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(8) { --vl-circle-item-angle: 144deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(9) { --vl-circle-item-angle: 162deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(10) { --vl-circle-item-angle: 180deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(11) { --vl-circle-item-angle: 198deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(12) { --vl-circle-item-angle: 216deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(13) { --vl-circle-item-angle: 234deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(14) { --vl-circle-item-angle: 252deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(15) { --vl-circle-item-angle: 270deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(16) { --vl-circle-item-angle: 288deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(17) { --vl-circle-item-angle: 306deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(18) { --vl-circle-item-angle: 324deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(19) { --vl-circle-item-angle: 342deg; }
    [vl-effect="circle-text-scroll"] > ul > li:nth-child(20) { --vl-circle-item-angle: 360deg; }

    [vl-effect="circle-text-scroll"] > ul > li > span {
        --vl-circle-velocity: calc(var(--vl-circle-rotate) - var(--vl-circle-delayed-rotate));
        --vl-circle-spacing-offset: calc(var(--vl-circle-spacing) * -4 * var(--vl-circle-velocity));
        --vl-circle-x: calc(var(--vl-circle-size) / 2 + var(--vl-circle-spacing-offset));
        --vl-circle-y: calc((var(--vl-char-index, 0) * -0.85rem) * var(--vl-circle-velocity));
        --vl-circle-r: calc(90deg * var(--vl-circle-velocity));
        display: inline-block;
        transform: translate(var(--vl-circle-x), var(--vl-circle-y)) rotate(var(--vl-circle-r));
        transform-origin: var(--vl-circle-x) 0;
        transition: --vl-circle-delayed-rotate calc(var(--vl-circle-ease-speed) * var(--vl-char-index, 0)) var(--vl-ease-out-soft);
    }

    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(1) { --vl-char-index: 0; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(2) { --vl-char-index: 1; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(3) { --vl-char-index: 2; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(4) { --vl-char-index: 3; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(5) { --vl-char-index: 4; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(6) { --vl-char-index: 5; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(7) { --vl-char-index: 6; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(8) { --vl-char-index: 7; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(9) { --vl-char-index: 8; }
    [vl-effect="circle-text-scroll"] > ul > li > span:nth-child(10) { --vl-char-index: 9; }

    [vl-effect="circle-text-scroll"] > em {
        position: absolute;
        inset: auto 0 0;
        margin: 0;
        padding: 0.4rem 0.6rem 0.55rem;
        text-align: center;
        font-family: var(--vl-font-family-mono);
        font-size: 0.66rem;
        line-height: 1.35;
        letter-spacing: 0.03em;
        color: var(--vl-text-secondary);
        background: linear-gradient(to top, color-mix(in oklch, var(--vl-bg-main) 88%, transparent), transparent);
        pointer-events: none;
    }

    @supports (animation-timeline: scroll()) {
        [vl-effect="circle-text-scroll"] > em {
            display: none;
        }
    }

    [vl-effect="code-greeting-stack"] {
        position: relative;
        display: grid;
        justify-items: start;
        gap: 0.08em;
        width: min(100%, 38rem);
        margin: 0 auto;
        font-family: var(--vl-font-family-mono);
        font-size: clamp(1rem, 2.7vmin, 1.7rem);
        line-height: 1.1;
        color: color-mix(in oklch, var(--vl-color-primary) 56%, var(--vl-color-secondary));
        user-select: none;
        isolation: isolate;
    }

    [vl-effect="code-greeting-stack"] .vl-code-line {
        margin: 0;
        font: inherit;
        line-height: 1;
        font-weight: 520;
        font-stretch: 102%;
        font-size: 0.98em;
        letter-spacing: -0.01em;
        white-space: nowrap;
        transition:
            font-weight var(--vl-transition-normal) var(--vl-ease-out-soft),
            font-size var(--vl-transition-normal) var(--vl-ease-out-soft),
            font-stretch var(--vl-transition-normal) var(--vl-ease-out-soft),
            letter-spacing var(--vl-transition-normal) var(--vl-ease-out-soft);
    }

    [vl-effect="code-greeting-stack"] .vl-code-greetings {
        position: relative;
        height: 1.18em;
        min-height: 1.18em;
        overflow: hidden;
        width: 100%;
    }

    [vl-effect="code-greeting-stack"] .vl-code-greetings-track {
        display: grid;
        grid-auto-rows: 1.18em;
        gap: 0;
        transition: opacity var(--vl-transition-normal) var(--vl-ease-out-soft);
        will-change: transform, opacity;
    }

    [vl-effect="code-greeting-stack"] .vl-code-greetings-track > span {
        display: block;
        min-height: 1.18em;
        line-height: 1.18em;
        font-weight: 520;
        font-stretch: 102%;
        font-size: 0.98em;
        letter-spacing: -0.01em;
        white-space: nowrap;
        color: var(--vl-code-greeting-color, color-mix(in oklch, var(--vl-color-primary) 70%, white));
        transition:
            font-weight var(--vl-transition-normal) var(--vl-ease-out-soft),
            font-size var(--vl-transition-normal) var(--vl-ease-out-soft),
            font-stretch var(--vl-transition-normal) var(--vl-ease-out-soft),
            letter-spacing var(--vl-transition-normal) var(--vl-ease-out-soft);
    }

    [vl-effect="code-greeting-stack"] .vl-code-greetings-track--base {
        --vl-code-greeting-color: color-mix(in oklch, var(--vl-color-primary) 74%, white);
        animation: vl-code-greeting-cycle 8s steps(1, end) infinite;
    }

    [vl-effect="code-greeting-stack"] .vl-code-greetings-track--hover {
        --vl-code-greeting-color: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 74%, white);
        position: absolute;
        inset: 0;
        opacity: 0;
        animation: vl-code-greeting-cycle 7.2s steps(1, end) infinite;
        animation-play-state: paused;
    }

    [vl-effect="code-greeting-stack"]:is(:hover, :focus-within) .vl-code-line,
    [vl-effect="code-greeting-stack"]:is(:hover, :focus-within) .vl-code-greetings-track > span {
        font-weight: 650;
        font-stretch: 112%;
        font-size: 1.04em;
        letter-spacing: -0.015em;
    }

    [vl-effect="code-greeting-stack"]:is(:hover, :focus-within) .vl-code-greetings-track--base {
        opacity: 0;
        animation-play-state: paused;
    }

    [vl-effect="code-greeting-stack"]:is(:hover, :focus-within) .vl-code-greetings-track--hover {
        opacity: 1;
        animation-play-state: running;
    }

    [vl-effect="code-greeting-stack"] .vl-code-token-plain { color: var(--vl-text-primary); }
    [vl-effect="code-greeting-stack"] .vl-code-token-secondary { color: color-mix(in oklch, var(--vl-color-secondary) 78%, white); }
    [vl-effect="code-greeting-stack"] .vl-code-token-accent { color: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 78%, white); }
    [vl-effect="code-greeting-stack"] .vl-code-token-warm { color: color-mix(in oklch, var(--vl-color-primary) 74%, var(--vl-color-accent, var(--vl-color-secondary))); }

    [vl-effect="text-ring-orbit"] {
        --vl-text-ring-size: clamp(1.8rem, 5.6vw, 3.7rem);
        --vl-text-ring-radius: 1.55em;
        position: relative;
        display: grid;
        place-items: center;
        overflow: hidden;
        isolation: isolate;
        perspective: 600px;
        text-transform: none;
        color: var(--vl-text-primary);
    }

    [vl-effect="text-ring-orbit"] * {
        transform-style: preserve-3d;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-stage {
        position: relative;
        width: min(100%, 20rem);
        height: min(100%, 12rem);
        animation: vl-text-ring-scene 12s linear infinite;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-stage::after {
        content: "";
        position: absolute;
        inset: -7.5em -1.5em;
        background-image: linear-gradient(
            to right,
            transparent 0%,
            transparent 10%,
            color-mix(in oklch, var(--vl-bg-main) 92%, black) 25%,
            color-mix(in oklch, var(--vl-bg-main) 92%, black) 75%,
            transparent 90%,
            transparent 100%
        );
        pointer-events: none;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track {
        position: absolute;
        top: 50%;
        left: 50%;
        translate: -50% -50%;
        font-family: var(--vl-font-family-display);
        font-size: var(--vl-text-ring-size);
        line-height: 1;
        animation: vl-text-ring-track 8s linear infinite;
        user-select: none;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track:nth-child(1) {
        color: color-mix(in oklch, var(--vl-color-primary) 68%, white);
        animation-delay: 0s;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track:nth-child(2) {
        color: color-mix(in oklch, var(--vl-color-secondary) 66%, white);
        animation-delay: -2s;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track:nth-child(3) {
        color: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 70%, white);
        animation-delay: -4s;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track:nth-child(4) {
        color: color-mix(in oklch, var(--vl-color-primary) 46%, var(--vl-color-secondary));
        animation-delay: -6s;
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span {
        position: absolute;
        inset: -1em;
        display: grid;
        place-items: center;
        font-weight: 700;
        transform:
            translateY(calc((var(--vl-ring-index, 0) - 6) * 0.6em))
            rotateY(calc(var(--vl-ring-index, 0) * 20deg))
            translateZ(var(--vl-text-ring-radius))
            rotateZ(-40deg);
    }

    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(1) { --vl-ring-index: 0; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(2) { --vl-ring-index: 1.25; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(3) { --vl-ring-index: 2.5; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(4) { --vl-ring-index: 4.5; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(5) { --vl-ring-index: 5.5; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(6) { --vl-ring-index: 7; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(7) { --vl-ring-index: 8; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(8) { --vl-ring-index: 9; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(9) { --vl-ring-index: 10; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(10) { --vl-ring-index: 11; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(11) { --vl-ring-index: 12; }
    [vl-effect="text-ring-orbit"] .vl-text-ring-track > span:nth-child(12) { --vl-ring-index: 13; }

    /* =========================================================================
       PRIMITIVE EFFECTS — interaction
       ========================================================================= */

    [vl-effect="duotone"] {
        --vl-duotone-a: color-mix(in oklch, var(--vl-color-primary) 78%, white 4%);
        --vl-duotone-b: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 74%, black 10%);
        position: relative;
        display: inline-block;
        isolation: isolate;
        overflow: hidden;
        background-color: var(--vl-duotone-a);
    }

    [vl-effect="duotone"]::after {
        content: "";
        position: absolute;
        inset: 0;
        background-color: color-mix(in oklch, var(--vl-duotone-b) 52%, transparent);
        mix-blend-mode: lighten;
        pointer-events: none;
    }

    [vl-effect="duotone"] > img,
    [vl-effect="duotone"] img {
        position: relative;
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        mix-blend-mode: darken;
        filter: contrast(1.08) saturate(0.9);
    }

    /* Spotlight: uses @property for smooth gradient tracking on hover */
    @property --vl-spotlight-x { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
    @property --vl-spotlight-y { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

    [vl-effect="spotlight"] {
        position: relative;
        overflow: hidden;
        transition:
            --vl-spotlight-x var(--vl-duration-normal) var(--vl-ease-out-soft),
            --vl-spotlight-y var(--vl-duration-normal) var(--vl-ease-out-soft);
    }

    [vl-effect="spotlight"]::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(
            circle at var(--vl-spotlight-x, 50%) var(--vl-spotlight-y, 50%),
            color-mix(in oklch, var(--vl-color-primary) 15%, transparent) 0%,
            transparent 65%
        );
        opacity: 0;
        transition: opacity var(--vl-transition-normal);
        pointer-events: none;
    }

    [vl-effect="spotlight"]:hover::before {
        opacity: 1;
    }

    /* Border beam: conic gradient animated border */
    @property --vl-beam-angle { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

    [vl-effect="border-beam"] {
        position: relative;
        --vl-beam-angle: 0deg;
        animation: vl-border-beam 4s linear infinite;
    }

    [vl-effect="border-beam"]::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        padding: 1px;
        background: conic-gradient(
            from var(--vl-beam-angle),
            transparent 0%,
            color-mix(in oklch, var(--vl-color-primary) 85%, transparent) 18%,
            transparent 36%
        );
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

    /* Press: physical depress feedback */
    [vl-effect="press"] {
        transition: transform var(--vl-duration-fast) var(--vl-ease-back-in), box-shadow var(--vl-duration-fast);
        cursor: pointer;
    }

    [vl-effect="press"]:active {
        transform: scale(0.96) translateY(1px);
        box-shadow: inset 0 2px 6px color-mix(in oklch, var(--vl-color-primary) 20%, transparent);
    }

    [vl-effect="hover-prism"] {
        position: relative;
        transform-style: preserve-3d;
        transition:
            transform var(--vl-duration-normal) var(--vl-ease-back-out),
            box-shadow var(--vl-duration-normal) var(--vl-ease-cinematic),
            filter var(--vl-duration-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-prism"]::after {
        content: "";
        position: absolute;
        inset: -10%;
        background: radial-gradient(circle at center, color-mix(in oklch, var(--vl-color-primary) 24%, transparent), transparent 62%);
        opacity: 0;
        transform: scale(0.92);
        transition:
            opacity var(--vl-duration-normal) var(--vl-ease-cinematic),
            transform var(--vl-duration-normal) var(--vl-ease-cinematic);
        pointer-events: none;
        z-index: -1;
    }

    [vl-effect="hover-prism"]:hover,
    [vl-effect="hover-prism"]:focus-visible {
        transform: perspective(1400px) rotateX(5deg) rotateY(-6deg) translate3d(0, -8px, 0);
        box-shadow: var(--vl-shadow-float), var(--vl-shadow-glow);
        filter: saturate(1.08);
    }

    [vl-effect="hover-prism"]:hover::after,
    [vl-effect="hover-prism"]:focus-visible::after {
        opacity: 1;
        transform: scale(1);
        animation: vl-halo-pulse 2.4s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="hover-depth-press"] {
        transition:
            transform var(--vl-duration-normal) var(--vl-ease-cinematic),
            box-shadow var(--vl-duration-normal) var(--vl-ease-cinematic);
    }

    [vl-effect="hover-depth-press"]:hover,
    [vl-effect="hover-depth-press"]:focus-visible {
        transform: translate3d(0, -6px, 0);
        box-shadow: var(--vl-shadow-float);
    }

    [vl-effect="hover-depth-press"]:active {
        transform: translate3d(0, -1px, 0) scale(0.985);
        box-shadow: inset 0 2px 8px color-mix(in oklch, var(--vl-color-primary) 22%, transparent);
    }

    [vl-effect="glitch-lite"] {
        animation: vl-glitch-lite 700ms steps(2, end) infinite;
    }

    [vl-effect="scanline"] {
        position: relative;
        overflow: clip;
    }

    [vl-effect="scanline"]::before {
        content: "";
        position: absolute;
        inset: -120% 0;
        background: linear-gradient(
            180deg,
            transparent 0%,
            color-mix(in oklch, var(--vl-color-primary) 28%, transparent) 48%,
            transparent 100%
        );
        background-size: 100% 200%;
        animation: vl-scanline-sweep 2.4s linear infinite;
        pointer-events: none;
    }

    [vl-effect="ripple"] {
        animation: vl-ripple-pulse 1.8s var(--vl-ease-out-soft) infinite;
    }

    [vl-effect="levitate-x"] {
        animation: vl-levitate-x 4.8s var(--vl-ease-in-out-smooth) infinite;
    }

    :is([vl-effect="halo-breathe"], [vl-loop~="halo-breathe"], [vl-loop-effect~="halo-breathe"]) {
        position: relative;
        isolation: isolate;
    }

    :is([vl-effect="halo-breathe"], [vl-loop~="halo-breathe"], [vl-loop-effect~="halo-breathe"])::after {
        content: "";
        position: absolute;
        inset: -14%;
        border-radius: inherit;
        background: radial-gradient(circle at center, color-mix(in oklch, var(--vl-color-primary) 26%, transparent), transparent 60%);
        z-index: -1;
        animation: vl-halo-pulse 3s var(--vl-ease-in-out-smooth) infinite;
    }

    [vl-effect="sweep-border"] {
        position: relative;
        border: 1px solid transparent;
        background:
            linear-gradient(var(--vl-bg-surface), var(--vl-bg-surface)) padding-box,
            linear-gradient(90deg, transparent, color-mix(in oklch, var(--vl-color-primary) 75%, transparent), transparent) border-box;
        background-size: auto, 200% 100%;
        animation: vl-sweep-border 2.2s linear infinite;
    }

    /* Shimmer text: gradient sweep on text */
    :is([vl-effect="shimmer-text"], [vl-loop~="shimmer-text"], [vl-loop-effect~="shimmer-text"]) {
        background: linear-gradient(
            90deg,
            var(--vl-text-primary) 0%,
            color-mix(in oklch, var(--vl-color-primary) 90%, white) 35%,
            var(--vl-text-primary) 55%,
            var(--vl-text-primary) 100%
        );
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    [vl-effect="shimmer-text"] {
        animation: vl-shimmer-text 3s var(--vl-ease-in-out-smooth) infinite;
    }

    @property --vl-gradient-text-color-1 {
        syntax: "<color>";
        inherits: false;
        initial-value: currentColor;
    }

    @property --vl-gradient-text-color-2 {
        syntax: "<color>";
        inherits: false;
        initial-value: currentColor;
    }

    @property --vl-circle-rotate {
        syntax: "<number>";
        inherits: true;
        initial-value: 0;
    }

    @property --vl-circle-delayed-rotate {
        syntax: "<number>";
        inherits: true;
        initial-value: 0;
    }

    [vl-effect="gradient-text-color"] {
        --vl-gradient-text-color-1: color-mix(in oklch, var(--vl-color-primary) 74%, var(--vl-color-secondary));
        --vl-gradient-text-color-2: color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 72%, var(--vl-color-primary));
        animation: vl-gradient-text-color-shift 2.2s linear infinite alternate;
        background: linear-gradient(
            to right in oklch,
            var(--vl-gradient-text-color-1),
            var(--vl-gradient-text-color-2)
        );
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
    }

    /* Fallback for browsers without @property support — static gradient instead of animated */
    @supports not (font-tech(color-COLRv1)) {
        /* Use an always-false @supports as proxy for @property support (Safari <15.4) */
    }
    @supports not selector(:has(+ *)) {
        [vl-effect="gradient-text-color"] {
            animation: none;
            background: linear-gradient(
                to right in oklch,
                color-mix(in oklch, var(--vl-color-primary) 74%, var(--vl-color-secondary)),
                color-mix(in oklch, var(--vl-color-accent, var(--vl-color-secondary)) 72%, var(--vl-color-primary))
            );
        }
    }

    /* =========================================================================
       PRIMITIVE EFFECTS — scroll-driven
       ========================================================================= */
    [vl-effect="rotate-scroll"] {
        animation: vl-rotate-scroll linear both;
        animation-timeline: view(block);
        animation-range: cover;
    }

    [vl-effect="wipe-reveal"] {
        animation: vl-wipe-scroll linear both;
        animation-timeline: view(block);
        animation-range: entry 0% cover 50%;
    }

    :is([vl-scroll~="depth-push"], [vl-effect="depth-push"]) {
        --vl-scroll-name: vl-depth-push;
        animation: vl-depth-push linear both;
        animation-timeline: view(block);
        animation-range: var(--vl-range, var(--vl-range-start, entry 0%) var(--vl-range-end, entry 100%));
    }

    /* Parallax — unified onto vl-parallax-shift (typed + legacy). */
    [vl-effect="parallax"] {
        --vl-scroll-name: vl-parallax-shift;
        animation: vl-parallax-shift both linear;
        animation-timeline: view(block);
        animation-range: var(--vl-range, var(--vl-range-start, cover 0%) var(--vl-range-end, cover 100%));
    }

    /* Counter-scroll — element moves in the opposite direction to page scroll */
    [vl-effect="counter-scroll"] {
        animation: vl-counter-scroll linear both;
        animation-timeline: scroll(root block);
        animation-range: 0% 100%;
    }

    /* Image reveal — clip-path expands from centre as element enters the viewport */
    [vl-effect="img-reveal"] {
        animation: vl-img-reveal linear both;
        animation-timeline: view(block);
        animation-range: entry 0% entry 75%;
    }

    /* Header shrink — sticky/fixed bar condenses when the page scrolls */
    [vl-effect="header-shrink"] {
        animation: vl-header-shrink linear both;
        animation-timeline: scroll(root block);
        animation-range: 0px 120px;
    }

    /* =========================================================================
       TEXT SYSTEMS
       ========================================================================= */

    /* Animated gradient text clip */
    .vl-gradient-text {
        background: linear-gradient(
            90deg,
            var(--vl-color-primary),
            var(--vl-color-secondary),
            var(--vl-brand-stone),
            var(--vl-color-primary)
        );
        background-size: 300% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: vl-shimmer-text 5s var(--vl-ease-in-out-smooth) infinite;
    }

    /* Wave text: each child span waves */
    .vl-text-wave {
        display: inline-flex;
        flex-wrap: wrap;
        overflow: hidden;
    }

    .vl-text-wave > span {
        display: inline-block;
        animation: vl-wave-char 1.8s var(--vl-ease-in-out-smooth) infinite;
    }

    .vl-text-wave > span:nth-child(1)  { animation-delay: 0ms; }
    .vl-text-wave > span:nth-child(2)  { animation-delay: 80ms; }
    .vl-text-wave > span:nth-child(3)  { animation-delay: 160ms; }
    .vl-text-wave > span:nth-child(4)  { animation-delay: 240ms; }
    .vl-text-wave > span:nth-child(5)  { animation-delay: 320ms; }
    .vl-text-wave > span:nth-child(6)  { animation-delay: 400ms; }
    .vl-text-wave > span:nth-child(7)  { animation-delay: 480ms; }
    .vl-text-wave > span:nth-child(8)  { animation-delay: 560ms; }
    .vl-text-wave > span:nth-child(9)  { animation-delay: 640ms; }
    .vl-text-wave > span:nth-child(10) { animation-delay: 720ms; }

    /* Split text: each child word rises in */
    .vl-text-split {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 0.25em;
        overflow: hidden;
    }

    .vl-text-split > span {
        display: inline-block;
        animation: vl-word-rise var(--vl-duration-slower) var(--vl-ease-cinematic) both;
    }

    .vl-text-split > span:nth-child(1) { animation-delay: 0ms; }
    .vl-text-split > span:nth-child(2) { animation-delay: 90ms; }
    .vl-text-split > span:nth-child(3) { animation-delay: 180ms; }
    .vl-text-split > span:nth-child(4) { animation-delay: 270ms; }
    .vl-text-split > span:nth-child(5) { animation-delay: 360ms; }
    .vl-text-split > span:nth-child(6) { animation-delay: 450ms; }
    .vl-text-split > span:nth-child(7) { animation-delay: 540ms; }
    .vl-text-split > span:nth-child(8) { animation-delay: 630ms; }

    /* Scroll-driven word split */
    .vl-text-split[vl-timeline="view"] > span {
        animation-timeline: view(block);
        animation-range: entry 10% cover 50%;
    }

    /* =========================================================================
       3D STAGE SYSTEM
       Inspired by pure CSS 3D (amit_sheen style) — zero JavaScript
       ========================================================================= */

    /* Perspective container */
    .vl-3d-stage {
        perspective: var(--vl-3d-perspective, 1000px);
        perspective-origin: var(--vl-3d-origin, 50% 50%);
        transform-style: preserve-3d;
    }

    /* 3D scene: preserves child transforms in 3D space */
    .vl-3d-scene {
        transform-style: preserve-3d;
        transform: rotateX(var(--vl-3d-rot-x, 0deg)) rotateY(var(--vl-3d-rot-y, 0deg));
        transition:
            transform var(--vl-duration-slow) var(--vl-ease-out-soft);
    }

    /* Spinning 3D scene */
    .vl-3d-scene--spin {
        animation: vl-spin-slow 18s linear infinite;
        transform-style: preserve-3d;
    }

    .vl-3d-scene--spin-reverse {
        animation: vl-spin-slow 24s linear infinite reverse;
        transform-style: preserve-3d;
    }

    /* CSS Cube system ─────────────────────────────────────────────── */
    .vl-cube {
        --vl-cube-size: 120px;
        width: var(--vl-cube-size);
        height: var(--vl-cube-size);
        position: relative;
        transform-style: preserve-3d;
        animation: vl-cube-tumble 8s var(--vl-ease-in-out-smooth) infinite;
    }

    @keyframes vl-cube-tumble {
        0%   { transform: rotateX(0deg)   rotateY(0deg); }
        25%  { transform: rotateX(90deg)  rotateY(45deg); }
        50%  { transform: rotateX(180deg) rotateY(180deg); }
        75%  { transform: rotateX(270deg) rotateY(225deg); }
        100% { transform: rotateX(360deg) rotateY(360deg); }
    }

    .vl-cube__face {
        position: absolute;
        width: 100%;
        height: 100%;
        border: 1px solid color-mix(in oklch, var(--vl-color-primary) 40%, transparent);
        background: color-mix(in oklch, var(--vl-bg-surface) 75%, transparent);
        backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--vl-font-family-mono);
        font-size: 0.75rem;
        color: var(--vl-text-secondary);
    }

    .vl-cube__face--front  { transform: translateZ(calc(var(--vl-cube-size) / 2)); }
    .vl-cube__face--back   { transform: rotateY(180deg) translateZ(calc(var(--vl-cube-size) / 2)); }
    .vl-cube__face--left   { transform: rotateY(-90deg) translateZ(calc(var(--vl-cube-size) / 2)); }
    .vl-cube__face--right  { transform: rotateY(90deg)  translateZ(calc(var(--vl-cube-size) / 2)); }
    .vl-cube__face--top    { transform: rotateX(90deg)  translateZ(calc(var(--vl-cube-size) / 2)); }
    .vl-cube__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--vl-cube-size) / 2)); }

    /* Nested cubes (orbit rings) */
    .vl-cube--lg { --vl-cube-size: 200px; }
    .vl-cube--sm { --vl-cube-size: 60px; }
    .vl-cube--xs { --vl-cube-size: 40px; }

    /* Cube with glow */
    .vl-cube--glow .vl-cube__face {
        background: color-mix(in oklch, var(--vl-color-primary) 12%, transparent);
        border-color: color-mix(in oklch, var(--vl-color-primary) 55%, transparent);
        box-shadow: inset 0 0 20px color-mix(in oklch, var(--vl-color-primary) 15%, transparent);
    }

    /* CSS Flip Card system ─────────────────────────────────────────── */
    .vl-flip-card {
        perspective: 1000px;
    }

    .vl-flip-card__inner {
        position: relative;
        transform-style: preserve-3d;
        transition: transform var(--vl-duration-slow) var(--vl-ease-out-soft);
        width: 100%;
        height: 100%;
    }

    .vl-flip-card:hover .vl-flip-card__inner,
    .vl-flip-card[aria-pressed="true"] .vl-flip-card__inner {
        transform: rotateY(180deg);
    }

    .vl-flip-card__front,
    .vl-flip-card__back {
        position: absolute;
        inset: 0;
        -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
        border-radius: inherit;
    }

    .vl-flip-card__back {
        transform: rotateY(180deg);
        background: var(--vl-bg-surface-elevated);
    }

    /* CSS 3D Orbit system ─────────────────────────────────────────── */
    .vl-orbit-system {
        position: relative;
        transform-style: preserve-3d;
    }

    .vl-orbit-ring {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 1px dashed color-mix(in oklch, var(--vl-color-primary) 30%, transparent);
        transform-style: preserve-3d;
        animation: vl-spin-slow var(--vl-orbit-duration, 10s) linear infinite;
    }

    .vl-orbit-ring:nth-child(2) {
        transform: rotateX(60deg);
        animation-duration: 14s;
        animation-direction: reverse;
    }

    .vl-orbit-ring:nth-child(3) {
        transform: rotateX(120deg);
        animation-duration: 18s;
    }

    .vl-orbit-dot {
        position: absolute;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--vl-color-primary);
        top: -4px;
        left: calc(50% - 4px);
        box-shadow: 0 0 8px var(--vl-color-primary);
    }

    /* =========================================================================
       CHILDREN CHOREOGRAPHY EXTENSIONS
       ========================================================================= */

    /* Wave: children animate in a wave pattern (stagger + wave-char keyframe) */
    [vl-children="wave"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-wave-char 1.8s var(--vl-ease-in-out-smooth) infinite;
    }


    /* Blur cascade: children blur-in with stagger */
    [vl-children="blur-cascade"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-blur-cascade var(--vl-duration-slower) var(--vl-ease-out-soft) both;
    }


    /* Zoom stagger: children zoom-scale-in with stagger */
    [vl-children="zoom-stagger"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-zoom-stagger var(--vl-duration-slow) var(--vl-ease-spring) both;
    }


    [vl-children="cinema-stagger"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-glide-in var(--vl-duration-slow) var(--vl-ease-expo-out) both;
    }

    [vl-children="cinema-stagger"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])):nth-child(odd) {
        animation-name: vl-spring-up;
    }


    [vl-children="grid-wave"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-grid-wave 1.6s var(--vl-ease-in-out-smooth) infinite;
    }


    [vl-children="spiral-stagger"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-spiral-stagger var(--vl-duration-slow) var(--vl-ease-back-out) both;
    }


    /* Extra stagger values */
    [vl-stagger="20ms"]  { --vl-stagger-step: 20ms; }
    [vl-stagger="30ms"]  { --vl-stagger-step: 30ms; }
    [vl-stagger="40ms"]  { --vl-stagger-step: 40ms; }
    [vl-stagger="250ms"] { --vl-stagger-step: 250ms; }
    [vl-stagger="300ms"] { --vl-stagger-step: 300ms; }

    /* =========================================================================
       SPEED EXTENSIONS
       ========================================================================= */
    [vl-speed="slower"]  { --vl-motion-duration: var(--vl-duration-slowest, 1200ms); }
    [vl-speed="fastest"] { --vl-motion-duration: var(--vl-duration-fastest, 80ms); }
    [vl-speed="turbo"] { --vl-motion-duration: 60ms; }
    [vl-speed="ultra-slow"] { --vl-motion-duration: 1800ms; }

    /* =========================================================================
       RANGE EXTENSIONS
       ========================================================================= */

    /* Exit range: animate as element exits viewport */
    [vl-range="exit"] {
        animation-range: exit 0% exit 100%;
    }

    [vl-range="exit-short"] {
        animation-range: contain 70% exit 100%;
    }

    /* Center: animate only while element is centered in viewport */
    [vl-range="center"] {
        animation-range: contain 30% contain 70%;
    }

    /* Full: entire cover range */
    [vl-range="full"] {
        animation-range: cover 0% cover 100%;
    }

    [vl-range="entry-micro"] {
        animation-range: entry 20% cover 30%;
    }

    [vl-range="cinema-wide"] {
        animation-range: entry 0% cover 90%;
    }

    /* =========================================================================
       SCROLL-DRIVEN LAYOUT SYSTEMS
       ========================================================================= */

    /* --- Stacking cards ------------------------------------------------------- */
    .vl-stack-cards {
        display: block;
        padding-bottom: var(--vl-stack-bottom, 4rem);
    }

    .vl-stack-card {
        --vl-stack-i: 0;
        position: sticky;
        top: calc(var(--vl-stack-offset, 5rem) + var(--vl-stack-i) * var(--vl-stack-spread, 1.5rem));
        transform-origin: top center;
        z-index: calc(var(--vl-stack-i) + 1);
        animation: vl-stack-push linear both;
        animation-timeline: view(block);
        animation-range: contain 25% exit 0%;
    }

    .vl-stack-cards > :nth-child(1) { --vl-stack-i: 0; }
    .vl-stack-cards > :nth-child(2) { --vl-stack-i: 1; }
    .vl-stack-cards > :nth-child(3) { --vl-stack-i: 2; }
    .vl-stack-cards > :nth-child(4) { --vl-stack-i: 3; }
    .vl-stack-cards > :nth-child(5) { --vl-stack-i: 4; }
    .vl-stack-cards > :nth-child(6) { --vl-stack-i: 5; }
    .vl-stack-cards > :nth-child(7) { --vl-stack-i: 6; }
    .vl-stack-cards > :nth-child(8) { --vl-stack-i: 7; }

    .vl-stack-cards > .vl-stack-card:last-child { animation: none; }

    /* --- Scroll shadows ------------------------------------------------------- */
    .vl-scroll-shadows {
        overflow-y: auto;
        background:
            linear-gradient(color-mix(in oklch, var(--vl-bg-surface) 100%, transparent) 33%, transparent)
                center top    / 100% var(--vl-scroll-shadow-size, 2.5rem) local  no-repeat,
            linear-gradient(transparent, color-mix(in oklch, var(--vl-bg-surface) 100%, transparent) 66%)
                center bottom / 100% var(--vl-scroll-shadow-size, 2.5rem) local  no-repeat,
            radial-gradient(farthest-side at 50% 0%,   color-mix(in oklch, black 28%, transparent), transparent)
                center top    / 100% var(--vl-scroll-shadow-size, 2.5rem) scroll no-repeat,
            radial-gradient(farthest-side at 50% 100%, color-mix(in oklch, black 28%, transparent), transparent)
                center bottom / 100% var(--vl-scroll-shadow-size, 2.5rem) scroll no-repeat;
        background-color: var(--vl-bg-surface);
    }

    .vl-scroll-shadows--x {
        overflow-y: visible;
        overflow-x: auto;
        background:
            linear-gradient(to right, color-mix(in oklch, var(--vl-bg-surface) 100%, transparent) 33%, transparent)
                left  / var(--vl-scroll-shadow-size, 2.5rem) 100% local  no-repeat,
            linear-gradient(to left,  color-mix(in oklch, var(--vl-bg-surface) 100%, transparent) 33%, transparent)
                right / var(--vl-scroll-shadow-size, 2.5rem) 100% local  no-repeat,
            radial-gradient(farthest-side at 0%   50%, color-mix(in oklch, black 28%, transparent), transparent)
                left  / var(--vl-scroll-shadow-size, 2.5rem) 100% scroll no-repeat,
            radial-gradient(farthest-side at 100% 50%, color-mix(in oklch, black 28%, transparent), transparent)
                right / var(--vl-scroll-shadow-size, 2.5rem) 100% scroll no-repeat;
        background-color: var(--vl-bg-surface);
    }

    /* --- Cover flow ----------------------------------------------------------- */
    .vl-cover-flow {
        display: flex;
        gap: var(--vl-coverflow-gap, var(--vl-space-md));
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
        perspective: var(--vl-coverflow-perspective, 1200px);
        padding-block: var(--vl-space-lg);
        padding-inline: max(var(--vl-space-lg), calc(50% - var(--vl-coverflow-item-size, 14rem) / 2));
    }

    .vl-cover-flow::-webkit-scrollbar { display: none; }

    .vl-cover-flow__item {
        flex: 0 0 var(--vl-coverflow-item-size, 14rem);
        scroll-snap-align: center;
        transform-style: preserve-3d;
        overflow: hidden;
        border-radius: var(--vl-radius-md, 0.5rem);
        margin: 0;
        animation: vl-coverflow-tilt linear both;
        animation-timeline: view(inline);
        animation-range: entry 0% entry 100%;
    }

    .vl-cover-flow__item:nth-child(odd)  { --vl-coverflow-rot: -28deg; }
    .vl-cover-flow__item:nth-child(even) { --vl-coverflow-rot:  28deg; }

    /* --- Horizontal section --------------------------------------------------- */
    .vl-horizontal-section {
        height: var(--vl-h-section-height, 300vh);
        timeline-scope: --vl-h-section;
        view-timeline-name: --vl-h-section;
        view-timeline-axis: block;
    }

    .vl-horizontal-section__pin {
        position: sticky;
        top: 0;
        height: 100dvh;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .vl-horizontal-section__track {
        display: flex;
        gap: var(--vl-h-section-gap, var(--vl-space-xl));
        align-items: center;
        will-change: transform;
        animation: vl-horizontal-travel linear both;
        animation-timeline: --vl-h-section;
        animation-range: contain 0% contain 100%;
    }

    /* --- List enter (scroll-driven stagger) ----------------------------------- */
    [vl-children="list-enter"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        animation: vl-list-enter var(--vl-duration-slow) var(--vl-ease-expo-out) both;
        animation-timeline: view(block);
        animation-range: entry 0% entry 60%;
    }

    [vl-children="list-enter-right"] > :where(:not([vl-effect]):not([vl-enter]):not([vl-exit])) {
        --vl-list-enter-x: 1.5rem;
        animation: vl-list-enter var(--vl-duration-slow) var(--vl-ease-expo-out) both;
        animation-timeline: view(block);
        animation-range: entry 0% entry 60%;
    }

    /* --- Scroll markers (CSS-native, Chrome 135+) ----------------------------- */
    :is(.vl-scroll-markers, [vl-scroll-markers]) { scroll-marker-group: after; }

    :is(.vl-scroll-markers, [vl-scroll-markers])::scroll-marker-group {
        display: flex;
        gap: var(--vl-marker-gap, var(--vl-space-xs));
        justify-content: center;
        align-items: center;
        padding-block: var(--vl-space-sm);
        height: calc(var(--vl-marker-h, 0.5rem) + var(--vl-space-sm) * 2);
    }

    :is(.vl-scroll-markers, [vl-scroll-markers]) > *::scroll-marker {
        content: "";
        width: var(--vl-marker-w, 0.5rem);
        height: var(--vl-marker-h, 0.5rem);
        border-radius: 999px;
        background: color-mix(in oklch, var(--vl-color-primary) 30%, var(--vl-bg-surface));
        border: 1px solid color-mix(in oklch, var(--vl-color-primary) 35%, transparent);
        transition:
            width      var(--vl-duration-normal) var(--vl-ease-back-out),
            background var(--vl-duration-normal) var(--vl-ease-out-soft);
    }

    :is(.vl-scroll-markers, [vl-scroll-markers]) > *::scroll-marker:target-current {
        width: var(--vl-marker-w-active, 1.75rem);
        background: var(--vl-color-primary);
        border-color: transparent;
    }

    /* =========================================================================
       GPU hints for new effects
       ========================================================================= */
    [vl-effect="spring-up"],
    [vl-effect="glide-in"],
    [vl-effect="zoom-blur"],
    [vl-effect="slice-in"],
    [vl-effect="unfold"],
    [vl-effect="slide-diagonal"],
    [vl-effect="flip-in"],
    [vl-effect="spring-3d"],
    [vl-effect="rise-3d"],
    [vl-effect="drop-in"],
    [vl-effect="skew-slide"],
    [vl-effect="hinge-down"],
    [vl-effect="cube-triad-stage"],
    [vl-effect="rotate-scroll"],
    [vl-effect="wipe-reveal"],
    [vl-effect="depth-push"],
    [vl-effect="parallax"],
    [vl-effect="counter-scroll"],
    [vl-effect="img-reveal"],
    .vl-stack-card,
    .vl-cover-flow__item,
    .vl-horizontal-section__track,
    [vl-children="list-enter"] > *,
    [vl-children="list-enter-right"] > * {
        will-change: transform, opacity;
    }

    [vl-effect="zoom-blur"],
    [vl-effect="glide-in"],
    .vl-stack-card {
        will-change: transform, opacity, filter;
    }

    /* =========================================================================
       REDUCED MOTION — respects user preference for all new effects
       ========================================================================= */
    @media (prefers-reduced-motion: reduce) {
        [vl-effect="spring-up"],
        [vl-effect="glide-in"],
        [vl-effect="zoom-blur"],
        [vl-effect="slice-in"],
        [vl-effect="unfold"],
        [vl-effect="slide-diagonal"],
        [vl-effect="flip-in"],
        [vl-effect="spring-3d"],
        [vl-effect="rise-3d"],
        [vl-effect="drop-in"],
        [vl-effect="skew-slide"],
        [vl-effect="hinge-down"],
        [vl-effect="img-reveal"] {
            animation: vl-fade-in var(--vl-duration-fast) linear both;
        }

        [vl-effect="parallax"],
        [vl-scroll~="parallax"],
        [vl-effect="counter-scroll"],
        [vl-effect="header-shrink"],
        .vl-stack-card,
        .vl-cover-flow__item,
        [vl-children="list-enter"] > *,
        [vl-children="list-enter-right"] > * {
            animation: none;
        }

        .vl-horizontal-section__track {
            animation: none;
            transform: translateX(0) !important;
        }

        [vl-effect="pulse-ring"],
        [vl-effect="spin-slow"],
        [vl-effect="pendulum"],
        [vl-effect="breathe"],
        [vl-effect="drift"],
        [vl-effect="bounce"],
        [vl-effect="aurora"],
        [vl-effect="circle-text-scroll"],
        [vl-effect="circle-text-scroll"] > ul,
        [vl-effect="code-greeting-stack"] .vl-code-greetings-track,
        [vl-effect="gradient-slide"],
        [vl-effect="gradient-text-color"],
        [vl-effect="mesh-pan"],
        [vl-effect="text-ring-orbit"] .vl-text-ring-stage,
        [vl-effect="text-ring-orbit"] .vl-text-ring-track,
        .vl-text-wave > span,
        .vl-cube,
        .vl-orbit-ring {
            animation: none;
        }

        :is([vl-effect="halo-breathe"], [vl-loop~="halo-breathe"], [vl-loop-effect~="halo-breathe"])::after {
            animation: none;
        }

        [vl-effect="text-ring-orbit"] .vl-text-ring-stage {
            transform: rotateX(20deg);
        }

        [vl-effect="circle-text-scroll"] > ul > li > span {
            transition: none;
            transform: translate(calc(var(--vl-circle-size) / 2), 0) rotate(0deg);
        }

        [vl-effect="code-greeting-stack"] .vl-code-greetings-track {
            transform: translateY(0);
            transition: none;
        }

        [vl-effect="code-greeting-stack"] .vl-code-greetings-track--hover {
            opacity: 0;
        }

        [vl-effect="gradient-text-color"] {
            color: color-mix(in oklch, var(--vl-color-primary) 58%, var(--vl-text-primary));
            -webkit-text-fill-color: currentColor;
            background: none;
        }

        [vl-effect="rotate-scroll"],
        [vl-effect="wipe-reveal"],
        [vl-effect="depth-push"],
        [vl-scroll~="depth-push"] {
            animation: none;
        }

        [vl-children="wave"] > *,
        [vl-children="blur-cascade"] > *,
        [vl-children="zoom-stagger"] > *,
        [vl-children="cinema-stagger"] > * {
            animation: vl-fade-in var(--vl-duration-fast) linear both;
        }

        [vl-effect="hover-prism"]:hover,
        [vl-effect="hover-prism"]:focus-visible,
        [vl-effect="hover-depth-press"]:hover,
        [vl-effect="hover-depth-press"]:focus-visible {
            transform: none;
            box-shadow: none;
            filter: none;
        }

        [vl-effect="hover-prism"]::after {
            display: none;
        }
    }

    /* =========================================================================
       FALLBACK  browsers without scroll-driven animations
       ========================================================================= */
    @supports not (animation-timeline: view(block)) {
        [vl-effect="rotate-scroll"],
        [vl-effect="wipe-reveal"],
        [vl-effect="depth-push"] {
            animation-timeline: auto;
            animation-range: normal;
        }

        [vl-effect="rotate-scroll"] {
            animation: none;
        }

        [vl-effect="wipe-reveal"] {
            animation: vl-slice-in var(--vl-duration-slower) var(--vl-ease-cinematic) both;
        }

        [vl-effect="depth-push"] {
            animation: vl-zoom-blur var(--vl-duration-slower) var(--vl-ease-out-soft) both;
        }
    }

    /* Border beam graceful fallback: if @property/conic-gradient unsupported, show static border */
    @supports not (background: conic-gradient(from 0deg, red, blue)) {
        [vl-effect="border-beam"] {
            border-color: color-mix(in oklch, var(--vl-color-primary) 40%, transparent);
            animation: none;
        }

        [vl-effect="border-beam"]::before {
            display: none;
        }
    } 

    /* =========================================================================
       CINEMATIC TYPOGRAPHY SYSTEM
       Reveal, stagger, masking, split-line, and oversized type motion.
       ========================================================================= */

    /* --- Keyframes: typography-specific --- */

    @keyframes vl-text-rise {
        from {
            opacity: 0;
            transform: translate3d(0, 110%, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes vl-text-mask-up {
        from {
            clip-path: inset(100% 0 0 0);
        }
        to {
            clip-path: inset(0 0 0 0);
        }
    }

    @keyframes vl-text-mask-down {
        from {
            clip-path: inset(0 0 100% 0);
        }
        to {
            clip-path: inset(0 0 0 0);
        }
    }

    @keyframes vl-text-blur-reveal {
        from {
            opacity: 0;
            filter: blur(20px);
            transform: scale(1.1);
        }
        to {
            opacity: 1;
            filter: blur(0);
            transform: scale(1);
        }
    }

    @keyframes vl-text-slide-mask {
        from {
            clip-path: inset(0 100% 0 0);
        }
        to {
            clip-path: inset(0 0 0 0);
        }
    }

    @keyframes vl-text-oversized-drift {
        from {
            opacity: 0;
            transform: translate3d(-2%, 0, 0) scale(1.02);
            filter: blur(4px);
        }
        50% {
            opacity: 1;
            filter: blur(0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
            filter: blur(0);
        }
    }

    @keyframes vl-char-cascade {
        0%   { opacity: 0; transform: translate3d(0, 0.5em, 0); filter: blur(4px); }
        60%  { opacity: 1; filter: blur(0); }
        100% { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
    }

    /* --- Reveal systems --- */

    .vl-text-reveal {
        overflow: hidden;
    }

    .vl-text-reveal > * {
        animation: vl-text-rise var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    .vl-text-reveal[vl-children="stagger"] > * {
        --_i: var(--vl-child-index, 0);
        animation-delay: calc(var(--_i) * var(--vl-stagger-step, 80ms));
    }

    /* --- Mask systems --- */

    .vl-text-mask-up {
        animation: vl-text-mask-up var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    .vl-text-mask-down {
        animation: vl-text-mask-down var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
    }

    .vl-text-slide-mask {
        animation: vl-text-slide-mask var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-silk, var(--vl-ease-cinematic)) both;
    }

    /* --- Blur reveal --- */

    .vl-text-blur-reveal {
        animation: vl-text-blur-reveal var(--vl-motion-duration, var(--vl-duration-slower)) var(--vl-ease-fluid, var(--vl-ease-out-soft)) both;
    }

    /* --- Split-line systems: per-line stagger --- */

    .vl-split-lines {
        overflow: hidden;
    }

    .vl-split-lines > * {
        display: block;
        overflow: hidden;
        animation: vl-text-mask-up var(--vl-motion-duration, var(--vl-duration-slow)) var(--vl-ease-cinematic) both;
        --_i: var(--vl-child-index, 0);
        animation-delay: calc(var(--_i) * var(--vl-stagger-step, 120ms));
    }

    /* --- Oversized cinematic typography --- */

    .vl-type-cinematic {
        font-family: var(--vl-font-family-display);
        font-size: clamp(3rem, 10vw, 8rem);
        font-weight: var(--vl-font-weight-bold, 700);
        line-height: var(--vl-leading-tight, 1.1);
        letter-spacing: var(--vl-tracking-tight, -0.03em);
        animation: vl-text-oversized-drift var(--vl-duration-slower, 800ms) var(--vl-ease-cinematic) both;
    }

    .vl-type-cinematic-hero {
        font-family: var(--vl-font-family-display);
        font-size: clamp(4rem, 14vw, 12rem);
        font-weight: var(--vl-font-weight-bold, 700);
        line-height: 0.95;
        letter-spacing: -0.04em;
        animation: vl-text-blur-reveal var(--vl-duration-slower, 800ms) var(--vl-ease-cinematic) both;
    }

    /* --- Character cascade (with CSS counter/nth-child stagger) --- */

    .vl-char-cascade > span {
        display: inline-block;
        animation: vl-char-cascade var(--vl-duration-slow, 500ms) var(--vl-ease-cinematic) both;
    }

    .vl-char-cascade > span:nth-child(1)  { animation-delay: 0ms; }
    .vl-char-cascade > span:nth-child(2)  { animation-delay: 30ms; }
    .vl-char-cascade > span:nth-child(3)  { animation-delay: 60ms; }
    .vl-char-cascade > span:nth-child(4)  { animation-delay: 90ms; }
    .vl-char-cascade > span:nth-child(5)  { animation-delay: 120ms; }
    .vl-char-cascade > span:nth-child(6)  { animation-delay: 150ms; }
    .vl-char-cascade > span:nth-child(7)  { animation-delay: 180ms; }
    .vl-char-cascade > span:nth-child(8)  { animation-delay: 210ms; }
    .vl-char-cascade > span:nth-child(9)  { animation-delay: 240ms; }
    .vl-char-cascade > span:nth-child(10) { animation-delay: 270ms; }
    .vl-char-cascade > span:nth-child(n+11) {
        animation-delay: calc((var(--vl-child-index, 10) - 1) * 30ms);
    }

    /* --- Scroll-triggered text reveals --- */

    .vl-text-reveal[vl-timeline="view"],
    .vl-text-mask-up[vl-timeline="view"],
    .vl-text-mask-down[vl-timeline="view"],
    .vl-text-blur-reveal[vl-timeline="view"],
    .vl-text-slide-mask[vl-timeline="view"],
    .vl-type-cinematic[vl-timeline="view"],
    .vl-type-cinematic-hero[vl-timeline="view"] {
        animation-timeline: view();
        animation-range: entry 10% entry 60%;
    }

    /* Fallback without sibling-index(): a fixed ladder for the first children. */
    @supports not (width: calc(sibling-index() * 1px)) {
        [vl-children="wave"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step, 80ms)); }
        [vl-children="wave"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step, 80ms)); }
        [vl-children="blur-cascade"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step, 80ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step, 70ms)); }
        [vl-children="zoom-stagger"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step, 70ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step, 90ms)); }
        [vl-children="cinema-stagger"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step, 90ms)); }
        [vl-children="grid-wave"] > *:nth-child(1)  { animation-delay: 0ms; }
        [vl-children="grid-wave"] > *:nth-child(2)  { animation-delay: 80ms; }
        [vl-children="grid-wave"] > *:nth-child(3)  { animation-delay: 160ms; }
        [vl-children="grid-wave"] > *:nth-child(4)  { animation-delay: 240ms; }
        [vl-children="grid-wave"] > *:nth-child(5)  { animation-delay: 320ms; }
        [vl-children="grid-wave"] > *:nth-child(6)  { animation-delay: 400ms; }
        [vl-children="grid-wave"] > *:nth-child(7)  { animation-delay: 480ms; }
        [vl-children="grid-wave"] > *:nth-child(8)  { animation-delay: 560ms; }
        [vl-children="spiral-stagger"] > *:nth-child(1)  { animation-delay: calc(0  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(2)  { animation-delay: calc(1  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(3)  { animation-delay: calc(2  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(4)  { animation-delay: calc(3  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(5)  { animation-delay: calc(4  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(6)  { animation-delay: calc(5  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(7)  { animation-delay: calc(6  * var(--vl-stagger-step, 90ms)); }
        [vl-children="spiral-stagger"] > *:nth-child(8)  { animation-delay: calc(7  * var(--vl-stagger-step, 90ms)); }
    }

    /* The families above declare an `animation` shorthand, which resets delay. Re-apply the shared stagger
       delay (defined once in 03-motion.css) after them. */
    @supports (width: calc(sibling-index() * 1px)) {
        :is([vl-children="wave"], [vl-children="blur-cascade"], [vl-children="zoom-stagger"], [vl-children="cinema-stagger"],
            [vl-children="spiral-stagger"], [vl-children="grid-wave"]) > * {
            animation-delay: var(--_stagger-delay);
        }
    }
}
