:root {
    /* --- Cyber Palette (Aero Edition) --- */
    --bg-dark: #000000;
    /* Pure Black */
    --bg-card: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);

    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    --brand-primary: #3b82f6;
    --brand-glow: #2563eb;

    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    --accent-emerald: #10b981;
    --accent-orange: #f97316;

    /* --- Spacing & UI --- */
    --container-width: 1280px;
    --header-height: 120px;
    --radius-lg: 1.5rem;
    --radius-md: 0.75rem;

    /* --- Fonts --- */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Resets & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(to right, #60a5fa, #a855f7, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Layout Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 5rem 0;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-3 {
    grid-template-columns: repeat(1, 1fr);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .col-span-2 {
        grid-column: span 2;
    }
}

/* --- Aero Glass Components --- */
.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Aero Shine */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    border-top-color: rgba(255, 255, 255, 0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* --- Hero Content Z-Index Fix --- */
#hero-content {
    position: relative;
    z-index: 10;
    /* Pushed back: Below Navbar (800+) stack */
    /* Ensure text sits above the fixed video background */
}

/* --- Video Transition System --- */
.hero-video-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    /* z-index: 0; REMOVED to prevent stacking context trap */
}

/* The Frame that moves/animates */
#video-frame {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    will-change: width, height, top, left;
    background: #000000;

    /* Removed clip-path and border-radius as requested by user */
}

/* The Video Content */
#hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 1.5s ease-in-out;
}

/* --- Breathing Fade Effect (Loop) --- */
.fade-out-active #hero-video {
    filter: brightness(0);
}

#watermark-cover {
    display: none;
    /* Hidden by default (Desktop) */
}

/* Watermark Mask (Percentage based) */
#watermark-mask {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 7%;
    height: 7%;
    background: #000000;
    z-index: 102;
    /* Top priority */
    pointer-events: none;
    border-top-left-radius: 30%;
    /* Smooth curve */
}

/* Navbar Logo Placeholder (Target for animation) */
#logo-target {
    width: 180px;
    /* 16:9 ratio */
    height: 101px;
    /* Hidden so video takes its place */
    opacity: 0;
    margin-left: 10px;
    object-fit: cover;
}

/* --- Spotlight Effect --- */
.spotlight-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(168, 85, 247, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 2;
}

.spotlight-card:hover::after {
    opacity: 1;
}

/* --- Mobile Menu --- */
.mobile-menu-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    z-index: 40;
}

.mobile-menu-overlay.open {
    transform: translateY(0);
    opacity: 1;
}

/* --- Desktop Menu Visibility --- */
@media (min-width: 1024px) {

    /* Target the ul directly next to the logo container */
    nav .container>ul {
        display: flex !important;
        /* Override inline display: none */
    }

    #mobile-toggle {
        display: none !important;
    }
}

/* --- Background Grid --- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    #hero-video {
        object-fit: contain !important;
        /* Force fit width, letterboxed if needed */
        width: 100% !important;
    }

    /* Force the frame to be 100% size on mobile (Fit Width, no crop) */
    /* REMOVED !important from ALL properties to allow JS animation */
    #video-frame {
        width: 100vw;
        height: 56.25vw;
        /* 16:9 of 100vw */
        /* JS handles top/left/transform for animation */
    }

    #hero-video {
        /* Removed zoom hacks. Using #watermark-cover instead. */
        object-fit: contain !important;
        width: 100% !important;
    }

    /* "The Black Tape" - Physical Overlay for Watermark */
    #watermark-cover {
        position: absolute;
        bottom: 0;
        right: 0;
        /* Use Percentages so it shrinks WITH the video */
        width: 15%;
        height: 10%;
        background-color: #000000;
        /* Matches video background */
        z-index: 50;
        /* Above video, below text if any */
        display: block;
        /* Visible on mobile */
    }

    #logo-target {
        height: 48px;
        /* Micro size */
        width: 85px;
        border-radius: 8px;
        /* Softer rounding */
        margin-left: 0;
    }
}

