/*
 * Scene 1 — phone screen insert + Tron-inspired system gate.
 * scene1-20260441.css — Scene 1→2→3 (mobile arrival into LLM world).
 */

:root {
    color-scheme: dark;
    --alive-glow: 14px;
    --tron-cyan: rgba(64, 240, 255, 0.55);
    --tron-cyan-dim: rgba(64, 240, 255, 0.12);

    /* Desktop plate inset — tuned to photo glass */
    --screen-top-desktop: 24.1%;
    --screen-left-desktop: 64.4%;
    --screen-width-desktop: 11.35%;
    --screen-height-desktop: 46.8%;
    --screen-radius-desktop: 20px;
    --screen-perspective-desktop: 860px;
    --screen-rx-desktop: 1.5deg;
    --screen-ry-desktop: -10deg;
    --screen-rz-desktop: 6deg;
    --screen-skew-x-desktop: 0.45deg;
    --screen-skew-y-desktop: -0.5deg;

    --screen-top-mobile: 25.2%;
    --screen-left-mobile: 45%;
    --screen-width-mobile: 29%;
    --screen-height-mobile: 44%;
    --screen-radius-mobile: 18px;
    --screen-perspective-mobile: 980px;
    --screen-rx-mobile: 1.9deg;
    --screen-ry-mobile: -4.4deg;
    --screen-rz-mobile: 5.1deg;
    --screen-skew-x-mobile: 0.35deg;
    --screen-skew-y-mobile: -0.72deg;

    --screen-top: var(--screen-top-desktop);
    --screen-left: var(--screen-left-desktop);
    --screen-width: var(--screen-width-desktop);
    --screen-height: var(--screen-height-desktop);
    --screen-radius: var(--screen-radius-desktop);
    --screen-per: var(--screen-perspective-desktop);
    --screen-rx: var(--screen-rx-desktop);
    --screen-ry: var(--screen-ry-desktop);
    --screen-rz: var(--screen-rz-desktop);
    --screen-skew-x: var(--screen-skew-x-desktop);
    --screen-skew-y: var(--screen-skew-y-desktop);

    --screen-alignment-outline: none;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #020308;
}

body.scene-1 {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

/* Scene 2: under Scene 1 until active; forward motion = zoom on .scene-layer__bg (not the container) */
#scene2.scene--tunnel {
    z-index: 1;
    opacity: 0;
    transform: scale(1);
    transform-origin: center center;
    transition: opacity 2.2s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    overflow: hidden;
}

/* Phone plate stays on top; portal ride stays low so tunnel can read above it once Scene 2 is active */
#scene1 {
    z-index: 4;
    transform: scale(1);
    opacity: 1;
    transform-origin: center center;
    transition:
        opacity 2.1s cubic-bezier(0.22, 1, 0.36, 1),
        transform 2.5s cubic-bezier(0.18, 1, 0.32, 1);
}

#scene1.scene--exit {
    opacity: 0;
    transform: scale(1.28);
    pointer-events: none;
    filter: saturate(1.15) brightness(1.08);
}

#scene2.scene--active {
    opacity: 1;
    transform: scale(1);
    z-index: 5;
    pointer-events: auto;
}

.scene-layer__bg {
    position: absolute;
    inset: -12%;
    background-color: #020308;
    background-image: url("scene2desktop.JPG");
    background-position: center 42%;
    background-size: cover;
    background-repeat: no-repeat;
    transform-origin: center center;
    will-change: transform;
    transform: scale(0.72);
}

#scene2.scene--active .scene-layer__bg {
    animation: tunnelForwardZoom 4s cubic-bezier(0.06, 0.58, 0.12, 1) forwards;
}

.scene2__status {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-weight: 400;
    font-size: clamp(0.65rem, 2.4vmin, 0.82rem);
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: rgba(160, 230, 255, 0.45);
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1) 2.2s;
    pointer-events: none;
}

#scene2.scene--active .scene2__status {
    opacity: 0.42;
}

/* Scene 3 — desktop: hidden (mobile-only arrival layer) */
@media (min-width: 769px) {
    #scene3.scene--world {
        display: none !important;
    }
}

/* Light portal veil only — stays under Scene 1 (z4) and under active Scene 2 (z5) so tunnel zoom reads */
.scene-ride {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0s linear 0.5s;
}

