:root {
    --bg-dark: #020617; /* Slate 950 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6; 
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    
    --glass-bg: rgba(15, 23, 42, 0.4); 
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    scrollbar-width: none; 
    -ms-overflow-style: none;
    line-height: 1.6;
}
body::-webkit-scrollbar { display: none; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Efecto Glassmorphism Profundo (Estilo Apple) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 40px -10px rgba(59, 130, 246, 0.3), 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px);
}

.glass-tag {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.35rem 1rem;
    border-radius: 999px;
}

.glass-icon {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Luces Ambientales */
.ambient-light {
    position: fixed; border-radius: 50%;
    filter: blur(120px); opacity: 0.25;
    pointer-events: none; z-index: -1;
    transition: background-color 0.5s ease;
}
.light-orb-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background-color: var(--primary); }
.light-orb-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background-color: var(--secondary); }
#light-cursor {
    width: 300px; height: 300px; 
    transform: translate(-50%, -50%); 
    opacity: 0.15; background-color: var(--accent);
    z-index: 10; filter: blur(80px);
}

/* Custom Cursor */
.cursor-dot {
    position: fixed; width: 8px; height: 8px;
    background-color: var(--text-main); border-radius: 50%;
    pointer-events: none; transform: translate(-50%, -50%);
    z-index: 10000; transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.1s;
    box-shadow: 0 0 10px var(--text-main);
}

/* Floating Navbar (Estilo Outlier/Moderno) */
.navbar {
    position: fixed;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 1.5rem 2rem;
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Navbar Scrolled State */
.navbar.scrolled {
    top: 1rem;
    width: 90%;
    max-width: 1000px;
}
.navbar.scrolled .nav-container {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 0.75rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand {
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.05em;
    color: var(--text-main);
}

.nav-links {
    display: none;
    gap: 2.5rem; text-transform: uppercase;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.mobile-menu-btn { display: block; background: none; border: none; color: white; cursor: pointer; }
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }

.hover-link { transition: color 0.3s, text-shadow 0.3s; }
.hover-link:hover { color: var(--primary); text-shadow: 0 0 10px var(--primary); }

/* Layout Containers */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 10rem 0; }

/* Hero Section */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    position: relative; padding: 0 1rem;
}

.logo-wrapper {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2rem; /* Separación amplia y clara para asegurar cero solapamientos */
}

/* 3D Prismatic Effect */
.prism-container {
    width: 320px;
    height: 320px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.prism-container canvas {
    display: block;
    outline: none;
    /* Extra glowing shadow for the canvas */
    filter: drop-shadow(0 20px 40px rgba(139, 92, 246, 0.2));
}

.brand-text-container { 
    margin-top: 0; /* Sin margen negativo, respeta el gap del logo-wrapper */
    z-index: 10;
    text-align: center;
}
.main-title {
    font-size: 3.5rem; font-weight: 700; letter-spacing: 0.15em;
    line-height: 1; margin-bottom: 0.25rem;
}
@media (min-width: 768px) { .main-title { font-size: 4.5rem; } }
.sub-title {
    font-size: 1rem; font-weight: 300; letter-spacing: 0.4em;
    color: var(--text-muted); text-transform: uppercase;
}
@media (min-width: 768px) { .sub-title { font-size: 1.15rem; } }

.description { 
    max-width: 700px; 
    margin: 0 auto; 
    color: var(--text-muted); 
    font-size: 1.25rem; 
    font-weight: 300; 
    margin-top: 3rem;
    line-height: 1.8;
}
.description .highlight-text {
    color: var(--text-main);
    font-weight: 600;
}

.scroll-indicator {
    position: absolute; bottom: 2.5rem; left: 50%;
    transform: translateX(-50%); display: flex; flex-direction: column;
    align-items: center; opacity: 0.6; animation: bounce 2s infinite;
}
.scroll-indicator span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.scroll-line { width: 1px; height: 3rem; background-color: var(--text-main); }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

/* Brands Marquee */
.brands-section {
    padding: 4rem 0;
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.2);
}
.brands-title {
    text-align: center;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 3rem;
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: scroll-marquee 30s linear infinite;
    gap: 6rem;
    padding: 0 3rem;
}
.marquee-track:hover {
    animation-play-state: paused;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.5;
    transition: opacity 0.3s, color 0.3s;
    cursor: default;
}
.brand-logo:hover {
    opacity: 1;
    color: var(--text-main);
}
.brand-logo svg {
    height: 28px;
    width: auto;
}
@keyframes scroll-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 3rem)); } /* Accounts for gap */
}
/* Fading edges for marquee */
.brands-section::before, .brands-section::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 15vw;
    z-index: 2;
    pointer-events: none;
}
.brands-section::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-dark), transparent);
}
.brands-section::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-dark), transparent);
}

