:root {
    --bg-color: #050505;
    --bg-secondary: #0A0A0A;
    --text-primary: #EDEDED;
    --text-secondary: #888888;
    --accent-color: #0070F3;
    --accent-glow: rgba(0, 112, 243, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.03);
    
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html, body {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    cursor: none;
    overscroll-behavior: none;
}

/* Ocultar barra de scroll nativa para mantener diseño limpio */
::-webkit-scrollbar {
    display: none;
}

/* Smooth Scroll Containers */
#smooth-wrapper {
    width: 100%;
    position: fixed;
    top: 0; left: 0;
    overflow: hidden;
    z-index: 1;
}

#smooth-content {
    width: 100%;
    will-change: transform;
}

/* 1. OS Booting Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 99999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 1s ease-out, transform 1s ease-out;
}
#preloader.loaded {
    opacity: 0; pointer-events: none; transform: scale(1.05);
}
.preloader-content { width: 300px; font-family: monospace; color: #00E5FF; }
.preloader-text { font-size: 0.9rem; margin-bottom: 20px; letter-spacing: 2px; }
.preloader-bar { width: 100%; height: 2px; background: rgba(0, 229, 255, 0.2); margin-bottom: 20px; overflow: hidden; }
.preloader-progress { width: 0%; height: 100%; background: #00E5FF; animation: load-progress 2s cubic-bezier(0.8, 0, 0.2, 1) forwards; }
@keyframes load-progress { 0% { width: 0%; } 50% { width: 40%; } 80% { width: 80%; } 100% { width: 100%; } }
.preloader-status { font-size: 0.75rem; opacity: 0.7; }

/* 2. Cinematic Noise Overlay */
.noise-overlay {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05; z-index: 9990; pointer-events: none; mix-blend-mode: overlay;
    animation: noise-anim 0.2s infinite;
}
@keyframes noise-anim { 0% { transform: translate(0, 0); } 20% { transform: translate(-5%, -5%); } 40% { transform: translate(5%, -10%); } 60% { transform: translate(-10%, 5%); } 80% { transform: translate(3%, 15%); } 100% { transform: translate(0, 0); } }

/* Background Effects */
.bg-grid { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: linear-gradient(to right, var(--border-color) 1px, transparent 1px), linear-gradient(to bottom, var(--border-color) 1px, transparent 1px); background-size: 50px 50px; mask-image: radial-gradient(circle at center, rgba(0,0,0,0.4) 0%, transparent 80%); -webkit-mask-image: radial-gradient(circle at center, rgba(0,0,0,0.4) 0%, transparent 80%); z-index: 0; pointer-events: none; will-change: transform; }
.glow-orb { position: fixed; border-radius: 50%; filter: blur(100px); z-index: 0; pointer-events: none; }
.main-orb { top: -10%; left: 50%; transform: translateX(-50%); width: 60vw; height: 60vh; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); opacity: 0.5; will-change: transform; }
#digitalCanvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; opacity: 0.3; }