.scene-ride.scene-ride--on {
    opacity: 0.28;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s;
}

.scene-ride.scene-ride--on.scene-ride--out {
    opacity: 0;
    transition: opacity 1.2s ease 0.1s;
}

.scene-ride__veil {
    position: absolute;
    inset: -10%;
    background: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 0%, rgba(0, 12, 28, 0.45) 55%, rgba(0, 0, 0, 0.65) 100%);
}

.scene-ride__core {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 48%, rgba(180, 255, 255, 0.12) 0%, transparent 42%);
    mix-blend-mode: screen;
    opacity: 0.6;
}

.scene-ride__rings,
.scene-ride__stream,
.scene-ride__sparkfield,
.scene-ride__glint {
    display: none;
}

body.scene-portal-riding #scene1 {
    filter: saturate(1.12);
}

/* Forward rush — aggressive depth: distant tunnel → rushing past you */
@keyframes tunnelForwardZoom {
    0% {
        transform: scale(0.66);
        filter: brightness(0.72) saturate(1.25) contrast(1.08);
    }
    45% {
        filter: brightness(1.02) saturate(1.35) contrast(1.05);
    }
    100% {
        transform: scale(1.34);
        filter: brightness(1.12) saturate(1.22) contrast(1.02);
    }
}

.scene__plate {
    position: absolute;
    inset: 0;
    background-color: #03050a;
    background-image: url("scene1desktop.JPG");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.scene__vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.5) 100%);
    mix-blend-mode: multiply;
}

.screen {
    position: absolute;
    top: var(--screen-top);
    left: var(--screen-left);
    width: var(--screen-width);
    height: var(--screen-height);
    padding: 0;
    margin: 0;
    border: none;
    cursor: pointer;
    background: transparent;
    font: inherit;
    color: inherit;
    overflow: hidden;
    border-radius: var(--screen-radius);
    pointer-events: auto;
    transform: perspective(var(--screen-per)) rotateX(var(--screen-rx)) rotateY(var(--screen-ry)) rotateZ(var(--screen-rz)) skewX(var(--screen-skew-x)) skewY(var(--screen-skew-y));
    transform-origin: center center;
    -webkit-tap-highlight-color: transparent;
    outline: var(--screen-alignment-outline);
    outline-offset: -1px;
    container-type: size;
    animation: desktopShellPulse 2.7s ease-in-out infinite;
}

.screen:focus-visible {
    outline: 1px solid rgba(120, 230, 255, 0.45);
    outline-offset: 2px;
}

.screen.is-engaged .screen__inner {
    filter: brightness(1.06);
    transition: filter 200ms ease;
}

.screen__bezel, .screen__glass { display: none; }

.screen__inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    opacity: 0.94;
    background: radial-gradient(circle at 50% 55%, rgba(8, 45, 66, 0.96), rgba(2, 8, 14, 0.99) 72%);
    box-shadow:
        inset 0 0 14px rgba(80, 220, 255, 0.06),
        inset 0 0 32px rgba(0, 70, 110, 0.1),
        0 0 var(--alive-glow, 14px) rgba(40, 180, 210, 0.05) inset;
}

.screen__shimmer {
    position: absolute;
    inset: -35%;
    opacity: 0.35;
    background: linear-gradient(
        115deg,
        transparent 42%,
        rgba(160, 230, 255, 0.03) 49%,
        rgba(160, 230, 255, 0.06) 50%,
        rgba(160, 230, 255, 0.03) 51%,
        transparent 58%
    );
    animation: shimmerDrift 16s ease-in-out infinite, shimmerFlicker 4.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.screen__tron {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
    opacity: 0.14;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 9px, var(--tron-cyan-dim) 9px, var(--tron-cyan-dim) 10px),
        repeating-linear-gradient(90deg, transparent, transparent 9px, var(--tron-cyan-dim) 9px, var(--tron-cyan-dim) 10px);
    mix-blend-mode: screen;
    animation: tronGridPulse 2.4s ease-in-out infinite;
}

