:root {
    --bg-color: #0F0F0F;
    /* Dark Mode profundo */
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-bg: rgba(255, 255, 255, 0.04);
    --card-hover-border: rgba(255, 255, 255, 0.12);

    --accent: #004DED;
    --accent-hover: #003cc2;
    --accent-glow: rgba(0, 77, 237, 0.2);

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;

    --radius: 28px;
    --gap: 20px;
}

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

body,
html {
    cursor: url('recursos/cursor.svg'), auto;
}

/* Devolver el cursor original de manito en botones y links */
a,
button,
.bento-card,
.gallery-card,
.nav-links a,
.nav-logo {
    cursor: pointer;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    padding: 90px 40px 70px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

body.no-scroll {
    overflow: hidden;
}

/* ================== FONDO INTERACTIVO ================== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;

    /* Efecto de linterna (Spotlight) siguiendo el cursor */
    mask-image: radial-gradient(circle 350px at var(--mouse-x, 50vw) var(--mouse-y, 50vh),
            rgba(0, 0, 0, 1) 0%,
            transparent 100%);
    -webkit-mask-image: radial-gradient(circle 350px at var(--mouse-x, 50vw) var(--mouse-y, 50vh),
            rgba(0, 0, 0, 1) 0%,
            transparent 100%);
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ================== NAVBAR ================== */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 500;
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--card-border);
    border-top: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.nav-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    letter-spacing: 0.02em;
}

.nav-logo .logo-light {
    font-weight: 300;
    opacity: 0.95;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #fff;
}

.btn-nav-primary {
    background: var(--accent);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 100px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-block;
    text-decoration: none;
}

.btn-nav-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

/* Ocultar Contacto en desktop, solo mostrar en mobile */
.nav-mobile-only {
    display: none;
}

/* Mostrar en desktop, ocultar en mobile */
.nav-desktop-only {
    display: block;
}

/* ================== CONFIGURACIÓN DE GRID ================== */
.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--gap);
    max-width: 1100px;
    width: 100%;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.bento-card:hover {
    transform: translateY(-4px);
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

/* Clases de Layout para Grid */
.bento-span-2x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-span-4x2 {
    grid-column: span 4;
    grid-row: span 2;
}

.bento-span-2x1 {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-span-1x2 {
    grid-column: span 1;
    grid-row: span 2;
}

/* Hero con imagen al lado */
.hero-profile {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    /* Alineado al tope, no centrado */
    height: 100%;
}

.hero-profile .profile-img {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
    margin-top: 72px;
    /* Alineación visual refinada con el bloque de títulos */
}

/* Hover solo en la imagen, no en toda la sección */
.hero-profile .profile-img:hover {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.hero-text {
    display: flex;
    flex-direction: column;
}

/* ================== TIPOGRAFÍA ================== */
.pre-title {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    display: block;
    margin-top: 24px;
    margin-bottom: -16px;
    letter-spacing: 0.02em;
}

h1 {
    font-size: 2.8rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 20px 0;
    letter-spacing: -0.03em;
    min-height: 3.2rem;
    /* Reserves space so cursor doesn't jump */
}

h1 .accent-text {
    color: var(--accent);
}

.cursor {
    color: var(--text-primary);
    font-weight: 300;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: var(--text-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 24px;
    font-weight: 300;
}

.small-text {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* ================== COMPONENTES ================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    width: max-content;
    border: 1px solid rgba(0, 230, 118, 0.2);
    position: relative;
    overflow: hidden;
}

.badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(87, 189, 104, 0.267), transparent);
    animation: shimmer 4s infinite ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    80% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #00e676;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

/* HERO (Naked Layout) */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: none;
    scroll-margin-top: 90px;
    /* Evita que el navbar lo pise al hacer smooth scroll */
}

.hero:hover {
    transform: none;
    /* No flotar si es naked */
}

/* ================== HERO EDITORIAL (HIGH IMPACT) ================== */
.hero-editorial-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.hero-top-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 32px;
    width: 100%;
    margin-bottom: 32px;
}

.hero-editorial-name {
    font-size: clamp(4.5rem, 11vw, 7.5rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin: 0 0 40px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-primary);
}

.hero-editorial-name .first-name {
    font-weight: 300;
    opacity: 0.9;
}

.hero-editorial-name .last-name {
    font-weight: 800;
}

.profile-and-title {
    display: flex;
    align-items: center;
}

.role-text-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-pre-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    font-weight: 500;
}