/* Typography */
h1, h2, h3, h4, .logo { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.text-white { color: #FFF; }
.gradient-text { background: linear-gradient(to right, #fff, #666); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 5; }
.mt-20 { margin-top: 20px; }

/* Glitch Effect */
.glitch-hover { position: relative; display: inline-block; }
.glitch-hover::before, .glitch-hover::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; background: var(--bg-color); pointer-events: none; }
.glitch-hover:hover::before { left: 2px; text-shadow: -2px 0 #00E5FF; clip: rect(24px, 550px, 90px, 0); animation: glitch-anim-2 3s infinite linear alternate-reverse; opacity: 1; }
.glitch-hover:hover::after { left: -2px; text-shadow: -2px 0 #0070F3; clip: rect(85px, 550px, 140px, 0); animation: glitch-anim 2.5s infinite linear alternate-reverse; opacity: 1; }
@keyframes glitch-anim { 0% { clip: rect(20px, 9999px, 83px, 0); } 50% { clip: rect(50px, 9999px, 91px, 0); } 100% { clip: rect(90px, 9999px, 78px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(60px, 9999px, 9px, 0); } 50% { clip: rect(20px, 9999px, 16px, 0); } 100% { clip: rect(70px, 9999px, 22px, 0); } }

/* Navbar */
.navbar { position: fixed; top: 0; width: 100%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); z-index: 100; transition: all 0.3s ease; }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.1em; color: #FFF; text-decoration: none; cursor: pointer; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a:not(.btn) { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; cursor: pointer; display: inline-block; }
.nav-links a:not(.btn):hover { color: #FFF; }

/* Hamburger Menu (Mobile) */
.hamburger { display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 101; }
.hamburger span { width: 30px; height: 2px; background-color: #FFF; transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 6px; font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; text-decoration: none; cursor: pointer; position: relative; overflow: hidden; }
.btn-primary { background-color: var(--text-primary); color: var(--bg-color); border: 1px solid var(--text-primary); box-shadow: 0 0 20px rgba(255,255,255,0.1); }
.btn-primary:hover { background-color: #FFF; box-shadow: 0 0 30px rgba(255,255,255,0.2); }
.btn-outline { background-color: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { background-color: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); }
.btn-link { display: inline-block; margin-top: 16px; color: #FFF; font-weight: 500; text-decoration: none; font-size: 0.9rem; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.btn-link:hover { border-bottom-color: #FFF; }

/* Back to Top Button */
.back-to-top {
    position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px;
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #FFF;
    z-index: 90; opacity: 0; visibility: hidden; transition: all 0.3s ease; cursor: pointer;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: rgba(255,255,255,0.1); transform: translateY(-5px); box-shadow: 0 5px 25px rgba(0, 112, 243, 0.4); border-color: rgba(255,255,255,0.3); }

/* Magnetic Items */
.magnetic-btn, .magnetic-link, .magnetic-card { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, background-color 0.3s; will-change: transform; }

/* Animated Conic Border Card */
.animated-border-card { position: relative; overflow: hidden; border: none !important; padding: 1px; }
.animated-border-card::after { content: ''; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent 0%, transparent 60%, var(--accent-color) 80%, transparent 100%); animation: rotate-border 4s linear infinite; z-index: 1; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.animated-border-card:hover::after { opacity: 1; }
.animated-border-card > * { position: relative; z-index: 3; background: var(--bg-secondary); border-radius: inherit; height: 100%; }
@keyframes rotate-border { 100% { transform: rotate(360deg); } }

/* Hero Section */
.hero { padding: 180px 0 100px; display: flex; flex-direction: column; align-items: center; text-align: center; min-height: 100vh; justify-content: center; position: relative;}
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 100px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 32px; }
.pulse-dot { width: 8px; height: 8px; background-color: #00E5FF; border-radius: 50%; box-shadow: 0 0 10px #00E5FF; animation: pulse 2s infinite; }
.hero-title { font-size: clamp(3rem, 8vw, 6rem); color: #FFF; margin-bottom: 24px; font-weight: 900; letter-spacing: -0.04em; line-height: 1;}
.hero-subtitle { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 60px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; border-top: 1px solid var(--border-color); padding-top: 40px; margin-top: 20px; }
.stat-item h4 { font-size: 1.5rem; color: #FFF; margin-bottom: 4px; }
.stat-item p { font-size: 0.85rem; color: var(--text-secondary); }

/* About / Philosophy */
.about { padding: 120px 0; border-top: 1px solid rgba(255,255,255,0.02); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--text-secondary); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em;}
.about-description p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 24px; }

/* Tech Stack Marquee */
.tech-stack { padding: 60px 0; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); background: var(--bg-secondary); overflow: hidden; }
.marquee-container { width: 100%; white-space: nowrap; overflow: hidden; position: relative; }
.marquee-container::before, .marquee-container::after { content: ""; position: absolute; top: 0; width: 150px; height: 100%; z-index: 2; pointer-events: none; }
.marquee-container::before { left: 0; background: linear-gradient(to right, var(--bg-secondary), transparent); }
.marquee-container::after { right: 0; background: linear-gradient(to left, var(--bg-secondary), transparent); }
.marquee-content { display: inline-block; animation: marquee 30s linear infinite; }
.marquee-content span { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--text-secondary); margin: 0 20px; }
.marquee-content span:hover { color: #FFF; }
.marquee-content span.dot { color: var(--border-color); font-size: 1.5rem; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Services */
.section-header { text-align: center; margin-bottom: 80px; }
.section-header h2 { font-size: clamp(2.5rem, 4vw, 3.5rem); color: var(--text-secondary); margin-bottom: 16px; font-weight: 900;}
.section-header p { color: var(--text-secondary); font-size: 1.1rem; }
.services { padding: 160px 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card { position: relative; background: var(--bg-secondary); border-radius: 12px; padding: 1px; overflow: hidden; cursor: pointer; }
.card-border { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 12px; background: var(--border-color); z-index: 1; transition: opacity 0.3s; }
.card:hover .card-border { opacity: 0; }
.card::before { content: ''; position: absolute; top: var(--mouse-y, 0); left: var(--mouse-x, 0); transform: translate(-50%, -50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 40%); opacity: 0; transition: opacity 0.3s; z-index: 2; pointer-events: none; }
.card:hover::before { opacity: 1; }
.card-content { position: relative; background: var(--bg-secondary); padding: 40px 32px; border-radius: 11px; height: 100%; z-index: 3; display: flex; flex-direction: column; }
.icon-wrapper { width: 48px; height: 48px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: var(--text-primary); }
.card h3 { font-size: 1.25rem; color: #FFF; margin-bottom: 12px; }
.card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 20px;}
.service-list { list-style: none; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border-color); }
.service-list li { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.service-list li::before { content: '→'; color: var(--accent-color); font-family: monospace; }

/* Methodology / Process Timeline */
.methodology { padding: 160px 0; background: linear-gradient(to bottom, var(--bg-color), var(--bg-secondary)); }
.timeline { max-width: 800px; margin: 0 auto; position: relative; }
.timeline::before { content: ''; position: absolute; left: 24px; top: 0; bottom: 0; width: 1px; background: var(--border-color); }
.timeline-item { position: relative; padding-left: 80px; margin-bottom: 60px; }
.timeline-item:last-child { margin-bottom: 0; }
.step-number { position: absolute; left: 0; top: 0; width: 48px; height: 48px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: #FFF; z-index: 2; }
.step-content h3 { font-size: 1.5rem; color: #FFF; margin-bottom: 12px; }
.step-content p { color: var(--text-secondary); font-size: 1rem; }

/* Projects / Case Studies */
.projects { padding: 160px 0; }
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.project-card { border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;}
.project-image { width: 100%; height: 350px; background: #111; position: relative; overflow: hidden;}
.placeholder-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.huge-typography { font-family: var(--font-display); font-weight: 900; font-size: 2.5rem; letter-spacing: 0px; color: rgba(255,255,255,0.9); }
.gradient-bg-1 { background: linear-gradient(135deg, rgba(0,112,243,0.3) 0%, rgba(0,0,0,1) 100%); }
.gradient-bg-2 { background: linear-gradient(135deg, rgba(138,43,226,0.3) 0%, rgba(0,0,0,1) 100%); }
.project-info { padding: 40px; flex: 1; display: flex; flex-direction: column;}
.tags { display: flex; gap: 8px; margin-bottom: 16px; }
.tags span { font-size: 0.75rem; padding: 4px 10px; border-radius: 100px; background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.1); }
.project-info h3 { font-size: 1.8rem; margin-bottom: 12px; color: #FFF; }
.project-info p { color: var(--text-secondary); font-size: 1rem; margin-bottom: 24px; flex: 1;}

/* CTA */
.cta { padding: 120px 0 200px; }
.cta-box { border-radius: 24px; }
.cta-content-wrapper { display: flex; justify-content: space-between; align-items: center; padding: 80px 60px; background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent); border-radius: inherit; }
.huge-typography-cta { font-size: clamp(3rem, 5vw, 4rem); font-weight: 900; line-height: 1; color: #FFF; margin-bottom: 16px; letter-spacing: -0.03em;}
.cta-text p { color: var(--text-secondary); font-size: 1.1rem; }

/* Extended Footer */
footer { border-top: 1px solid var(--border-color); padding: 100px 0 40px; background: var(--bg-secondary); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 80px; }
.footer-brand p { color: var(--text-secondary); margin-top: 16px; font-size: 0.95rem; max-width: 300px; }
.footer-links-group h4 { color: #FFF; font-size: 1rem; margin-bottom: 24px; }
.footer-links-group a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; margin-bottom: 12px; transition: color 0.2s; cursor: pointer; }
.footer-links-group a:hover { color: #FFF; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; color: var(--text-secondary); }
.legal-links { display: flex; gap: 24px; }
.legal-links a { color: var(--text-secondary); text-decoration: none; cursor: pointer;}
.legal-links a:hover { color: #FFF; }

/* Custom Cursor Glow */
.cursor-glow { position: fixed; top: 0; left: 0; width: 400px; height: 400px; background: radial-gradient(circle, rgba(0, 112, 243, 0.15) 0%, transparent 60%); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 9999; mix-blend-mode: screen; transition: opacity 0.3s, transform 0.1s ease-out; opacity: 0; }
.cursor-dot { position: fixed; top: 0; left: 0; width: 8px; height: 8px; background-color: white; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 10000; mix-blend-mode: difference; opacity: 0; transition: transform 0.2s ease-out, background-color 0.2s ease; }

/* Responsive */
@media (max-width: 992px) { 
    .about-grid, .projects-grid, .cta-content-wrapper { flex-direction: column; grid-template-columns: 1fr; gap: 40px; } 
    .cta-content-wrapper { text-align: center; } 
    .footer-grid { grid-template-columns: 1fr 1fr; } 
}
@media (max-width: 768px) { 
    html, body { overflow: auto; height: auto; cursor: auto; } 
    #smooth-wrapper { position: relative; height: auto; overflow: visible; } 
    .hamburger { display: flex; }
    .nav-links { 
        position: fixed; top: 70px; left: 0; width: 100%; height: calc(100vh - 70px); 
        background: var(--bg-color); flex-direction: column; align-items: center; justify-content: center; 
        gap: 40px; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.8, 0, 0.2, 1); 
    }
    .nav-links.active { transform: translateX(0); }
    .nav-links a:not(.btn) { font-size: 1.5rem; }
    .hero-stats { flex-direction: column; gap: 24px; align-items: center; } 
    .footer-grid { grid-template-columns: 1fr; } 
    .footer-bottom { flex-direction: column; gap: 16px; align-items: flex-start; } 
    .cursor-glow, .cursor-dot, #digitalCanvas, .noise-overlay { display: none; } 
    .marquee-container::before, .marquee-container::after { width: 50px; } 
    .back-to-top { bottom: 20px; right: 20px; width: 45px; height: 45px; }
}