.screen__tron-scan {
    position: absolute;
    left: -5%;
    right: -5%;
    height: 18%;
    top: -20%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(64, 240, 255, 0.04),
        rgba(64, 240, 255, 0.14),
        rgba(64, 240, 255, 0.04),
        transparent
    );
    animation: tronScan 3.1s ease-in-out infinite, tronScanGlow 3.1s ease-in-out infinite;
    opacity: 0.65;
    pointer-events: none;
    z-index: 1;
}

.screen__tron-frame {
    position: absolute;
    inset: 5px;
    border-radius: calc(var(--screen-radius, 18px) - 5px);
    box-shadow:
        0 0 0 1px rgba(64, 240, 255, 0.12) inset,
        0 0 12px rgba(64, 240, 255, 0.06) inset;
    pointer-events: none;
    z-index: 1;
    animation: frameEdgePulse 2.8s ease-in-out infinite;
}

/* Deeper field + occasional horizontal burst — “quantum handoff” */
.screen__quantum {
    position: absolute;
    inset: -10%;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    mix-blend-mode: screen;
    opacity: 0.78;
    background:
        radial-gradient(ellipse 72% 58% at 50% 46%, rgba(100, 255, 255, 0.14) 0%, transparent 58%),
        radial-gradient(ellipse 38% 42% at 50% 54%, rgba(0, 220, 255, 0.1) 0%, transparent 62%),
        radial-gradient(circle at 50% 50%, rgba(0, 80, 120, 0.15) 0%, transparent 70%);
    animation: quantumField 2.2s ease-in-out infinite, quantumSpin 8s linear infinite;
}

.screen__quantum-flash {
    position: absolute;
    inset: -7%;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    mix-blend-mode: plus-lighter;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(120, 255, 255, 0.05) 42%,
        rgba(200, 255, 255, 0.18) 50%,
        rgba(120, 255, 255, 0.05) 58%,
        transparent 100%
    );
    opacity: 0;
    animation: quantumFlashBurst 3.4s steps(1, end) infinite;
}

.screen__system {
    position: relative;
    z-index: 3;
    height: 100%;
    width: 100%;
}

.screen__nodes-wrap {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 16%;
    height: 42%;
    filter: drop-shadow(0 0 5px rgba(64, 240, 255, 0.32));
    animation: graphBloom 2.4s ease-in-out infinite;
}

.screen__graph {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.65;
}