.role-pre-label::after {
    content: " :";
    margin-right: 4px;
}

.role-animated-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    display: inline-block;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.hero-editorial-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-editorial-desc {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 32px;
    max-width: 800px;
    width: 100%;
}

.hero-editorial-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* Responsividad para el Hero Editorial */
@media (max-width: 768px) {
    .hero-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 22px;
    }

    .role-text-container {
        flex-wrap: wrap;
    }

    .hero-editorial-name {
        margin: 0 0 26px 0;
    }

    .hero-editorial-desc {
        font-size: 1.05rem;
        margin-bottom: 22px;
    }

    .hero-editorial-actions {
        flex-wrap: wrap;
        gap: 16px;
    }

    .hero-stack {
        margin-top: 0;
        margin-bottom: 22px;
    }
}


.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
    box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.link-secondary {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.link-secondary:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.hero-socials {
    display: flex;
    gap: 20px;
}

.hero-social-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.hero-social-btn .social-svg {
    width: 20px;
    height: 20px;
    fill: #9CA3AF;
    transition: fill 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* Previene que el SVG capture el hover/click */
}

.hero-social-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.hero-social-btn:hover .linkedin-svg {
    fill: #ffffff;
}

.hero-social-btn:hover .dribbble-svg {
    fill: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid var(--card-border);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: auto;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ELEMENTOS VISUALES INTERNOS */
.glow-effect {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.profile-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 2px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: grayscale(100%);
    transition: filter 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.bento-card.profile:hover .profile-img {
    filter: grayscale(0%);
    transform: scale(1.05);
    /* Optional little pop */
}

/* ================== HERO WORK STACK ================== */
.hero-stack-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 14px;
    opacity: 1;
}

.hero-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 0;
    margin-bottom: 26px;
    align-items: center;
    width: 100%;
}

.hero-stack-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 10px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.hero-stack-item .tool-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.hero-stack-item .tool-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, margin-left 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-left: 0;
    pointer-events: none;
}

/* Hover state */
.hero-stack-item:hover {
    background: rgba(24, 24, 28, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    padding-left: 12px;
    padding-right: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.hero-stack-item:hover .tool-icon {
    opacity: 1;
    transform: scale(1.05);
}

.hero-stack-item:hover .tool-label {
    max-width: 350px;
    opacity: 1;
    margin-left: 10px;
}

.ia-subtext {
    color: #7b828e;
    font-weight: 400;
    margin-left: 6px;
    display: inline-block;
}

.glitch-char {
    color: #00b0ff;
    /* Bright futuristic cyan */
    font-family: monospace;
    font-weight: 600;
}

.projects {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.projects .card-content {
    max-width: 70%;
}

.projects p {
    margin-bottom: 0;
}

.arrow-link {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
}

.bento-card.projects:hover .arrow-link {
    transform: rotate(45deg) scale(1.1);
    background: var(--accent);
    color: #fff;
}

.stat {
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ================== AUDIO BUTTON ================== */
.mute-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-secondary);
    display: none;
    /* Ocultado por el momento */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.mute-btn svg {
    width: 22px;
    height: 22px;
}

/* ================== SECCIÓN DE PROYECTOS ================== */
.projects-section {
    max-width: 1100px;
    width: 100%;
    margin-top: 0;
    margin-bottom: 20px;
    scroll-margin-top: 100px;
    /* Evita que el navbar lo pise al hacer smooth scroll */
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-header-carousel {
    max-width: 1100px;
    width: 100%;
    margin: 60px auto 0 auto;
    text-align: left;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.header-text h2 {
    margin: 0;
}

.header-text p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 0;
    line-height: 1.6;
    max-width: 100%;
}

.bottom-controls {
    justify-content: center;
    margin-top: -68px;
    position: relative;
    z-index: 10;
}

.carousel-controls {
    display: flex;
    gap: 16px;
}

.carousel-controls button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-controls button:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.carousel-controls button.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.carousel-controls button svg {
    transition: transform 0.2s ease;
    pointer-events: none;
}

.carousel-controls #prev-project:hover svg {
    transform: translateX(-2px);
}

.carousel-controls #next-project:hover svg {
    transform: translateX(2px);
}

.gallery-carousel {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-top: 10px;
    padding-bottom: 60px;
    /* Sombra del hover necesita margen, los controles consumen ~52px negativos */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.gallery-carousel::-webkit-scrollbar {
    display: none;
}

.gallery-card {
    flex: 0 0 auto;
    width: calc((100% - 56px) / 3);
    /* Cálculo exacto para visualizar 3 tarjetas a la vez deduciendo 2 gaps de 28px */
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    display: grid;
    justify-content: start;
    align-content: end;
    position: relative;
    border-radius: 16px;
    height: 230px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--card-border);
    padding: 20px;

    --brightness: 0.85;
    --saturation: 1.5;
    --frostRadius: 16px;
}

.gallery-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    transition: transform 500ms ease-in-out;
}

.gallery-card:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.gallery-card:hover .gallery-backdrop {
    transform: scale(1.08);
}

.gallery-card::after {
    content: "";
    position: absolute;
    inset: -0.5rem;
    z-index: 1;
    pointer-events: none;
    -webkit-backdrop-filter: blur(var(--frostRadius)) saturate(var(--saturation)) brightness(var(--brightness));
    backdrop-filter: blur(var(--frostRadius)) saturate(var(--saturation)) brightness(var(--brightness));
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.4) 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.45) 50%,
            black 75%);
    mask-image: linear-gradient(to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.45) 50%,
            black 75%);
}

