/* THEME TOKENS */
:root {
    --bg: #0a0d14;
    --card: #0f1420;
    --text: #e8ecf1;
    --muted: #9fb0c7;
    --accent: #4c76ff;
    --accent-2: #39c3ff;
    --border: #1b2231;
    --shadow: 0 10px 28px rgba(0, 0, 0, .35);
    --ring: conic-gradient(from 180deg at 50% 50%, #4c76ff, #39c3ff, #4c76ff);
    --menu-bg: rgba(2, 6, 12, .92);
    --page-pad: clamp(22px, 6vw, 56px);
}

:root.light {
    --bg: #ffffff;
    --card: #f6f8ff;
    --text: #0c1222;
    --muted: #586176;
    --accent: #3056ff;
    --accent-2: #00a8ff;
    --border: #e6e9f2;
    --shadow: 0 12px 26px rgba(10, 22, 50, .12);
    --menu-bg: rgba(255, 255, 255, .96);
}



/* BASE */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
    line-height: 1.6;
    accent-color: var(--accent);
}

.container {
    width: min(1100px, 100%);
    margin-inline: auto;
    padding-inline: var(--page-pad);
}

.section {
    padding-block: 96px;
}

.section-head {
    margin-bottom: 32px
}

.section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 2.2vw, 34px)
}

.section-head p {
    margin: 0;
    color: var(--muted)
}

.ring {
    position: fixed;
    inset: auto -25% -25% auto;
    width: 520px;
    height: 520px;
    z-index: -1;
    background: var(--ring);
    filter: blur(60px);
    opacity: .18;
    border-radius: 50%;
    animation: spin 18s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* HEADER & NAV */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
    border-bottom: 1px solid var(--border);
}
/* Ajuste para que el contenido no quede debajo del menú fijo */
main, .main-content, .content, .hero, .section {
    margin-top: 70px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 16px
}

/* en el bloque base de navegación */
.nav-list {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: var(--shadow)
}

.brand-text {
    letter-spacing: .3px
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0
}

.nav-list a {
    color: var(--text);
    text-decoration: none;
    position: relative
}

.nav-list a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .2s ease
}

.nav-list a:hover::after {
    width: 100%;
    opacity: 0.8
}

/* Estado activo - página actual */
.nav-list a.active::after {
    width: 100%;
    background: linear-gradient(90deg, 
        color-mix(in srgb, var(--accent) 85%, #000), 
        color-mix(in srgb, var(--accent-2) 85%, #000)
    );
    opacity: 1
}

/* Hover sobre elemento activo - color más claro */
.nav-list a.active:hover::after {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 1
}

/* Estilos especiales para el botón Contactar activo */
.nav-list a.btn.active {
    box-shadow: 0 0 0 2px rgba(76, 118, 255, 0.3);
    transform: scale(1.02);
}

.nav-list a.btn.active:hover {
    box-shadow: 0 6px 22px rgba(76, 118, 255, 0.4);
    transform: translateY(-1px) scale(1.02);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 4px 0
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center
}

/* BUTTONS/CHIPS */
.btn {
    display: inline-block;
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: transform .07s ease, box-shadow .2s, border-color .2s
}

.btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 6px 22px rgba(76, 118, 255, .25)
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 0;
    color: #fff
}

.btn-secondary {
    background: var(--card)
}

.btn-ghost {
    background: transparent
}

.chip {
    border: 1px solid var(--border);
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    font-size: 14px
}

.chip.small {
    padding: 5px 8px
}

.chip.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 0
}

/* HERO */
.hero {
    padding: 110px 0 60px;
    text-align: center
}

.eyebrow {
    color: var(--muted);
    letter-spacing: .3px;
    margin-bottom: 8px
}

.hero h1 {
    font-size: clamp(36px, 5.4vw, 56px);
    margin: 0 0 10px
}

.accent {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent
}

