/* ==========================================================================
   AsiaPhone Portal - Cinematic Animations & Visual Transitions
   ========================================================================== */

:root {
    --bg-void: #03050b;
    --neon-cyan: #00f2fe;
    --neon-azure: #4facfe;
    --neon-purple: #9b51e0;
    --neon-magenta: #ff007f;
    --glass-panel: rgba(18, 24, 43, 0.45);
    --glass-border: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-void);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    user-select: none;
}

/* ==========================================================================
   Intro Reveal Sequence & Transitions
   ========================================================================== */

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeOutIntro 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.intro-ring {
    width: 80px;
    height: 80px;
    border: 3px solid var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 40px var(--neon-cyan);
    animation: explodeRing 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes explodeRing {
    0% { transform: scale(0.1); opacity: 1; }
    70% { transform: scale(15); opacity: 0.8; border-width: 20px; }
    100% { transform: scale(35); opacity: 0; }
}

@keyframes fadeOutIntro {
    to { opacity: 0; visibility: hidden; }
}

/* ==========================================================================
   Particle Canvas & Ambient Universe
   ========================================================================== */

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.ambient-universe {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: nebulaDrift 20s infinite alternate ease-in-out;
}

.nebula-cyan {
    top: -20%;
    left: 10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 65%);
}

.nebula-magenta {
    bottom: -20%;
    right: -10%;
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle, var(--neon-magenta) 0%, transparent 65%);
    animation-delay: -7s;
    animation-duration: 24s;
}

.nebula-purple {
    top: 30%;
    left: 35%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--neon-purple) 0%, transparent 60%);
    opacity: 0.2;
    animation: pulseNebula 10s infinite alternate ease-in-out;
}

@keyframes nebulaDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.15); }
}

@keyframes pulseNebula {
    0% { transform: scale(0.85); opacity: 0.15; }
    100% { transform: scale(1.25); opacity: 0.35; }
}

/* Light beams rising from below */
.light-beams {
    position: absolute;
    bottom: -10%;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(0deg, rgba(0, 242, 254, 0.08) 0%, rgba(155, 81, 224, 0.03) 40%, transparent 100%);
    clip-path: polygon(15% 100%, 85% 100%, 65% 0, 35% 0);
    opacity: 0.7;
    animation: breathBeam 8s infinite alternate ease-in-out;
}

@keyframes breathBeam {
    0% { opacity: 0.4; transform: scaleX(0.9); }
    100% { opacity: 0.85; transform: scaleX(1.1); }
}

/* ==========================================================================
   Rotating Energy Rings & Portal System
   ========================================================================== */

.stage-viewport {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
}

.logo-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    animation: stageBobbing 7s infinite ease-in-out;
}

@keyframes stageBobbing {
    0%, 100% { transform: translateY(0px) rotateZ(0deg); }
    50% { transform: translateY(-16px) rotateZ(1deg); }
}

.energy-system {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Pulsing radial audio/energy waves */
.pulse-wave {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 242, 254, 0.6);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
    opacity: 0;
    pointer-events: none;
}

.wave-1 {
    width: 300px;
    height: 300px;
    animation: emitWave 4s infinite linear;
}

.wave-2 {
    width: 300px;
    height: 300px;
    animation: emitWave 4s infinite linear 2s;
}

@keyframes emitWave {
    0% { transform: scale(1) translateZ(-10px); opacity: 0.8; }
    100% { transform: scale(3.5) translateZ(-10px); opacity: 0; border-color: rgba(255, 0, 127, 0.1); }
}

/* Futuristic Rotating Portal Rings */
.portal-ring {
    position: absolute;
    border-radius: 50%;
    box-sizing: border-box;
}

.ring-inner {
    width: 480px;
    height: 480px;
    border: 2px dashed rgba(0, 242, 254, 0.5);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
    animation: rotateClockwise 25s infinite linear;
    transform: translateZ(-20px);
}

