/* ═══════════════════════════════════════════════════════
   VEX HOMEPAGE — Cinematic Intro FULLSCREEN
   ═══════════════════════════════════════════════════════ */

:root {
    --vxhm-gold:        #c9a96e;
    --vxhm-gold-bright: #e8c988;
    --vxhm-gold-soft:   #a88a56;
    --vxhm-dark:        #0a0807;
}

/* Blocca scroll del body mentre l'intro è attiva */
body.vxhm-intro-active {
    overflow: hidden;
}

.vxhm-cinema {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;  /* sopra header e tutto */
    background: var(--vxhm-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    isolation: isolate;
    animation: vxhmCinemaIn 1s ease;
}
.vxhm-cinema.vxhm-closing {
    animation: vxhmCinemaOut 1.2s cubic-bezier(.6, 0, .2, 1) forwards;
}
@keyframes vxhmCinemaIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes vxhmCinemaOut {
    0%   { opacity: 1; transform: scale(1); filter: blur(0); }
    60%  { opacity: 1; transform: scale(1.08); filter: blur(6px); }
    100% { opacity: 0; transform: scale(1.25); filter: blur(20px); }
}

/* ═══════════════════════════════════════════════════════
   SLIDESHOW BACKGROUND
   ═══════════════════════════════════════════════════════ */
.vxhm-bg-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    animation: vxhmBgFadeIn 2s ease 3s forwards;
}
.vxhm-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 2.5s ease;
    will-change: transform, opacity;
}

/* Slide attiva: fade in + zoom lento senza loop */
.vxhm-bg-slide.vxhm-bg-active {
    opacity: 1;
    animation: vxhmKenBurns 10s ease-out forwards;
}

/* Slide in uscita: resta visibile finché si completa il fade-out */
.vxhm-bg-slide.vxhm-bg-leaving {
    opacity: 0;
    /* Mantiene lo zoom corrente — nessun reset */
    animation: vxhmKenBurns 10s ease-out forwards;
    animation-play-state: paused;
}
@keyframes vxhmBgFadeIn { to { opacity: 1; } }
@keyframes vxhmKenBurns {
    from { transform: scale(1.05) translate(0, 0); }
    to   { transform: scale(1.18) translate(-1.5%, -1%); }
}
/* Slide 2: zoom da destra verso sinistra */
.vxhm-bg-slide:nth-child(2).vxhm-bg-active {
    animation: vxhmKenBurns2 8s ease-out forwards;
}

/* Slide 3: zoom verso il basso */
.vxhm-bg-slide:nth-child(3).vxhm-bg-active {
    animation: vxhmKenBurns3 8s ease-out forwards;
}


@keyframes vxhmKenBurns3 {
    from { transform: scale(1.05) translate(0, 0); }
    to   { transform: scale(1.2) translate(0, 1.5%); }
}

/* ═══════════════════════════════════════════════════════
   OVERLAY SCURO + VIGNETTA
   ═══════════════════════════════════════════════════════ */
.vxhm-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,.5) 55%, rgba(0,0,0,.9) 100%),
        linear-gradient(180deg, rgba(10,8,7,.6) 0%, rgba(10,8,7,.3) 50%, rgba(10,8,7,.85) 100%);
}

/* ═══════════════════════════════════════════════════════
   VORTICE DORATO 3D MIGLIORATO
   ═══════════════════════════════════════════════════════ */
.vxhm-vortex {
    position: absolute;
    top: 38%;  /* allineato col logo */
    left: 50%;
    width: min(1000px, 95vw);
    height: min(1000px, 95vw);
    max-width: 95vh;
    max-height: 95vh;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    perspective: 1200px;
    transform-style: preserve-3d;
    animation: vxhmVortexFade 1.2s ease 3.2s forwards;
}

/* Raggi di luce che si aprono */
.vxhm-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 50%;
    background: linear-gradient(to top,
        transparent 0%,
        rgba(232, 201, 136, .8) 40%,
        rgba(255, 245, 210, 1) 100%);
    transform-origin: top center;
    opacity: 0;
    filter: blur(1px);
    animation: vxhmRayPulse 3s ease forwards;
}
.vxhm-ray-1 { transform: translate(-50%, 0) rotate(0deg);   animation-delay: .3s; }
.vxhm-ray-2 { transform: translate(-50%, 0) rotate(90deg);  animation-delay: .5s; }
.vxhm-ray-3 { transform: translate(-50%, 0) rotate(180deg); animation-delay: .7s; }
.vxhm-ray-4 { transform: translate(-50%, 0) rotate(270deg); animation-delay: .9s; }
@keyframes vxhmRayPulse {
    0%   { opacity: 0; height: 0; }
    40%  { opacity: 1; height: 50%; }
    100% { opacity: 0; height: 55%; }
}

