:root {
    --bg-color: #2d0b3a;
    --primary-color: #a855f7;
    --accent-color: #ffffff;
    --font-main: 'Outfit', sans-serif;
    --font-tesla: 'Tesla', sans-serif;
    --cursor-x: 50%;
    --cursor-y: 50%;
}

@font-face {
    font-family: 'Tesla';
    src: url('TESLA.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    color: var(--accent-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    position: relative;
}

/* Cursor Spotlight */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(600px circle at var(--cursor-x) var(--cursor-y),
            rgba(168, 85, 247, 0.15),
            transparent 40%);
    transition: background 0.15s ease;
    mix-blend-mode: screen;
}

#interactive-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Header & Navigation */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 400;
    /* Thinner weight */
    letter-spacing: -1px;
    color: var(--accent-color);
    font-family: 'Tesla';
    display: block;
    /* Revert to block */
    visibility: visible;
}



.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #111;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
    padding: 0.6rem 1rem;
    display: block;
    white-space: nowrap;
    border-radius: 8px;
}

.dropdown-menu li a:hover {
    background: rgba(168, 85, 247, 0.1);
}

/* CTA Button */
.cta-button {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 968px) {

    .nav-links,
    .cta-button {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mobile-menu-btn span {
        width: 30px;
        height: 2px;
        background: white;
        border-radius: 2px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e0726;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Hero Section */
.scroll-container {
    height: 400vh;
    /* Altura generosa para una transición suave por frames */
    position: relative;
    background-color: #000000;
    /* Negro sólido absoluto */
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: none;
    /* Allow clicks */
}

.media-layer {
    z-index: 1;
    /* Below header */
}

.text-layer {
    z-index: 2000;
    /* Above header */
    margin-top: -100vh;
    /* Overlap media */
}

#hero-canvas {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    /* La transparencia se manejará vía JS con globalCompositeOperation */
}

.hero-text {
    font-family: var(--font-tesla);
    font-size: clamp(2rem, 6vw, 4.5rem);
    /* Significantly smaller font size */
    color: var(--accent-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Reduced spacing */
    z-index: 2000;
    /* Ensure it floats ABOVE the navbar */
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    display: flex;
    gap: 0.8rem;
    /* Reduced gap */
    justify-content: center;
    align-items: center;
    /* Ensure vertical alignment */
}

.hero-text .word {
    display: inline-flex;
    align-items: center;
}

/* Ensure letters being kept (E, T, C) are wrapped properly if needed */
.hero-text span {
    display: inline-block;
}

/* Rest of the words */
.hero-text .rest {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
}

.hero-media {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 80%;
    height: 80%;
    max-width: 1000px;
    opacity: 0;
    /* Hidden initially */
    z-index: 1;
    /* Behind text initially if needed, but text moves away */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.2);
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Section */
.content-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    /* Changed from #000000 to transparent for spotlight */
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    /* Ensure z-index works if needed */
    z-index: 1;
}

.container {
    max-width: 1200px;
    /* Aumentado para mejor visualización */
    margin: 0 auto;
    padding: 0 2rem;
}

h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
}

p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    text-align: center;
}

/* Content Section & Features */
.content-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    /* Changed from #000000 to transparent for spotlight */
    padding: 10rem 0;
    text-align: center;
    position: relative;
    /* Ensure z-index works if needed */
    z-index: 2;
    /* Ensures content is above spotlight */
}


.section-header {
    text-align: center;
    margin-bottom: 6rem;
    width: 100%;
}

.section-tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 1.5rem auto 0;
    max-width: 600px;
    line-height: 1.7;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin: 4rem auto 0;
    width: 100%;
    max-width: 1200px;
}

.feature-card {
    background: rgba(25, 25, 25, 0.7);
    /* Lighter and more opaque */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    /* More visible border */
    padding: 4rem 2rem;
    border-radius: 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 40px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0), rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-12px);
    background: rgba(15, 10, 25, 0.8);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.15), 0 0 40px rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.3);
}

.icon-wrap {
    font-size: 2.5rem;
    margin: 0 auto 2rem;
    background: rgba(168, 85, 247, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
}

/* Highlight Section (Promo Box Centrada) */
.highlight-section {
    padding: 8rem 0;
    background: #000;
}

.promo-box {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.1);
    padding: 6rem 2rem;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 10;
}

.promo-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
}

.promo-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Testimonials Centered */
.testimonials-section {
    padding: 10rem 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin: 5rem auto 0;
    max-width: 1200px;
}

