@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

:root {
    --mobile-surface: rgba(255, 255, 255, 0.92);
    --mobile-shadow: 0 24px 60px rgba(2, 44, 34, 0.16);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-offset, 120px);
}

body {
    font-family: 'Roboto', sans-serif;
}

body.menu-open {
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
}

section[id] {
    scroll-margin-top: var(--header-offset, 120px);
}

/* ── Staggered reveal animations ── */
.reveal-child {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.reveal.active .reveal-child:nth-child(1) { transition-delay: 0.05s; }
.reveal.active .reveal-child:nth-child(2) { transition-delay: 0.12s; }
.reveal.active .reveal-child:nth-child(3) { transition-delay: 0.19s; }
.reveal.active .reveal-child:nth-child(4) { transition-delay: 0.26s; }
.reveal.active .reveal-child:nth-child(5) { transition-delay: 0.33s; }
.reveal.active .reveal-child:nth-child(6) { transition-delay: 0.40s; }
.reveal.active .reveal-child:nth-child(7) { transition-delay: 0.47s; }
.reveal.active .reveal-child:nth-child(8) { transition-delay: 0.54s; }
.reveal.active .reveal-child:nth-child(9) { transition-delay: 0.61s; }

/* ── FAQ smooth open/close ── */
details summary {
    transition: color 0.2s ease;
}

details summary:hover {
    color: #065f46;
}

details[open] summary {
    color: #065f46;
    margin-bottom: 0.25rem;
}

details summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: #a8a29e;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

details[open] summary::after {
    transform: rotate(180deg);
    color: #065f46;
}

details {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

details:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}

details[open] {
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1);
}

/* ── Subtle section divider ── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
}

/* ── Header shrink on scroll ── */
@media (min-width: 768px) {
    #main-header.is-scrolled .mobile-header-shell {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    #main-header.is-scrolled .brand-logo {
        height: 2.2rem;
    }

    #main-header.is-scrolled .brand-title {
        font-size: 1.25rem;
    }

    #main-header.is-scrolled .brand-subtitle {
        display: none;
    }
}

#main-header {
    transition: box-shadow 0.3s ease;
}

#main-header.is-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Smooth counter animation for commitment numbers ── */
.commitment-number {
    background: linear-gradient(135deg, #047857, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
}

.hero-bg {
    background: linear-gradient(135deg, rgba(2, 44, 34, 0.9) 0%, rgba(6, 78, 59, 0.75) 100%), url('../images/hero-ngobe.jpg') center/cover no-repeat;
    background-attachment: fixed;
}

.hero-shell {
    min-height: min(720px, calc(100vh - 72px));
}

.nav-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: #57534e;
    transition: all 0.25s ease;
}

.nav-chip:hover,
.nav-chip.is-current {
    background: #f0fdf4;
    border-color: rgba(16, 185, 129, 0.18);
    color: #065f46;
}

.nav-chip-compact {
    padding: 0.55rem 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 60;
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.98) 0%, rgba(255, 255, 255, 0.98) 28%, rgba(255, 255, 255, 1) 100%);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.24);
    transform: translateX(-105%);
    transition: transform 0.3s ease;
    z-index: 70;
    overflow: hidden;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.mobile-drawer-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

.mobile-drawer-inner::before {
    content: '';
    position: absolute;
    top: -72px;
    right: -96px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0) 70%);
    pointer-events: none;
}

.mobile-drawer-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0.9rem;
}

.mobile-drawer-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 0 0.25rem 1.1rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: var(--mobile-surface);
    border: 1px solid rgba(16, 185, 129, 0.12);
    box-shadow: 0 10px 30px rgba(6, 78, 59, 0.08);
}

.mobile-drawer-brand-logo {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(6, 78, 59, 0.12);
}

.mobile-drawer-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.2rem 0;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: #1f2937;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-drawer-link:hover {
    background: #f0fdf4;
    color: #065f46;
}

.mobile-drawer-link:focus-visible,
.mobile-drawer-cta:focus-visible,
.mobile-menu-trigger:focus-visible,
.mobile-contact-cta:focus-visible {
    outline: 2px solid rgba(5, 150, 105, 0.75);
    outline-offset: 2px;
}

