:root {
    --bg-dark: #07071a;
    --text-main: #f0f0ff;
    --text-muted: #8890a8;
    --text-caption: #606880;
    
    --primary: #4f8ef7;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --pink: #e040fb;

    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.07);

    /* ─── Tipografía Consistente ─── */
    --fs-hero:    clamp(2.8rem, 7vw, 5.5rem);
    --fs-h2:      clamp(1.75rem, 3.5vw, 2.5rem);
    --fs-h3:      clamp(1.1rem, 2vw, 1.35rem);
    --fs-body:    1rem;
    --fs-caption: 0.8125rem;
    --fw-bold: 700;
    --fw-semi: 600;
    --fw-reg:  400;
    --lh-tight: 1.1;
    --lh-body: 1.7;

    /* ─── Spacing Consistente ─── */
    --section-v: clamp(5rem, 10vw, 9rem);
    --gap-card: 1.25rem;
    --radius-card: 1.5rem;
}

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

html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }

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

/* ══════════════════════════════════════
   EFECTOS DE FONDO GLOBALES
══════════════════════════════════════ */

/* Grain / Noise premium */
.noise-overlay {
    position: fixed; inset: 0; z-index: 9999;
    pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Prisma de fondo fijo */
.bg-prism {
    position: fixed;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120vw; height: 100vh;
    pointer-events: none; z-index: -5;
    overflow: hidden;
}
.bg-prism::before {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 400px; height: 700px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: conic-gradient(from 200deg at 50% 0%,
        rgba(255,0,85,0.12),
        rgba(255,100,0,0.10),
        rgba(255,200,0,0.09),
        rgba(0,220,255,0.10),
        rgba(100,80,255,0.12),
        rgba(200,0,255,0.10),
        rgba(255,0,85,0.08)
    );
    filter: blur(40px);
    opacity: 0.7;
    animation: prism-rotate 18s ease-in-out infinite alternate;
}
.bg-prism::after {
    content: '';
    position: absolute;
    top: 30%; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(ellipse, rgba(79,142,247,0.12) 0%, transparent 70%);
    filter: blur(60px);
}
@keyframes prism-rotate {
    0%   { transform: translateX(-50%) scaleX(1)   rotate(-6deg); opacity: 0.5; }
    100% { transform: translateX(-50%) scaleX(1.3) rotate(6deg);  opacity: 0.85; }
}

/* Orbes ambientales */
.ambient-light { position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.22; pointer-events: none; z-index: -2; }
.light-orb-1 { top:-10%; left:-10%; width:50vw; height:50vw; background: var(--primary); }
.light-orb-2 { bottom:-10%; right:-10%; width:40vw; height:40vw; background: var(--secondary); }
#light-cursor { width:280px; height:280px; transform:translate(-50%,-50%); opacity:0.12; background: var(--accent); z-index:10; filter:blur(80px); }

/* Custom Cursor */
.cursor-dot {
    position: fixed; width: 7px; height: 7px;
    background: var(--text-main); border-radius: 50%;
    pointer-events: none; transform: translate(-50%,-50%);
    z-index: 10000; box-shadow: 0 0 8px var(--text-main);
}

/* Stars */
.stars-bg {
    position: absolute; inset: 0; z-index: -1; opacity: 0.25;
    background-image:
        radial-gradient(1px 1px at 15% 25%, white, transparent),
        radial-gradient(1px 1px at 40% 60%, white, transparent),
        radial-gradient(1.5px 1.5px at 70% 15%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 85% 55%, white, transparent),
        radial-gradient(1px 1px at 25% 85%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 92% 30%, white, transparent),
        radial-gradient(1px 1px at 55% 70%, white, transparent);
    background-size: 300px 300px;
    animation: slow-pan 80s linear infinite;
}
@keyframes slow-pan {
    0%   { background-position: 0 0; }
    100% { background-position: 300px 300px; }
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.navbar {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%);
    width: 100%; padding: 1.25rem 1.5rem; z-index: 100;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1140px; margin: 0 auto; width: 100%;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.navbar.scrolled { top: 0.75rem; width: 92%; max-width: 980px; }
.navbar.scrolled .nav-container {
    background: rgba(10, 10, 30, 0.75); backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px; padding: 0.6rem 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.brand { font-size: 1.1rem; font-weight: var(--fw-bold); letter-spacing: 0.08em; opacity: 0.5; }

.nav-links {
    display: none; gap: 2rem; text-transform: uppercase;
    font-size: var(--fs-caption); font-weight: var(--fw-semi); letter-spacing: 0.14em;
}
.nav-links.mobile-open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; width: 100%;
    background: rgba(7, 7, 26, 0.96); backdrop-filter: blur(24px);
    padding: 2rem; border-radius: 1rem;
    border: 1px solid var(--glass-border); gap: 1.5rem; text-align: center;
    margin-top: 0.75rem;
}
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-links.mobile-open { display: flex; position: static; flex-direction: row; background: none; border: none; padding: 0; margin-top: 0; }
}
.mobile-menu-btn { display: block; background: none; border: none; color: white; cursor: pointer; padding: 0.4rem; }
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }
.hover-link { transition: color 0.25s, opacity 0.25s; opacity: 0.6; }
.hover-link:hover { color: var(--text-main); opacity: 1; }