.testimonial-card {
    text-align: center;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: 30px;
    padding: 3rem 2rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 10;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(15, 10, 25, 0.7);
}

/* Contact Section Centered */
.contact-section {
    padding: 10rem 2rem;
}

.contact-card {
    margin: 0 auto;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 40px;
    padding: 4rem 3rem;
    max-width: 600px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 10;
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
}

/* Footer */
.main-footer {
    background-color: transparent;
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    /* 4 columns */
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    /* Left align */
}

.footer-info .logo {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.footer-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.footer-links h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    justify-content: center;
}

/* Back To Top Button */
.back-to-top {
    position: fixed;
    bottom: 110px;
    /* Above WhatsApp button */
    right: 44px;
    /* Aligned with WhatsApp center */
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 9989;
    /* Slightly below WhatsApp */
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: #c084fc;
    transform: translateY(-3px);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-info {
        align-items: center;
    }

    .social-icons {
        justify-content: center;
    }

    .float-whatsapp {
        bottom: 20px;
        right: 20px;
    }

    .back-to-top {
        bottom: 90px;
        right: 25px;
    }
}

/* Directory Page Styles */
.directory-page {
    padding-top: 80px;
    /* Space for fixed header */
}

.directory-hero {
    padding: 8rem 0 4rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
}

.team-section {
    padding: 4rem 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    justify-items: center;
}

.team-card {
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.5);
    /* Stronger border for visibility */
    border-radius: 24px;
    padding: 0;
    /* Remove padding to let image fill */
    text-align: center;
    width: 100%;
    max-width: 350px;
    height: 480px;
    /* Taller card */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Text at bottom */
    position: relative;
    overflow: hidden;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
}

/* Background Image Container */
.card-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.card-image-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .card-image-bg img {
    transform: scale(1.05);
}

/* Gradient Overlay for Text Readability */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

/* Card Content (Text) */
.card-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    text-align: center;
    width: 100%;
}

.team-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    color: #fff;
    font-weight: 700;
}

.team-card .role {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.icon-link {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.icon-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* WhatsApp Floating Button */
.float-whatsapp {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5);
    z-index: 9990;
    /* High Z-Index, below cursor */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.float-whatsapp:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    background-color: #128c7e;
    /* Darker green on hover */
    color: #FFF;
}

/* ========================================= */
/* RESPONSIVE STYLES */
/* ========================================= */

@media (max-width: 968px) {

    /* Navbar Mobile Styles */
    .nav-links {
        display: none;
        /* Hidden by default, controlled by JS toggle */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 3rem 2rem;
        border-bottom: 1px solid rgba(168, 85, 247, 0.2);
        gap: 2rem;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    /* In mobile menu, ensure links interact nicely */
    .nav-links a {
        font-size: 1.2rem;
        display: block;
        width: 100%;
        text-align: center;
    }

    .cta-button {
        display: none;
    }

    /* Adjust hero text for tablet/small laptop */
    .hero-text {
        font-size: clamp(2.5rem, 8vw, 6rem);
        flex-wrap: wrap;
        /* Allow wrapping if needed */
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    /* Collapse Grids to Single Column */
    .feature-grid,
    .team-grid,
    .stats-counter-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    /* Stack Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .footer-info,
    .footer-links,
    .social-icons {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .social-icons {
        flex-direction: row;
        /* Keep icons horizontal */
    }

    /* Section Spacing */
    .content-section,
    .testimonials-section,
    .contact-section,
    .highlight-section {
        padding: 5rem 1rem;
    }

    /* Typography Scaling */
    h2 {
        font-size: 2.2rem;
    }

    .section-tagline {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .team-card {
        max-width: 100%;
        /* Use full width in single column */
        height: auto;
        min-height: 450px;
    }
}

@media (max-width: 480px) {

    /* Mobile Phone Adjustments */
    .container {
        padding: 0 1rem;
    }

    /* Stack Hero Text Vertically for readability */
    .hero-text {
        font-size: clamp(2rem, 10vw, 3.5rem);
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-text .word {
        justify-content: center;
    }

    .contact-card,
    .feature-card,
    .testimonial-card,
    .promo-box {
        padding: 2.5rem 1.5rem;
        border-radius: 25px;
    }

    /* Adjust Icons */
    .icon-wrap {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Ensure floating buttons don't block content or overlap */
    .float-whatsapp {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 85px;
        /* Above whatsapp */
        right: 25px;
        font-size: 1rem;
    }
}