:root {
    --navy: #091d96;
    --blue: #1b47fe;
    --blue-light: #eaf4ff;
    --ink: #091d96;
    --muted: #334a7a;
    --paper: #ffffff;
    --soft: #ffffff;
    --line: #c8e6fe;
    --accent: #1b47fe;
    --shadow: 0 18px 45px rgba(9, 29, 150, 0.16);
    --container: 1180px;
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: normal;
    font-weight: 300;
    src: url("fonts/neuemontreal-light.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: normal;
    font-weight: 400;
    src: url("fonts/neuemontreal-regular.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: normal;
    font-weight: 500;
    src: url("fonts/neuemontreal-medium.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: normal;
    font-weight: 700;
    src: url("fonts/neuemontreal-bold.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: italic;
    font-weight: 300;
    src: url("fonts/neuemontreal-lightitalic.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: italic;
    font-weight: 400;
    src: url("fonts/neuemontreal-italic.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: italic;
    font-weight: 500;
    src: url("fonts/neuemontreal-mediumitalic.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: "Neue Montreal";
    font-style: italic;
    font-weight: 700;
    src: url("fonts/neuemontreal-bolditalic.otf") format("opentype");
}

@font-face {
    font-display: swap;
    font-family: Montserrat;
    font-style: normal;
    font-weight: 100 900;
    src: url("fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: Montserrat;
    font-style: italic;
    font-weight: 100 900;
    src: url("fonts/Montserrat-Italic-VariableFont_wght.ttf") format("truetype");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: "Neue Montreal", Arial, sans-serif; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: inherit; }
section, footer { scroll-margin-top: 85px; }
.container { width: min(90%, var(--container)); margin: 0 auto; }

.site-header { background: var(--navy); color: var(--paper); position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 20px rgba(9, 29, 150, .25); }
.header-content { align-items: center; display: flex; justify-content: space-between; min-height: 78px; }
.brand { align-items: center; display: inline-flex; gap: .75rem; text-decoration: none; }
.brand-logo { height: auto; width: 138px; }
.menu-toggle { display: none; }
.brand-mark { align-items: center; background: var(--accent); color: var(--paper); display: inline-flex; font-family: Montserrat, sans-serif; font-size: 1.7rem; font-weight: 700; height: 42px; justify-content: center; width: 42px; }
.brand strong, .brand small { display: block; letter-spacing: .14em; line-height: 1.1; }
.brand strong { font-family: Montserrat, sans-serif; font-size: 1.25rem; }
.brand small { font-size: .53rem; margin-top: .35rem; }
nav ul { display: flex; gap: 1.7rem; list-style: none; }
nav a { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
nav a:hover, nav a:focus-visible { color: var(--blue-light); }

.hero { align-items: center; background: url("assets/Portada.jfif") center/cover; color: var(--paper); display: flex; min-height: 690px; overflow: hidden; position: relative; }
.hero::before { background: var(--next-hero-image) center/cover; content: ""; inset: 0; opacity: 0; position: absolute; transition: opacity 1s ease-in-out; z-index: 0; }
.hero.is-transitioning::before { opacity: 1; }
.hero-overlay { background: linear-gradient(90deg, rgba(9,29,150,.94), rgba(9,29,150,.62) 65%, rgba(27,71,254,.35)); inset: 0; position: absolute; z-index: 1; }
.hero-content { max-width: 850px; position: relative; z-index: 1; }
.eyebrow { color: var(--blue-light); font-size: .76rem; font-weight: 700; letter-spacing: .2em; margin-bottom: 1rem; }
.eyebrow-blue { color: var(--blue); }
h1, h2, h3 { font-family: Montserrat, sans-serif; font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.8rem, 6vw, 5.3rem); max-width: 850px; }
h2 { color: var(--navy); font-size: clamp(2rem, 4vw, 3.2rem); }
.hero-lead { font-size: 1.3rem; margin: 1.5rem 0 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.button { border: 1px solid transparent; display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; padding: .9rem 1.4rem; text-decoration: none; text-transform: uppercase; transition: .25s ease; }
.button-light { background: var(--paper); color: var(--navy); }
.button-light:hover { background: var(--blue-light); }
.button-outline { border-color: rgba(255,255,255,.7); color: var(--paper); }
.button-outline:hover { background: var(--paper); color: var(--navy); }

.section { padding: 7rem 0; }
.about-grid { display: grid; gap: 5rem; grid-template-columns: 1fr 1fr; }
.intro-copy { color: var(--muted); font-size: 1.08rem; max-width: 520px; }
.intro-copy p + p { margin-top: 1rem; }
.commitment-bar { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 2rem; grid-template-columns: repeat(3, 1fr); margin-top: 5rem; padding: 1.8rem 0; }
.commitment-bar div { border-left: 2px solid var(--accent); padding-left: 1.2rem; }
.commitment-bar strong, .commitment-bar span { display: block; }
.commitment-bar strong { color: var(--navy); font-size: .95rem; }
.commitment-bar span { color: var(--muted); font-size: .83rem; }
.section-heading { margin: 0 auto 3rem; max-width: 700px; text-align: center; }
.reveal-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity .7s ease var(--reveal-delay), transform .7s ease var(--reveal-delay); }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.section-logo { display: block; height: 42px; margin: 0 auto 1.15rem; object-fit: contain; width: 42px; }
.section-logo-blue { filter: drop-shadow(0 8px 12px rgba(9, 29, 150, .16)); }
.section-logo-white { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .2)); opacity: .9; }
.section-heading > p:last-child { color: var(--muted); margin: 1rem auto 0; }
.section-values { background: var(--soft); }
.section-values .eyebrow { color: var(--blue); }
.values-grid, .services-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
.value-card { background: var(--paper); border-top: 3px solid var(--accent); box-shadow: var(--shadow); padding: 2.3rem; }
.value-number, .service-icon { color: var(--blue); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.value-card h3, .service-card h3 { color: var(--navy); font-size: 1.7rem; margin: 1.5rem 0 .7rem; }
.value-card p, .service-card p { color: var(--muted); font-size: .92rem; }
.section-services, .section-process { background: var(--navy); color: var(--paper); }
.section-services, .section-process { position: relative; }
.section-services::after, .section-process::after { background: url("assets/Imagen de Logo Blanco SEREX.png") center/contain no-repeat; content: ""; height: 280px; opacity: .045; pointer-events: none; position: absolute; right: 2%; top: 50%; transform: translateY(-50%); width: 280px; }
.section-services > .container, .section-process > .container { position: relative; z-index: 1; }
.section-heading-light h2 { color: var(--paper); }
.section-heading-light > p:last-child { color: var(--paper); }
.services-grid { grid-template-columns: repeat(3, 1fr); }
.service-card { align-content: end; background: linear-gradient(145deg, rgba(27,71,254,.32), rgba(255,255,255,.06)); border: 1px solid rgba(255,255,255,.2); color: var(--paper); cursor: pointer; display: grid; font-family: inherit; min-height: 260px; overflow: hidden; padding: 2rem; position: relative; text-align: left; transition: background .25s ease, border-color .25s ease, transform .25s ease; }
.service-card::after { border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; height: 180px; position: absolute; right: -55px; top: -75px; width: 180px; }
.service-card h3, .service-card p { position: relative; z-index: 1; }
.service-card:hover, .service-card:focus-visible { border-color: var(--blue-light); transform: translateY(-5px); }
.service-card:hover, .service-card:focus-visible { background: linear-gradient(145deg, rgba(27,71,254,.48), rgba(255,255,255,.1)); }
.service-card-icon { fill: none; height: 72px; margin-bottom: 1.5rem; stroke: var(--blue-light); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.3; width: 72px; }
.card-action { align-items: center; border-top: 1px solid rgba(255,255,255,.28); display: flex; font-size: .78rem; font-weight: 700; justify-content: space-between; letter-spacing: .08em; margin-top: 1.4rem; padding-top: 1rem; position: relative; text-transform: uppercase; z-index: 1; }
.card-action span { font-size: 1.35rem; line-height: 1; transition: transform .25s ease; }
.service-card:hover .card-action span, .service-card:focus-visible .card-action span { transform: translateX(5px); }
.service-card:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 4px; }
.service-card h3 { color: var(--paper); }
.service-card p { color: var(--paper); }
.service-icon { color: var(--blue-light); }

.service-modal { align-items: center; background: rgba(3, 12, 65, .82); display: flex; inset: 0; justify-content: center; opacity: 0; padding: 1.5rem; pointer-events: none; position: fixed; transition: opacity .2s ease; visibility: hidden; z-index: 45; }
.service-modal.is-open { opacity: 1; pointer-events: auto; visibility: visible; }
.service-modal-content { background: var(--paper); max-height: 90vh; max-width: 620px; overflow: auto; padding: 3rem; position: relative; transform: translateY(18px) scale(.97); transition: transform .3s ease; width: 100%; }
.service-modal.is-open .service-modal-content { transform: translateY(0) scale(1); }
.service-modal-content h2 { margin-bottom: 1rem; }
.service-modal-content > p:not(.eyebrow) { color: var(--muted); }
.service-modal-content ul { display: grid; gap: .65rem; list-style: none; margin: 1.5rem 0 2rem; }
.service-modal-content li { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.service-modal-content li::before { color: var(--blue); content: "✓"; font-weight: 700; margin-right: .65rem; }
.service-modal-close { background: var(--navy); border: 0; color: var(--paper); cursor: pointer; font-size: 2rem; height: 2.5rem; line-height: 1; position: absolute; right: 1rem; top: 1rem; width: 2.5rem; }
.service-modal-contact { background: var(--navy); color: var(--paper); }

.projects-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
.project-card { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-5px); }
.project-image-button { background: none; border: 0; cursor: pointer; display: block; height: 210px; overflow: hidden; padding: 0; position: relative; width: 100%; }
.project-image-placeholder { align-items: center; background: repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,.07) 18px 36px), linear-gradient(135deg, #1232ae, #091d96); color: var(--paper); display: flex; height: 210px; justify-content: center; }
.project-image-placeholder span { border: 1px solid rgba(255,255,255,.55); font-size: .75rem; font-weight: 700; letter-spacing: .1em; padding: .7rem 1rem; text-transform: uppercase; }
.project-image-button::after { background: var(--navy); bottom: 1rem; color: var(--paper); content: "Ver galería  →"; font-size: .72rem; font-weight: 700; left: 1rem; letter-spacing: .06em; padding: .7rem .9rem; position: absolute; text-transform: uppercase; transition: background .25s ease, transform .25s ease; z-index: 2; }
.project-image-button:hover::after, .project-image-button:focus-visible::after { background: var(--blue); transform: translateX(4px); }
.project-image-button:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.project-card img { height: 100%; object-fit: cover; width: 100%; }
.image-load-error { background: var(--blue-light); opacity: .7; }
.project-card[data-project="centro-salud"] img { object-position: left center; }
.project-content { padding: 1.4rem; }
.project-year { color: var(--blue); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.project-content h3 { font-family: Montserrat, sans-serif; font-size: 1.3rem; font-weight: 700; margin: .45rem 0; }
.project-content p { color: var(--muted); font-size: .88rem; }
.project-featured { grid-column: span 1; }

.modal-open { overflow: hidden; }
.gallery-modal { align-items: center; background: rgba(3, 12, 65, .82); display: flex; inset: 0; justify-content: center; opacity: 0; padding: 1.5rem; pointer-events: none; position: fixed; transition: opacity .2s ease; visibility: hidden; z-index: 40; }
.gallery-modal.is-open { opacity: 1; pointer-events: auto; visibility: visible; }
.gallery-modal-content { background: var(--paper); max-height: 92vh; max-width: 980px; opacity: 0; overflow: auto; padding: 2.5rem; position: relative; transform: translateY(18px) scale(.97); transition: opacity .3s ease, transform .3s ease; width: 100%; }
.gallery-modal.is-open .gallery-modal-content { opacity: 1; transform: translateY(0) scale(1); }
.gallery-modal-content h2 { font-size: clamp(1.7rem, 4vw, 2.7rem); margin-bottom: 1.5rem; }
.gallery-close { background: var(--navy); border: 0; color: var(--paper); cursor: pointer; font-size: 2rem; height: 2.5rem; line-height: 1; position: absolute; right: 1rem; top: 1rem; width: 2.5rem; }
.gallery-main { align-items: center; background: var(--blue-light); display: flex; height: min(65vh, 620px); justify-content: center; overflow: hidden; }
.gallery-main img { height: 100%; object-fit: contain; width: 100%; }
.gallery-main img.is-loading { opacity: .35; }
.gallery-thumbnails { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); margin-top: 1rem; }
.gallery-thumbnail { background: var(--paper); border: 2px solid transparent; cursor: pointer; padding: 0; }
.gallery-thumbnail.is-active { border-color: var(--blue); }
.gallery-thumbnail { overflow: hidden; }
.gallery-thumbnail img { height: 90px; object-fit: cover; width: 100%; }

.process-list { display: grid; gap: 1rem; grid-template-columns: repeat(5, 1fr); list-style: none; }
.process-list li { border-top: 1px solid rgba(255,255,255,.3); padding-top: 1.3rem; }
.process-list span { color: var(--blue-light); font-size: .8rem; font-weight: 700; }
.process-list h3 { font-size: 1.1rem; margin: 1rem 0 .7rem; }
.process-list p { color: var(--paper); font-size: .87rem; }
.section-testimonials { background: var(--soft); }
.testimonials-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2, 1fr); }
.section-partners { background: var(--soft); }
.partner-content { align-items: center; display: grid; gap: 3rem; grid-template-columns: 1fr 1fr; }
.partner-content h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.partner-content > p { color: var(--muted); font-size: 1.08rem; }
.partner-logos { display: grid; gap: .5rem; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin-top: 3rem; }
.partner-logos li { align-items: center; display: flex; height: 220px; justify-content: center; }
.partner-logos img { height: 210px; object-fit: contain; width: 100%; }
blockquote { background: var(--paper); border-left: 4px solid var(--accent); box-shadow: var(--shadow); padding: 2rem; }
blockquote p { color: var(--navy); font-family: "Neue Montreal", Arial, sans-serif; font-size: 1.25rem; font-style: italic; }
blockquote cite { color: var(--blue); display: block; font-size: .85rem; font-style: normal; font-weight: 700; margin-top: 1.3rem; }
blockquote cite span { color: var(--muted); font-weight: 400; }
.contact-cta { background: url("assets/Portada.jfif") center/cover; color: var(--paper); padding: 5rem 0; position: relative; }
.contact-cta::before { background: linear-gradient(90deg, rgba(9,29,150,.94), rgba(9,29,150,.62) 65%, rgba(27,71,254,.35)); content: ""; inset: 0; position: absolute; }
.cta-content { align-items: center; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.cta-content h2 { color: var(--paper); }
.cta-description { color: var(--paper); margin-top: 1rem; max-width: 560px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
.cta-actions .button-outline { border-color: rgba(255,255,255,.7); }
.whatsapp-float { align-items: center; background: #16a34a; border: 3px solid var(--paper); border-radius: 50%; bottom: 1.25rem; box-shadow: 0 8px 24px rgba(0,0,0,.24); color: var(--paper); display: inline-flex; height: 3.75rem; justify-content: center; position: fixed; right: 1.25rem; text-decoration: none; transition: background .2s ease, transform .2s ease; width: 3.75rem; z-index: 25; }
.whatsapp-icon { fill: currentColor; height: 2rem; width: 2rem; }
.whatsapp-float:hover, .whatsapp-float:focus-visible { background: #15803d; color: var(--paper); transform: translateY(-3px); }
.whatsapp-float:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 3px; }

footer { background: var(--navy); color: var(--paper); padding: 4rem 0 1.5rem; }
.footer-grid { display: grid; gap: 3rem; grid-template-columns: 2fr 1fr 1fr; }
.brand-footer { margin-bottom: 1.2rem; }
.footer-note, footer p { color: var(--paper); font-size: .88rem; }
footer h3 { font-size: .85rem; letter-spacing: .1em; margin-bottom: 1rem; text-transform: uppercase; }
footer p + p { margin-top: .4rem; }
.contact-item { align-items: center; display: flex; gap: .55rem; }
.contact-icon { align-items: center; background: var(--blue); border-radius: 50%; color: var(--paper); display: inline-flex; font-size: .75rem; height: 1.35rem; justify-content: center; width: 1.35rem; }
footer a { color: var(--paper); text-underline-offset: 3px; }
footer a:hover { color: var(--blue-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.5); color: var(--paper); display: flex; font-size: .76rem; justify-content: space-between; margin-top: 3rem; padding-top: 1.2rem; }

nav a:focus-visible, .button:focus-visible, footer a:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 4px; }
@media (max-width: 900px) {
    .header-content { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 1rem 0; }
    nav ul { flex-wrap: wrap; gap: .7rem 1rem; }
    .hero { min-height: 600px; }
    .about-grid, .partner-content { gap: 2rem; grid-template-columns: 1fr; }
    .values-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .partner-logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .process-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .header-content { align-items: center; flex-direction: row; min-height: 68px; padding: .8rem 0; position: relative; }
    .brand-logo { width: 125px; }
    .menu-toggle { align-items: center; background: transparent; border: 1px solid rgba(255,255,255,.55); cursor: pointer; display: flex; flex-direction: column; gap: 5px; justify-content: center; height: 42px; padding: .65rem; width: 42px; }
    .menu-toggle span:not(.sr-only) { background: var(--paper); display: block; height: 2px; transition: transform .2s ease, opacity .2s ease; width: 20px; }
    .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    nav { background: var(--navy); display: none; left: 0; padding: 1rem 5%; position: absolute; right: 0; top: 100%; }
    nav.is-open { display: block; }
    nav ul { flex-direction: column; gap: 1rem; }
    .section { padding: 4.5rem 0; }
    .commitment-bar, .values-grid, .services-grid, .projects-grid, .testimonials-grid, .footer-grid { grid-template-columns: 1fr; }
    .partner-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .partner-logos li { height: 180px; }
    .partner-logos img { height: 170px; }
    .process-list { grid-template-columns: 1fr; }
    .project-image-button, .project-image-placeholder { height: 230px; }
    .cta-content, .footer-bottom { align-items: flex-start; flex-direction: column; gap: 1.5rem; }
    .cta-actions { justify-content: flex-start; }
    .cta-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
    .reveal-on-scroll { opacity: 1; transform: none; }
}
