/* Ludic Jam Sonora 2025 - Main Stylesheet */

/* Base styles and typography */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 30% 20%, #18223f 0%, #0d1124 55%, #05070f 100%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fluid media */
img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* Better tap behavior on mobile */
button, a { -webkit-tap-highlight-color: transparent; }

/* Improved text readability */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

/* Focus styles for better accessibility */
*:focus-visible {
    outline: 2px solid rgba(244, 114, 182, 0.8);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced Navigation */
.nav-glass {
    background: rgba(15, 23, 42, .85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    transition: all 0.3s ease;
}

.nav-glass:hover {
    background: rgba(15, 23, 42, .9);
    border-bottom-color: rgba(244, 114, 182, .2);
}

/* Enhanced navigation links */
nav a {
    position: relative;
    overflow: hidden;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f472b6, #a855f7);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a:focus::after {
    width: 100%;
}

/* Hero section */
.hero-title {
    background: linear-gradient(90deg, #fff, #cbd5e1, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.5px;
}

.glow {
    text-shadow: 0 0 25px rgba(96, 165, 250, .45), 0 0 55px rgba(244, 114, 182, .25);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 7, 15, .85), rgba(5, 7, 15, .35), rgba(5, 7, 15, .1));
}

/* Stars canvas */
#stars-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 40%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 4px 25px -5px rgba(168, 85, 247, .45), 0 0 0 1px rgba(255, 255, 255, .08);
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 35px -5px rgba(168, 85, 247, .6), 0 0 0 1px rgba(255, 255, 255, .15);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.01);
    transition-duration: 0.1s;
}

.btn-outline {
    border: 2px solid #34d399;
    color: #34d399;
    background: transparent;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
}

.btn-outline:hover,
.btn-outline:focus {
    background: #34d399;
    color: #0d1124;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px -6px rgba(52, 211, 153, .45);
}

.btn-outline:active {
    transform: translateY(-1px) scale(1.01);
    transition-duration: 0.1s;
}

/* CTA glow enhancer */
.glow-cta {
    box-shadow: 0 0 22px rgba(244, 114, 182, .45), 0 0 38px rgba(96, 165, 250, .30);
}

.glow-cta:hover {
    box-shadow: 0 0 30px rgba(244, 114, 182, .6), 0 0 55px rgba(96, 165, 250, .45);
}

/* Timeline */
.timeline-dot {
    background: linear-gradient(135deg, #f472b6, #60a5fa);
    box-shadow: 0 0 0 4px #0d1124, 0 0 18px 4px rgba(96, 165, 250, .4);
}

/* Enhanced Cards with better microinteractions */
.card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 25px -6px rgba(0, 0, 0, .4);
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.6s ease-in-out;
}

.card:hover::before {
    left: 100%;
}

.card:hover,
.card:focus-within {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(244, 114, 182, .2);
    box-shadow: 0 12px 50px -8px rgba(244, 114, 182, .3), 0 8px 40px -4px rgba(0, 0, 0, .6);
}

/* Enhanced timeline dots */
.timeline-dot {
    background: linear-gradient(135deg, #f472b6, #60a5fa);
    box-shadow: 0 0 0 4px #0d1124, 0 0 18px 4px rgba(96, 165, 250, .4);
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px #0d1124, 0 0 25px 6px rgba(96, 165, 250, .6);
}

/* Section effects */
.section-fade {
    position: relative;
}

.section-fade:before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 80% 10%, rgba(96, 165, 250, .15), transparent 60%),
                radial-gradient(circle at 10% 80%, rgba(244, 114, 182, .15), transparent 65%);
}

/* Accessibility: focus-visible ring */
a:focus-visible, 
button:focus-visible {
    outline: 2px solid rgba(52, 211, 153, .6);
    outline-offset: 2px;
}

/* Mobile helpers */
.timeline h3 {
    word-break: break-word;
    hyphens: auto;
}

/* Custom Tailwind utilities and overrides */
.hero-title {
    background: linear-gradient(90deg, #fff, #cbd5e1, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.5px;
}

.text-gradient {
    background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom glass effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced reveal animation - DISABLED for immediate visibility */
.reveal {
    opacity: 1;
    transform: translateY(0);
    /* transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1); */
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu styles */
.mobile-menu {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading states and visual feedback */
.btn-primary:active,
.btn-outline:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary[disabled],
.btn-outline[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #f472b6;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Skip link enhancement */
.sr-only:focus {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 9999 !important;
    background: #f472b6 !important;
    color: white !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 25px -3px rgba(244, 114, 182, 0.5) !important;
    animation: slideIn 0.2s ease-out !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    /* Better touch targets */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improved text readability on mobile */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Better spacing for mobile */
    .btn-primary,
    .btn-outline {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* Improve mobile menu UX */
    #mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out;
        opacity: 0;
    }
    
    #mobile-menu.show {
        max-height: 500px;
        opacity: 1;
    }
    
    /* Better mobile card spacing */
    .card {
        margin-bottom: 1rem;
    }
}

/* Ultra-small screens support */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.625rem; /* ~26px, keep hierarchy without changing design */
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    .btn-primary,
    .btn-outline {
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }
    /* Slightly tighter gaps in complex grids */
    .timeline .grid { gap: 1rem; }
}

/* Safe area insets for iOS notch devices */
@supports(padding: max(0px)) {
    body {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-top: max(0px, env(safe-area-inset-top));
    }
}

/* Tablet and larger improvements */
@media (min-width: 769px) {
    /* Better hover states for non-touch devices */
    .card:hover {
        transform: translateY(-8px);
    }
    
    /* Improved timeline spacing */
    .timeline .grid {
        gap: 2rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    /* Better content max-width */
    .max-w-6xl {
        max-width: 72rem;
    }
    
    /* Enhanced hero spacing */
    section#inicio {
        padding-top: 8rem;
        padding-bottom: 10rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #fff;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .card {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Dark mode optimizations (already dark, but for completeness) */
@media (prefers-color-scheme: dark) {
    /* Ensure proper contrast in dark mode */
    body {
        color: #e2e8f0;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .btn-primary:hover,
    .btn-primary:focus,
    .btn-outline:hover,
    .btn-outline:focus {
        transform: none !important;
    }
}