:root {
    scroll-behavior: smooth;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
}

main {
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
svg {
    max-width: 100%;
}

section {
    scroll-margin-top: 100px;
}

.brand-link {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: 5.5rem;
}

.brand-logo {
    display: block;
    height: 5.5rem;
    object-fit: contain;
    width: 14rem;
}

.nav-strip {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    padding: 0 1rem;
    white-space: nowrap;
}

.nav-link {
    border-radius: 999px;
    color: #18312f;
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.66rem 0.78rem;
    transition: background-color 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: #f4fbf8;
    color: #12614f;
    outline: none;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(18, 97, 79, 0.12);
    border-radius: 1rem;
    box-shadow: 0 24px 80px rgba(18, 97, 79, 0.16);
    display: grid;
    gap: 0.2rem;
    left: 0;
    min-width: 17rem;
    opacity: 0;
    padding: 0.55rem;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown-menu a {
    border-radius: 0.75rem;
    color: #18312f;
    font-size: 0.9rem;
    font-weight: 650;
    padding: 0.72rem 0.85rem;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
    background: #f4fbf8;
    color: #12614f;
    outline: none;
}

[data-dropdown].is-open .dropdown-menu,
[data-dropdown]:hover .dropdown-menu,
[data-dropdown]:focus-within .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

body.menu-open {
    overflow: hidden;
}

.mobile-backdrop {
    background: rgba(8, 61, 53, 0.35);
    bottom: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 7rem;
    transition: opacity 200ms ease;
    z-index: 40;
}

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

.mobile-panel {
    background: #fff;
    border-top: 1px solid #dff3ec;
    bottom: 0;
    box-shadow: 0 24px 50px rgba(8, 61, 53, 0.16);
    left: 0;
    max-height: calc(100vh - 7rem);
    max-height: calc(100dvh - 7rem);
    opacity: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 7rem;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
    visibility: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 50;
}

.mobile-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.mobile-section-label {
    color: #12614f;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.18em;
    margin-top: 0.35rem;
    padding: 0.5rem 1rem 0.15rem;
    text-transform: uppercase;
}

.mobile-link-cta {
    background: #12614f;
    color: #fff;
    margin-top: 0.35rem;
    text-align: center;
    transition: background-color 150ms ease, color 150ms ease;
}

.mobile-link-cta:hover,
.mobile-link-cta:focus-visible,
.mobile-link-cta:active,
.mobile-link-cta.is-pressed {
    background: #083d35;
    color: #fff;
}

.mobile-link {
    border-radius: 0.9rem;
    color: #18312f;
    font-weight: 750;
    padding: 0.85rem 1rem;
    transition: background-color 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: rgba(18, 97, 79, 0.12);
}

.mobile-link:hover,
.mobile-link:focus-visible,
.mobile-link:active,
.mobile-link.is-pressed {
    background: #f4fbf8;
    color: #12614f;
    outline: none;
}

.hero-shell {
    min-height: 760px;
    position: relative;
}

.hero-shell::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.84) 62%, #fff 100%);
    bottom: -1px;
    content: "";
    height: 38%;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    z-index: 1;
}

.hero-image {
    filter: saturate(1.02);
    inset: 0;
    object-fit: cover;
    object-position: center;
    position: absolute;
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.82) 34%, rgba(255, 255, 255, 0.2) 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 42%);
    inset: 0;
    position: absolute;
}

.section-kicker {
    color: #12614f;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.soft-band {
    background:
        radial-gradient(circle at 12% 0%, rgba(35, 152, 120, 0.1), transparent 28rem),
        linear-gradient(180deg, #f4fbf8 0%, #fff 100%);
}

.topic-pill {
    align-items: center;
    background: #f4fbf8;
    border: 1px solid rgba(18, 97, 79, 0.1);
    border-radius: 999px;
    color: #12614f;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 750;
    padding: 0.42rem 0.68rem;
}

.image-slot {
    align-items: center;
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, rgba(35, 152, 120, 0.12), rgba(239, 111, 97, 0.1)),
        #f8fcfa;
    border: 1px dashed rgba(18, 97, 79, 0.28);
    border-radius: 0.85rem;
    color: #12614f;
    display: grid;
    justify-items: center;
    min-height: 10rem;
    overflow: hidden;
    padding: 1.25rem;
    text-align: center;
}

.image-slot.is-compact {
    aspect-ratio: 4 / 3;
    min-height: 8rem;
}

.image-slot:has(> img) {
    background: none;
    border: none;
    display: block;
    min-height: 0;
    padding: 0;
}

