/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red: #d62200;
    --black: #000000;
    --white: #ffffff;
    --gray: #666666;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    position: relative;
}

/* Animation Layer */
.animation-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Circle Outline - Growing circle with thick black stroke that expands off screen */
.circle-outline {
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid var(--black);
    border-radius: 50%;
    background: transparent;
    animation: circleOutlineGrow 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes circleOutlineGrow {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    40% {
        width: min(60vw, 350px);
        height: min(60vw, 350px);
        opacity: 1;
    }
    100% {
        width: 300vmax;
        height: 300vmax;
        opacity: 0;
    }
}

/* Network Background - Persistent effect */
.network-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease-out;
}

/* Glitch Lines */
.glitch-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: glitchLinesShow 0.1s 1.2s forwards;
}

@keyframes glitchLinesShow {
    to { opacity: 0.5; }
}

.glitch-line {
    position: absolute;
    background: var(--black);
    transform-origin: center;
}

.glitch-line:nth-child(1) {
    top: 0;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide1 0.8s 1.3s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(2) {
    top: 12.5%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide2 0.7s 1.4s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(3) {
    top: 25%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide3 0.6s 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(4) {
    top: 37.5%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide4 0.65s 1.55s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(5) {
    top: 50%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide5 0.55s 1.6s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(6) {
    top: 62.5%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide6 0.7s 1.45s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(7) {
    top: 75%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide7 0.6s 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.glitch-line:nth-child(8) {
    top: 87.5%;
    left: 0;
    width: 100%;
    height: 12.5%;
    animation: glitchSlide8 0.75s 1.35s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* Diagonal glitch animations */
@keyframes glitchSlide1 {
    0% { transform: translateX(0) skewX(0); }
    20% { transform: translateX(5%) skewX(-3deg); }
    40% { transform: translateX(-3%) skewX(2deg); }
    60% { transform: translateX(80%) skewX(-15deg); }
    100% { transform: translateX(120%) skewX(-20deg); opacity: 0; }
}

@keyframes glitchSlide2 {
    0% { transform: translateX(0) skewX(0); }
    15% { transform: translateX(-4%) skewX(2deg); }
    35% { transform: translateX(3%) skewX(-2deg); }
    55% { transform: translateX(-90%) skewX(18deg); }
    100% { transform: translateX(-130%) skewX(25deg); opacity: 0; }
}

@keyframes glitchSlide3 {
    0% { transform: translateX(0) skewX(0); }
    25% { transform: translateX(6%) skewX(-4deg); }
    50% { transform: translateX(85%) skewX(-20deg); }
    100% { transform: translateX(140%) skewX(-30deg); opacity: 0; }
}

@keyframes glitchSlide4 {
    0% { transform: translateX(0) skewX(0); }
    20% { transform: translateX(-5%) skewX(3deg); }
    45% { transform: translateX(-75%) skewX(15deg); }
    100% { transform: translateX(-125%) skewX(22deg); opacity: 0; }
}

@keyframes glitchSlide5 {
    0% { transform: translateX(0) skewX(0); }
    30% { transform: translateX(4%) skewX(-2deg); }
    60% { transform: translateX(90%) skewX(-22deg); }
    100% { transform: translateX(135%) skewX(-28deg); opacity: 0; }
}

@keyframes glitchSlide6 {
    0% { transform: translateX(0) skewX(0); }
    25% { transform: translateX(-6%) skewX(4deg); }
    50% { transform: translateX(-85%) skewX(20deg); }
    100% { transform: translateX(-140%) skewX(30deg); opacity: 0; }
}

@keyframes glitchSlide7 {
    0% { transform: translateX(0) skewX(0); }
    20% { transform: translateX(5%) skewX(-3deg); }
    55% { transform: translateX(80%) skewX(-18deg); }
    100% { transform: translateX(125%) skewX(-25deg); opacity: 0; }
}

@keyframes glitchSlide8 {
    0% { transform: translateX(0) skewX(0); }
    30% { transform: translateX(-4%) skewX(2deg); }
    60% { transform: translateX(-95%) skewX(24deg); }
    100% { transform: translateX(-145%) skewX(32deg); opacity: 0; }
}

/* Logo Container */
.logo-container {
    position: relative;
    z-index: 10;
    margin-bottom: 40px;
}

.logo {
    width: min(80vw, 420px);
    height: auto;
    opacity: 0;
    animation: logoReveal 0.8s 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(10px);
    }
    50% {
        opacity: 1;
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Logo Circle - No animation, just visible */
.logo-circle {
    /* Sin animación adicional */
}

/* Logo Text Animation */
.logo-text {
    opacity: 0;
    animation: textReveal 0.6s 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Content */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    opacity: 0;
    animation: contentFadeIn 1s 3.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 300;
    color: var(--gray);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--black);
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--red);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.cta-button:hover::before {
    transform: translateX(0);
}

.btn-text, .btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon {
    display: flex;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-button:hover .btn-icon {
    transform: translateX(5px);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(214, 34, 0, 0.3);
}

/* Glitch overlay effect */
.animation-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    opacity: 0;
    animation: scanlines 0.1s 1.2s forwards;
}

@keyframes scanlines {
    to { opacity: 1; }
}

/* Hide animation layer after complete */
.animation-layer {
    animation: hideLayer 0.01s 3.5s forwards;
}

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

/* Responsive */
@media (max-width: 768px) {
    .logo {
        width: 85vw;
    }
    
    .tagline {
        letter-spacing: 0.2em;
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 90vw;
    }
    
    .content {
        gap: 24px;
    }
    
    .tagline {
        font-size: 0.85rem;
        letter-spacing: 0.15em;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        animation-delay: 0s !important;
    }
}
