/* ==========================================================================
   ETAPA 1: VARIABLES GLOBALES (Configuración de Colores del Tema Claro)
   ========================================================================== */
:root {
    --azul-profundo: #0f172a;  /* Azul corporativo para la cabecera */
    --verde-neon: #22c55e;     /* Verde brillante para destacar enlaces y botones */
    --gris-fondo: #f1f5f9;     /* Gris suave para el cuerpo, eliminando el blanco hospital */
    --blanco-puro: #ffffff;    /* Fondo para tarjetas claras */
    --texto-principal: #1e293b;/* Color para títulos y párrafos */
    --borde-sutil: #e2e8f0;    /* Líneas de separación discretas */
    --overlay-hero: rgba(15, 23, 42, 0.8); /* Capa de contraste sobre el video */

    --fuente-principal: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   ETAPA 2: VARIABLES MODO OSCURO (Se activan mediante JavaScript)
   ========================================================================== */
body.dark-theme {
    --azul-profundo: #020617;  /* Cabecera aún más oscura */
    --gris-fondo: #0b0f19;     /* El fondo del cuerpo pasa a negro tecnológico */
    --blanco-puro: #131c2e;    /* Las tarjetas se vuelven azul oscuro metalizado */
    --texto-principal: #f8fafc;/* El texto pasa a blanco suave para descansar la vista */
    --borde-sutil: #1e293b;    /* Bordes oscuros adaptados */
    --overlay-hero: rgba(2, 6, 23, 0.9);
    --card-text: #dfe7f5;
}

/* ==========================================================================
   ETAPA 3: RESET INICIAL DE NAVEGADORES (Lienzo Limpio)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-principal);
    background-color: var(--gris-fondo);
    color: var(--texto-principal);
    line-height: 1.6;
}

/* ==========================================================================
   ETAPA 4: CABECERA Y CÁPSULA RECTANGULAR DE ALTO CONTRASTE (CORREGIDA)
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 5%;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 35%),
                linear-gradient(180deg, rgba(6, 18, 32, 0.98), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.24);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-badge {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.logo-badge:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.logo-img {
    height: 68px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 0 rgba(15, 23, 42, 0.12));
}

.logo-badge-original {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.2rem;
    min-width: 0;
}

.logo-icon-wrap {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.10), rgba(59,130,246,0.06));
    border: 1px solid rgba(110, 231, 183, 0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 14px 28px rgba(16, 185, 129, 0.08);
    flex-shrink: 0;
}

.logo-icon {
    width: 76px;
    height: 76px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 7px 16px rgba(16, 185, 129, 0.2));
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1;
    text-align: left;
}

.brand-primary {
    font-size: clamp(1.45rem, 2.4vw, 2.9rem);
    font-weight: 900;
    letter-spacing: -0.08em;
    color: #f3fbff;
    line-height: 0.95;
    text-shadow: 0 1px 0 rgba(15, 23, 42, 0.18);
    background: linear-gradient(180deg, #f2fbff 0%, #d8ebff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-secondary {
    font-size: clamp(0.7rem, 1vw, 0.95rem);
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #8cf0d7;
    text-transform: uppercase;
    margin-top: 0.32rem;
    text-shadow: 0 0 18px rgba(110, 231, 183, 0.18);
}

.brand-tagline {
    margin-top: 0.5rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #dbe9f8;
    text-transform: uppercase;
    opacity: 0.92;
}

body.dark-theme .brand-primary {
    color: #e2f3ff;
}

body.dark-theme .brand-secondary {
    color: #7ee6d4;
}

body.dark-theme .brand-tagline {
    color: #cfe1f7;
}

body.dark-theme .logo-icon {
    filter: brightness(1.06) contrast(1.08) saturate(1.2);
}

/* ==========================================================================
   ETAPA 5: MENÚ DE NAVEGACIÓN HORIZONTAL DEL HEADER
   ========================================================================== */
.nav-horizontal {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-horizontal a {
    text-decoration: none;
    color: #f8fafc !important; 
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-horizontal a:hover {
    color: var(--verde-neon) !important; 
}

.btn-dark-mode {
    background: transparent;
    border: 2px solid var(--verde-neon);
    color: var(--verde-neon);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.85rem;
    font-family: var(--fuente-principal);
    transition: all 0.3s ease;
}

.btn-dark-mode:hover {
    background: var(--verde-neon);
    color: #ffffff;
    transform: scale(1.05);
}

body.dark-theme .btn-dark-mode {
    border-color: #ffffff;
    color: #ffffff;
}

body.dark-theme .btn-primary {
    background: #4ade80;
    color: #03130b;
    box-shadow: 0 12px 24px rgba(74, 222, 128, 0.26);
}

body.dark-theme .btn-secondary {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.5);
    color: #f8fafc;
}

body.dark-theme .logo-badge {
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(239,246,255,0.98));
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18), 0 18px 36px rgba(34, 197, 94, 0.2);
}