.screen__edge {
    fill: none;
    stroke: url(#edgeGrad);
    stroke-width: 0.28;
    stroke-linecap: round;
    stroke-dasharray: 0.8 3.2;
    animation: edgeBreathMobile 3.2s ease-in-out infinite;
    opacity: 0.38;
}

.screen__edge:nth-child(2) { animation-delay: 0.7s; }
.screen__edge:nth-child(3) { animation-delay: 1.4s; }
.screen__edge:nth-child(4) { animation-delay: 2.1s; }

.screen__node {
    fill: rgba(195, 255, 255, 0.95);
    opacity: 0.55;
    animation: nodePulse 2.7s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.screen__node:nth-child(2) { animation-delay: 0.5s; }
.screen__node:nth-child(3) { animation-delay: 1s; }
.screen__node:nth-child(4) { animation-delay: 1.5s; }

.screen__pulse {
    opacity: 0;
    animation: ringPulse 3.4s ease-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.screen__pulse--alt {
    animation-delay: 1.4s;
    stroke: rgba(120, 255, 255, 0.35);
}

.screen__copy {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    pointer-events: none;
}

.screen__title {
    font-size: clamp(0.28rem, 1.15cqw, 0.45rem);
    letter-spacing: 0.2em;
    font-weight: 600;
    color: rgba(210, 250, 255, 0.72);
    text-shadow:
        0 0 8px rgba(64, 240, 255, 0.35),
        0 0 18px rgba(0, 200, 255, 0.15);
    animation: titleQuantumStrobe 2.8s ease-in-out infinite;
}

.screen__sub {
    font-size: clamp(0.22rem, 0.9cqw, 0.34rem);
    letter-spacing: 0.16em;
    text-transform: lowercase;
    color: rgba(120, 220, 240, 0.42);
    text-shadow: 0 0 6px rgba(64, 240, 255, 0.2);
    animation: subOpacGlitch 2.2s ease-in-out infinite;
}

@media (max-width: 768px) {
    /* Scene 3 — LLM world (under Scene 2 until overlap resolve) */
    #scene3.scene--world {
        z-index: 0;
        opacity: 0;
        transform: scale(1.05);
        transform-origin: center center;
        transition:
            opacity 2.4s cubic-bezier(0.22, 1, 0.36, 1),
            transform 2.5s cubic-bezier(0.2, 1, 0.35, 1);
        pointer-events: none;
        overflow: hidden;
    }

    #scene3.scene--world.scene--active {
        z-index: 3;
        opacity: 1;
        transform: scale(1);
        pointer-events: none;
    }

    body.scene-3-active #scene3.scene--world.scene--active {
        z-index: 6;
    }

    .scene3__layer {
        position: absolute;
        inset: -8%;
        background-color: #020308;
        background-image: url("scene3mobile.jpg");
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
        transform-origin: center center;
        will-change: transform, filter;
        filter: saturate(1.02) contrast(1.03);
    }

    #scene3.scene--world.scene--active .scene3__layer {
        animation: scene3AmbientDrift 8s ease-in-out 2.2s infinite alternate;
    }

    .scene3__status {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        font-weight: 400;
        font-size: clamp(0.55rem, 2.2vmin, 0.72rem);
        letter-spacing: 0.42em;
        text-transform: uppercase;
        color: rgba(160, 230, 255, 0.45);
        opacity: 0;
        transition: opacity 1.6s ease 2.6s;
        pointer-events: none;
    }

    #scene3.scene--world.scene--active .scene3__status {
        opacity: 0.4;
    }

    /* Scene 2 → 3: motion resolves forward; tunnel softens */
    body.scene-3-transitioning #scene2.scene--tunnel.scene--active:not(.scene--departed) {
        opacity: 0.52;
        transform: scale(1.09);
        filter: blur(1.2px) brightness(1.12);
        transition:
            opacity 2.2s cubic-bezier(0.22, 1, 0.36, 1),
            transform 2.4s cubic-bezier(0.2, 1, 0.35, 1),
            filter 2.2s ease;
    }

    body.scene-3-transitioning #scene2.scene--tunnel.scene--active:not(.scene--departed) .scene-layer__bg {
        filter: brightness(1.18) saturate(1.2);
    }

    body.scene-3-transitioning #scene2.scene--tunnel.scene--active:not(.scene--departed) .scene2__status {
        opacity: 0.22;
        transition: opacity 1.4s ease;
    }

    #scene2.scene--tunnel.scene--departed {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .scene-layer__bg {
        background-image: url("scene2mobile.JPG");
    }

    .scene__plate {
        background-image: url("scene1mobile.JPG");
    }

    :root {
        --screen-top: var(--screen-top-mobile);
        --screen-left: var(--screen-left-mobile);
        --screen-width: var(--screen-width-mobile);
        --screen-height: var(--screen-height-mobile);
        --screen-radius: var(--screen-radius-mobile);
        --screen-per: var(--screen-perspective-mobile);
        --screen-rx: var(--screen-rx-mobile);
        --screen-ry: var(--screen-ry-mobile);
        --screen-rz: var(--screen-rz-mobile);
        --screen-skew-x: var(--screen-skew-x-mobile);
        --screen-skew-y: var(--screen-skew-y-mobile);
    }

    .screen {
        background:
            radial-gradient(ellipse 82% 68% at 48% 44%, rgba(0, 100, 120, 0.38), transparent 52%),
            radial-gradient(circle at 50% 52%, rgba(6, 38, 58, 0.96), rgba(0, 6, 14, 0.99) 78%);
        opacity: 0.93;
        box-shadow:
            inset 0 0 18px rgba(64, 240, 255, 0.1),
            inset 0 0 36px rgba(0, 80, 120, 0.12),
            0 0 22px rgba(64, 240, 255, 0.12);
        outline: none;
        filter: saturate(1.08);
        animation: mobileShellPulse 2.6s ease-in-out infinite;
    }

    .screen__inner {
        opacity: 1;
        background: transparent;
        box-shadow:
            0 0 var(--alive-glow, 14px) rgba(64, 240, 255, 0.08) inset,
            0 0 28px rgba(0, 60, 90, 0.2) inset;
    }

    .screen__shimmer {
        opacity: 0.22;
        background: linear-gradient(
            105deg,
            transparent 38%,
            rgba(64, 240, 255, 0.05) 48%,
            rgba(64, 240, 255, 0.12) 50%,
            rgba(64, 240, 255, 0.05) 52%,
            transparent 62%
        );
        animation: shimmerDrift 18s ease-in-out infinite, shimmerFlicker 4.5s ease-in-out infinite;
    }

    .screen__tron {
        opacity: 0.22;
        animation: tronGridPulse 2.4s ease-in-out infinite;
        background-image:
            repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(64, 240, 255, 0.11) 6px, rgba(64, 240, 255, 0.11) 7px),
            repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(64, 240, 255, 0.09) 6px, rgba(64, 240, 255, 0.09) 7px);
    }

    .screen__tron-scan {
        animation: tronScan 3.1s ease-in-out infinite, tronScanGlow 3.1s ease-in-out infinite;
        opacity: 0.72;
    }

    .screen__tron-frame {
        inset: 4px;
        animation: frameEdgePulse 2.8s ease-in-out infinite;
        box-shadow:
            0 0 0 1px rgba(64, 240, 255, 0.22) inset,
            0 0 16px rgba(64, 240, 255, 0.1) inset;
    }

    .screen__quantum {
        inset: -12%;
        opacity: 0.85;
        animation: quantumField 2.2s ease-in-out infinite, quantumSpin 8s linear infinite;
    }

    .screen__quantum-flash {
        inset: -8%;
        animation: quantumFlashBurst 3.4s steps(1, end) infinite;
    }

    .screen__edge {
        opacity: 0.42;
        animation: edgeBreathMobile 3.2s ease-in-out infinite;
    }

    .screen__node {
        fill: rgba(200, 255, 255, 0.95);
        animation: nodePulse 2.6s ease-in-out infinite;
    }

    .screen__pulse {
        animation-duration: 3.4s;
    }

    .screen__system {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding-top: 3%;
        box-sizing: border-box;
    }

    .screen__nodes-wrap {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        width: 72px;
        height: 72px;
        flex-shrink: 0;
        filter: drop-shadow(0 0 6px rgba(64, 240, 255, 0.35));
        animation: graphBloom 2.4s ease-in-out infinite;
    }

    .screen__graph {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0.62;
        transform: scale(0.94);
        transform-origin: center center;
    }

    .screen__copy {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        opacity: 0.62;
        padding: 0 4%;
    }

    .screen__title {
        font-size: 10px;
        letter-spacing: 2.2px;
        opacity: 0.72;
        margin: 0 0 7px;
        font-weight: 600;
        color: rgba(220, 255, 255, 0.92);
        text-shadow:
            0 0 10px rgba(64, 240, 255, 0.55),
            0 0 24px rgba(0, 200, 255, 0.25);
        animation: titleQuantumStrobe 2.8s ease-in-out infinite;
    }

    .screen__sub {
        font-size: 7px;
        opacity: 0.48;
        letter-spacing: 0.14em;
        color: rgba(140, 235, 255, 0.55);
        text-shadow: 0 0 8px rgba(64, 240, 255, 0.25);
        animation: subGlitchPulse 2.2s ease-in-out infinite;
    }
}