.image-slot.is-compact > img {
    aspect-ratio: 4 / 3;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.video-slot {
    background: #083d35;
    border-radius: 0.85rem;
    margin-inline: auto;
    max-width: 100%;
    overflow: hidden;
}

.video-slot > video {
    display: block;
    height: auto;
    width: 100%;
}

.video-slot.is-horizontal {
    aspect-ratio: 16 / 10;
    max-width: 42rem;
}

.video-slot.is-horizontal > video {
    height: 100%;
    object-fit: cover;
}

.video-slot.is-vertical {
    aspect-ratio: 9 / 16;
    max-width: 20rem;
}

.video-slot.is-vertical > video {
    height: 100%;
    object-fit: cover;
}

.image-slot:has(> img):not(.is-compact) > img {
    aspect-ratio: 16 / 10;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.image-slot i {
    height: 2rem;
    width: 2rem;
}

.image-slot span {
    display: block;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    margin-top: 0.7rem;
    text-transform: uppercase;
}

.field {
    border: 1px solid rgba(18, 97, 79, 0.16);
    border-radius: 0.9rem;
    color: #18312f;
    font-size: 0.95rem;
    padding: 0.9rem 1rem;
    width: 100%;
}

.field:focus {
    border-color: #239878;
    box-shadow: 0 0 0 4px rgba(35, 152, 120, 0.12);
    outline: none;
}

@media (max-width: 768px) {
    .brand-logo {
        height: 4.25rem;
        width: 10rem;
    }

    .hero-shell {
        min-height: 700px;
    }

    .hero-shell h1 {
        font-size: clamp(2.25rem, 10vw, 3rem);
        overflow-wrap: anywhere;
    }

    .hero-shell p,
    .section-kicker {
        overflow-wrap: anywhere;
    }

    .hero-image {
        object-position: 58% center;
    }

    .hero-overlay {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 44%, rgba(255, 255, 255, 0.36) 78%),
            linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.3));
    }

    .organigrama-grid {
        grid-template-columns: 1fr;
    }

    .organigrama-grid::before {
        left: 12%;
        right: 12%;
    }

    .organigrama-email {
        font-size: 0.75rem;
        justify-content: center;
        word-break: break-all;
    }

    .services-table-head,
    .services-table-row,
    .services-table-head-short,
    .services-table-row-short {
        grid-template-columns: 1fr;
        overflow-wrap: anywhere;
        padding-inline: 1rem;
    }

    .services-table-head {
        display: none;
    }

    .services-table-product {
        font-size: 1rem;
    }

    .shadow-soft {
        box-shadow: 0 12px 36px rgba(18, 97, 79, 0.12);
    }

    a[href^="mailto:"] {
        word-break: break-all;
    }
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

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

/* Delays para efectos escalonados (staggered) */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

/* Transición para el botón Volver Arriba */
#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.organigrama-shell {
    margin-inline: auto;
    max-width: 72rem;
}

.organigrama-head {
    background: linear-gradient(135deg, #12614f, #083d35);
    border-radius: 1rem;
    color: #fff;
    margin-inline: auto;
    max-width: 28rem;
    padding: 1.5rem 1.75rem;
    position: relative;
    text-align: center;
    z-index: 1;
}

.organigrama-head::after {
    background: #12614f;
    bottom: -1.75rem;
    content: '';
    height: 1.75rem;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 2px;
}

.organigrama-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.organigrama-role {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

.organigrama-email {
    align-items: center;
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 0.35rem;
    margin-top: 0.75rem;
    transition: color 0.2s ease;
}

.organigrama-email:hover {
    color: #fff;
}

.organigrama-body {
    padding-top: 1.75rem;
    position: relative;
}

.organigrama-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    padding-top: 1rem;
    position: relative;
}

.organigrama-grid::before {
    background: #12614f;
    content: '';
    height: 2px;
    left: 8%;
    position: absolute;
    right: 8%;
    top: 0;
}

.organigrama-node {
    background: #f4fbf8;
    border: 1px solid rgba(18, 97, 79, 0.12);
    border-radius: 0.85rem;
    padding: 1rem 0.85rem 1rem;
    position: relative;
    text-align: center;
}

.organigrama-node::before {
    background: #12614f;
    content: '';
    height: 1rem;
    left: 50%;
    position: absolute;
    top: -1rem;
    transform: translateX(-50%);
    width: 2px;
}

.director-card {
    position: relative;
}

.director-card::after {
    background: #12614f;
    bottom: -1.5rem;
    content: '';
    height: 1.5rem;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 2px;
}

.organigrama-node-title {
    color: #083d35;
    font-size: 0.92rem;
    font-weight: 800;
}

.organigrama-node-meta {
    color: #ef6f61;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.services-table-head,
.services-table-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(10rem, 0.9fr) 1.6fr;
    padding: 1.1rem 1.25rem;
}

.services-table-head-short,
.services-table-row-short {
    grid-template-columns: minmax(7rem, 0.55fr) 1.45fr;
}

.services-table-head {
    background: #12614f;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.services-table-row {
    border-top: 1px solid rgba(18, 97, 79, 0.08);
}

.services-table-row:nth-child(even) {
    background: #f8fcfa;
}

.services-table-product {
    color: #083d35;
    font-weight: 800;
}

.services-table-action {
    color: #12614f;
    font-weight: 800;
}

.services-table-impact {
    color: rgba(24, 49, 47, 0.76);
    line-height: 1.65;
    overflow-wrap: anywhere;
}