/* Services */
.section-header { margin-bottom: 4rem; }
.section-title { font-size: 3.5rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.section-title.center { text-align: center; margin-bottom: 4rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.125rem; max-width: 600px; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.icon-wrapper {
    width: 4.5rem; height: 4.5rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2rem; color: var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.icon-wrapper svg { width: 2.5rem; height: 2.5rem; }

h4 { font-size: 2rem; margin-bottom: 1.5rem; font-weight: 600; }

.feature-list { color: var(--text-muted); display: flex; flex-direction: column; gap: 1rem; }
.feature-list li { display: flex; align-items: center; gap: 1rem; font-size: 1.1rem; }
.bullet { width: 6px; height: 6px; border-radius: 50%; background-color: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* Projects */
.projects-wrapper { display: flex; flex-direction: column; gap: 4rem; }
.project-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 2rem; }
@media (min-width: 768px) {
    .project-card { flex-direction: row; align-items: center; }
    .project-card.reverse { flex-direction: row-reverse; }
}

.project-info { padding: 4rem; flex: 1; }
.project-tag {
    font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--primary); margin-bottom: 1rem; display: block; font-weight: 600;
}
.project-info h4 { font-size: 3rem; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.project-info p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; line-height: 1.7;}
.tech-stack { display: flex; gap: 0.75rem; font-size: 0.75rem; font-weight: 600; flex-wrap: wrap; }

.project-image { flex: 1; min-height: 400px; position: relative; overflow: hidden; }
.project-image img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.6;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.5s;
}
.project-card:hover .project-image img { transform: scale(1.08); opacity: 1; }
.image-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, var(--primary) 0%, transparent 70%);
    opacity: 0.2; z-index: 1; transition: opacity 0.7s; mix-blend-mode: overlay;
}
.project-card:hover .image-overlay { opacity: 0.4; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; text-align: center; }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi-card { padding: 3rem 2rem; border-radius: 2rem; }
.kpi-number {
    font-size: 3.5rem; font-weight: 700; color: var(--primary);
    margin-bottom: 0.5rem; text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}
@media (min-width: 768px) { .kpi-number { font-size: 4.5rem; } }
.kpi-label { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); font-weight: 600;}

/* Footer */
.footer {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; text-align: center;
}
.footer-content h2 { font-size: 5rem; margin-bottom: 1.5rem; letter-spacing: -0.03em;}
@media (min-width: 768px) { .footer-content h2 { font-size: 7rem; } }
.footer-content p { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 3rem; }
.email-link {
    font-size: 2rem; font-weight: 600; color: var(--text-main);
    border-bottom: 2px solid var(--accent); padding-bottom: 0.5rem;
    transition: color 0.4s, border-color 0.4s; text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}
.email-link:hover { color: var(--accent); border-color: var(--primary); }

.social-links { display: flex; gap: 1.5rem; margin-top: 5rem; }
.magnetic-wrap { display: inline-block; padding: 10px; cursor: pointer; }
.magnetic-el {
    display: flex; align-items: center; justify-content: center;
    width: 70px; height: 70px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s;
    color: var(--text-main); font-weight: 600; font-size: 1.2rem;
    position: relative; overflow: hidden; text-transform: uppercase;
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px);
}
.magnetic-el::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 0; height: 0; background: var(--secondary);
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1; opacity: 0.4;
}
.magnetic-wrap:hover .magnetic-el::before { width: 200%; height: 200%; }
.magnetic-wrap:hover .magnetic-el { border-color: var(--secondary); box-shadow: 0 0 30px rgba(139, 92, 246, 0.4); }

.copyright { position: absolute; bottom: 2rem; font-size: 0.875rem; color: var(--text-muted); }

/* Apple-Style Reveal Animation */
.reveal-up {
    opacity: 0;
    transform: translateY(80px) scale(0.95);
    filter: blur(10px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
}
.reveal-up.active { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