/* Anelli rotanti in profondità 3D */
.vxhm-vortex-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    will-change: transform;
}
.vxhm-vortex-ring-1 {
    border-top-color: var(--vxhm-gold-bright);
    border-right-color: var(--vxhm-gold);
    box-shadow: 0 0 60px rgba(232, 201, 136, .4),
                inset 0 0 60px rgba(232, 201, 136, .2);
    animation: vxhmSpin1 3.5s cubic-bezier(.3, .1, .3, 1) forwards;
    filter: blur(.5px);
}
.vxhm-vortex-ring-2 {
    inset: 12%;
    border-width: 1.5px;
    border-top-color: var(--vxhm-gold);
    border-left-color: var(--vxhm-gold-bright);
    box-shadow: 0 0 40px rgba(201, 169, 110, .35);
    animation: vxhmSpin2 3s cubic-bezier(.3, .1, .3, 1) forwards;
}
.vxhm-vortex-ring-3 {
    inset: 25%;
    border-width: 1.2px;
    border-top-color: var(--vxhm-gold-bright);
    border-bottom-color: var(--vxhm-gold);
    box-shadow: 0 0 30px rgba(232, 201, 136, .3);
    animation: vxhmSpin3 2.5s cubic-bezier(.3, .1, .3, 1) forwards;
}
.vxhm-vortex-ring-4 {
    inset: 38%;
    border-width: 1px;
    border-left-color: var(--vxhm-gold);
    border-right-color: var(--vxhm-gold-bright);
    box-shadow: 0 0 25px rgba(201, 169, 110, .25);
    animation: vxhmSpin4 2s cubic-bezier(.3, .1, .3, 1) forwards;
}
@keyframes vxhmSpin1 {
    0%   { transform: rotate(0deg) rotateX(75deg) scale(0); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: rotate(900deg) rotateX(15deg) scale(1); opacity: .85; }
}
@keyframes vxhmSpin2 {
    0%   { transform: rotate(0deg) rotateY(75deg) scale(0); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: rotate(-720deg) rotateY(10deg) scale(1); opacity: .7; }
}
@keyframes vxhmSpin3 {
    0%   { transform: rotate(0deg) rotateX(-60deg) scale(0); opacity: 0; }
    25%  { opacity: 1; }
    100% { transform: rotate(540deg) rotateX(5deg) scale(1); opacity: .55; }
}
@keyframes vxhmSpin4 {
    0%   { transform: rotate(0deg) scale(0); opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: rotate(-360deg) scale(1); opacity: .4; }
}

/* Core luminoso centrale */
.vxhm-vortex-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12%;
    height: 12%;
    background: radial-gradient(circle,
        #fff 0%,
        var(--vxhm-gold-bright) 30%,
        var(--vxhm-gold) 60%,
        transparent 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    filter: blur(4px);
    animation: vxhmCorePulse 3s ease forwards;
}
@keyframes vxhmCorePulse {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    60%  { transform: translate(-50%, -50%) scale(.8); opacity: .8; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* Glow esterno */
.vxhm-vortex-glow {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle,
        var(--vxhm-gold-bright) 0%,
        var(--vxhm-gold) 40%,
        transparent 75%);
    filter: blur(50px);
    opacity: 0;
    animation: vxhmGlow 3.5s ease forwards;
}
@keyframes vxhmGlow {
    0%   { opacity: 0; transform: scale(.2); }
    50%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: .2; transform: scale(.6); }
}

@keyframes vxhmVortexFade {
    to { opacity: 0; transform: translate(-50%, -50%) scale(2.2); filter: blur(20px); }
}

/* ═══════════════════════════════════════════════════════
   STAGE: LOGO + TESTI + HINT
   ═══════════════════════════════════════════════════════ */
.vxhm-stage {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-top: 2vh;    /* logo più in alto */
    pointer-events: none;
    width: 100%;
    max-width: 700px;
}