body.dark-theme .logo-img {
    filter: brightness(1.05) contrast(1.15) saturate(1.1);
}

body.dark-theme .proyecto-card,
body.dark-theme .service-card,
body.dark-theme .item-comparativa,
body.dark-theme .presupuesto-wrap {
    background: rgba(19, 28, 46, 0.98);
    border-color: var(--borde-sutil);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}

body.dark-theme .proyecto-card p,
body.dark-theme .service-card p,
body.dark-theme .item-comparativa p,
body.dark-theme .presupuesto-form label,
body.dark-theme .presupuesto-form select,
body.dark-theme .presupuesto-form textarea,
body.dark-theme .presupuesto-header p,
body.dark-theme .biografia,
body.dark-theme .service-card h3,
body.dark-theme .proyecto-card h3,
body.dark-theme .item-comparativa h4,
body.dark-theme .presupuesto-header h2,
body.dark-theme .presupuesto-form .form-hint,
body.dark-theme .form-field input,
body.dark-theme .form-field select,
body.dark-theme .form-field textarea {
    color: var(--card-text, #dfe7f5);
}

body.dark-theme .service-card,
body.dark-theme .proyecto-card,
body.dark-theme .item-comparativa,
body.dark-theme .presupuesto-form input,
body.dark-theme .presupuesto-form select,
body.dark-theme .presupuesto-form textarea {
    color: var(--card-text, #dfe7f5);
}

body.dark-theme .presupuesto-form input,
body.dark-theme .presupuesto-form select,
body.dark-theme .presupuesto-form textarea {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
    color: #dfe7f5;
}

body.dark-theme .presupuesto-form input:hover,
body.dark-theme .presupuesto-form select:hover,
body.dark-theme .presupuesto-form textarea:hover {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(15, 23, 42, 1);
}

body.dark-theme .presupuesto-form input::placeholder,
body.dark-theme .presupuesto-form textarea::placeholder,
body.dark-theme .presupuesto-form select option {
    color: rgba(203, 213, 225, 0.65);
}

body.dark-theme .presupuesto-form select {
    background-image: linear-gradient(45deg, transparent 50%, #dfe7f5 50%), linear-gradient(135deg, #dfe7f5 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(1.1em + 2px), calc(100% - 12px) calc(1.1em + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

body.dark-theme .footer-global {
    background-color: #020617;
}

/* ==========================================================================
   ETAPA 6: HERO CON TEXTO Y ELEMENTOS ABSOLUTAMENTE CENTRADOS (CORREGIDA)
   ========================================================================== */
.hero {
    position: relative;
    min-height: 78vh;
    height: auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 80px 0 60px;
}

#hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-hero);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center; /* Centrado estricto de textos */
    padding: 0 20px;
    max-width: 950px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrado horizontal de cajas hijas */
    justify-content: center;
}

/* Título unificado en un bloque simétrico */
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.3rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -1px;
    text-shadow: 0 6px 20px rgba(0,0,0,0.6);
    color: #ffffff;
}

/* Eslogan flotante centrado de manera absoluta */
.hero-badge-eslogan {
    display: inline-block;
    background: rgba(34, 197, 94, 0.12);
    border: 2px solid var(--verde-neon);
    padding: 12px 30px;
    border-radius: 50px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin: 0 auto;
    animation: flotar 3s ease-in-out infinite;
}

.hero-slogan {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a7f3d0;
    margin-bottom: 1rem;
}

.eyebrow-dark {
    color: var(--verde-neon);
}

.hero-subtitle {
    max-width: 760px;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto 2rem auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary,
.btn-ver {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.95rem 1.8rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.btn-primary,
.btn-ver {
    background: var(--verde-neon);
    color: #03130b;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.26);
}

.btn-primary:hover,
.btn-ver:hover {
    background: #4ade80;
    transform: translateY(-2px);
}

.btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 20px;
    width: min(680px, 100%);
    margin: 0 auto 2.2rem auto;
}

.hero-stats div {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1rem 0.8rem;
    backdrop-filter: blur(8px);
}

.hero-stats strong {
    display: block;
    font-size: 1.5rem;
    color: #ffffff;
}

.hero-stats span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.servicios {
    padding: 90px 5% 40px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.01));
}

.contenedor-servicios,
.contenedor-bio,
.titulo-seccion-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.titulo-seccion-wrap {
    text-align: center;
    margin-bottom: 2rem;
}

.titulo-seccion-wrap h2,
.contenedor-bio h2,
.titulo-seccion {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--texto-principal);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}

