/* VNDEL 3D layer: subtle depth for desktop pointers only.
   Tilt + parallax are driven by CSS variables set in assets/js/vn-3d.js.
   Remove the <link> in includes/common/overwrites/seo.tpl to disable. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {

    /* ---- cards: perspective tilt with layered depth ---- */
    body.lagom .package-col { perspective: 1100px; }
    body.lagom .package.package-link,
    body.lagom .tile {
        transform-style: preserve-3d;
        transform: rotateX(var(--vn-rx, 0deg)) rotateY(var(--vn-ry, 0deg)) translate3d(0, var(--vn-ty, 0px), 0);
        transition: transform .18s ease-out, box-shadow .35s var(--vn-ease, ease), border-color .35s ease;
        will-change: transform;
    }
    body.lagom .package.package-link:hover,
    body.lagom .tile:hover {
        --vn-ty: -6px;
        transform: rotateX(var(--vn-rx, 0deg)) rotateY(var(--vn-ry, 0deg)) translate3d(0, var(--vn-ty, 0px), 0);
        box-shadow: 0 28px 50px -22px rgba(0, 0, 0, .75), 0 0 0 1px rgba(129, 140, 248, .35);
    }
    body.lagom .package.package-link .package-graphic,
    body.lagom .package.package-link .package-illustration,
    body.lagom .package.package-link img.package-media {
        transform: translateZ(46px);
        transition: transform .3s var(--vn-ease, ease);
    }
    body.lagom .package.package-link .package-title { transform: translateZ(28px); }
    body.lagom .package.package-link .package-actions { transform: translateZ(18px); }
    body.lagom .tile .tile-stat { transform: translateZ(30px); }
    body.lagom .tile .tile-icon-absolute { transform: translateZ(18px); }

    /* ---- hero: illustrations drift opposite to the pointer ---- */
    body.lagom [data-site-banner] .graphic-background-left {
        transform: translate3d(calc(var(--vn-px, 0) * 22px), calc(var(--vn-py, 0) * 12px), 0);
        transition: transform .35s ease-out;
    }
    body.lagom [data-site-banner] .graphic-background-right {
        transform: translate3d(calc(var(--vn-px, 0) * -22px), calc(var(--vn-py, 0) * 12px), 0);
        transition: transform .35s ease-out;
    }
    body.lagom [data-site-banner] .banner-body {
        transform: translate3d(calc(var(--vn-px, 0) * -6px), calc(var(--vn-py, 0) * -4px), 0);
        transition: transform .35s ease-out;
    }
}

/* ==========================================================================
   Hero server rack (pure CSS 3D). Built by vn-3d.js on wide desktop screens
   only; elsewhere the stock hero illustration stays untouched.
   ========================================================================== */
[data-site-banner].vn-rack-on .graphic-background-center { opacity: 0; visibility: hidden; }

.vn-rack {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 420px;
    height: 360px;
    margin-left: -210px;
    pointer-events: none;
    z-index: 3;
    perspective: 1300px;
}
.vn-rack::before {               /* glow on the floor */
    content: "";
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 380px;
    height: 70px;
    margin-left: -190px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, .55) 0%, rgba(99, 102, 241, .18) 45%, transparent 72%);
    filter: blur(6px);
}
.vn-rack-pointer {
    position: absolute;
    left: 50%;
    bottom: 64px;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: rotateX(calc(var(--vn-py, 0) * -6deg)) rotateY(calc(var(--vn-px, 0) * 16deg));
    transition: transform .3s ease-out;
}
.vn-rack-sway {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: rotateX(-14deg) rotateY(-26deg);
    animation: vnRackSway 11s ease-in-out infinite alternate;
}
@keyframes vnRackSway {
    from { transform: rotateX(-14deg) rotateY(-40deg); }
    to   { transform: rotateX(-14deg) rotateY(-12deg); }
}
.vn-base {
    position: absolute;
    left: -150px;
    top: 0;
    width: 300px;
    height: 220px;
    margin-top: -110px;
    border-radius: 14px;
    transform: rotateX(90deg) translateZ(-1px);
    background: linear-gradient(135deg, rgba(79, 70, 229, .35), rgba(15, 19, 29, .9));
    border: 1px solid rgba(129, 140, 248, .35);
    box-shadow: 0 0 40px rgba(99, 102, 241, .35);
}
.vn-unit {
    position: absolute;
    left: -120px;
    top: -44px;
    width: 240px;
    height: 44px;
    transform-style: preserve-3d;
    transform: translateY(calc(var(--i) * -58px - 12px));
}
.vn-unit .f {
    position: absolute;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(129, 140, 248, .28);
}
.vn-unit .f-front  { width: 240px; height: 44px; transform: translateZ(85px);
    background: linear-gradient(180deg, #252d44 0%, #161c2e 100%); border-radius: 4px; }
.vn-unit .f-back   { width: 240px; height: 44px; transform: rotateY(180deg) translateZ(85px); background: #10141f; }
.vn-unit .f-left   { width: 170px; height: 44px; left: 35px; transform: rotateY(-90deg) translateZ(120px);
    background: linear-gradient(90deg, #121726, #1b2238); }
.vn-unit .f-right  { width: 170px; height: 44px; left: 35px; transform: rotateY(90deg) translateZ(120px);
    background: linear-gradient(90deg, #1b2238, #0f1320); }
.vn-unit .f-top    { width: 240px; height: 170px; top: -63px; transform: rotateX(90deg) translateZ(22px);
    background: linear-gradient(180deg, #2b3552, #1c2440); }
.vn-unit .f-bottom { width: 240px; height: 170px; top: -63px; transform: rotateX(-90deg) translateZ(22px); background: #0b0e16; }

/* front panel details: vents, drive bays, status LEDs */
.vn-unit .bays {
    position: absolute;
    left: 12px;
    top: 10px;
    width: 120px;
    height: 22px;
    border-radius: 3px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .10) 0 24px, transparent 24px 30px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.vn-unit .bays::after {
    content: "";
    position: absolute;
    right: -62px;
    top: 7px;
    width: 52px;
    height: 8px;
    border-radius: 2px;
    background: repeating-linear-gradient(90deg, rgba(129, 140, 248, .35) 0 3px, transparent 3px 7px);
}
.vn-unit .led {
    position: absolute;
    top: 19px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: vnBlink 2.4s ease-in-out infinite;
    animation-delay: calc(var(--i) * .43s);
}
.vn-unit .l1 { right: 14px; background: #34d399; box-shadow: 0 0 9px #34d399; }
.vn-unit .l2 { right: 28px; background: #818cf8; box-shadow: 0 0 9px #818cf8; animation-duration: 1.7s; }
.vn-unit .l3 { right: 42px; background: #fbbf24; box-shadow: 0 0 9px #fbbf24; animation-duration: 3.1s; }
@keyframes vnBlink {
    0%, 100% { opacity: 1; }
    46%      { opacity: .25; }
    52%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .vn-rack-sway, .vn-unit .led { animation: none; }
}