.gallery-content {
    position: relative;
    z-index: 2;
    display: grid;
    bottom: 0;
    justify-content: start;
    align-content: end;
    gap: 4px;
    width: 100%;
    text-align: left;
}

.gallery-category {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    opacity: 0.5;
    color: var(--text-primary);
}

.gallery-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 2px 0 4px 0;
    line-height: 1.2;
}

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

/* Header fuera del container */
.services-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 1100px;
    width: 100%;
    margin: 60px auto 24px auto;
    scroll-margin-top: 100px;
    /* Evita que el navbar lo pise al hacer smooth scroll */
}

.services-top h2 {
    margin: 0;
}

.services-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
    margin: 0;
    max-width: 100%;
}

/* Container glass */
.services-section {
    max-width: 1100px;
    width: 100%;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    overflow: hidden;
}

/* ── Fila de servicio ── */
.srv-row {
    display: grid;
    grid-template-columns: 52px 1fr 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    border-bottom: 1px solid var(--card-border);
    position: relative;
    cursor: default;
    transition: background 0.3s ease;
    /* Línea de acento que crece desde la izquierda */
    overflow: hidden;
}

/* Línea de acento animada */
.srv-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 2px 2px 0;
}

.srv-row:hover::before,
.srv-row:focus-visible::before {
    transform: scaleY(1);
}

.srv-row:hover,
.srv-row:focus-visible {
    background: rgba(255, 255, 255, 0.03);
    outline: none;
}

/* Número */
.srv-num {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: color 0.3s ease, opacity 0.3s ease;
    user-select: none;
}

.srv-row:hover .srv-num {
    color: var(--accent);
    opacity: 1;
}

/* Centro: título + tag */
.srv-center {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.srv-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    transition: color 0.25s ease;
}

.srv-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.04em;
}

/* Descripción: oculta por defecto, aparece en hover */
.srv-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 340px;
}

.srv-row:hover .srv-desc,
.srv-row:focus-visible .srv-desc {
    opacity: 1;
    transform: translateX(0);
}

/* Flecha */
.srv-arrow {
    font-size: 1.1rem;
    color: var(--text-secondary);
    opacity: 0.3;
    transform: translateX(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    user-select: none;
}

.srv-row:hover .srv-arrow {
    opacity: 1;
    color: var(--accent);
    transform: translateX(0);
}

/* CTA inferior */
.srv-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
}

