/* ============================================
   VASTU SACRED INTRO — THREE.JS CINEMATIC
   Realistic 3D Pyramid Experience
   ============================================ */

/* Intro Overlay */
#vastu-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a0845 0%, #0d0030 50%, #0a0028 100%);
}

#vastu-intro.intro-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#vastu-intro.intro-removed {
    display: none !important;
}

/* Three.js Canvas */
#vastu-intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Overlay Gradient (top + bottom vignette) */
.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(60, 20, 140, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(20, 40, 120, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at center, transparent 35%, rgba(5, 0, 20, 0.7) 100%),
        linear-gradient(to bottom, rgba(10, 0, 40, 0.4) 0%, transparent 25%, transparent 75%, rgba(5, 0, 20, 0.6) 100%);
}

/* Energy Beam from Top */
.intro-energy-beam {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 55%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    animation: beamFadeIn 2s ease 1s forwards;
}

@keyframes beamFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.beam-core {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(212, 175, 55, 0.8) 40%, rgba(212, 175, 55, 0.3) 80%, transparent);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8), 0 0 20px rgba(212, 175, 55, 0.4);
    animation: beamPulse 2s ease-in-out infinite;
}

@keyframes beamPulse {
    0%, 100% { opacity: 0.8; transform: translateX(-50%) scaleX(1); }
    50% { opacity: 1; transform: translateX(-50%) scaleX(1.5); }
}

.beam-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1) 50%, transparent 90%);
    filter: blur(8px);
    animation: beamGlowPulse 3s ease-in-out infinite;
}

@keyframes beamGlowPulse {
    0%, 100% { opacity: 0.5; width: 30px; }
    50% { opacity: 0.8; width: 45px; }
}

.beam-particles {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    overflow: hidden;
}

.beam-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 0 6px #d4af37, 0 0 12px rgba(212, 175, 55, 0.5);
    animation: beamParticleFall 1.5s linear infinite;
    left: 50%;
}

.beam-particles span:nth-child(1) { animation-delay: 0s; left: 30%; }
.beam-particles span:nth-child(2) { animation-delay: 0.15s; left: 70%; }
.beam-particles span:nth-child(3) { animation-delay: 0.3s; left: 45%; }
.beam-particles span:nth-child(4) { animation-delay: 0.5s; left: 55%; }
.beam-particles span:nth-child(5) { animation-delay: 0.7s; left: 35%; }
.beam-particles span:nth-child(6) { animation-delay: 0.85s; left: 65%; }
.beam-particles span:nth-child(7) { animation-delay: 1.0s; left: 50%; }
.beam-particles span:nth-child(8) { animation-delay: 1.15s; left: 40%; }
.beam-particles span:nth-child(9) { animation-delay: 1.3s; left: 60%; }
.beam-particles span:nth-child(10) { animation-delay: 1.45s; left: 48%; }

@keyframes beamParticleFall {
    0% { top: -5%; opacity: 0; transform: scale(0.5); }
    10% { opacity: 1; transform: scale(1); }
    90% { opacity: 1; transform: scale(1.2); }
    100% { top: 100%; opacity: 0; transform: scale(0.3); }
}

/* Sacred Geometry SVG Overlay */
.intro-sacred-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    z-index: 3;
    opacity: 0.12;
    animation: sacredSpin 60s linear infinite;
    pointer-events: none;
}

@keyframes sacredSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* CTA Content */
.intro-content {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    width: 90%;
    max-width: 600px;
}

.intro-tagline {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.6);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(20px);
}

.intro-heading {
    font-family: 'Cinzel', serif;
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 8px;
    text-shadow: 0 0 60px rgba(212, 175, 55, 0.2);
    opacity: 0;
    transform: translateY(20px);
}

.intro-heading em {
    font-style: normal;
    color: #d4af37;
}

.intro-subheading {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    margin-bottom: 35px;
    opacity: 0;
    transform: translateY(20px);
}