/* Wide viewports: same stacked UI as mobile (graph + OPEN SYSTEM) — base used absolute + tiny cqw text */
@media (min-width: 769px) {
    .screen__system {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: clamp(4px, 2.5cqh, 10px);
        padding: 4% 5% 5%;
        box-sizing: border-box;
    }

    .screen__nodes-wrap {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        width: min(68px, 58cqi);
        height: min(68px, 58cqi);
        flex-shrink: 0;
        filter: drop-shadow(0 0 6px rgba(64, 240, 255, 0.35));
        animation: graphBloom 2.4s ease-in-out infinite;
    }

    .screen__graph {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0.62;
        transform: scale(0.94);
        transform-origin: center center;
    }

    .screen__copy {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        padding: 0 4%;
        opacity: 0.72;
    }

    .screen__title {
        font-size: clamp(8px, 12cqw, 11px);
        letter-spacing: 0.18em;
        margin: 0 0 clamp(4px, 1.2cqh, 8px);
        font-weight: 600;
        color: rgba(220, 255, 255, 0.92);
        text-shadow:
            0 0 10px rgba(64, 240, 255, 0.55),
            0 0 24px rgba(0, 200, 255, 0.25);
        animation: titleQuantumStrobe 2.8s ease-in-out infinite;
    }

    .screen__sub {
        font-size: clamp(6px, 9cqw, 8px);
        letter-spacing: 0.14em;
        color: rgba(140, 235, 255, 0.55);
        text-shadow: 0 0 8px rgba(64, 240, 255, 0.25);
        animation: subGlitchPulse 2.2s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen__shimmer,
    .screen__quantum,
    .screen__quantum-flash {
        animation: none !important;
    }
    .screen__quantum {
        opacity: 0.35;
    }
    .screen__quantum-flash {
        opacity: 0;
    }
    .screen {
        animation: none !important;
    }
    .screen__tron {
        animation: none !important;
    }
    .screen__tron-scan {
        animation: tronScan 5.5s ease-in-out infinite !important;
    }
    .screen__tron-frame {
        animation: none !important;
    }
    .screen__tron-scan {
        opacity: 0.5;
    }
    .screen__edge {
        animation: edgeBreath 5.5s ease-in-out infinite !important;
    }
    .screen__node,
    .screen__pulse {
        animation: none !important;
    }
    .screen__node { opacity: 0.45; }
    .screen__title,
    .screen__sub {
        animation: none !important;
    }
    .screen__nodes-wrap {
        animation: none !important;
    }

    #scene2.scene--active .scene-layer__bg {
        animation: none !important;
    }

    #scene1,
    #scene2.scene--tunnel {
        transition-duration: 0.35s !important;
    }

    #scene1.scene--exit {
        filter: none !important;
    }

    .scene-ride {
        display: none !important;
    }

    body.scene-portal-riding #scene1 {
        filter: none !important;
    }
}