.subtitle {
    max-width: 760px;
    margin: 0 auto 20px;
    color: var(--muted)
        /* ...existing code... */
    }

    .social-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .social-title {
        font-size: 2.2rem;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 0.5rem;
    }

    :root {
        --social-title-color: #111;
    }

    [data-theme="dark"] {
        --social-title-color: #fff;
    }

    .social-desc {
        font-size: 1.1rem;
        color: #555;
        margin-bottom: 1.2rem;
    }

    .social-video {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }
    .social-video iframe {
        border-radius: 16px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.15);
        max-width: 560px;
        width: 100%;
        height: 315px;
    }

    .social-desc {
        display: block;
        text-align: center;
        margin: 0;
        font-size: 1.1rem;
        color: #555;
    }

    .social-desc-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 1rem;
        margin-bottom: 1.2rem;
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 24px;
        margin-bottom: 1.5rem;
    }
    .social-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #1976d2;
    background: transparent;
    color: #1976d2;
    text-decoration: none;
    transition: box-shadow .2s, transform .1s;
    padding: 16px;
    cursor: pointer;
    }
    .social-btn:hover {
        transform: translateY(-1px);
    }
    
    /* Colores específicos para cada red social */
    .social-btn.instagram:hover,
    .social-btn.instagram:active {
        background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
        border-color: #bc1888;
        color: white;
        box-shadow: 0 4px 16px rgba(188, 24, 136, 0.4);
    }

    .social-btn.facebook:hover,
    .social-btn.facebook:active {
        background: #1877f2;
        border-color: #1877f2;
        color: white;
        box-shadow: 0 4px 16px rgba(24, 119, 242, 0.4);
    }

    .social-btn.tiktok:hover,
    .social-btn.tiktok:active {
        background: #000000;
        border-color: #ff0050;
        color: #ff0050;
        box-shadow: 0 4px 16px rgba(255, 0, 80, 0.4);
    }

    .social-btn.youtube:hover,
    .social-btn.youtube:active {
        background: #ff0000;
        border-color: #ff0000;
        color: white;
        box-shadow: 0 4px 16px rgba(255, 0, 0, 0.4);
    }
    .social-btn .icon {
    width: 32px;
    height: 32px;
    color: #1976d2;
    }

.cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0 10px
}

.hero-meta {
    color: var(--muted);
    font-size: 14px;
    margin-top: 8px
}

/* LAYOUT / CARDS */
.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

/* Manejo específico para elementos ocultos por JavaScript */
.card.card-hidden {
    display: none !important;
}

.card.card-visible {
    display: flex !important;
    flex-direction: column;
}

.card:first-child {
    margin-top: 32px;
}

/* Espaciado específico para tarjetas en secciones con idiomas */
[data-lang] .card:first-child {
    margin-top: 32px;
}

.card:last-child {
    margin-bottom: 0
}

/* Excepciones para tarjetas del blog - sin márgenes */
#blog-cards .card:first-child {
    margin-top: 0 !important;
}

#blog-cards [data-lang] .card:first-child {
    margin-top: 0 !important;
}

/* Excepciones para tarjetas de Labs - sin márgenes y tamaño uniforme */
.section .cards .card:first-child {
    margin-top: 0 !important;
}

.section .cards [data-lang] .card:first-child {
    margin-top: 0 !important;
}

/* Asegurar altura uniforme para todas las tarjetas de labs */
.section .cards .card {
    min-height: 280px;
    height: auto;
    align-self: stretch;
}

/* Alineación específica para las tarjetas de la página About */
.section .grid-2 .card:first-child {
    margin-top: 0 !important;
}

.section .grid-2 [data-lang] .card:first-child {
    margin-top: 0 !important;
}

/* Asegurar que ambas tarjetas en grid-2 estén alineadas en la parte superior */
.grid-2 .card {
    align-self: start;
}

/* Espacio adicional para el botón LinkedIn después del timeline */
.timeline + a.btn {
    margin-top: 14px !important;
}

.card h3 {
    margin-top: 0
}

/* BLOG SPECIFIC STYLES */
/* Mayor espacio entre header y cards en el blog */
#blog-cards {
    margin-top: 2.5rem;
}

#blog-cards .card {
    height: 400px !important;
    justify-content: space-between;
    box-sizing: border-box;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Estilos para títulos de blog posts */
.card h2 {
    margin: 0 0 1rem 0;
    line-height: 1.3;
    flex-shrink: 0;
}

.card h2 a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    transition: color 0.2s ease, transform 0.1s ease;
    display: block;
    line-height: 1.4;
    min-height: 3.5rem;
    overflow: visible;
    word-wrap: break-word;
    hyphens: auto;
}

.card h2 a:hover {
    color: var(--accent-2);
    transform: translateX(2px);
}

.card h2 a:visited {
    color: var(--accent);
}

.card h2 a:visited:hover {
    color: var(--accent-2);
}

/* Mejorar espaciado de cards en blog */
#blog-cards .card p:not(.meta) {
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Párrafos estándar en tarjetas fuera del blog: sin recorte */
.card p.meta ~ p,
.card p {
    margin-bottom: 1rem;
    line-height: 1.6;
    overflow: visible;
}

.card .meta {
    margin-bottom: 1rem;
    opacity: 0.8;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* Responsive: Ajustar margin en mobile */
@media (max-width: 768px) {
    #blog-cards {
        margin-top: 2rem;
    }
    
    .card h2 a {
        font-size: 1.1rem;
        min-height: 2.8rem;
        max-height: 2.8rem;
    }

    #blog-cards .card p:not(.meta) {
        -webkit-line-clamp: 3;
        min-height: 4.2rem;
        max-height: 4.2rem;
    }
}

