/* =========================================
   RESET
========================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #030712;
    color: #f8fafc;

    line-height: 1.6;

    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}


/* =========================================
   VARIABLES
========================================= */

:root {

    --bg-main: #030712;
    --bg-secondary: #050914;

    --card: rgba(15, 23, 42, 0.55);
    --card-hover: rgba(20, 30, 50, 0.75);

    --border: rgba(148, 163, 184, 0.12);
    --border-hover: rgba(148, 163, 184, 0.25);

    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --blue: #3b82f6;
    --purple: #8b5cf6;
    --teal: #14b8a6;

    --gradient:
        linear-gradient(
            90deg,
            #3b82f6,
            #8b5cf6,
            #14b8a6
        );

    --max-width: 1100px;
}


/* =========================================
   NAVBAR
========================================= */

.navbar {

    position: fixed;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    width: calc(100% - 40px);
    max-width: 1000px;

    z-index: 1000;

    border: 1px solid transparent;

    transition:
        background .3s ease,
        border-color .3s ease,
        box-shadow .3s ease,
        backdrop-filter .3s ease;
}

.navbar.scrolled {

    background: rgba(3, 7, 18, 0.78);

    border-color: var(--border);

    backdrop-filter: blur(16px);

    box-shadow:
        0 10px 40px rgba(0, 0, 0, .25);

    border-radius: 50px;
}

.nav-container {

    height: 56px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;
}

.brand {

    font-size: 15px;
    font-weight: 700;

    letter-spacing: .04em;
}

.brand-dot {
    color: var(--purple);
}

.nav-links {

    display: flex;
    gap: 28px;

    font-size: 13px;

    color: var(--text-secondary);
}

.nav-links a {

    transition: color .2s ease;
}

.nav-links a:hover {
    color: white;
}


/* =========================================
   MOBILE MENU
========================================= */

.menu-toggle {

    display: none;

    background: none;
    border: 0;

    cursor: pointer;
}

.menu-toggle span {

    display: block;

    width: 22px;
    height: 2px;

    margin: 4px;

    background: white;
}

.mobile-menu {
    display: none;
}


/* =========================================
   HERO
========================================= */

.hero {

    min-height: 100vh;

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding:
        130px 20px
        80px;

    overflow: hidden;
}


/* Grid background */

.grid-background {

    position: absolute;

    inset: 0;

    background-image:

        linear-gradient(
            rgba(148, 163, 184, .055) 1px,
            transparent 1px
        ),

        linear-gradient(
            90deg,
            rgba(148, 163, 184, .055) 1px,
            transparent 1px
        );

    background-size: 50px 50px;

    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 85%
        );

    opacity: .6;
}


/* Subtle glow */

.hero::before {

    content: "";

    position: absolute;

    width: 600px;
    height: 400px;

    top: 80px;

    background:
        radial-gradient(
            ellipse,
            rgba(99, 102, 241, .12),
            transparent 70%
        );

    filter: blur(20px);

    pointer-events: none;
}


.hero-content {

    position: relative;

    z-index: 2;

    text-align: center;

    max-width: 760px;

    margin-bottom: 65px;
}

.eyebrow {

    font-size: 12px;

    letter-spacing: .2em;

    color: var(--text-muted);

    margin-bottom: 18px;
}