/* Logo — 600x600 ma responsive */
.vxhm-logo {
    width: min(600px, 70vw);
    max-width: min(600px, 70vh);
    height: auto;
    display: block;
    filter: drop-shadow(0 0 50px rgba(201, 169, 110, .6))
            drop-shadow(0 25px 70px rgba(0, 0, 0, .7));
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    animation: vxhmLogoEmerge 2.8s cubic-bezier(.2, .8, .2, 1) 1.6s forwards,
               vxhmLogoFloat 6s ease-in-out 5.5s infinite;
    will-change: transform, opacity, filter;
    margin-bottom: -40px;  /* riduce spazio sotto al logo (cerchio nero del png) */
}
@keyframes vxhmLogoEmerge {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
        filter: blur(25px) drop-shadow(0 0 60px var(--vxhm-gold-bright));
    }
    40% {
        opacity: 1;
        transform: scale(1.15) rotate(-15deg);
        filter: blur(8px) drop-shadow(0 0 100px var(--vxhm-gold-bright));
    }
    70% {
        transform: scale(.96) rotate(5deg);
        filter: blur(1px) drop-shadow(0 0 60px var(--vxhm-gold));
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0) drop-shadow(0 0 50px rgba(201, 169, 110, .6))
                        drop-shadow(0 25px 70px rgba(0, 0, 0, .7));
    }
}
@keyframes vxhmLogoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* Block testi sotto */
.vxhm-text-block {
    text-align: center;
    opacity: 0;
    animation: vxhmTextIn 1.4s ease 4.8s forwards;
    margin-top: 20px;
}
@keyframes vxhmTextIn {
    from { opacity: 0; transform: translateY(25px); }
    to   { opacity: 1; transform: translateY(0); }
}

.vxhm-brand {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 300;
    letter-spacing: 6px;
    line-height: 1;
    margin: 0 0 14px;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 4px 30px rgba(0, 0, 0, .8),
                 0 0 40px rgba(201, 169, 110, .25);
}
.vxhm-brand span {
    font-weight: 700;
    color: var(--vxhm-gold-bright);
    margin-left: 6px;
    letter-spacing: 8px;
}

.vxhm-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(12px, 1.3vw, 14.5px);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    padding: 10px 22px;
    background: rgba(10, 8, 7, .45);
    border: 1px solid rgba(201, 169, 110, .35);
    border-radius: 99px;
    backdrop-filter: blur(12px);
    margin: 0;
}
.vxhm-meta svg { color: var(--vxhm-gold-bright); flex-shrink: 0; }
.vxhm-dot { color: var(--vxhm-gold); margin: 0 2px; }

/* Hint "clicca per entrare" */
.vxhm-hint {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
    opacity: 0;
    animation: vxhmHintIn 1s ease 6.5s forwards,
               vxhmHintPulse 2.5s ease-in-out 7.5s infinite;
}
.vxhm-hint svg { color: var(--vxhm-gold-bright); }
@keyframes vxhmHintIn {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to   { opacity: .7; transform: translate(-50%, 0); }
}
@keyframes vxhmHintPulse {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   TRANSITION FINALE AL CLICK
   ═══════════════════════════════════════════════════════ */
.vxhm-transition {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: radial-gradient(circle at center,
        var(--vxhm-gold-bright) 0%,
        var(--vxhm-gold) 30%,
        var(--vxhm-dark) 100%);
    opacity: 0;
    pointer-events: none;
}
.vxhm-closing .vxhm-transition {
    animation: vxhmTransFlash 1.2s cubic-bezier(.6, 0, .2, 1) forwards;
}
@keyframes vxhmTransFlash {
    0%   { opacity: 0; transform: scale(.5); }
    40%  { opacity: .9; transform: scale(1); }
    100% { opacity: 0; transform: scale(2); }
}

/* ═══════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .vxhm-logo, .vxhm-text-block, .vxhm-hint,
    .vxhm-bg-stage, .vxhm-bg-slide {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .vxhm-hint { transform: translateX(-50%) !important; }
    .vxhm-vortex { display: none; }
    .vxhm-bg-slide.vxhm-bg-active { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .vxhm-logo { width: min(400px, 78vw); margin-bottom: -30px; }
    .vxhm-brand { letter-spacing: 4px; }
    .vxhm-brand span { letter-spacing: 5px; }
    .vxhm-meta {
        font-size: 10.5px;
        letter-spacing: 2px;
        padding: 8px 14px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .vxhm-hint { font-size: 9.5px; letter-spacing: 3px; }
}