@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    overscroll-behavior: none;
    /* Variable CSS para altura dinámica */
    --vh: 1vh;
}

body {
    font-family: 'Inter', sans-serif;
    height: 100vh;
    height: 100dvh; /* Usar altura dinámica de viewport para móviles */
    width: 100vw;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    background-size: 120% 120%;
    overflow: hidden;
    position: fixed; /* Fijar el body para evitar scroll */
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    animation: breatheBackground 20s ease-in-out infinite;
    /* Mejoras de rendimiento para móviles */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevenir zoom en doble tap en iOS */
    touch-action: manipulation;
    /* Prevenir overscroll en iOS */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

@keyframes breatheBackground {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

/* Partículas de fondo */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(100, 149, 237, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    /* Aceleración por hardware */
    will-change: transform, opacity;
    transform: translateZ(0);
}

.particle:nth-child(odd) {
    animation-direction: reverse;
}

.particle:nth-child(3n) {
    animation-name: floatAlt;
}

.particle:nth-child(4n) {
    animation-name: floatSpin;
}

.particle:nth-child(5n) {
    animation-name: floatZigzag;
}

.particle:nth-child(7n) {
    animation-duration: 10s;
    background: rgba(135, 206, 250, 0.15);
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) translateX(0) rotate(0deg); 
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-30px) translateX(15px) rotate(90deg); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-15px) translateX(-15px) rotate(180deg); 
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-45px) translateX(8px) rotate(270deg); 
        opacity: 0.4;
    }
}

@keyframes floatAlt {
    0%, 100% { 
        transform: translateY(0) translateX(0) scale(1); 
        opacity: 0.2;
    }
    33% { 
        transform: translateY(-20px) translateX(-20px) scale(1.2); 
        opacity: 0.7;
    }
    66% { 
        transform: translateY(10px) translateX(20px) scale(0.8); 
        opacity: 0.5;
    }
}

@keyframes floatSpin {
    0% { 
        transform: translateY(0) translateX(0) rotate(0deg) scale(1); 
        opacity: 0.1;
    }
    25% { 
        transform: translateY(-25px) translateX(10px) rotate(180deg) scale(1.3); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-10px) translateX(-25px) rotate(360deg) scale(0.7); 
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-35px) translateX(15px) rotate(540deg) scale(1.1); 
        opacity: 0.3;
    }
    100% { 
        transform: translateY(0) translateX(0) rotate(720deg) scale(1); 
        opacity: 0.1;
    }
}

@keyframes floatUp {
    0% { 
        transform: translateY(0) translateX(0) scale(0.5); 
        opacity: 0;
    }
    10% { 
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-50vh) translateX(20px) scale(1.2); 
        opacity: 0.6;
    }
    100% { 
        transform: translateY(-120vh) translateX(-10px) scale(0.3); 
        opacity: 0;
    }
}

@keyframes floatZigzag {
    0%, 100% { 
        transform: translateY(0) translateX(0); 
        opacity: 0.2;
    }
    25% { 
        transform: translateY(-15px) translateX(25px); 
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-30px) translateX(-10px); 
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-15px) translateX(15px); 
        opacity: 0.5;
    }
}

/* Container principal */
.container {
    position: relative;
    height: 100vh;
    height: 100dvh; /* Usar altura dinámica de viewport */
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
    cursor: pointer;
    overflow: hidden;
}

/* Logo container */
.logo-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 50px;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-container:hover {
    transform: scale(1.02);
}

/* Ondas expansivas desde el logo - versión sutil */
.logo-container::before,
.logo-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 1px solid rgba(100, 149, 237, 0.1);
    border-radius: 50%;
    animation: pulseRingSoft 6s ease-out infinite;
    pointer-events: none;
}

.logo-container::after {
    animation-delay: 3s;
}

