/* ===== CINEMATIC - Effetti premium ===== */

/* --- Film Grain (CSS-only) --- */
.cinematic-grain {
    position: fixed; inset: 0; z-index: 99998;
    pointer-events: none; mix-blend-mode: overlay;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: repeat; background-size: 256px 256px;
    animation: grainShift 0.3s steps(3) infinite;
}
@keyframes grainShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-2px, 1px) rotate(0.5deg); }
    66% { transform: translate(1px, -1px) rotate(-0.3deg); }
    100% { transform: translate(-1px, 2px) rotate(0.2deg); }
}

/* --- Vignette --- */
.cinematic-vignette {
    position: fixed; inset: 0; z-index: 99997;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* --- Letterbox (cinematic bars) — below navbar (10000) --- */
.cinematic-letterbox {
    position: fixed; left: 0; right: 0; z-index: 9995;
    pointer-events: none;
    background: #000;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}
.cinematic-letterbox--top {
    top: 0; height: 60px;
    transform: translateY(-100%);
}
.cinematic-letterbox--bottom {
    bottom: 0; height: 60px;
    transform: translateY(100%);
}
.cinematic-letterbox.active {
    transform: translateY(0);
}
@media (min-width: 768px) {
    .cinematic-letterbox--top,
    .cinematic-letterbox--bottom { height: 72px; }
}

/* --- Hero Cinematic Enhancements --- */

/* Cinematic gradient overlay - multi-layer depth (over hero-overlay, under content) */
.hero-overlay-cinematic {
    position: absolute; inset: 0; z-index: 3;
    background:
        linear-gradient(to bottom,
            rgba(10,10,10,0.15) 0%,
            rgba(10,10,10,0.30) 30%,
            rgba(10,10,10,0.55) 60%,
            rgba(10,10,10,0.85) 100%
        );
    pointer-events: none;
}

/* Atmospheric light ray */
.hero-lightray {
    position: absolute; top: -20%; right: 10%; z-index: 4;
    width: 2px; height: 140%;
    background: linear-gradient(to bottom,
        rgba(196,163,90,0.20) 0%,
        rgba(196,163,90,0.05) 50%,
        transparent 100%
    );
    transform: rotate(15deg);
    transform-origin: top;
    animation: lightRaySway 12s ease-in-out infinite;
    pointer-events: none;
}
.hero-lightray--2 {
    right: 30%; width: 1px;
    animation-delay: -4s;
    animation-duration: 16s;
}
.hero-lightray--3 {
    right: 55%; width: 3px;
    animation-delay: -8s;
    animation-duration: 14s;
    opacity: 0.6;
}
@keyframes lightRaySway {
    0%, 100% { transform: rotate(12deg) scaleY(1); opacity: 0.6; }
    25% { transform: rotate(18deg) scaleY(1.05); opacity: 1; }
    50% { transform: rotate(14deg) scaleY(0.95); opacity: 0.7; }
    75% { transform: rotate(20deg) scaleY(1.02); opacity: 0.8; }
}

/* Floating dust motes */
.hero-dust-container {
    position: absolute; inset: 0; z-index: 4; overflow: hidden;
    pointer-events: none;
}
.hero-dust {
    position: absolute;
    width: 2px; height: 2px;
    background: rgba(245,240,235,0.4);
    border-radius: 50%;
    animation: dustFloat linear infinite;
}
.hero-dust:nth-child(1) { left: 15%; top: 30%; width: 1.5px; height: 1.5px; animation-duration: 22s; animation-delay: -2s; }
.hero-dust:nth-child(2) { left: 25%; top: 55%; width: 3px; height: 3px; animation-duration: 28s; animation-delay: -7s; }
.hero-dust:nth-child(3) { left: 45%; top: 25%; width: 1px; height: 1px; animation-duration: 18s; animation-delay: -1s; }
.hero-dust:nth-child(4) { left: 60%; top: 60%; width: 2.5px; height: 2.5px; animation-duration: 25s; animation-delay: -5s; }
.hero-dust:nth-child(5) { left: 75%; top: 35%; width: 1.5px; height: 1.5px; animation-duration: 20s; animation-delay: -10s; }
.hero-dust:nth-child(6) { left: 85%; top: 65%; width: 2px; height: 2px; animation-duration: 30s; animation-delay: -3s; }
.hero-dust:nth-child(7) { left: 35%; top: 70%; width: 1px; height: 1px; animation-duration: 24s; animation-delay: -15s; }
.hero-dust:nth-child(8) { left: 50%; top: 40%; width: 2px; height: 2px; animation-duration: 26s; animation-delay: -8s; }
.hero-dust:nth-child(9) { left: 10%; top: 50%; width: 1.5px; height: 1.5px; animation-duration: 19s; animation-delay: -12s; }
.hero-dust:nth-child(10) { left: 70%; top: 20%; width: 3px; height: 3px; animation-duration: 23s; animation-delay: -6s; }

@keyframes dustFloat {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    5% { opacity: 0.6; }
    45% { opacity: 0.4; }
    90% { opacity: 0; }
    100% { transform: translateY(-100vh) translateX(40px) scale(0.5); opacity: 0; }
}

/* Cinematic CTA shine effect */
.hero-actions .btn {
    position: relative; overflow: hidden;
}
.hero-actions .btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}
.hero-actions .btn:hover::before {
    transform: translateX(100%);
}

/* --- Cinematic cursor trail --- */
@media (hover: hover) and (pointer: fine) {
    .cursor-trail {
        position: fixed; pointer-events: none; z-index: 99995;
        width: 120px; height: 120px; border-radius: 50%;
        background: radial-gradient(circle, rgba(196,163,90,0.04) 0%, transparent 70%);
        transform: translate(-50%, -50%);
        transition: opacity 0.5s ease;
        will-change: transform;
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .cinematic-grain { display: none; }
    .hero-lightray { animation: none; opacity: 0.3; }
    .hero-dust { display: none; }
    .cursor-trail { display: none; }
}