@keyframes shimmerDrift {
    0%, 100% {
        transform: translate3d(-4%, 0, 0);
        opacity: 0.22;
    }
    50% {
        transform: translate3d(5%, 1%, 0);
        opacity: 0.38;
    }
}

@keyframes shimmerFlicker {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.34; }
}

@keyframes tronScan {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.35;
    }
    45% {
        transform: translate3d(0, 220%, 0);
        opacity: 0.75;
    }
    55% {
        transform: translate3d(0, 220%, 0);
        opacity: 0.75;
    }
}

@keyframes tronScanGlow {
    0%, 100% { filter: brightness(1); }
    48% { filter: brightness(1.35); }
}

@keyframes tronGridPulse {
    0%, 100% { opacity: 0.18; }
    50% { opacity: 0.28; }
}

@keyframes edgeBreath {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.42; }
}

@keyframes edgeBreathMobile {
    0%, 100% { opacity: 0.32; }
    22% { opacity: 0.52; }
    24% { opacity: 0.28; }
    26% { opacity: 0.48; }
    50% { opacity: 0.46; }
}

@keyframes nodePulse {
    0%, 100% {
        opacity: 0.42;
        transform: scale(0.94);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.06);
    }
}

@keyframes ringPulse {
    0% {
        opacity: 0.28;
        transform: scale(0.6);
    }
    100% {
        opacity: 0;
        transform: scale(2.2);
    }
}

@keyframes quantumField {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.92;
        transform: scale(1.04);
    }
}

@keyframes quantumSpin {
    0% { filter: hue-rotate(0deg) saturate(1); }
    50% { filter: hue-rotate(12deg) saturate(1.15); }
    100% { filter: hue-rotate(0deg) saturate(1); }
}

@keyframes quantumFlashBurst {
    0%, 4%, 8%, 100% { opacity: 0; transform: translate3d(0, -8%, 0) scaleY(0.6); }
    5% { opacity: 0.55; transform: translate3d(0, 42%, 0) scaleY(1.15); }
    6% { opacity: 0.12; transform: translate3d(0, 55%, 0) scaleY(1); }
    25%, 30% { opacity: 0; }
    27% { opacity: 0.35; transform: translate3d(0, 18%, 0) scaleY(1.05); }
    60%, 65% { opacity: 0; }
    62% { opacity: 0.22; transform: translate3d(0, 70%, 0) scaleY(0.95); }
}