.ring-middle {
    width: 590px;
    height: 590px;
    border: 1px solid rgba(155, 81, 224, 0.4);
    border-top: 3px solid var(--neon-cyan);
    border-bottom: 3px solid var(--neon-magenta);
    box-shadow: 0 0 40px rgba(155, 81, 224, 0.3);
    animation: rotateCounter 18s infinite linear;
    transform: translateZ(-35px) rotateX(15deg);
}

.ring-outer {
    width: 710px;
    height: 710px;
    border: 1px dotted rgba(255, 255, 255, 0.25);
    border-left: 2px solid var(--neon-cyan);
    animation: rotateClockwise 35s infinite linear;
    transform: translateZ(-50px);
}

@keyframes rotateClockwise {
    from { transform: rotateZ(0deg) translateZ(-20px); }
    to { transform: rotateZ(360deg) translateZ(-20px); }
}

@keyframes rotateCounter {
    from { transform: rotateZ(360deg) translateZ(-35px) rotateX(15deg); }
    to { transform: rotateZ(0deg) translateZ(-35px) rotateX(15deg); }
}

/* ==========================================================================
   Levitating Logo Glass Card
   ========================================================================== */

.levitating-card {
    position: relative;
    padding: 3.5rem 6rem;
    border-radius: 40px;
    background: var(--glass-panel);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(0, 242, 254, 0.15),
        inset 0 0 25px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Interactive sweeping light edge effect on hover */
.card-edge-glow {
    position: absolute;
    inset: -2px;
    border-radius: 42px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), transparent);
    background-size: 300% 300%;
    z-index: 0;
    opacity: 0.4;
    transition: opacity 0.4s ease;
    animation: animateGradient 6s infinite ease;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
}

@keyframes animateGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.inner-aura {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.4) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    opacity: 0.6;
    transition: all 0.5s ease;
    pointer-events: none;
}

.brand-logo-image {
    position: relative;
    z-index: 2;
    max-width: clamp(300px, 50vw, 620px);
    max-height: 48vh;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 30px rgba(0, 242, 254, 0.4));
    transform: translateZ(45px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover dynamic state */
.logo-stage:hover .levitating-card {
    background: rgba(25, 33, 58, 0.65);
    border-color: rgba(0, 242, 254, 0.5);
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.85),
        0 0 100px rgba(0, 242, 254, 0.3),
        0 0 40px rgba(255, 0, 127, 0.2);
    transform: scale(1.03);
}

.logo-stage:hover .brand-logo-image {
    filter: drop-shadow(0 20px 45px rgba(0, 242, 254, 0.8)) brightness(1.1);
    transform: translateZ(65px) scale(1.05);
}

.logo-stage:hover .card-edge-glow {
    opacity: 1;
}

.logo-stage:hover .ring-inner {
    border-color: rgba(0, 242, 254, 0.9);
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.5);
    animation-duration: 8s;
}

.logo-stage:hover .ring-middle {
    animation-duration: 6s;
}

/* ==========================================================================
   Hologram Base Reflection
   ========================================================================== */

.hologram-base {
    position: absolute;
    bottom: -160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    transform: rotateX(75deg);
}

.base-ring {
    width: 500px;
    height: 500px;
    border: 2px solid rgba(0, 242, 254, 0.25);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.3), inset 0 0 40px rgba(0, 242, 254, 0.2);
    animation: rotateClockwise 20s infinite linear;
}

.ground-reflection {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.4) 0%, transparent 70%);
    filter: blur(25px);
    margin-top: -450px;
}

.interaction-hint {
    position: fixed;
    bottom: 2.5rem;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: none;
    animation: pulseHint 3s infinite alternate;
}

@keyframes pulseHint {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .levitating-card {
        padding: 2.5rem 2.5rem;
    }
    .brand-logo-image {
        max-width: 75vw;
    }
    .ring-inner { width: 340px; height: 340px; }
    .ring-middle { width: 420px; height: 420px; }
    .ring-outer { width: 500px; height: 500px; }
}