.mobile-drawer-link.is-current {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 95, 70, 0.08));
    color: #065f46;
    transform: translateX(4px);
}

.mobile-drawer-footer {
    position: relative;
    padding-top: 0.85rem;
}

.mobile-drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #047857, #065f46);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 16px 30px rgba(6, 95, 70, 0.24);
}

.mobile-drawer-cta:hover {
    background: linear-gradient(135deg, #065f46, #064e3b);
}

.brand-logo,
.brand-title,
.brand-subtitle,
.mobile-header-shell {
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #10b981;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #10b981;
}

.nav-link.is-current {
    color: #10b981;
}

.card-hover {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    border: 1px solid transparent;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 30px -5px rgb(16 185 129 / 0.1), 0 10px 10px -5px rgb(16 185 129 / 0.04);
    border-color: rgba(16, 185, 129, 0.2);
}

.video-btn {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.video-btn.active {
    background-color: #10b981;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    border-color: #10b981;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#back-to-top {
    position: fixed;
    bottom: -60px;
    right: 30px;
    z-index: 99;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
}

#back-to-top.visible {
    bottom: 30px;
    opacity: 1;
    pointer-events: auto;
}

.experience-image-frame {
    min-height: 0;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(135deg, rgba(6, 78, 59, 0.9), rgba(16, 185, 129, 0.7)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 40%);
}

.experience-image-fallback {
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(209, 250, 229, 0.92)),
        repeating-linear-gradient(
            -45deg,
            rgba(16, 185, 129, 0.06),
            rgba(16, 185, 129, 0.06) 12px,
            transparent 12px,
            transparent 24px
        );
}

@media (min-width: 768px) {
    .mobile-header-shell {
        padding-top: 0.95rem;
        padding-bottom: 0.95rem;
    }

    .mobile-header-row {
        gap: 1.25rem;
    }

    .site-brand-lockup {
        flex: 0 1 auto;
        min-width: 0;
        gap: 0.9rem;
    }

    .brand-logo {
        height: 3.35rem;
        width: auto;
        max-width: 15rem;
        object-fit: contain;
    }

    .brand-title {
        font-size: 2rem;
        line-height: 1.02;
        letter-spacing: -0.03em;
    }

    .brand-subtitle {
        margin-top: 0.2rem;
        font-size: 0.72rem;
        letter-spacing: 0.18em;
        white-space: nowrap;
    }

    .header-primary-nav {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
        gap: 1.35rem;
    }

    .header-primary-nav .nav-link {
        white-space: nowrap;
        line-height: 1.15;
    }
}