.meta {
    color: var(--muted);
    font-size: 14px
}

.list {
    padding-left: 18px;
    margin: 8px 0
}

.timeline {
    list-style: disc;
    margin: 8px 0 0 18px;
    color: var(--muted)
}

.form-note {
    color: var(--muted);
    font-size: 12px;
    margin: 8px 0 0
}

.stack-grid {
    display: grid;
    gap: 20px;
    /* tarjetas que se ajustan: nunca menos de 260px y nunca más que 1fr */
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    margin-top: 14px;
}

.stack-col {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    max-width: 100%;
    /* evita que la tarjeta crezca más que la columna */
    overflow: hidden;
    /* por si algún contenido se desborda */
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags li {
    border: 1px dashed var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--muted);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none
}

.badges li {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px
}

/* ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease
}

.reveal.visible {
    opacity: 1;
    transform: none
}

.hover-rise {
    transition: transform .2s ease, box-shadow .2s ease
}

.hover-rise:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35)
}

.float {
    animation: float 8s ease-in-out infinite;
    will-change: transform
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-6px)
    }
}

/* FOOTER */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    margin-top: 56px
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap
}

.footer-nav {
    display: flex;
    gap: 16px
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none
}

.footer-nav a:hover {
    color: var(--accent)
}

/* RESPONSIVE */
@media (max-width: 960px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    #blog-cards .card {
        height: 350px !important;
    }

    .card {
        padding: 20px;
    }
}

/* NAV: modo móvil a partir de 1024px hacia abajo */
@media (max-width: 1024px) {
    .cards {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    #blog-cards .card {
        height: 320px !important;
    }

    /* si ya estaba, mantenlo */
    .nav-toggle {
        display: block;
        z-index: 20;
    }

    .nav-list {
        position: fixed;
        inset: 70px 0 auto 0;
        background: var(--menu-bg);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        translate: 0 -120%;
        transition: translate .2s ease;
        z-index: 99;
    }

    .nav-list.open {
        translate: 0 0;
    }

    /* textos un poquito más grandes en el overlay */
    .nav-list>li a {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    :root {
        --page-pad: 26px;
    }

    /* fuerza un poco más de padding lateral en móvil pequeño */
}


/* FORM — pretty */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: var(--text)
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    transition: box-shadow .15s, border-color .15s, background .15s;
}

:root.light input[type="text"],
:root.light input[type="email"],
:root.light textarea {
    background: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 8px;
}

#formStatus {
    color: var(--muted);
    font-size: 14px
}

/* Contact card spacing */
#contact .card {
    padding: 22px
}

/* --- Social Hub --- */
.social-section {
    padding: 48px 0;
}

.social-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    margin: 0;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 18px;
}

.social-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(128, 128, 128, 0.22);
    border: 1px solid color-mix(in oklab, currentColor 22%, transparent);
    background: color-mix(in oklab, currentColor 10%, transparent);
    color: currentColor;
    text-decoration: none;
    transition: transform .1s ease, border-color .2s ease, background .2s ease;
    padding: 0;
}

.social-btn:hover {
    transform: translateY(-1px);
}

/* Colores específicos para cada red social */
.social-btn.instagram:hover,
.social-btn.instagram:active {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    border-color: #bc1888;
    color: white;
    box-shadow: 0 4px 16px rgba(188, 24, 136, 0.4);
}

.social-btn.facebook:hover,
.social-btn.facebook:active {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.4);
}

.social-btn.tiktok:hover,
.social-btn.tiktok:active {
    background: #000000;
    border-color: #ff0050;
    color: #ff0050;
    box-shadow: 0 4px 16px rgba(255, 0, 80, 0.4);
}

.social-btn.youtube:hover,
.social-btn.youtube:active {
    background: #ff0000;
    border-color: #ff0000;
    color: white;
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.4);
}

.icon {
    width: 28px;
    height: 28px;
}

/* screen-reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contact-networks {
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .social-btn {
        border-color: rgba(128, 128, 128, 0.3);
        border-color: color-mix(in oklab, currentColor 30%, transparent);
    }
}

/* opcional: si usas .container en todo el sitio */
.social-section .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Contact Social Section Styles */
.contact-email {
    margin-bottom: 20px;
    text-align: center;
}

.contact-email p {
    margin: 0;
    font-size: 1rem;
}

.contact-email a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.contact-email a:hover {
    text-decoration: underline;
}