/* ══════════════════════════════════════
   LAYOUT BASE
══════════════════════════════════════ */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: var(--section-v) 0; }

/* ══════════════════════════════════════
   HERO (only pyramid + wordmark)
══════════════════════════════════════ */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    position: relative; padding: 0 1.25rem; overflow: hidden;
}

/* ══════════════════════════════════════
   TAGLINE STRIP
══════════════════════════════════════ */
.tagline-strip {
    padding: 3.5rem 1.5rem 4rem;
    display: flex; flex-direction: column;
    align-items: center; gap: 1.25rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.015);
}
.tagline-label {
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--primary);
}
/* Outlined pill button — estilo del screenshot */
.cta-outlined {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 100px;
    font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-main);
    transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.cta-outlined:hover {
    border-color: var(--primary);
    background: rgba(79,142,247,0.1);
    color: var(--primary);
}

.logo-wrapper {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.5rem; position: relative;
    transition: transform 0.08s ease-out;
}

/* Prisma 3D */
.prism-container {
    width: 100%; max-width: 360px; height: 280px;
    position: relative; display: flex;
    justify-content: center; align-items: center;
    margin-bottom: -0.5rem;
}
@media (min-width: 768px) {
    .prism-container { max-width: 440px; height: 420px; margin-bottom: -1.5rem; }
}

.prism-container::before {
    content: ''; position: absolute;
    top: 50%; left: 50%; width: 200px; height: 200px;
    transform: translate(-50%,-50%); background: var(--primary);
    filter: blur(80px); opacity: 0.45; z-index: -1; border-radius: 50%;
    animation: pulse-glow 4s ease-in-out infinite alternate;
}
@keyframes pulse-glow {
    0%   { opacity: 0.25; transform: translate(-50%,-50%) scale(1); }
    100% { opacity: 0.5;  transform: translate(-50%,-50%) scale(1.5); }
}
.prism-container canvas { display: block; outline: none; z-index: 10; filter: drop-shadow(0 16px 40px rgba(139,92,246,0.35)); }

/* Haz blanco entrando por arriba */
.incoming-beam-top {
    position: absolute;
    bottom: 50%; left: 50%;
    width: 6px; height: 55%;
    background: linear-gradient(to top, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 100%);
    transform: translateX(-50%);
    filter: blur(8px); z-index: -1;
    animation: incoming-pulse 2.5s ease-in-out infinite alternate;
}
@keyframes incoming-pulse {
    0%   { opacity: 0.4; filter: blur(12px); }
    100% { opacity: 0.9; filter: blur(6px); }
}

/* Espectro saliente - un solo cono difuminado */
.outgoing-spectrum-bottom {
    position: absolute;
    top: calc(50% + 20px); left: 50%;
    width: 100%; max-width: 320px; height: 240px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,0,85,0.7)   15%,
        rgba(255,110,0,0.7)  30%,
        rgba(255,210,0,0.7)  50%,
        rgba(0,220,255,0.7)  68%,
        rgba(120,80,255,0.7) 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    filter: blur(22px); opacity: 0.55; z-index: -2;
    transform-origin: top center;
    animation: sway 7s ease-in-out infinite alternate;
    pointer-events: none;
    transform: translateX(-50%);
}
@keyframes sway {
    0%   { transform: translateX(-50%) rotate(-5deg); opacity: 0.45; }
    100% { transform: translateX(-50%) rotate(5deg);  opacity: 0.65; }
}

.brand-text-container { z-index: 2; position: relative; text-align: center; margin-top: 0.5rem; }