/* Enter Button */
.intro-enter-btn {
    display: inline-block;
    position: relative;
    padding: 16px 52px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.35);
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    backdrop-filter: blur(4px);
}

.intro-enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.12), transparent);
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.intro-enter-btn:hover {
    border-color: rgba(212, 175, 55, 0.9);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.15), 0 0 80px rgba(212, 175, 55, 0.05);
    color: #f5d96a;
    text-decoration: none;
    transform: translateY(-2px) !important;
}

/* Scroll Indicator */
.intro-scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    opacity: 0;
}

.intro-scroll-hint span {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 8px;
}

.intro-scroll-line {
    width: 1px;
    height: 40px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.5), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* Portal Flash */
.intro-portal-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    background: radial-gradient(circle at center, #d4af37, #fff);
    opacity: 0;
    pointer-events: none;
}

/* Vastu Grid Transition */
.intro-vastu-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 45;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.intro-vastu-grid.active {
    opacity: 1;
}

.grid-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
    transform: scale(0);
    transition: none;
}

.grid-h {
    left: 0;
    width: 100%;
    height: 1px;
}

.grid-v {
    top: 0;
    height: 100%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.6), transparent);
}

.grid-h1 { top: 20%; }
.grid-h2 { top: 35%; }
.grid-h3 { top: 50%; }
.grid-h4 { top: 65%; }
.grid-h5 { top: 80%; }

.grid-v1 { left: 15%; }
.grid-v2 { left: 30%; }
.grid-v3 { left: 50%; }
.grid-v4 { left: 70%; }
.grid-v5 { left: 85%; }

.intro-vastu-grid.active .grid-line {
    animation: gridExpand 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.intro-vastu-grid.active .grid-h { transform-origin: center center; }
.intro-vastu-grid.active .grid-v { transform-origin: center center; }

.intro-vastu-grid.active .grid-h1 { animation-delay: 0s; }
.intro-vastu-grid.active .grid-h2 { animation-delay: 0.05s; }
.intro-vastu-grid.active .grid-h3 { animation-delay: 0.1s; }
.intro-vastu-grid.active .grid-h4 { animation-delay: 0.15s; }
.intro-vastu-grid.active .grid-h5 { animation-delay: 0.2s; }
.intro-vastu-grid.active .grid-v1 { animation-delay: 0.08s; }
.intro-vastu-grid.active .grid-v2 { animation-delay: 0.13s; }
.intro-vastu-grid.active .grid-v3 { animation-delay: 0.03s; }
.intro-vastu-grid.active .grid-v4 { animation-delay: 0.16s; }
.intro-vastu-grid.active .grid-v5 { animation-delay: 0.1s; }

@keyframes gridExpand {
    0% { transform: scale(0); opacity: 0; }
    30% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.grid-center-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.4);
    pointer-events: none;
    opacity: 0;
}

.intro-vastu-grid.active .grid-center-pulse {
    animation: gridPulseOut 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes gridPulseOut {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

/* Loading State */
.intro-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
}

.intro-loader-ring {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(212, 175, 55, 0.1);
    border-top-color: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: loaderSpin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

.intro-loader-text {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(212, 175, 55, 0.5);
    text-transform: uppercase;
}

/* Body lock */
body.intro-active {
    overflow: hidden;
}

body.intro-active #floating-enquiry-btn,
body.intro-active #floating-enquiry-panel {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-heading {
        font-size: 26px;
    }
    .intro-tagline {
        font-size: 10px;
        letter-spacing: 5px;
    }
    .intro-subheading {
        font-size: 12px;
    }
    .intro-enter-btn {
        padding: 14px 36px;
        font-size: 11px;
        letter-spacing: 3px;
    }
    .intro-sacred-svg {
        width: 400px;
        height: 400px;
    }
    .intro-content {
        bottom: 15%;
    }
}

@media (max-width: 480px) {
    .intro-heading {
        font-size: 22px;
    }
    .intro-content {
        bottom: 18%;
    }
    .intro-enter-btn {
        padding: 12px 28px;
        font-size: 10px;
    }
}