@keyframes pulseRingSoft {
    0% {
        width: 80%;
        height: 80%;
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    50% {
        width: 120%;
        height: 120%;
        opacity: 0.08;
    }
    100% {
        width: 150%;
        height: 150%;
        opacity: 0;
    }
}

/* Ondas expansivas al hacer clic - efecto dramático */
.ripple-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

@keyframes rippleExpand {
    0% {
        width: 50%;
        height: 50%;
        opacity: 0;
        border: 3px solid rgba(100, 149, 237, 0.8);
        box-shadow: 0 0 20px rgba(100, 149, 237, 0.6);
    }
    10% {
        opacity: 0.9;
        border-width: 3px;
    }
    30% {
        width: 150%;
        height: 150%;
        opacity: 0.6;
        border-width: 2px;
    }
    60% {
        width: 250%;
        height: 250%;
        opacity: 0.3;
        border-width: 1px;
    }
    100% {
        width: 350%;
        height: 350%;
        opacity: 0;
        border-width: 0.5px;
        box-shadow: 0 0 50px rgba(100, 149, 237, 0);
    }
}

.logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 250px;
    max-height: 250px;
    filter: drop-shadow(0 0 20px rgba(100, 149, 237, 0.3));
    animation: heartbeat 6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    /* Aceleración por hardware */
    will-change: transform, opacity, filter;
    transform: translate(-50%, -50%) translateZ(0);
    /* Prevenir selección en móviles */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

@keyframes heartbeat {
    0% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.98) rotate(0deg);
        filter: drop-shadow(0 0 15px rgba(100, 149, 237, 0.2)) blur(0.3px);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    10% { 
        opacity: 0.42;
        transform: translate(-50%, -50%) scale(0.995) rotate(0.2deg);
        filter: drop-shadow(0 0 20px rgba(100, 149, 237, 0.3)) blur(0.2px);
        animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
    }
    20% { 
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(1.015) rotate(0.4deg);
        filter: drop-shadow(0 0 28px rgba(100, 149, 237, 0.5)) blur(0px);
        animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
    }
    35% { 
        opacity: 0.68;
        transform: translate(-50%, -50%) scale(1.035) rotate(-0.3deg);
        filter: drop-shadow(0 0 38px rgba(100, 149, 237, 0.65)) blur(0px);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    50% { 
        opacity: 0.75;
        transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
        filter: drop-shadow(0 0 45px rgba(100, 149, 237, 0.8)) blur(0px);
        animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
    }
    60% { 
        opacity: 0.68;
        transform: translate(-50%, -50%) scale(1.03) rotate(0.2deg);
        filter: drop-shadow(0 0 38px rgba(100, 149, 237, 0.65)) blur(0px);
        animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
    }
    70% { 
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(1.01) rotate(-0.2deg);
        filter: drop-shadow(0 0 28px rgba(100, 149, 237, 0.5)) blur(0px);
        animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
    }
    85% { 
        opacity: 0.42;
        transform: translate(-50%, -50%) scale(0.995) rotate(-0.1deg);
        filter: drop-shadow(0 0 20px rgba(100, 149, 237, 0.3)) blur(0.2px);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.98) rotate(0deg);
        filter: drop-shadow(0 0 15px rgba(100, 149, 237, 0.2)) blur(0.3px);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

/* Efectos de humo */
.smoke {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.smoke-layer {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(100, 149, 237, 0.08) 30%, 
        transparent 70%);
    animation: smokeMove 8s ease-in-out infinite;
    /* Aceleración por hardware */
    will-change: transform, opacity;
    transform: translateZ(0);
}

.smoke-layer:nth-child(1) {
    animation-delay: 0s;
    animation-duration: 8s;
}

.smoke-layer:nth-child(2) {
    animation-delay: -2s;
    animation-duration: 10s;
    animation-direction: reverse;
}

.smoke-layer:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 12s;
}

@keyframes smokeMove {
    0% { 
        transform: translateX(-10%) translateY(-10%) rotate(0deg);
        opacity: 0.3;
    }
    25% { 
        transform: translateX(5%) translateY(-5%) rotate(90deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateX(10%) translateY(5%) rotate(180deg);
        opacity: 0.4;
    }
    75% { 
        transform: translateX(-5%) translateY(10%) rotate(270deg);
        opacity: 0.7;
    }
    100% { 
        transform: translateX(-10%) translateY(-10%) rotate(360deg);
        opacity: 0.3;
    }
}

/* Texto principal */
.main-text {
    font-size: 2.5rem;
    font-weight: 300;
    color: #ffffff;
    text-align: center;
    letter-spacing: 3px;
    text-transform: lowercase;
    opacity: 0;
    animation: textReveal 2s ease-out 1s forwards, textFloat 6s ease-in-out 3s infinite;
    text-shadow: 0 0 30px rgba(100, 149, 237, 0.5);
}

.main-text .highlight {
    color: #6495ed;
    font-weight: 500;
    display: inline-block;
    animation: highlightPulse 3s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(100, 149, 237, 0.5);
    }
    50% {
        text-shadow: 0 0 25px rgba(100, 149, 237, 0.9), 0 0 35px rgba(100, 149, 237, 0.6);
    }
}

@keyframes textFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes textReveal {
    0% { 
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Efectos de brillo en los bordes */
.glow-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(100, 149, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(135, 206, 250, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(70, 130, 180, 0.1) 0%, transparent 50%);
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Destellos de luz */
.light-flare {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(100, 149, 237, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(100, 149, 237, 0.8);
    pointer-events: none;
    animation: flareFloat 3s ease-in-out infinite;
    z-index: 4;
}

@keyframes flareFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
    80% {
        opacity: 0.6;
        transform: translate(calc(var(--tx) * 2), calc(var(--ty) * 2)) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) * 3), calc(var(--ty) * 3)) scale(0.3);
    }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0); }
}