.main-title {
    font-size: var(--fs-hero); font-weight: var(--fw-bold);
    letter-spacing: -0.04em; line-height: var(--lh-tight);
    text-shadow: 0 0 50px rgba(255,255,255,0.25);
}
.sub-title {
    font-size: var(--fs-caption); font-weight: var(--fw-reg);
    letter-spacing: 0.35em; color: var(--text-muted);
    text-transform: uppercase; margin-top: 0.35rem;
}

/* Hero tagline */
.hero-tagline {
    margin-top: 2rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.hero-label {
    font-size: var(--fs-caption); font-weight: var(--fw-semi);
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-muted);
}
.hero-label span { color: var(--primary); }

/* Botón CTA pill */
.cta-pill {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 2rem; border-radius: 100px;
    background: var(--primary); color: #fff;
    font-size: var(--fs-body); font-weight: var(--fw-semi);
    letter-spacing: -0.01em;
    box-shadow: 0 0 30px rgba(79,142,247,0.35);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.3s, background 0.3s;
}
.cta-pill:hover {
    transform: translateY(-2px) scale(1.03);
    background: #6fa4ff;
    box-shadow: 0 0 50px rgba(79,142,247,0.55);
}
.cta-pill .wa-icon { font-size: 1.2rem; }

.scroll-indicator {
    position: absolute; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%); display: flex; flex-direction: column;
    align-items: center; gap: 0.4rem; opacity: 0.4;
    animation: bounce 2.5s ease-in-out infinite;
    transition: opacity 0.5s ease;
}
.scroll-indicator.faded { opacity: 0; pointer-events: none; }
.scroll-indicator .scroll-text { font-size: var(--fs-caption); letter-spacing: 0.12em; }
@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50%       { transform: translate(-50%, -8px); }
}

/* ══════════════════════════════════════
   BRANDS / STACK
══════════════════════════════════════ */
.brands-section {
    padding: 4rem 0 3rem; overflow: hidden; position: relative;
    border-bottom: 1px solid var(--glass-border);
}
.brands-header {
    text-align: left;
    margin-bottom: 3rem;
    padding-bottom: 0;
}
.brands-title {
    font-size: clamp(2rem, 5vw, 3rem); font-weight: var(--fw-bold);
    letter-spacing: -0.03em; line-height: 1.1;
    margin-bottom: 0.6rem;
}
.brands-subtitle {
    font-size: var(--fs-body); color: var(--text-muted);
}

.marquee-track {
    display: flex; width: max-content; animation: scroll-marquee 28s linear infinite;
    gap: 5rem; padding: 0 2.5rem;
}
.marquee-track:hover { animation-play-state: paused; }
.brand-logo {
    display: flex; align-items: center; gap: 0.65rem;
    color: var(--text-muted); font-size: 1.1rem; font-weight: var(--fw-semi);
    opacity: 0.45; transition: opacity 0.25s; cursor: default;
}
.brand-logo:hover { opacity: 0.9; }
.brand-logo svg { height: 22px; width: auto; }
@keyframes scroll-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 2.5rem)); }
}
.brands-section::before, .brands-section::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 12vw; 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); }

/* ══════════════════════════════════════
   SECCIÓN TÍTULOS — SISTEMA UNIFICADO
══════════════════════════════════════ */
.section-eyebrow {
    font-size: var(--fs-caption); font-weight: var(--fw-semi);
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--primary); margin-bottom: 0.75rem; display: block;
}
.section-title {
    font-size: var(--fs-h2); font-weight: var(--fw-bold);
    letter-spacing: -0.02em; line-height: var(--lh-tight);
    margin-bottom: 1rem;
}
.section-body {
    font-size: var(--fs-body); color: var(--text-muted);
    max-width: 560px; line-height: var(--lh-body);
}
.section-header { margin-bottom: 3.5rem; }

/* ══════════════════════════════════════
   GLASS PANEL BASE
══════════════════════════════════════ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-card);
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1),
                border-color 0.4s, box-shadow 0.4s;
}
.glass-panel:hover {
    transform: translateY(-5px);
    border-color: rgba(79,142,247,0.3);
    box-shadow: 0 0 40px -8px rgba(79,142,247,0.2);
}
.glass-tag {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    padding: 0.3rem 0.9rem; border-radius: 999px;
    font-size: var(--fs-caption); font-weight: var(--fw-semi);
}

/* ══════════════════════════════════════
   SERVICIOS
══════════════════════════════════════ */
.services-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--gap-card);
}
@media (min-width: 640px) { .services-grid { grid-template-columns: 1fr 1fr; } }