.service-card {
    background: var(--blanco-puro);
    border: 1px solid var(--borde-sutil);
    border-radius: 22px;
    padding: 30px 22px;
    text-align: left;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    border-color: var(--verde-neon);
}

.service-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.08));
    font-size: 1.8rem;
    transition: transform 0.25s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.08);
}

.service-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.25rem;
    color: var(--texto-principal);
    font-weight: 900;
}

.service-card p {
    color: rgba(30, 41, 59, 0.8);
    font-size: 0.95rem;
}

.sobre-mi {
    padding: 90px 5% 30px;
    background: var(--blanco-puro);
}

.bio-texto {
    max-width: 900px;
    margin: 0 auto 2rem auto;
    text-align: center;
    font-size: 1.06rem;
    color: rgba(30, 41, 59, 0.8);
}

.comparativa-tecnica {
    margin-top: 2.5rem;
}

.comparativa-tecnica h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--texto-principal);
}

.grid-comparativa {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.item-comparativa {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.01));
    border: 1px solid var(--borde-sutil);
    border-radius: 18px;
    padding: 24px;
}

.item-comparativa h4 {
    margin-bottom: 0.8rem;
    color: var(--texto-principal);
}

.item-comparativa p {
    color: rgba(30, 41, 59, 0.82);
}

.proyectos-seccion {
    padding: 90px 5% 100px;
}

.proyecto-card {
    background: var(--blanco-puro);
    padding: 30px 24px;
    border-radius: 22px;
    border: 1px solid var(--borde-sutil);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.card-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.6rem auto;
    background: rgba(34, 197, 94, 0.12);
    font-size: 2rem;
}

.proyecto-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--texto-principal);
}

.proyecto-card p {
    color: rgba(30, 41, 59, 0.8);
    margin-bottom: 1.2rem;
}

.software-destacado {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
    color: #f8fafc;
    border-color: rgba(34, 197, 94, 0.45);
}

.software-destacado h3,
.software-destacado p {
    color: #f8fafc;
}

.tag-tech {
    align-self: center;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.6);
    color: #a7f3d0;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-col {
    min-width: 260px;
}

.presupuesto-section {
    padding: 80px 5% 100px;
    background: linear-gradient(180deg, transparent, rgba(241, 245, 249, 0.5));
}

.presupuesto-wrap {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--blanco-puro);
    border: 1px solid var(--borde-sutil);
    border-radius: 28px;
    padding: 60px 40px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.3s ease;
}

.presupuesto-wrap:hover {
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
}

.presupuesto-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.presupuesto-header h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--texto-principal);
    font-weight: 900;
}

.presupuesto-header p {
    color: rgba(30, 41, 59, 0.8);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.presupuesto-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 1.2rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 700;
    color: var(--texto-principal);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1.5px solid var(--borde-sutil);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--texto-principal);
    padding: 1rem 1.1rem;
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(51, 65, 85, 0.65);
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(255, 255, 255, 1);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--verde-neon);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
    background: rgba(255, 255, 255, 1);
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: rgba(30, 41, 59, 0.68);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
}