/* --- Modern Glass Menu Redesign (Capsule) --- */
/* Navbar Container - The "Capsule" */
nav .container {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;

    padding: 0.5rem 1.5rem;
    margin-top: 0;
    box-shadow: none;
    max-width: 1200px;
    /* Limit width */
    width: 90%;
    /* Responsive */
    margin-left: auto;
    margin-right: auto;
    transition: all 0.4s ease;

    /* CRITICAL Z-INDEX SAFETY */
    position: relative;
    z-index: 1000 !important;
    /* Always on top */
}

/* Menu Links */
nav ul li a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* CTA Button Redesign */
nav .btn-primary {
    background: #ffffff;
    color: #000;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    border: none;
}

nav .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
    background: #fff;
}

/* --- Dynamic Scroll Bar --- */
#dynamic-scroll-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: #000000;
    transform: translateY(-100%);
    opacity: 0;
    z-index: 900;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#dynamic-scroll-bar.show-bar {
    transform: translateY(0);
    opacity: 1;
}

/* --- CONTENT REBUILD STYLES (Glass/Aero Theme) --- */

/* General Section Layout */
.main-content {
    color: #fff;
    padding-bottom: 2rem;
}

.section-padding {
    padding: 6rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-gradient {
    background: linear-gradient(to right, #60a5fa, #a855f7, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-highlight {
    color: #3b82f6;
}

/* Hero Text Section (Post-Video) */
.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 9999px;
    font-size: 0.85rem;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary {
    background: #fff;
    color: #000 !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #fff;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item strong {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-item span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

/* Marquee */
.clients-section {
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    /* Mask edges */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    gap: 4rem;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-content img {
    height: 35px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: 0.3s;
}

.marquee-content img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Grids & Cards */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.card-large {
    grid-column: span 1;
    /* Default mobile */
}

@media (min-width: 768px) {
    .grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-large {
        grid-column: span 2;
    }
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.glass-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.glass-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    color: rgba(255, 255, 255, 0.8);
}

/* Features (Why Us) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Pricing */
.pricing-section .glass-card {
    text-align: center;
    padding: 4rem 2rem;
}

.pricing-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.price-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 300px;
    max-width: 100%;
}

.price-box.featured {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.05);
    position: relative;
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #a855f7;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 99px;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.po {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    margin-top: 1rem;
}

.full-width {
    width: 100%;
    display: block;
    text-align: center;
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #000;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.consulting-banner {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    margin-bottom: 4rem;
}

.consulting-banner h3 {
    margin-bottom: 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1.5rem;
}

.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

/* Utility */
.center {
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .nav-links {
        display: none;
    }

    /* Ensure menu issues don't crop up */
    .hero-title {
        font-size: 2.5rem;
    }

    .price-box.featured {
        transform: scale(1);
    }

    .marquee-content {
        gap: 2rem;
    }

    /* Logo más pequeño en móvil */
    #logo-target {
        width: 100px !important;
        height: 56px !important;
        margin-left: 5px !important;
    }
}

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* Animated Rings */
.loader-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid transparent;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loader-ring:nth-child(2) {
    width: 100px;
    height: 100px;
    border-top-color: #a855f7;
    animation-duration: 2s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 80px;
    height: 80px;
    border-top-color: #2dd4bf;
    animation-duration: 1.2s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loader-text {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 180px;
}

.loading-gradient {
    background: linear-gradient(to right, #60a5fa, #a855f7, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.25rem;
}

.loading-dots span {
    color: white;
    animation: dot-blink 1.4s infinite;
    font-size: 1.5rem;
    font-weight: 700;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-blink {
    0%, 20% {
        opacity: 0;
    }
    40%, 100% {
        opacity: 1;
    }
}

/* Responsive loading screen */
@media (max-width: 768px) {
    .loader-ring {
        width: 90px;
        height: 90px;
    }
    
    .loader-ring:nth-child(2) {
        width: 75px;
        height: 75px;
    }
    
    .loader-ring:nth-child(3) {
        width: 60px;
        height: 60px;
    }
    
    .loader-text {
        margin-top: 150px;
    }
    
    .loading-gradient {
        font-size: 1.2rem;
    }
}