.srv-cta-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Mobile */
@media (max-width: 700px) {
    .srv-row {
        grid-template-columns: 40px 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 10px;
        column-gap: 16px;
        padding: 22px 20px;
    }

    .srv-num {
        grid-column: 1;
        grid-row: 1;
    }

    .srv-center {
        grid-column: 2;
        grid-row: 1;
    }

    .srv-arrow {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        margin-top: 4px;
    }

    /* Descripción siempre visible, ocupa la segunda fila */
    .srv-desc {
        display: block;
        opacity: 1;
        transform: none;
        max-width: 100%;
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .srv-cta {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 20px;
    }

    .srv-cta .btn-nav-primary {
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}






.site-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(12, 12, 14, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--card-border);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    text-align: center;
}

.site-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ================== CASE STUDIES SECTION ================== */
.case-studies-section {
    max-width: 1100px;
    width: 100%;
    margin-top: 0;
    scroll-margin-top: 100px;
    /* Evita que el navbar lo pise al hacer smooth scroll */
    display: flex;
    flex-direction: column;
}

.section-header-simple {
    max-width: 1100px;
    width: 100%;
    margin: 60px auto 24px auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-header-simple h2 {
    margin: 0;
}

.section-header-simple p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 0;
    line-height: 1.6;
    max-width: 100%;
}

.case-study {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.case-img-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--card-border);
}

.case-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-study:hover .case-image {
    transform: scale(1.05);
}

.case-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.case-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.case-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin: 0px 0 0px 0;
    font-weight: 400;
}

.case-study h3 {
    font-size: 1.5rem;
    margin: 0;
}

.case-study p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

.btn-text {
    margin-top: auto;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: color 0.2s ease, gap 0.2s ease;
}