.form-actions .btn-primary {
    min-width: 300px;
    padding: 1.1rem 2rem;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    box-shadow: 0 15px 35px rgba(34, 197, 94, 0.3);
    transition: all 0.3s ease;
}

.form-actions .btn-primary:hover {
    box-shadow: 0 20px 50px rgba(34, 197, 94, 0.45);
    transform: translateY(-3px);
}

body.dark-theme .form-field input::placeholder,
body.dark-theme .form-field textarea::placeholder {
    color: rgba(203, 213, 225, 0.72);
}

@media (max-width: 768px) {
    .hero {
        min-height: 620px;
        padding: 60px 0 40px;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .nav-horizontal {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ver {
        width: 100%;
    }

    .presupuesto-wrap {
        padding: 40px 24px;
    }

    .presupuesto-form {
        grid-template-columns: 1fr;
    }

    .form-actions .btn-primary {
        min-width: 100%;
    }

    .proyectos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .grid-comparativa {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-container {
        flex-direction: column;
        gap: 30px;
    }

    .main-header {
        flex-direction: column;
        gap: 1rem;
    }
}

@keyframes flotar {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================================
   ETAPA 7: SECCIÓN SOBRE MÍ Y COMPARATIVA
   ========================================================================== */
.sobre-mi {
    padding: 80px 10%;
    background-color: var(--blanco-puro);
}

.contenedor-bio h2 {
    font-size: 2.2rem;
    color: var(--verde-neon);
    margin-bottom: 20px;
    text-align: center;
}

/* ==========================================================================
   ETAPA 8: CUADRÍCULA DE PROYECTOS (TARJETAS DEL PORTAFOLIO)
   ========================================================================== */
.proyectos-seccion {
    padding: 80px 5%;
}

.titulo-seccion {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
}

.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.proyecto-card {
    background-color: var(--blanco-puro);
    padding: 35px 25px;
    border-radius: 20px;
    border: 1.5px solid var(--borde-sutil);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.proyecto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(34, 197, 94, 0.12);
    border-color: var(--verde-neon);
}

.card-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem auto;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.08));
    font-size: 2.2rem;
    transition: transform 0.25s ease;
}

.proyecto-card:hover .card-icon {
    transform: scale(1.1);
}

.proyecto-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.8rem;
    color: var(--texto-principal);
    font-weight: 900;
}

.proyecto-card p {
    color: rgba(30, 41, 59, 0.82);
    margin-bottom: 1.5rem;
    font-size: 0.96rem;
    line-height: 1.5;
    flex-grow: 1;
}

.proyecto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--verde-neon);
}

.badge-en-proceso {
    display: inline-block;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(59, 130, 246, 0.12));
    color: #8b5cf6;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(139, 92, 246, 0.25);
    margin-top: 16px;
}