.service-card { padding: 2.25rem; }

.service-icon {
    width: 3rem; height: 3rem; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(79,142,247,0.12); color: var(--primary);
    margin-bottom: 1.5rem;
}
.service-icon svg { width: 1.5rem; height: 1.5rem; }

.service-card h4 {
    font-size: var(--fs-h3); font-weight: var(--fw-semi);
    margin-bottom: 1rem; letter-spacing: -0.01em;
}
.feature-list { display: flex; flex-direction: column; gap: 0.6rem; }
.feature-list li {
    display: flex; align-items: center; gap: 0.65rem;
    font-size: var(--fs-body); color: var(--text-muted);
}
.bullet { flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ══════════════════════════════════════
   PROYECTOS — GRID UNIFORME
══════════════════════════════════════ */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-card);
}
@media (min-width: 640px) { .projects-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .projects-grid { grid-template-columns: 1fr 1fr 1fr; } }

.project-card {
    display: flex; flex-direction: column;
    overflow: hidden; padding: 0;
    /* Altura fija uniforme */
}

.project-image {
    width: 100%; height: 220px; position: relative; overflow: hidden; flex-shrink: 0;
}
.project-image img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.65;
    transition: transform 1.2s cubic-bezier(0.16,1,0.3,1), opacity 0.6s;
}
.project-card:hover .project-image img { transform: scale(1.06); opacity: 0.9; }
.image-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to bottom, transparent 40%, rgba(7,7,26,0.85) 100%);
}

.project-info { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.project-tag {
    font-size: var(--fs-caption); text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--primary);
    font-weight: var(--fw-semi); margin-bottom: 0.5rem; display: block;
}
.project-info h4 {
    font-size: var(--fs-h3); font-weight: var(--fw-semi);
    letter-spacing: -0.01em; margin-bottom: 0.65rem; line-height: 1.25;
}
.project-info p {
    font-size: var(--fs-body); color: var(--text-muted);
    line-height: var(--lh-body); flex: 1; margin-bottom: 1.25rem;
}
.tech-stack { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }

/* ══════════════════════════════════════
   IMPACTO / KPIs
══════════════════════════════════════ */
.kpi-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-card); text-align: center;
}
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi-card { padding: 2.5rem 1.5rem; }
.kpi-number {
    font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: var(--fw-bold);
    color: var(--primary); margin-bottom: 0.4rem;
    text-shadow: 0 0 25px rgba(79,142,247,0.45); line-height: 1;
}
.kpi-label {
    font-size: var(--fs-caption); text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--text-muted); font-weight: var(--fw-semi);
}

/* ══════════════════════════════════════
   FOOTER / CONTACT
══════════════════════════════════════ */
.footer {
    min-height: 80vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative; text-align: center; padding: 5rem 1.5rem 3rem;
}
.footer-content { max-width: 640px; }
.footer-content h2 {
    font-size: clamp(2.5rem, 6vw, 5rem); font-weight: var(--fw-bold);
    letter-spacing: -0.03em; line-height: var(--lh-tight); margin-bottom: 1rem;
}
.footer-content h2 .accent-word { color: var(--primary); }
.footer-content p {
    font-size: var(--fs-body); color: var(--text-muted);
    margin-bottom: 2.5rem; line-height: var(--lh-body);
}
.footer-cta { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.email-link {
    font-size: 1rem; font-weight: var(--fw-semi); color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 0.3rem;
    transition: color 0.3s, border-color 0.3s;
}
.email-link:hover { color: var(--text-main); border-color: var(--primary); }

.social-links { display: flex; gap: 1rem; margin-top: 4rem; }
.social-btn {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted);
    font-size: var(--fs-caption); font-weight: var(--fw-semi); text-transform: uppercase;
    background: var(--glass-bg); backdrop-filter: blur(10px);
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}
.social-btn:hover { border-color: var(--primary); color: var(--text-main); transform: translateY(-3px); }

.copyright { margin-top: 3rem; font-size: var(--fs-caption); color: var(--text-caption); }

/* ══════════════════════════════════════
   REVEAL ANIMATION
══════════════════════════════════════ */
.reveal-up {
    opacity: 0; transform: translateY(40px); filter: blur(6px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1),
                filter 0.9s cubic-bezier(0.16,1,0.3,1);
    will-change: opacity, transform;
}
.reveal-up.active { opacity: 1; transform: translateY(0); filter: blur(0); }