@media (min-width: 1200px) {
    .header-primary-nav {
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    html {
        scroll-padding-top: var(--header-offset, 120px);
    }

    body {
        background: linear-gradient(180deg, #f8fafc 0%, #f5f5f4 18%, #fafaf9 100%);
        overflow-x: hidden;
    }

    #main-header {
        background: rgba(248, 250, 252, 0.9);
        backdrop-filter: blur(18px);
        border-bottom-color: rgba(214, 211, 209, 0.7);
    }

    .mobile-header-shell {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .site-brand-lockup {
        gap: 0.75rem;
    }

    .brand-logo {
        height: 2.85rem;
        width: 2.85rem;
        border-radius: 1rem;
        object-fit: cover;
        box-shadow: 0 14px 30px rgba(6, 78, 59, 0.14);
    }

    .brand-title {
        font-size: 1rem;
        line-height: 1.15;
    }

    .brand-subtitle {
        margin-top: 0.25rem;
        font-size: 0.5rem;
        letter-spacing: 0.18em;
    }

    .mobile-menu-trigger,
    .mobile-contact-cta {
        height: 2.9rem;
        width: 2.9rem;
        border-radius: 1rem;
    }

    .hero-shell {
        min-height: calc(100svh - 82px);
        padding: 1rem 0 2.75rem;
        align-items: flex-end;
    }

    .hero-bg {
        background-attachment: scroll;
        background-position: center right 34%;
    }

    .hero-content-wrap {
        padding-left: 1rem;
        padding-right: 1rem;
        text-align: left;
    }

    .hero-panel {
        padding: 1.3rem 1.15rem 1.35rem;
        border-radius: 1.75rem;
        background: linear-gradient(180deg, rgba(2, 44, 34, 0.26), rgba(2, 44, 34, 0.5)), rgba(2, 6, 23, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.16);
        backdrop-filter: blur(10px);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    }

    .hero-panel p,
    .hero-panel h1,
    .hero-panel div {
        text-align: left;
    }

    .hero-actions {
        gap: 0.9rem;
    }

    .hero-actions a {
        width: 100%;
        justify-content: center;
        padding: 0.95rem 1.25rem;
        font-size: 0.97rem;
        box-shadow: 0 16px 24px rgba(2, 44, 34, 0.18);
    }

    .section-shell {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    #quienes-somos,
    #proyecto,
    #clpi,
    #compromisos,
    #faq,
    #descargas,
    #contacto {
        padding-top: 4.2rem;
        padding-bottom: 4.2rem;
    }

    #quienes-somos .grid,
    .contact-grid {
        gap: 1.5rem;
    }

    #quienes-somos .bg-emerald-50,
    .contact-form-card {
        border-radius: 1.75rem;
        box-shadow: var(--mobile-shadow);
    }

    .project-card {
        padding: 1.25rem;
        border-radius: 1.75rem;
        box-shadow: var(--mobile-shadow);
    }

    .project-stat-grid {
        gap: 0.9rem;
        text-align: left;
    }

    .project-stat-grid > div {
        display: grid;
        grid-template-columns: 3.6rem 1fr;
        align-items: start;
        gap: 0.15rem 1rem;
        padding: 1rem;
        border-radius: 1.25rem;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.88));
        border: 1px solid rgba(226, 232, 240, 0.95);
    }

    .project-stat-grid > div > div:first-child {
        grid-row: span 2;
        font-size: 2.35rem;
        line-height: 1;
        margin: 0;
    }

    .project-stat-grid h4,
    .project-stat-grid p {
        text-align: left;
    }

    .phase-grid {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        margin-right: -0.15rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .phase-grid::-webkit-scrollbar {
        display: none;
    }

    .phase-card {
        min-width: min(84vw, 320px);
        scroll-snap-align: start;
        border-radius: 1.75rem;
    }

    .video-panel {
        padding: 1.1rem;
        border-radius: 1.75rem;
        box-shadow: var(--mobile-shadow);
    }

    .video-panel .flex.flex-col.sm\:flex-row {
        gap: 0.7rem;
    }

    .video-btn {
        width: 100%;
        min-height: 3.2rem;
        border-radius: 999px;
        background: #ffffff;
        border-color: rgba(214, 211, 209, 0.8);
        font-weight: 700;
    }

    .commitment-grid {
        gap: 0.9rem;
    }

    .commitment-grid > div {
        padding: 1.25rem;
        border-radius: 1.5rem;
        background: linear-gradient(180deg, rgba(250, 250, 249, 0.95), rgba(245, 245, 244, 0.96));
        box-shadow: 0 18px 26px rgba(120, 113, 108, 0.08);
    }

    #faq details {
        border-radius: 1.4rem;
        padding: 1.15rem 1rem;
        border: 1px solid rgba(231, 229, 228, 0.95);
        box-shadow: 0 12px 20px rgba(120, 113, 108, 0.08);
    }

    #faq summary {
        align-items: flex-start;
        line-height: 1.45;
    }

    .download-stack a {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        padding: 1.15rem;
        border-radius: 1.5rem;
    }

    .download-stack a > div {
        min-width: 0;
    }

    .contact-grid > div:first-child {
        padding: 1.4rem 1.2rem;
        border-radius: 1.75rem;
        background: linear-gradient(180deg, rgba(240, 253, 244, 0.75), rgba(255, 255, 255, 0.95));
        border: 1px solid rgba(16, 185, 129, 0.08);
    }

    .contact-form-card {
        padding: 1.25rem;
        background: rgba(248, 250, 252, 0.95);
    }

    .card-hover:hover {
        transform: none;
    }

    #back-to-top {
        right: 16px;
    }

    #back-to-top.visible {
        bottom: 20px;
    }

    .experience-image-frame,
    .experience-image-fallback {
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 768px) {
    .mobile-menu-overlay,
    .mobile-drawer {
        display: none;
    }
}