.btn-text span {
    transition: transform 0.2s ease;
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-text:hover span {
    transform: translateX(4px);
}

/* Card entera clickeable */
.card-clickable {
    position: relative;
    cursor: pointer;
}

.card-full-link {
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
}

.card-clickable .case-content {
    position: relative;
    z-index: 2;
}

.card-clickable .case-img-wrapper {
    position: relative;
    z-index: 0;
}

.card-clickable:hover .case-image {
    transform: scale(1.05);
}

.card-clickable:hover .btn-text {
    color: var(--text-primary);
}

.card-clickable:hover .btn-text span {
    transform: translateX(4px);
}


/* ================== RESPONSIVE ================== */
@media (max-width: 900px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-span-2x2,
    .bento-span-2x1 {
        grid-column: span 2;
    }

    .projects {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .projects .card-content {
        max-width: 100%;
    }

    .arrow-link {
        align-self: flex-end;
    }

    .gallery-card {
        width: calc((100% - 28px) / 2);
        /* En tablets verán 2 elementos */
    }
}

@media (max-width: 600px) {
    .glass-nav {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        height: auto;
        min-height: 70px;
        align-items: flex-start;
    }

    .nav-content {
        padding: 0;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .nav-logo {
        margin-left: 20px;
        font-size: 1rem;
        z-index: 1000;
        height: 70px;
        display: flex;
        align-items: center;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        margin-right: 12px;
        height: 70px;
    }

    .nav-links {
        display: none;
        position: static;
        width: 100%;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px 24px 32px 24px;
        gap: 20px;
        border-bottom: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: none;
        margin: 0;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
        padding-bottom: 70px;
        /* Offset to center items perfectly */
        animation: fadeIn 0.3s ease;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 10px 0;
        font-size: 1.125rem;
    }

    .nav-links .btn-nav-primary {
        box-sizing: border-box;
        width: 100%;
    }

    .nav-links .nav-mobile-only {
        display: flex;
    }

    .nav-desktop-only {
        display: none;
    }

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

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

    .bento-container {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(100px, auto);
        gap: 16px;
    }

    .section-header-carousel {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .gallery-card {
        width: 85%;
        /* En móviles se ve 1 elemento y un trozo del siguiente */
    }

    .bento-span-2x2,
    .bento-span-2x1 {
        grid-column: span 1;
    }

    .case-img-wrapper {
        height: 240px;
    }

    .case-content {
        padding: 24px;
    }


    body {
        padding: 76px 16px 80px 16px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero-profile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-actions {
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    .hero-socials {
        justify-content: flex-end;
        width: auto;
        gap: 12px;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }

    .link-secondary {
        flex: 1;
        display: block;
        box-sizing: border-box;
        text-align: center;
        padding: 14px 16px;
    }

    .hero-social-btn {
        width: 50px;
        height: 50px;
    }

    .bento-card {
        padding: 24px;
    }

    .services-bottom {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Mobile: mostrar overlay siempre (no hay hover en touch) */
    .service-card {
        height: auto;
        min-height: 130px;
    }

    .service-card-overlay {
        opacity: 1;
        position: relative;
        inset: unset;
        border-radius: 0;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        justify-content: flex-start;
    }

    .service-name {
        display: none;
    }
}

/* ================== ESTILOS DE PÁGINAS INTERIORES (ARTÍCULOS DE CASO DE ESTUDIO) ================== */

.glass-nav.back-nav-mode .back-nav-links {
    display: flex !important;
    position: static !important;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    flex-direction: row !important;
}

.btn-back {
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: #fff;
}

.case-article-container {
    max-width: 800px;
    width: 100%;
    margin: 40px auto 0 auto;
    padding: 0 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-hero {
    margin-top: 20px;
    margin-bottom: 40px;
    text-align: left;
    width: 100%;
}

.project-hero .case-category {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.project-hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 16px 0;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.article-date {
    display: block;
    margin-top: 1rem;
    padding-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.project-hero .project-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 300;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 24px 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 40px;
    width: 100%;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 600;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 400;
}

.project-media-wrapper {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    margin: 40px 0;
}

.project-media-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.project-media-wrapper:hover img {
    transform: scale(1.02);
}

.case-body {
    font-size: 1.1rem;
    line-height: 1.75;
    color: #d1d5db;
    font-weight: 300;
    width: 100%;
}

.case-body h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.case-body p {
    margin-bottom: 24px;
    color: #d1d5db;
}

.case-body b,
.case-body strong {
    font-weight: 600;
    color: #ffffff;
}

.case-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1.6;
}

.case-body ul,
.case-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.case-body li {
    margin-bottom: 12px;
    color: #d1d5db;
}

.case-conclusion-card {
    margin-top: 60px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.case-conclusion-card h3 {
    font-size: 1.75rem;
    margin-bottom: 16px;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.metric-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.metric-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    background: linear-gradient(180deg, #00e676 0%, #00b0ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-box.standard .metric-number {
    background: linear-gradient(180deg, #004DED 0%, #00b0ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.case-footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 80px;
    margin-bottom: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--card-border);
    width: 100%;
}

.case-footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.case-footer-nav a:hover {
    color: #fff;
}

/* Responsividad para artículos */
@media (max-width: 768px) {
    .project-hero h1 {
        font-size: 2.5rem;
    }

    .project-meta-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .metrics-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .case-conclusion-card {
        padding: 24px;
    }
}

/* ================== CONTACT SECTION ================== */
.contact-section {
    max-width: 1100px;
    width: 100%;
    margin-top: 40px;
    margin-bottom: 20px;
    scroll-margin-top: 100px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.contact-section:hover {
    transform: translateY(-4px);
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.contact-section h2 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: var(--text-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-text {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 780px;
    margin: 0;
    font-weight: 300;
}

.btn-contact {
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    padding: 16px 38px;
    border-radius: 100px;
    background: var(--accent);
    color: #ffffff !important;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-contact:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px var(--accent-glow);
}

@media (max-width: 600px) {
    .contact-section {
        padding: 50px 24px;
        gap: 20px;
        margin-bottom: 60px;
    }

    .contact-action {
        width: 100%;
    }

    .btn-contact {
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ================== RELATED POST CARD ================== */
.related-post-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0 20px 0 0;
    margin: 32px auto;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.related-post-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.related-post-thumb {
    width: 200px;
    align-self: stretch;
    object-fit: cover;
    flex-shrink: 0;
    border: none;
    border-right: 1px solid var(--card-border);
}

.related-post-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 16px 0;
}

.related-post-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.related-post-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.related-post-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 !important;
    font-weight: 300;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-arrow {
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
    margin-right: 8px;
}

.related-post-card:hover .related-post-arrow {
    transform: translateX(4px);
    color: #ffffff;
}

@media (max-width: 480px) {
    .related-post-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 0 16px 0;
    }

    .related-post-thumb {
        width: 100%;
        height: 120px;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .related-post-content {
        padding: 16px;
    }

    .related-post-arrow {
        display: none;
    }
}

/* ================== SCROLL REVEAL EFFECT ================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}