.hero h1 {

    font-size:
        clamp(55px, 9vw, 100px);

    line-height: 1;

    font-weight: 750;

    margin-bottom: 18px;

    background:
        linear-gradient(
            90deg,
            #3b82f6,
            #8b5cf6,
            #14b8a6
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.hero h2 {

    font-size:
        clamp(25px, 4vw, 42px);

    line-height: 1.15;

    margin-bottom: 22px;
}

.hero-description {

    max-width: 650px;

    margin: auto;

    color: var(--text-secondary);

    font-size: 17px;
}


/* =========================================
   BADGES
========================================= */

.technology-badges {

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 8px;

    margin-top: 28px;
}

.badge {

    padding:
        6px 14px;

    border-radius: 30px;

    font-size: 12px;

    border: 1px solid transparent;
}

.badge-blue {

    color: #60a5fa;

    background: rgba(59, 130, 246, .1);

    border-color:
        rgba(59, 130, 246, .15);
}

.badge-purple {

    color: #a78bfa;

    background: rgba(139, 92, 246, .1);

    border-color:
        rgba(139, 92, 246, .15);
}

.badge-teal {

    color: #2dd4bf;

    background: rgba(20, 184, 166, .1);

    border-color:
        rgba(20, 184, 166, .15);
}


/* =========================================
   BUTTONS
========================================= */

.hero-buttons,
.contact-buttons {

    display: flex;

    justify-content: center;

    gap: 12px;

    margin-top: 32px;
}

.btn {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        11px 22px;

    border-radius: 8px;

    font-size: 14px;

    font-weight: 600;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.btn:hover {

    transform: translateY(-2px);
}

.btn-primary {

    background:
        linear-gradient(
            90deg,
            #3b82f6,
            #8b5cf6
        );

    box-shadow:
        0 10px 30px
        rgba(99, 102, 241, .18);
}

.btn-secondary {

    background:
        rgba(15, 23, 42, .6);

    border:
        1px solid var(--border);

    color: var(--text-secondary);
}

.btn-secondary:hover {

    background:
        rgba(30, 41, 59, .8);

    color: white;
}


/* =========================================
   SERVICE OVERVIEW
========================================= */

.service-overview {

    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 960px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    padding: 15px;

    background:
        rgba(15, 23, 42, .4);

    border:
        1px solid var(--border);

    border-radius: 12px;

    backdrop-filter: blur(10px);
}

.service-card {

    padding: 25px;

    background:
        rgba(30, 41, 59, .42);

    border:
        1px solid transparent;

    border-radius: 8px;

    transition:
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.service-card:hover {

    background:
        rgba(30, 41, 59, .7);

    border-color:
        var(--border-hover);

    transform:
        translateY(-3px);
}

.service-icon {

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    margin-bottom: 15px;

    font-size: 13px;

    font-family:
        monospace;

    font-weight: bold;
}

.service-icon.blue {

    color: #60a5fa;

    background:
        rgba(59, 130, 246, .1);
}

.service-icon.purple {

    color: #a78bfa;

    background:
        rgba(139, 92, 246, .1);
}

.service-icon.teal {

    color: #2dd4bf;

    background:
        rgba(20, 184, 166, .1);
}

.service-card h3 {

    font-size: 17px;

    margin-bottom: 8px;
}

.service-card p {

    font-size: 13px;

    color:
        var(--text-secondary);
}


/* =========================================
   SECTIONS
========================================= */

.section {

    padding:
        120px 20px;
}

.section-container {

    max-width:
        var(--max-width);

    margin: auto;
}

.section-heading {

    max-width: 700px;

    margin:
        0 auto 60px;

    text-align: center;
}

.section-label {

    display: block;

    font-size: 11px;

    letter-spacing: .18em;

    color: var(--purple);

    margin-bottom: 15px;

    font-weight: 700;
}

.section-heading h2 {

    font-size:
        clamp(30px, 5vw, 42px);

    line-height: 1.2;

    margin-bottom: 16px;
}

.section-heading p {

    color: var(--text-secondary);

    font-size: 15px;
}


/* =========================================
   SERVICES
========================================= */

.services-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 18px;
}

.large-service-card {

    position: relative;

    min-height: 270px;

    padding: 30px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius: 12px;

    overflow: hidden;

    transition:
        transform .3s ease,
        border-color .3s ease,
        background .3s ease;
}

.large-service-card:hover {

    transform:
        translateY(-5px);

    background:
        var(--card-hover);

    border-color:
        var(--border-hover);
}

.card-number {

    display: block;

    font-size: 12px;

    color:
        var(--text-muted);

    margin-bottom: 45px;
}

.large-service-card h3 {

    font-size: 22px;

    margin-bottom: 12px;
}

.large-service-card p {

    color:
        var(--text-secondary);

    font-size: 14px;
}

.card-tags {

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 22px;
}

.card-tags span {

    padding:
        4px 9px;

    border-radius: 5px;

    background:
        rgba(148, 163, 184, .07);

    color:
        var(--text-muted);

    font-size: 11px;
}


/* =========================================
   PRODUCTS
========================================= */

.section-products {

    background:
        linear-gradient(
            to bottom,
            transparent,
            rgba(15, 23, 42, .18),
            transparent
        );
}

.products-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;
}

.product-card {

    overflow: hidden;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius: 12px;

    transition:
        transform .3s ease,
        border-color .3s ease;
}

.product-card:hover {

    transform:
        translateY(-5px);

    border-color:
        var(--border-hover);
}

.product-image {

    height: 240px;

    background:
        #070c16;

    border-bottom:
        1px solid var(--border);
}

.product-placeholder {

    width: 100%;
    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    color:
        rgba(148, 163, 184, .2);

    font-size: 12px;

    letter-spacing: .25em;

    background-image:

        linear-gradient(
            rgba(148, 163, 184, .04) 1px,
            transparent 1px
        ),

        linear-gradient(
            90deg,
            rgba(148, 163, 184, .04) 1px,
            transparent 1px
        );

    background-size: 30px 30px;
}

.product-content {

    padding: 25px;
}

.product-top {

    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;
}

.product-status {

    color:
        #a78bfa;

    font-size: 11px;
}

.product-platform {

    color:
        var(--text-muted);

    font-size: 11px;
}

.product-content h3 {

    font-size: 22px;

    margin-bottom: 10px;
}

.product-content p {

    color:
        var(--text-secondary);

    font-size: 14px;
}

.product-footer {

    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-top: 22px;
}

.product-footer .card-tags {

    margin-top: 0;
}

.product-link {

    color:
        #818cf8;

    font-size: 13px;

    font-weight: 600;
}


/* =========================================
   PRODUCTO DESTACADO (CIBR Chat Bot)
   Ocupa todo el ancho: galeria + descripcion
========================================= */

.product-featured {

    grid-column: 1 / -1;

    display: grid;

    grid-template-columns:
        minmax(0, 1.25fr)
        minmax(0, 1fr);

    border-color:
        rgba(139, 92, 246, .35);
}

.product-featured .product-content {

    display: flex;
    flex-direction: column;

    padding: 30px;
}

.product-featured .product-footer {
    margin-top: auto;
}

.product-status-ready {

    color:
        #2dd4bf;
}


/* Galeria */

.product-gallery {

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px;

    background:
        #070c16;

    border-right:
        1px solid var(--border);
}

.product-gallery-main {

    display: block;

    overflow: hidden;

    border-radius: 8px;

    aspect-ratio: 4 / 3;
}

.product-gallery-main img {

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: opacity .2s ease;
}

.product-gallery-thumbs {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 8px;
}

.product-gallery-thumbs button {

    padding: 0;

    overflow: hidden;

    background: none;

    border:
        2px solid transparent;

    border-radius: 6px;

    opacity: .55;

    cursor: pointer;

    transition:
        opacity .2s ease,
        border-color .2s ease;
}

.product-gallery-thumbs button:hover,
.product-gallery-thumbs button:focus-visible {
    opacity: .9;
}

.product-gallery-thumbs button.active {

    opacity: 1;

    border-color:
        var(--purple);
}

.product-gallery-thumbs img {

    display: block;

    width: 100%;
    height: auto;
}


/* Lista de ventajas */

.product-features {

    margin: 16px 0 22px;
    padding: 0;

    list-style: none;
}

.product-features li {

    position: relative;

    padding: 5px 0 5px 24px;

    color:
        var(--text-secondary);

    font-size: 14px;
}

.product-features li::before {

    content: "✓";

    position: absolute;
    left: 0;

    color:
        #2dd4bf;

    font-weight: 700;
}


/* =========================================
   PROJECTS
========================================= */

.projects-list {

    display: flex;

    flex-direction: column;

    gap: 20px;
}

.project-card {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 30px;

    padding: 28px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius: 12px;

    transition:
        transform .3s ease,
        border-color .3s ease;
}

.project-card:hover {

    transform:
        translateY(-4px);

    border-color:
        var(--border-hover);
}

.project-number {

    display: block;

    color:
        var(--text-muted);

    font-size: 12px;

    margin-bottom: 35px;
}

.project-info h3 {

    font-size: 24px;

    margin-bottom: 12px;
}

.project-info p {

    color:
        var(--text-secondary);

    font-size: 14px;

    max-width: 500px;
}

.project-visual {

    min-height: 270px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        #050912;

    border:
        1px solid rgba(148, 163, 184, .06);

    color:
        rgba(148, 163, 184, .2);

    font-size: 11px;

    letter-spacing: .2em;
}


/* =========================================
   TECHNOLOGIES
========================================= */

.technologies-section {

    background:
        rgba(15, 23, 42, .12);
}

.technology-list {

    border-top:
        1px solid var(--border);

    border-bottom:
        1px solid var(--border);
}

.technology-item {

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding:
        22px 10px;

    border-bottom:
        1px solid var(--border);

    transition:
        padding .2s ease,
        background .2s ease;
}

.technology-item:last-child {
    border-bottom: none;
}

.technology-item:hover {

    padding-left: 20px;
    padding-right: 20px;

    background:
        rgba(148, 163, 184, .025);
}

.tech-name {

    font-size: 17px;

    font-weight: 600;
}

.tech-type {

    font-size: 12px;

    color:
        var(--text-muted);
}


/* =========================================
   ABOUT
========================================= */

.about-content {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 80px;

    align-items: start;
}

.about-content h2 {

    font-size:
        clamp(30px, 4vw, 45px);

    line-height: 1.15;
}

.about-text {

    color:
        var(--text-secondary);

    font-size: 15px;
}

.about-text p {

    margin-bottom: 20px;
}


/* =========================================
   CONTACT
========================================= */

.contact-section {

    padding-bottom: 80px;
}

.contact-container {

    max-width:
        720px;

    margin: auto;

    text-align: center;
}

.contact-container h2 {

    font-size:
        clamp(35px, 6vw, 55px);

    margin-bottom: 20px;
}

.contact-container > p {

    color:
        var(--text-secondary);

    max-width:
        580px;

    margin: auto;
}

.contact-links {

    display: flex;

    justify-content: center;

    gap: 12px;

    margin-top: 35px;

    color:
        var(--text-muted);

    font-size: 13px;
}

.contact-links a:hover {

    color: white;
}


/* =========================================
   FOOTER
========================================= */

footer {

    border-top:
        1px solid var(--border);

    padding:
        25px 20px;

    color:
        var(--text-muted);

    font-size: 12px;
}

.footer-container {

    max-width:
        var(--max-width);

    margin: auto;

    display: flex;

    justify-content: space-between;
}


/* =========================================
   SCROLL REVEAL
========================================= */

.reveal {

    opacity: 0;

    transform:
        translateY(25px);

    transition:
        opacity .7s ease,
        transform .7s ease;
}

.reveal.visible {

    opacity: 1;

    transform:
        translateY(0);
}


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

@media (max-width: 800px) {

    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .navbar {
        width: calc(100% - 25px);
        top: 12px;
    }

    .mobile-menu {

        display: flex;

        flex-direction: column;

        gap: 5px;

        padding:
            0 15px 15px;

        max-height: 0;

        overflow: hidden;

        transition:
            max-height .3s ease;
    }

    .mobile-menu.open {
        max-height: 300px;
    }

    .mobile-menu a {

        padding:
            11px 10px;

        border-radius: 6px;

        color:
            var(--text-secondary);
    }

    .mobile-menu a:hover {

        background:
            rgba(148, 163, 184, .05);

        color: white;
    }

    .service-overview {

        grid-template-columns:
            1fr;
    }

    .services-grid {

        grid-template-columns:
            1fr;
    }

    .products-grid {

        grid-template-columns:
            1fr;
    }

    /* Producto destacado: galeria arriba, texto abajo */
    .product-featured {

        grid-template-columns:
            1fr;
    }

    .product-gallery {

        border-right: none;

        border-bottom:
            1px solid var(--border);
    }

    .project-card {

        grid-template-columns:
            1fr;
    }

    .project-visual {
        min-height: 200px;
    }

    .about-content {

        grid-template-columns:
            1fr;

        gap: 35px;
    }
}


@media (max-width: 500px) {

    .hero {

        padding-top: 110px;
    }

    .hero-buttons,
    .contact-buttons {

        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .technology-item {

        padding:
            18px 5px;
    }

    .tech-name {
        font-size: 15px;
    }

    .footer-container {

        flex-direction: column;

        gap: 5px;
    }

    /* =========================================
   MATRIX INTRO
========================================= */

.matrix-intro {

    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 99999;

    background: #000;

    overflow: hidden;

    opacity: 1;

    visibility: visible;

    transition:
        opacity .9s ease,
        visibility .9s ease;
}


/* Canvas ocupa toda la pantalla */

#matrixCanvas {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    display: block;
}


/* =========================================
   TEXTO CENTRAL
========================================= */

.matrix-intro-content {

    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    pointer-events: none;

    text-align: center;

    opacity: 0;

    transform: translateY(15px);

    animation:
        matrixTextAppear 1.2s ease forwards;

    animation-delay: .8s;
}


/* Nombre */

.matrix-name {

    font-size:
        clamp(45px, 8vw, 90px);

    line-height: 1;

    font-weight: 750;

    letter-spacing: .08em;

    color: #39ff88;

    text-shadow:

        0 0 8px rgba(57, 255, 136, .8),

        0 0 25px rgba(57, 255, 136, .5),

        0 0 60px rgba(57, 255, 136, .25);
}


/* Título */

.matrix-title {

    margin-top: 15px;

    font-size: 12px;

    letter-spacing: .35em;

    color: rgba(57, 255, 136, .7);

    text-shadow:
        0 0 10px rgba(57, 255, 136, .4);
}


/* =========================================
   ANIMACION TEXTO
========================================= */

@keyframes matrixTextAppear {

    from {

        opacity: 0;

        transform:
            translateY(15px)
            scale(.97);

    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);

    }

}


/* =========================================
   ESTADO FINAL
========================================= */

.matrix-intro.fade-out {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* =========================================
   ACCESIBILIDAD
========================================= */

@media (prefers-reduced-motion: reduce) {

    .matrix-intro-content {

        animation: none;

        opacity: 1;

        transform: none;

    }

}
}