/* =====================================================
   VARIABLES
===================================================== */
:root {
    --azul: #08264c;
    --azul-profundo: #061c38;
    --turquesa: #087f94;
    --turquesa-claro: #35b8bb;
    --gris: #556174;
    --gris-claro: #eef4f7;
    --borde: #dce7ed;
    --blanco: #ffffff;
    --sombra: 0 22px 50px rgba(8, 38, 76, .10);
    --radio: 22px;
    --max: 1360px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--azul-profundo);
    background: var(--blanco);
}

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

/* =====================================================
   HEADER
===================================================== */
.site-header {
    height: 92px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(8, 38, 76, .08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-wrap {
    width: min(var(--max), calc(100% - 80px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 250px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #06336d 0%, #0b8192 52%, #57c2bd 100%);
    box-shadow: inset 0 0 22px rgba(255, 255, 255, .16);
}

.brand-copy strong {
    display: block;
    font-size: 2rem;
    line-height: .95;
    letter-spacing: -.04em;
    font-weight: 900;
}

.brand-copy small {
    display: block;
    margin-top: 5px;
    color: var(--turquesa);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .72rem;
    font-weight: 900;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 36px;
    font-size: 1.05rem;
    color: #1c3555;
}

.main-nav a {
    transition: color .2s ease;
}

.main-nav a:hover {
    color: var(--turquesa);
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: 1px solid rgba(8, 127, 148, .55);
    border-radius: 999px;
    color: var(--turquesa);
    font-weight: 800;
    background: rgba(255, 255, 255, .72);
}

/* =====================================================
   HERO
===================================================== */
.hero-section {
    min-height: 585px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    background: #f4f8fa;
}

.hero-content {
    width: min(46vw, 575px);
    padding: 74px 0 74px max(80px, calc((100vw - var(--max)) / 2 + 40px));
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-visual {
    position: absolute;
    inset: 0 0 0 33%;
    background-image:
        linear-gradient(90deg,
            rgba(244, 248, 250, 1) 0%,
            rgba(244, 248, 250, .84) 8%,
            rgba(244, 248, 250, .48) 18%,
            rgba(244, 248, 250, 0) 32%),
        url("../img/puente-paia-hero.png");
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    z-index: 1;
}

.kicker {
    color: var(--turquesa);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .86rem;
    line-height: 1.2;
    font-weight: 900;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: clamp(3rem, 4.2vw, 4.55rem);
    line-height: 1.04;
    letter-spacing: -.06em;
    font-weight: 900;
    color: var(--azul);
    margin-bottom: 22px;
}

.accent-line {
    width: 42px;
    height: 2px;
    border-radius: 99px;
    background: var(--turquesa);
    margin-bottom: 24px;
}

.hero-content p {
    max-width: 520px;
    color: #3e4a5c;
    font-size: 1.12rem;
    line-height: 1.75;
    margin-bottom: 34px;
}

/* =====================================================
   BOTONES
===================================================== */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: .98rem;
    font-weight: 850;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--azul);
    color: white;
    box-shadow: 0 12px 28px rgba(8, 38, 76, .22);
}

.button.secondary {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(8, 127, 148, .45);
    color: var(--azul);
}

/* =====================================================
   MAPA PRINCIPAL
===================================================== */
.map-section {
    padding: 36px 40px 80px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.section-head {
    width: min(var(--max), 100%);
    margin: 0 auto;
    text-align: center;
}

.section-head .kicker {
    margin-bottom: 8px;
}

.section-head h2 {
    color: var(--azul);
    font-size: clamp(1.75rem, 2.6vw, 2.25rem);
    line-height: 1.18;
    letter-spacing: -.035em;
    font-weight: 900;
    margin-bottom: 10px;
}

.section-head p {
    max-width: 870px;
    margin: 0 auto;
    color: var(--gris);
    font-size: 1.02rem;
    line-height: 1.6;
}

/* =====================================================
   TARJETAS
===================================================== */
.cards-grid {
    width: min(1180px, 100%);
    margin: 30px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    min-height: 205px;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 20px;
    align-items: start;
    padding: 32px;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    transition: transform .2s ease, box-shadow .2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(8, 38, 76, .14);
}

.icon-circle {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e6f3f5;
    color: var(--turquesa);
}

.icon-circle svg {
    width: 48px;
    height: 48px;
}

.card-tag {
    display: block;
    color: var(--turquesa);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .74rem;
    font-weight: 900;
    margin-bottom: 7px;
}

.feature-card h3 {
    color: var(--azul);
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -.03em;
    font-weight: 900;
    margin-bottom: 10px;
}

.feature-card p {
    color: #38465a;
    font-size: .96rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.card-link {
    color: var(--turquesa);
    font-weight: 850;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   FOOTER
===================================================== */
.site-footer {
    background: var(--azul);
    color: rgba(255, 255, 255, .82);
    padding: 32px 40px;
}

.footer-wrap {
    width: min(var(--max), 100%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: .95rem;
    line-height: 1.6;
}

.footer-wrap strong {
    color: white;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 1100px) {
    .nav-wrap {
        width: calc(100% - 48px);
    }

    .main-nav {
        gap: 20px;
    }

    .hero-content {
        width: min(52vw, 540px);
        padding-left: 48px;
    }

    .hero-visual {
        inset-left: 38%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        max-width: 720px;
    }
}

@media (max-width: 860px) {
    .site-header {
        height: auto;
    }

    .nav-wrap {
        padding: 18px 0;
        flex-wrap: wrap;
    }

    .brand {
        min-width: auto;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .contact-button {
        padding: 11px 18px;
    }

    .hero-section {
        min-height: auto;
        display: block;
        background: white;
    }

    .hero-content {
        width: 100%;
        padding: 56px 28px 36px;
    }

    .hero-visual {
        position: relative;
        inset: auto;
        width: 100%;
        height: 360px;
        background-image: url("../img/puente-paia-hero.png");
        background-position: center;
    }

    .map-section {
        padding: 48px 24px 64px;
    }

    .feature-card {
        grid-template-columns: 1fr;
    }

    .footer-wrap {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .brand-copy small {
        display: none;
    }

    .main-nav {
        gap: 18px;
        font-size: .95rem;
    }

    .hero-content h1 {
        font-size: 2.65rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-actions {
        align-items: stretch;
    }

    .button {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   COMPATIBILIDAD CON PÁGINAS PAIA EXISTENTES
   Mantiene biblioteca, artículos, ISC, Continuidad, Equipo y Contacto.
===================================================== */
.topbar {
    height: 92px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(8, 38, 76, .08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav {
    width: min(var(--max), calc(100% - 80px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brandmark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #06336d 0%, #0b8192 52%, #57c2bd 100%);
    box-shadow: inset 0 0 22px rgba(255, 255, 255, .16);
}

.links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 1rem;
    color: #1c3555;
}

.links a:hover {
    color: var(--turquesa);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: .98rem;
    font-weight: 850;
    background: var(--azul);
    color: white;
    box-shadow: 0 12px 28px rgba(8, 38, 76, .22);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.secondary {
    background: rgba(255,255,255,.72);
    color: var(--azul);
    border: 1px solid rgba(8, 127, 148, .45);
    box-shadow: none;
}

.hero {
    background: #f4f8fa;
    color: var(--azul-profundo);
}

.wrap {
    width: min(var(--max), calc(100% - 80px));
    margin: 0 auto;
    padding: 74px 0;
}

.actions {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.section {
    padding: 70px 40px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.section .inner,
.footer .inner {
    width: min(var(--max), 100%);
    margin: 0 auto;
}

.section h2 {
    color: var(--azul);
    font-size: clamp(1.85rem, 2.8vw, 3rem);
    line-height: 1.12;
    letter-spacing: -.04em;
    font-weight: 900;
    margin-bottom: 14px;
}

.lead {
    max-width: 860px;
    color: var(--gris);
    font-size: 1.08rem;
    line-height: 1.7;
}

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

.card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(8, 38, 76, .14);
}

.card .tag,
.tag {
    display: block;
    color: var(--turquesa);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .74rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.card h3 {
    color: var(--azul);
    font-size: 1.45rem;
    line-height: 1.15;
    letter-spacing: -.03em;
    font-weight: 900;
    margin-bottom: 12px;
}

.card p {
    color: #38465a;
    font-size: .98rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.card .more,
.more {
    margin-top: auto;
    color: var(--turquesa);
    font-weight: 850;
}

.page-title {
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fa 100%);
    border-bottom: 1px solid rgba(8, 38, 76, .08);
}

.page-title .wrap {
    padding-top: 58px;
    padding-bottom: 48px;
}

.page-title h1 {
    color: var(--azul);
    font-size: clamp(2.3rem, 4.5vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -.06em;
    font-weight: 900;
    margin-bottom: 18px;
}

.library-shell {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 80px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.sidebar {
    position: sticky;
    top: 112px;
    align-self: start;
    background: white;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 20px;
    box-shadow: var(--sombra);
}

.side-title {
    font-weight: 900;
    color: var(--azul);
    margin-bottom: 14px;
}

.filter {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 0;
    background: #f3f7fa;
    border-radius: 14px;
    margin: 8px 0;
    color: #26435d;
    font-weight: 800;
    cursor: pointer;
}

.filter.active,
.filter:hover {
    background: var(--azul);
    color: white;
}

.library-main {
    min-width: 0;
}

.searchbox {
    background: white;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 18px 20px;
    box-shadow: var(--sombra);
    margin-bottom: 22px;
}

.searchbox input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 1.05rem;
    color: var(--azul-profundo);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.article-card {
    background: white;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 24px;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.article-card h3 {
    margin: 8px 0;
    color: var(--azul);
    font-size: 1.35rem;
    letter-spacing: -.03em;
}

.article-card p {
    margin: 0;
    color: var(--gris);
    line-height: 1.6;
}

.pillrow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    font-size: .72rem;
    font-weight: 900;
    color: var(--azul);
    background: #eaf7f7;
    border: 1px solid #d4eeee;
    padding: 6px 10px;
    border-radius: 999px;
}

.article-card .open {
    margin-top: auto;
    padding-top: 20px;
    color: var(--turquesa);
    font-weight: 850;
}

.content {
    max-width: 860px;
    margin: 70px auto;
    background: white;
    border: 1px solid var(--borde);
    border-radius: 28px;
    padding: 44px;
    box-shadow: var(--sombra);
}

.content h1,
.content h2,
.content h3 {
    color: var(--azul);
    letter-spacing: -.03em;
}

.content p {
    font-size: 1.06rem;
    line-height: 1.75;
}

.note {
    background: #effbfb;
    border: 1px solid #d8f1f1;
    border-radius: 20px;
    padding: 18px;
    color: #17445a;
}

.footer {
    background: var(--azul);
    color: rgba(255,255,255,.82);
    padding: 32px 40px;
}

.footer .inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: .95rem;
    line-height: 1.6;
    flex-wrap: wrap;
}

.footer strong {
    color: white;
}

@media (max-width: 900px) {
    .nav {
        width: calc(100% - 48px);
        padding: 18px 0;
        flex-wrap: wrap;
        height: auto;
    }

    .topbar {
        height: auto;
    }

    .links {
        width: 100%;
        overflow-x: auto;
        gap: 18px;
        padding-bottom: 4px;
    }

    .wrap {
        width: calc(100% - 48px);
        padding: 56px 0;
    }

    .ecosystem,
    .library-shell,
    .article-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .content {
        margin: 40px 24px;
        padding: 28px;
    }
}