body.dark-theme .proyecto-card {
    background: rgba(19, 28, 46, 0.9);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-theme .proyecto-card p,
body.dark-theme .proyecto-card h3 {
    color: #dfe7f5;
}

/* ==========================================================================
   ETAPA 9: PIE DE PÁGINA GLOBAL (FOOTER NAVEGABLE)
   ========================================================================== */
.footer-global {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    color: #ffffff;
    padding: 80px 5% 40px 5%;
    border-top: 2px solid var(--verde-neon);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

.footer-info, .footer-nav, .footer-col {
    flex: 1;
    min-width: 260px;
}

.footer-global h3 {
    color: var(--verde-neon);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.footer-global h4 {
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    opacity: 0.95;
}

.footer-global p {
    color: #cbd5e1;
    font-size: 0.96rem;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-nav ul,
.footer-col ul {
    list-style: none;
}

.footer-nav li,
.footer-col li {
    margin-bottom: 1rem;
}

.footer-nav a,
.footer-col a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
}

.footer-nav a:hover,
.footer-col a:hover {
    color: var(--verde-neon);
    padding-left: 6px;
}

.footer-link {
    color: #a7f3d0 !important;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.25s ease;
}

.footer-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 12px var(--verde-neon);
}

.footer-col li {
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    font-size: 0.9rem;

    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #64748b;
}

/* ==========================================================================
   ETAPA 10: OPTIMIZACIÓN RESPONSIVE PARA DISPOSITIVOS MÓVILES (CELULARES)
   ========================================================================== */
@media (max-width: 768px) {
    /* En celulares, el menú y el logo se apilan verticalmente para que no se encimen */
    .main-header { 
        padding: 1rem; 
        flex-direction: column; 
        gap: 15px; 
    }
    
    /* Reducimos un poco la cápsula y el logo para pantallas chicas */
    .logo-badge { 
        padding: 6px 15px; 
    }
    
    .logo-img { 
        height: 45px; 
    } 
    
    /* Achicamos la separación de los botones del menú de arriba */
    .nav-horizontal { 
        gap: 15px; 
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* El título del video se hace más chico para que no desborde la pantalla */
    .hero-title { 
        font-size: 2.2rem; 
    }
    
    /* El eslogan reduce su letra para leerse cómodo con el pulgar */
    .hero-slogan {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   TARJETA DE CONTACTO PREMIUM - ClemAr Web Solutions
   ========================================================================== */
.body-vcard-premium {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, rgba(34,197,94,0.15), transparent 25%),
        linear-gradient(135deg, #020817 0%, #0b1120 35%, #111827 100%);
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    padding: 24px;
}

.vcard-container {
    width: min(100%, 440px);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 60px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(14px);
}

.vcard-header-bg {
    padding: 26px 24px 18px;
    background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(14,165,233,0.08));
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    justify-content: center;
}

.vcard-avatar-border {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03));
    border: 1px solid rgba(110, 231, 183, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 18px 32px rgba(6, 182, 212, 0.15);
}

.vcard-logo-img {
    width: 82px;
    height: 82px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(16,185,129,0.18));
}

.vcard-content {
    padding: 24px 22px 10px;
    text-align: center;
}

.vcard-content h1 {
    font-size: clamp(2rem, 4vw, 2.4rem);
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.06em;
    color: #f8fbff;
}

.vcard-tag {
    margin-top: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8cf0d7;
    font-weight: 800;
}

.vcard-location {
    margin: 18px 0 20px;
    color: #d9e5f4;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-save-contact {
    width: 100%;
    border: 2px solid rgba(52, 211, 153, 0.9);
    background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(16,185,129,0.1));
    color: #ecfdf5;
    border-radius: 999px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.25s ease;
    margin-bottom: 20px;
}

.btn-save-contact:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34,197,94,0.16);
}

.vcard-action-list {
    display: grid;
    gap: 12px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    color: #f8fafc;
    text-decoration: none;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: all 0.2s ease;
}

.action-item:hover {
    transform: translateY(-1px);
    border-color: rgba(110,231,183,0.25);
    background: rgba(17, 24, 39, 0.92);
}

.icon {
    font-size: 1.2rem;
}

.vcard-footer-info {
    padding: 18px 20px 24px;
    text-align: center;
    color: #cbd5e1;
    border-top: 1px solid rgba(148,163,184,0.1);
    background: rgba(2,6,23,0.32);
}

.vcard-footer-info p {
    margin: 0;
    font-size: 0.82rem;
}

/* Solo se aplica cuando el body tiene la clase dark-theme */
body.dark-theme .logo-img {
    filter: invert(1);
}
/* Corrección para que el logo ClemAr sea legible en fondo oscuro */
body.dark-theme .logo-img {
    filter: brightness(0) invert(1); /* Convierte el logo en blanco puro */
    opacity: 0.9; /* Suaviza un poco el brillo */
}

/* Estilo para el botón de regresar dentro de las páginas de proyectos */
.btn-regresar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-regresar:hover {
    background-color: #333333;
    transform: translateX(-3px); /* Desplaza suavemente hacia la izquierda al pasar el cursor */
}

.btn-regresar .flecha {
    font-size: 1.1rem;
}
html {
    scroll-behavior: smooth;
}

/* Quita el subrayado automático de los enlaces de la marca */
.brand-container a, 
.sidebar-header a,
.sidebar h2 a,
.footer-portfolio-link {
    text-decoration: none !important;
}

/* O si metiste el enlace directo en la marca, atacamos directamente al tag <a> */
a {
    text-decoration: none;
}