/* Desktop insert: no full-bleed plate on `.screen` — pulse via filter + outer glow */
@keyframes desktopShellPulse {
    0%, 100% {
        filter: saturate(1.06) drop-shadow(0 0 6px rgba(40, 200, 255, 0.1));
    }
    50% {
        filter: saturate(1.18) brightness(1.02)
            drop-shadow(0 0 14px rgba(80, 230, 255, 0.28))
            drop-shadow(0 0 26px rgba(0, 150, 200, 0.14));
    }
}

@keyframes mobileShellPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 18px rgba(64, 240, 255, 0.1),
            inset 0 0 36px rgba(0, 80, 120, 0.12),
            0 0 22px rgba(64, 240, 255, 0.12);
        filter: saturate(1.08);
    }
    50% {
        box-shadow:
            inset 0 0 24px rgba(64, 240, 255, 0.2),
            inset 0 0 44px rgba(0, 100, 140, 0.18),
            0 0 38px rgba(100, 240, 255, 0.32),
            0 0 56px rgba(64, 220, 255, 0.18);
        filter: saturate(1.22) brightness(1.04);
    }
}

@keyframes frameEdgePulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(64, 240, 255, 0.22) inset,
            0 0 16px rgba(64, 240, 255, 0.1) inset;
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(120, 255, 255, 0.45) inset,
            0 0 28px rgba(64, 240, 255, 0.22) inset,
            0 0 40px rgba(100, 255, 255, 0.12);
    }
}

@keyframes titleQuantumStrobe {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(64, 240, 255, 0.55),
            0 0 24px rgba(0, 200, 255, 0.25);
        opacity: 0.72;
    }
    12% {
        text-shadow:
            0 0 18px rgba(180, 255, 255, 0.85),
            0 0 36px rgba(0, 240, 255, 0.45),
            0 0 52px rgba(100, 255, 255, 0.2);
        opacity: 0.98;
    }
    14% {
        text-shadow:
            0 0 8px rgba(64, 240, 255, 0.4),
            0 0 20px rgba(0, 200, 255, 0.2);
        opacity: 0.65;
    }
    16% {
        text-shadow:
            0 0 16px rgba(160, 255, 255, 0.75),
            0 0 32px rgba(0, 220, 255, 0.38);
        opacity: 0.95;
    }
    45%, 55% {
        text-shadow:
            0 0 12px rgba(100, 255, 255, 0.65),
            0 0 28px rgba(0, 210, 255, 0.32);
        opacity: 0.88;
    }
}

@keyframes subOpacGlitch {
    0%, 100% { opacity: 0.96; }
    35% { opacity: 1; }
    37% { opacity: 0.8; }
    39% { opacity: 0.94; }
    55% { opacity: 0.98; }
}

@keyframes subGlitchPulse {
    0%, 100% {
        opacity: 0.48;
        letter-spacing: 0.14em;
    }
    40% {
        opacity: 0.62;
        letter-spacing: 0.16em;
    }
    41% {
        opacity: 0.38;
        letter-spacing: 0.12em;
    }
    43% {
        opacity: 0.58;
        letter-spacing: 0.15em;
    }
}

@keyframes graphBloom {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(64, 240, 255, 0.35)) drop-shadow(0 0 14px rgba(0, 180, 220, 0.15));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(120, 255, 255, 0.65)) drop-shadow(0 0 28px rgba(0, 220, 255, 0.28));
    }
}

/* After the main zoom: subtle brightness pulse only (keeps transform from tunnelForwardZoom) */

@keyframes scene3AmbientDrift {
    0% {
        transform: scale(1);
        filter: saturate(1.02) contrast(1.03) brightness(1);
    }
    100% {
        transform: scale(1.02);
        filter: saturate(1.05) contrast(1.04) brightness(1.035);
    }
}

@media (prefers-reduced-motion: reduce) {
    @media (max-width: 768px) {
        #scene3.scene--world,
        #scene3.scene--world.scene--active {
            transition-duration: 0.35s;
        }

        #scene3.scene--world.scene--active .scene3__layer {
            animation: none !important;
        }

        body.scene-3-transitioning #scene2.scene--tunnel.scene--active:not(.scene--departed) {
            filter: none;
            transition-duration: 0.35s;
        }
    }
}
