@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --bg-primary:   #020617;
    --bg-secondary: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent:       #3b82f6;
    --accent-glow:  rgba(59,130,246,0.2);
    --border:       rgba(255,255,255,0.08);
    --glass:        rgba(15,23,42,0.7);
    --card-hover:   rgba(59,130,246,0.05);
    --menu-bg:      #08111f;
}

[data-theme="light"] {
    --bg-primary:    #f8fafc;
    --bg-secondary:  #ffffff;
    --text-primary:  #020617;
    --text-secondary:#475569;
    --accent:        #2563eb;
    --accent-glow:   rgba(37,99,235,0.08);
    --border:        rgba(0,0,0,0.08);
    --glass:         rgba(255,255,255,0.85);
    --card-hover:    rgba(37,99,235,0.03);
    --menu-bg:       #ffffff;
}

html, body {
    margin: 0; padding: 0;
    width: 100%; min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.8s cubic-bezier(0.4,0,0.2,1), color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3, .font-outfit { font-family: 'Outfit', sans-serif; }

/* ============================================
   GLASSMORPHISM
   ============================================ */
.glass {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* ============================================
   LOGO GRADIENT
   ============================================ */
.logo-gradient {
    background: linear-gradient(90deg, #3b82f6, #ec4899, #3b82f6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flow 5s linear infinite;
}
@keyframes flow { to { background-position: 200% center; } }

/* ============================================
   HAMBURGER BUTTON
   ============================================ */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 9px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.hamburger-btn:hover {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.35);
}
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}
[data-theme="light"] .hamburger-btn span { background: #020617; }

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.mobile-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   MOBILE SLIDE-IN MENU
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: min(300px, 82vw);
    height: 100dvh;
    background: var(--menu-bg);
    border-left: 1px solid var(--border);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 2rem;
    overflow-y: auto;
    box-shadow: -24px 0 60px rgba(0,0,0,0.45);
    /* Scrollbar sutil */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.mobile-menu.open { transform: translateX(0); }

/* Top bar */
.mobile-menu-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Close button */
.mobile-menu-close {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.mobile-menu-close:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.35);
    color: #ef4444;
}

/* Divider */
.mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

/* Nav */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    padding: 0.5rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.22s ease;
}
.mobile-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.mobile-nav-link:hover {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.18);
    color: var(--text-primary);
    transform: translateX(3px);
}
.mobile-nav-link:hover i { opacity: 1; }
.mobile-nav-link.active {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.28);
    color: #3b82f6;
}
.mobile-nav-link.active i { opacity: 1; color: #3b82f6; }

/* CTA block */
.mobile-menu-cta {
    padding: 1.1rem 0;
}
.mobile-cta-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #2563eb;
    color: #fff;
    padding: 0.8rem 1.25rem;
    border-radius: 12px;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px -4px rgba(37,99,235,0.4);
}
.mobile-cta-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px -4px rgba(37,99,235,0.5);
}

/* Feature tags */
.mobile-menu-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.25rem;
}
.mobile-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

/* ============================================
   BENTO CARDS
   ============================================ */
.bento-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 2rem;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
}
.bento-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.3);
}
.bento-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at var(--x) var(--y), var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.bento-card:hover::before { opacity: 1; }

/* ============================================
   THEME RIPPLE & CANVAS
   ============================================ */
#theme-ripple {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: var(--bg-primary);
    clip-path: circle(0% at center);
    z-index: 9999;
    pointer-events: none;
    transition: clip-path 0.8s cubic-bezier(0.4,0,0.2,1);
}
#theme-ripple.active { clip-path: circle(150% at center); }

#three-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2; pointer-events: none;
}

.global-glass-aura {
    position: fixed; inset: 0;
    pointer-events: none; z-index: -1; overflow: hidden;
}
.glass-square {
    position: absolute;
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
[data-theme="light"] .bento-card {
    background: #ffffff;
    box-shadow: 0 15px 45px -10px rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.05);
}
[data-theme="light"] .glass {
    background: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.4);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.animate-pulse-slow {
    animation: pulse-glow 3s infinite ease-in-out;
}
@keyframes pulse-glow {
    0%,100% { opacity:0.5; transform:scale(1);   filter:blur(5px); }
    50%      { opacity:0.8; transform:scale(1.1); filter:blur(2px); }
}

.wa-float { animation: wa-float 4s infinite ease-in-out; }
@keyframes wa-float {
    0%,100% { transform: translateY(0) rotate(0); }
    50%     { transform: translateY(-15px) rotate(5deg); }
}

.yellow-gradient {
    background: linear-gradient(135deg, #fff 0%, #ffdf00 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glow-yellow { color:#ffdf00; text-shadow: 0 0 20px rgba(255,223,0,0.3); }
.glow-text   { text-shadow: 0 0 20px var(--accent-glow); }

/* Float animation */
@keyframes float {
    0%,100% { transform: translateY(0px);   }
    50%     { transform: translateY(-20px); }
}
.animate-float { animation: float 8s ease-in-out infinite; }

/* ============================================
   HERO MOBILE STACK
   ============================================ */
.hero-stack {
    position: relative;
    width: 160px; height: 340px;
    margin: 0 auto;
    perspective: 4000px;
    transform-style: preserve-3d;
    z-index: 10;
}
.hero-stack-item {
    position: absolute;
    width: 100%; height: 100%;
    cursor: pointer;
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
    transform-origin: center;
    transform-style: preserve-3d;
}
.hero-stack-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 1.5rem;
    border: 4px solid #000;
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.8);
}

.hero-info-tag {
    opacity: 0;
    transform: translateY(20px);
}
.hero-info-tag i { font-size: 0.9rem; }

/* ============================================
   RESPONSIVE — TABLET (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .hero-stack { width: 140px; height: 300px; }
}

/* ============================================
   RESPONSIVE — MOBILE (max 768px)
   ============================================ */
@media (max-width: 768px) {

    /* Secciones: padding lateral reducido */
    section { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Hero stack: más pequeño */
    .hero-stack { width: 120px; height: 260px; }

    /* Bento cards: border-radius menor */
    .bento-card { border-radius: 1.5rem !important; }

    /* Parallax: desactivado en mobile para evitar glitches */
    [data-parallax] { transform: none !important; }

    /* Imágenes absolutas flotantes: ocultar para no romper layout */
    .absolute.hidden-mobile-img { display: none !important; }
}

/* ============================================
   RESPONSIVE — SMALL PHONES (max 400px)
   ============================================ */
@media (max-width: 400px) {
    .hero-stack { width: 100px; height: 220px; }

    .mobile-menu { width: 88vw; }

    /* Columnas de imágenes "Responsive Total": solo 2 columnas */
    .responsive-col-third { display: none; }
}