@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Responsive */

/* Tablets en horizontal y pantallas medianas (max-width: 1024px) */
@media (max-width: 1024px) {
    .logo-container {
        width: 280px;
        height: 280px;
        margin-bottom: 40px;
    }
    
    .logo {
        max-width: 230px;
        max-height: 230px;
    }
    
    .main-text {
        font-size: 2.2rem;
        letter-spacing: 2.5px;
    }
    
    .smoke-layer {
        width: 130%;
        height: 130%;
    }
}

/* Tablets en vertical y móviles grandes (max-width: 768px) */
@media (max-width: 768px) {
    html, body {
        position: fixed;
        overflow: hidden;
        height: 100%;
        width: 100%;
        overscroll-behavior: none;
    }
    
    body {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 60%, #16213e 100%);
        /* Usar la altura real del viewport en móviles */
        height: 100vh;
        height: 100dvh;
        min-height: -webkit-fill-available;
    }
    
    .logo-container {
        width: 240px;
        height: 240px;
        margin-bottom: 40px;
    }
    
    .logo {
        max-width: 190px;
        max-height: 190px;
    }
    
    .main-text {
        font-size: 1.8rem;
        letter-spacing: 2px;
        padding: 0 20px;
    }
    
    .smoke-layer {
        width: 140%;
        height: 140%;
    }
    
    .glow-effect {
        opacity: 0.7;
    }
}

/* Móviles medianos (max-width: 480px) */
@media (max-width: 480px) {
    .logo-container {
        width: 200px;
        height: 200px;
        margin-bottom: 35px;
    }
    
    .logo {
        max-width: 160px;
        max-height: 160px;
    }
    
    .main-text {
        font-size: 1.5rem;
        letter-spacing: 1.5px;
        padding: 0 15px;
    }
    
    .smoke-layer {
        width: 150%;
        height: 150%;
    }
    
    /* Reducir número de partículas visualmente en móviles pequeños */
    .particle:nth-child(n+40) {
        display: none;
    }
}

/* Móviles pequeños (max-width: 375px) */
@media (max-width: 375px) {
    .logo-container {
        width: 180px;
        height: 180px;
        margin-bottom: 30px;
    }
    
    .logo {
        max-width: 140px;
        max-height: 140px;
    }
    
    .main-text {
        font-size: 1.3rem;
        letter-spacing: 1px;
        padding: 0 10px;
        line-height: 1.4;
    }
    
    /* Menos partículas para mejor rendimiento */
    .particle:nth-child(n+30) {
        display: none;
    }
}

/* Móviles muy pequeños (max-width: 320px) */
@media (max-width: 320px) {
    .logo-container {
        width: 160px;
        height: 160px;
        margin-bottom: 25px;
    }
    
    .logo {
        max-width: 120px;
        max-height: 120px;
    }
    
    .main-text {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
        padding: 0 10px;
    }
    
    .smoke-layer {
        width: 160%;
        height: 160%;
    }
    
    /* Solo las partículas más importantes */
    .particle:nth-child(n+20) {
        display: none;
    }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        gap: 30px;
    }
    
    .logo-container {
        width: 180px;
        height: 180px;
        margin-bottom: 0;
    }
    
    .logo {
        max-width: 150px;
        max-height: 150px;
    }
    
    .main-text {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}

/* Pantallas de alta resolución (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}