/* ==========================================================================
   SGM · Design tokens  (Fase 0)
   Paleta heredada del sitio actual — NO cambiar valores sin aprobación.
   ========================================================================== */
:root {
  /* Marca */
  --sgm-red:        #E41D23;   /* rojo corporativo (manual de identidad: RGB 228 29 35) */
  --sgm-red-700:    #BE171C;   /* hover del rojo */
  --sgm-wine:       #711110;   /* bandas, pie de página */
  --sgm-wine-800:   #5A0D0C;
  --sgm-wine-900:   #420707;
  --sgm-ink:        #081E3F;   /* títulos, secciones oscuras */
  --sgm-ink-700:    #0F2D5C;
  --sgm-signal:     #FCC10A;   /* señalética: usar con muchísima moderación */

  /* Neutros */
  --gray-900: #1E1E1E;
  --gray-800: #393939;
  --gray-700: #515151;
  --gray-500: #767472;
  --gray-300: #D9D9D9;
  --gray-200: #E2E2E2;
  --gray-100: #F3F2F2;
  --gray-50:  #FAF9F9;
  --white:    #FFFFFF;

  /* Semánticos */
  --text:        var(--gray-700);
  --text-strong: var(--sgm-ink);
  --surface:     var(--white);
  --surface-alt: var(--gray-50);
  --border:      var(--gray-200);
  --whatsapp:    #25D366;

  /* Tipografía */
  /* Manual de identidad: títulos Source Sans Pro Bold, subtítulos SemiBold, texto Source Sans 3 */
  --font-head: "Source Sans Pro", "Source Sans 3", "Segoe UI", system-ui, Arial, sans-serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --fs-xs: .875rem;
  --fs-sm: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-h3: clamp(1.15rem, 1.05rem + .4vw, 1.35rem);
  --fs-h2: clamp(1.85rem, 1.4rem + 1.8vw, 2.75rem);
  --fs-h1: clamp(2.3rem, 1.5rem + 3.2vw, 3.9rem);

  /* Espaciado / forma */
  --space-section: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;

  /* Elevación */
  --shadow-sm: 0 1px 2px rgba(8, 30, 63, .08), 0 2px 8px rgba(8, 30, 63, .06);
  --shadow-md: 0 6px 18px rgba(8, 30, 63, .12);
  --shadow-lg: 0 18px 44px rgba(8, 30, 63, .20);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 76px;
}

/* ==========================================================================
   SGM · Sitio público — maqueta Fase 0 (v2: sobrio, sin degradados ni efectos)
   Reglas: colores planos, bordes finos, radios pequeños, sin sombras de adorno,
   sin animaciones de entrada, sin cristal/blur.
   ========================================================================== */
@font-face { font-family: "Source Sans 3"; font-weight: 200 900; font-style: normal; font-display: swap; src: url("../fonts/SourceSans3-Variable.woff") format("woff"); }
@font-face { font-family: "Source Sans Pro"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/SourceSansPro-Bold.woff") format("woff"); }
@font-face { font-family: "Source Sans Pro"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/SourceSansPro-SemiBold.woff") format("woff"); }
@font-face { font-family: "Source Sans Pro"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/SourceSansPro-Light.woff") format("woff"); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.65; color: var(--text); background: var(--surface); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sgm-red); text-decoration: none; }
a:hover { color: var(--sgm-red-700); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text-strong); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--sgm-signal); outline-offset: 3px; }
.icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:root { --r: 4px; }  /* radio único para todo el sitio */
.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section--alt { background: var(--surface-alt); border-block: 1px solid var(--border); }


/* ---- Botones ---- */
.btn { font-family: var(--font-head); display: inline-flex; align-items: center; justify-content: center; gap: .55rem; font: 600 var(--fs-sm)/1 var(--font-sans); letter-spacing: .03em; text-transform: uppercase; padding: 1rem 1.6rem; border-radius: var(--r); border: 2px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--primary { background: var(--sgm-red); color: #fff; }
.btn--primary:hover { background: var(--sgm-red-700); color: #fff; }
.btn--light { background: #fff; color: var(--sgm-wine); }
.btn--light:hover { background: var(--gray-100); color: var(--sgm-wine-900); }
.btn--outline { border-color: #fff; color: #fff; }
.btn--outline:hover { background: #fff; color: var(--sgm-wine); }
.btn--sm { padding: .7rem 1.1rem; font-size: var(--fs-xs); }
.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: var(--fs-sm); }

/* ---- Encabezados de sección ---- */
.sec-head { max-width: 680px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sec-head--center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .75rem; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sgm-red); margin-bottom: .8rem; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--sgm-red); }
.sec-head--center .eyebrow::after { content: ""; width: 28px; height: 2px; background: var(--sgm-red); }
.sec-head h2 { font-size: var(--fs-h2); }
.sec-head p { margin-top: .9rem; font-size: var(--fs-lg); }

/* ---- Utilidades ---- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 200; background: var(--sgm-ink); color: #fff; padding: .7rem 1rem; border-radius: var(--r); font-weight: 600; }
.skip-link:focus { top: .5rem; color: #fff; }
.h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.empty { text-align: center; color: var(--gray-500); padding-block: 2rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: rgba(255, 255, 255, .8); cursor: pointer; text-align: left; }
.linklike:hover { color: #fff; text-decoration: underline; }
.sec-head--tight { margin-bottom: 1.5rem; }
.btn--ghost { border-color: var(--gray-500); color: var(--gray-800); background: #fff; }
.btn--ghost:hover { border-color: var(--sgm-ink); color: var(--sgm-ink); }
.btn--dark { background: var(--sgm-ink); color: #fff; }
.btn--dark:hover { background: var(--sgm-ink-700); color: #fff; }
.btn--block { display: flex; width: 100%; }

/* ---- Top bar ---- */
.topbar { background: var(--sgm-wine-900); color: rgba(255, 255, 255, .9); font-size: var(--fs-xs); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 40px; }
.topbar a { color: inherit; display: inline-flex; align-items: center; gap: .45rem; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar__list { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.topbar__cta { font-weight: 600; }
.topbar__text { display: inline-flex; align-items: center; gap: .45rem; }
@media (max-width: 760px) { .topbar__cta, .topbar__list li:nth-child(n+2) { display: none; } }

/* ---- Header ---- */
.header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 3px solid var(--sgm-red); }
.header .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1.5rem; }
.brand img { height: 46px; width: auto; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a:not(.btn) { color: var(--gray-800); font-weight: 600; font-size: var(--fs-sm); padding: .6rem .85rem; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--sgm-red); border-bottom-color: var(--sgm-wine); }
.nav .btn { margin-left: .75rem; }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; color: var(--gray-800); cursor: pointer; }
.nav-toggle .icon { width: 28px; height: 28px; }
@media (max-width: 1020px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; inset: 100% 0 auto 0; background: #fff; flex-direction: column; align-items: stretch; padding: .5rem var(--gutter) 1.25rem; border-bottom: 3px solid var(--sgm-red); display: none; }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: .95rem .25rem; border-bottom: 1px solid var(--border); }
  .nav .btn { margin: 1rem 0 0; }
}

/* ---- Hero: foto limpia + bloque de texto sólido ---- */
.hero { position: relative; background: var(--gray-800); }
.hero__slide { position: relative; min-height: clamp(520px, 74vh, 720px); display: flex; align-items: center; padding-block: 3.5rem; }
.hero__slide[hidden] { display: none; }  /* sustituido por fundido en el bloque de movimiento */
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero__slide .container { position: relative; }
.hero__content { max-width: 640px; background: var(--sgm-wine); border-left: 6px solid var(--sgm-red); padding: clamp(1.75rem, 3.5vw, 2.75rem); color: #fff; }
.hero__tag { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .75); margin-bottom: 1rem; }
.hero h1, .hero .h1 { color: #fff; font-size: clamp(2.3rem, 1.5rem + 2.6vw, 3.6rem); font-weight: 700; letter-spacing: -.01em; }

.hero p { font-size: var(--fs-lg); color: rgba(255, 255, 255, .9); margin: 1.2rem 0 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---- Cifras: franja plana ---- */
.stats { background: var(--sgm-wine-900); color: #fff; }

.stats .container { overflow: hidden; }
.stats__grid { display: flex; flex-wrap: wrap; margin-left: -1px; }
.stat { flex: 1 1 150px; padding: 1.9rem 1.25rem; text-align: center; border-left: 1px solid rgba(255, 255, 255, .22); }
.stat__num { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 700; line-height: 1; color: #fff; }
.stat__num sup { font-size: .5em; top: -.6em; color: #ff8b8a; }
.stat__label { margin-top: .6rem; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }

/* ---- Nosotros (resumen) ---- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.about img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; border-radius: var(--r); }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ---- Tarjetas (servicios) ---- */
.cards { display: grid; gap: 1.5rem; }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 900px) { .cards--3 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .cards--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards--4 { grid-template-columns: 1fr; } }
.card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--sgm-red); }
.card:hover { border-color: var(--gray-500); border-top-color: var(--sgm-red); }
.card__media { aspect-ratio: 16 / 10; background: var(--gray-200); }
.card__media .img-clip { width: 100%; height: 100%; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__ph, .project__ph, .news__ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--gray-100); color: var(--sgm-wine); }
.card__ph .icon, .project__ph .icon, .news__ph .icon { width: 56px; height: 56px; stroke-width: 1.4; }
.project__ph { aspect-ratio: 16 / 9; }
.stretched { color: inherit; }
.stretched::after { content: ""; position: absolute; inset: 0; }
.stretched:hover { color: var(--sgm-red); }
.card__body { padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.card__body h3 { font-size: var(--fs-h3); }
.card__body p { font-size: var(--fs-sm); margin: 0; flex: 1; }

/* ---- Por qué SGM: lista numerada, fondo claro ---- */
.why__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; counter-reset: n; }
@media (max-width: 980px) { .why__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .why__grid { grid-template-columns: 1fr; } }
.why__item { counter-increment: n; border-top: 2px solid var(--sgm-ink); padding: 1.4rem 0 2.2rem; }
.why__item::before { content: counter(n, decimal-leading-zero); display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--sgm-red); letter-spacing: .1em; margin-bottom: .6rem; }
.why__item h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.why__item p { font-size: var(--fs-sm); margin: 0; }

/* ---- Franja RNP ---- */
.rnp { background: var(--gray-100); border-block: 1px solid var(--border); }
.rnp .container { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; padding-block: 1.4rem; text-align: center; }
.rnp__ico { color: var(--sgm-wine); display: inline-flex; }
.rnp__ico .icon { width: 28px; height: 28px; }
.rnp strong { color: var(--sgm-ink); }
.rnp p { margin: 0; font-size: var(--fs-sm); }

/* ---- Proyectos: foto arriba, datos abajo ---- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
@media (max-width: 800px) { .projects { grid-template-columns: 1fr; } }
.project { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; color: var(--text); }
.project:hover { border-color: var(--gray-500); color: var(--text); }
.project img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.project__body { padding: 1.5rem; border-top: 4px solid var(--sgm-red); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: .3rem .65rem; border-radius: 2px; background: var(--sgm-red); color: #fff; margin-bottom: .8rem; }
.badge--done { background: var(--gray-800); }
.project h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.project__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: var(--fs-xs); color: var(--gray-700); margin-bottom: 1rem; }
.project__meta span { display: inline-flex; align-items: center; gap: .4rem; }
.section-cta { margin-top: 2.5rem; text-align: center; }

/* ---- Banda CTA: color plano ---- */
.cta-band { background: var(--sgm-wine); color: #fff; text-align: center; padding-block: clamp(3rem, 6vw, 4.5rem); }
.cta-band h2 { color: #fff; font-size: var(--fs-h2); max-width: 22ch; margin-inline: auto; }
.cta-band p { max-width: 58ch; margin: 1.1rem auto 1.8rem; color: rgba(255, 255, 255, .9); font-size: var(--fs-lg); }
.cta-band__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; }

/* ---- Noticias ---- */
.news { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
@media (max-width: 800px) { .news { grid-template-columns: 1fr; } }
.news__item { display: grid; grid-template-columns: 40% 1fr; background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; color: var(--text); }
.news__item:hover { border-color: var(--gray-500); color: var(--text); }
.news__item img { width: 100%; height: 100%; object-fit: cover; min-height: 200px; }
.news__body { padding: 1.4rem; display: flex; flex-direction: column; gap: .55rem; }
.news__date { font-size: var(--fs-xs); font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; }
.news__body h3 { font-size: 1.1rem; }
.news__body p { font-size: var(--fs-sm); margin: 0; flex: 1; }
@media (max-width: 520px) { .news__item { grid-template-columns: 1fr; } .news__item img { height: 200px; } }

/* ---- Clientes ---- */
.clients { overflow: hidden; padding-block: .25rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.clients__track { display: flex; gap: 1rem; width: max-content; animation: clients-scroll 45s linear infinite; }
.clients:hover .clients__track { animation-play-state: paused; }
@keyframes clients-scroll { to { transform: translateX(calc(-50% - .5rem)); } }
.clients__item { flex: 0 0 200px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 1rem; display: grid; place-items: center; aspect-ratio: 5 / 3; }
.clients__item img { max-height: 70px; width: auto; }
@media (max-width: 700px) { .clients__item { flex-basis: 150px; } .clients__track { animation-duration: 35s; } }
@media (prefers-reduced-motion: reduce) {
  .clients { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .clients__track { animation: none; }
  .clients__item[aria-hidden="true"] { display: none; }
}

/* ---- Contacto ---- */
.contact { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.contact__info { background: var(--sgm-wine); color: #fff; border-radius: var(--r); padding: clamp(1.6rem, 3vw, 2.4rem); border-left: 6px solid var(--sgm-red); }
.contact__info h3 { color: #fff; font-size: 1.5rem; margin-bottom: .6rem; }
.contact__info > p { color: rgba(255, 255, 255, .88); }
.contact__list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 1.2rem; }
.contact__list li { display: flex; gap: .9rem; align-items: flex-start; }
.contact__list .ico { width: 24px; flex: none; padding-top: .15rem; color: #ff8b8a; }
.contact__list small { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.contact__list a { color: #fff; font-weight: 600; }
.contact__list a:hover { text-decoration: underline; }
.contact__wa { margin-top: 1.6rem; }
.form { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: clamp(1.4rem, 3vw, 2.2rem); }
.form h3 { font-size: 1.4rem; margin-bottom: .35rem; }
.form > p { font-size: var(--fs-sm); margin-bottom: 1.5rem; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form__grid { grid-template-columns: 1fr; } }
.field label { font: 600 var(--fs-xs)/1.2 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--sgm-ink); }
.field input, .field select, .field textarea { font: inherit; font-size: var(--fs-sm); color: var(--gray-900); padding: .85rem 1rem; border: 1px solid var(--gray-500); border-radius: var(--r); background: #fff; width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sgm-red); box-shadow: inset 0 0 0 1px var(--sgm-red); }
.form__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 1.4rem; }
.form__foot small { color: var(--gray-500); max-width: 38ch; }

/* ---- Footer ---- */
.footer { background: var(--sgm-wine-900); color: rgba(255, 255, 255, .8); font-size: var(--fs-sm); border-top: 6px solid var(--sgm-red); }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 2.5rem; padding-block: 3.5rem 3rem; }
@media (max-width: 980px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer img.logo { height: 56px; width: auto; margin-bottom: 1.2rem; }
.footer h4 { color: #fff; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.footer a { color: rgba(255, 255, 255, .8); }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__legal { font-size: var(--fs-xs); line-height: 1.7; }
.social { display: flex; gap: .5rem; margin-top: 1rem; }
.social a .icon { width: 20px; height: 20px; }
.social a { width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--r); display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; }
.social a:hover { background: var(--sgm-red); border-color: var(--sgm-red); text-decoration: none; }
.footer__bar { border-top: 1px solid rgba(255, 255, 255, .18); padding-block: 1.3rem; font-size: var(--fs-xs); }
.footer__bar .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; }

/* ---- WhatsApp flotante ---- */
.wa { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; background: var(--whatsapp); color: #fff; display: grid; place-items: center; }
.wa:hover { color: #fff; background: #1ebe5a; }
.wa__icon { width: 30px; height: 30px; }
.has-cookie .wa { bottom: 112px; }
@media (max-width: 700px) { .has-cookie .wa { bottom: 190px; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ==========================================================================
   Fase 3 — páginas interiores y componentes nuevos
   ========================================================================== */

/* Hero: controles de varias diapositivas */
.hero__controls { position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: flex; justify-content: flex-end; pointer-events: none; }
.hero__dots { display: flex; gap: .5rem; pointer-events: auto; }
.hero__dots button { width: 34px; height: 6px; padding: 0; border: 0; border-radius: 0; background: rgba(255, 255, 255, .5); cursor: pointer; }
.hero__dots button[aria-current="true"] { background: var(--sgm-red); }
.hero__dots button:hover { background: #fff; }

/* Encabezado de páginas interiores */
.page-head { background: var(--sgm-wine); color: #fff; padding-block: clamp(2rem, 4vw, 3.25rem); border-bottom: 6px solid var(--sgm-red); }
.page-head h1 { color: #fff; font-size: var(--fs-h2); max-width: 28ch; }
.page-head__lead { margin: .9rem 0 0; max-width: 62ch; color: rgba(255, 255, 255, .9); font-size: var(--fs-lg); }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem .6rem; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; color: rgba(255, 255, 255, .7); }
.crumbs a { color: rgba(255, 255, 255, .85); }
.crumbs a:hover { color: #fff; text-decoration: underline; }

/* Texto enriquecido (HTML saneado desde el panel) */
.prose { max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: var(--fs-h3); margin: 2rem 0 .8rem; }
.prose h3 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
.prose h4 { font-size: 1rem; margin: 1.4rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: 1.5rem 0; padding: .4rem 0 .4rem 1.25rem; border-left: 4px solid var(--sgm-red); color: var(--gray-800); font-weight: 500; }
.prose a { text-decoration: underline; }
.prose strong { color: var(--sgm-ink); }

/* Detalle (servicio / proyecto): contenido + panel lateral */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.detail__cover { margin-bottom: 1.75rem; }
.detail__cover img { width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: var(--r); }
.detail__h { font-size: var(--fs-h3); margin: 2.25rem 0 1rem; }
.detail__aside { position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 960px) { .detail__aside { position: static; } }
.aside-card { border: 1px solid var(--border); border-top: 4px solid var(--sgm-red); border-radius: var(--r); padding: 1.5rem; background: #fff; display: grid; gap: .9rem; }
.aside-card h2 { font-size: 1.2rem; }
.aside-card p { margin: 0; font-size: var(--fs-sm); }
.aside-card__dl { margin-top: .25rem; }
.aside-card__tel { color: var(--gray-700); }
.facts { margin: 0; display: grid; gap: .8rem; }
.facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-500); }
.facts dd { margin: .1rem 0 0; color: var(--sgm-ink); font-weight: 600; }

/* Artículo de noticia */
.article { max-width: 860px; }
.article__lead { font-size: var(--fs-lg); color: var(--gray-800); font-weight: 500; }

/* Galería del proyecto */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.gallery a { display: block; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--gray-100); }
.gallery a:hover { border-color: var(--gray-500); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Nosotros: misión/visión, certificados, documentos */
.mv { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
@media (max-width: 800px) { .mv { grid-template-columns: 1fr; } }
.mv__item { background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--sgm-red); border-radius: var(--r); padding: clamp(1.4rem, 3vw, 2.2rem); }
.certs { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.cert { flex: 0 1 280px; margin: 0; border: 1px solid var(--border); border-radius: var(--r); background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.cert img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--gray-50); padding: .75rem; }
.cert figcaption { padding: 1rem; display: grid; gap: .5rem; font-size: var(--fs-sm); border-top: 1px solid var(--border); }
.cert strong { color: var(--sgm-ink); }
.docs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 800px) { .docs { grid-template-columns: 1fr; } }
.doc { display: flex; gap: 1.1rem; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 1.25rem; }
.doc img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r); flex: none; }
.doc h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.doc p { font-size: var(--fs-sm); margin: 0 0 .6rem; }

/* Filtros y paginación */
.filters { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.filters a { padding: .8rem 0; font-weight: 600; font-size: var(--fs-sm); color: var(--gray-700); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.filters a:hover { color: var(--sgm-red); }
.filters a[aria-current="true"] { color: var(--sgm-ink); border-bottom-color: var(--sgm-red); }
.pager { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.pager a, .pager__cur { min-width: 40px; height: 40px; padding: 0 .8rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r); font-weight: 600; font-size: var(--fs-sm); color: var(--gray-800); background: #fff; }
.pager a:hover { border-color: var(--sgm-red); color: var(--sgm-red); }
.pager__cur { background: var(--sgm-wine); border-color: var(--sgm-wine); color: #fff; }

/* Formulario: estados */
.alert { padding: .85rem 1rem; border-radius: var(--r); font-size: var(--fs-sm); margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert--error { background: #fdecec; border-color: #f2b8b5; color: #7a1412; }
.field__error { font-size: var(--fs-xs); color: #a31412; font-weight: 600; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #c41e1d; }

/* Gracias y errores */
.thanks .container, .error-site .container { max-width: 640px; text-align: center; }
.thanks__ico { display: inline-grid; place-items: center; width: 72px; height: 72px; border: 3px solid var(--sgm-wine); border-radius: 50%; color: var(--sgm-wine); margin-bottom: 1.25rem; }
.thanks__ico .icon { width: 36px; height: 36px; }
.thanks h1, .error-site h1 { font-size: var(--fs-h2); margin-bottom: 1rem; }
.thanks__actions, .error-site__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.75rem; }
.error-site { padding-block: clamp(4rem, 10vw, 8rem); }
.error-site__code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 700; line-height: 1; color: var(--sgm-red); margin-bottom: .5rem; }

/* Aviso de cookies */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: #fff; border-top: 4px solid var(--sgm-red); padding: 1rem var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2rem; font-size: var(--fs-sm); }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; max-width: 70ch; }
.cookie__actions { display: flex; gap: .6rem; }


/* ======================================================================
   Movimiento — sutil y profesional. Colores planos, sin degradados.
   Todo se desactiva con prefers-reduced-motion.
   ====================================================================== */
:root { --ease: cubic-bezier(.22, .61, .36, 1); }

/* Cabecera: se compacta al bajar */
.header .container { transition: min-height .25s var(--ease); }
.brand img { transition: height .25s var(--ease); }
.header.is-stuck .container { min-height: 64px; }
.header.is-stuck .brand img { height: 36px; }

/* Menú: subrayado que crece */
.nav a:not(.btn) { position: relative; border-bottom: 0; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px; background: var(--sgm-red); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease); }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 1020px) { .nav a:not(.btn)::after { display: none; } .nav a:not(.btn) { border-bottom: 1px solid var(--border); } }

/* Botones: elevación leve y flecha que avanza */
.btn { transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .icon, .link-arrow .icon { transition: transform .25s var(--ease); }
.btn:hover .icon, .link-arrow:hover .icon { transform: translateX(4px); }

/* Tarjetas: foto con zoom lento, borde que marca */
.card, .project, .news__item, .cert, .clients__item, .mv__item { transition: border-color .25s, transform .3s var(--ease); }
.card:hover, .project:hover, .news__item:hover, .cert:hover, .mv__item:hover { transform: translateY(-4px); }
.card__media, .project__media, .news__media { overflow: hidden; }
.card__media img, .project img, .news__item img, .gallery img { transition: transform .8s var(--ease); }
.card:hover .card__media img, .project:hover img, .news__item:hover img, .gallery a:hover img { transform: scale(1.06); }
.project, .news__item { overflow: hidden; }
.card__body h3, .project h3, .news__body h3 { transition: color .2s; }
.card:hover .card__body h3, .project:hover h3, .news__item:hover h3 { color: var(--sgm-red); }
.clients__item:hover { border-color: var(--sgm-red); }
.clients__item img { transition: transform .3s var(--ease); }
.clients__item:hover img { transform: scale(1.06); }

/* Hero: fundido entre diapositivas, zoom lento y texto que sube */
.hero { display: grid; overflow: hidden; }
.hero__slide { grid-area: 1 / 1; transition: opacity .9s var(--ease), visibility .9s; }
.hero__slide[hidden] { display: flex; opacity: 0; visibility: hidden; pointer-events: none; }
.hero__controls { z-index: 3; }
.hero__bg img { transform: scale(1.08); transition: transform 9s linear; }
.hero__slide:not([hidden]) .hero__bg img { transform: scale(1); }
.hero__content > * { opacity: 0; transform: translateY(16px); }
.hero__slide:not([hidden]) .hero__content > * { animation: rise .7s var(--ease) forwards; }
.hero__slide:not([hidden]) .hero__content > :nth-child(2) { animation-delay: .12s; }
.hero__slide:not([hidden]) .hero__content > :nth-child(3) { animation-delay: .22s; }
.hero__slide:not([hidden]) .hero__content > :nth-child(4) { animation-delay: .32s; }
.hero__dots button { transition: background-color .2s, width .3s var(--ease); }
.hero__dots button[aria-current="true"] { width: 52px; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Aparición al hacer scroll (la clase .reveal la agrega el JS, solo fuera de pantalla) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.reveal--left { transform: translateX(-26px); }
.reveal.reveal--right { transform: translateX(26px); }
.reveal.reveal--left.is-in, .reveal.reveal--right.is-in { transform: none; }
.card.reveal.is-in:hover, .project.reveal.is-in:hover, .news__item.reveal.is-in:hover { transform: translateY(-4px); transition-delay: 0s; }
.sec-head .eyebrow::before, .sec-head .eyebrow::after { transition: width .8s var(--ease) .2s; }
.sec-head.reveal:not(.is-in) .eyebrow::before, .sec-head.reveal:not(.is-in) .eyebrow::after { width: 0; }
.about img { transition: transform 1.1s var(--ease); }
.about:hover img { transform: scale(1.02); }

/* Cifras */
.stat__num { font-variant-numeric: tabular-nums; }

/* WhatsApp: pulso discreto */
.wa { transition: transform .2s var(--ease); animation: wa-ring 4.5s ease-out 3s infinite; }
.wa:hover { transform: scale(1.08); animation: none; }
@keyframes wa-ring { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 18%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }

/* Popup de galería */
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 300; background: rgba(8, 14, 26, .94); display: grid; place-items: center; padding: 3.5rem 4.5rem; opacity: 0; transition: opacity .25s var(--ease); }
.lb.is-open { opacity: 1; }
.lb[hidden] { display: none; }
.lb__fig { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: grid; gap: .9rem; justify-items: center; }
.lb__img { max-width: 100%; max-height: calc(100vh - 11rem); width: auto; height: auto; border-radius: var(--r); background: var(--gray-800); opacity: 0; transform: scale(.98); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.lb__img.is-in { opacity: 1; transform: none; }
.lb__cap { color: rgba(255, 255, 255, .9); font-size: var(--fs-sm); text-align: center; max-width: 70ch; }
.lb__count { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); color: rgba(255, 255, 255, .75); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; }
.lb__btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--r); background: rgba(8, 14, 26, .6); color: #fff; cursor: pointer; transition: background-color .2s, border-color .2s; }
.lb__btn:hover { background: var(--sgm-red); border-color: var(--sgm-red); }
.lb__close { top: 1rem; right: 1rem; }
.lb__prev, .lb__next { top: 50%; margin-top: -24px; }
.lb__prev { left: 1rem; }
.lb__prev .icon { transform: rotate(180deg); }
.lb__next { right: 1rem; }
@media (max-width: 700px) { .lb { padding: 3.5rem .75rem 3rem; } .lb__prev, .lb__next { top: auto; bottom: .75rem; margin-top: 0; } .lb__prev { left: .75rem; } .lb__next { right: .75rem; } }
.gallery a { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  .lb, .lb__img { transition: none !important; }
  .reveal, .hero__content > *, .hero__bg img, .hero__slide, .card, .project, .news__item, .btn, .cert, .mv__item { transition: none !important; animation: none !important; }
  .reveal, .hero__content > * { opacity: 1 !important; transform: none !important; }
  .hero__bg img { transform: none !important; }
  .wa { animation: none; }
}

/* ==========================================================================
   Mapa del Perú (obras)
   ========================================================================== */
.peru-sec { background: var(--sgm-ink); color: #c9d4e6; border-block: 0; }
.peru { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .peru { grid-template-columns: minmax(0, 1fr) minmax(0, 470px); } }
.peru .sec-head h2 { color: #fff; }
.peru .sec-head p { color: #c9d4e6; }
.peru__list { list-style: none; margin: 0 0 1.25rem; padding: 0; border-top: 1px solid rgba(255,255,255,.14); }
.peru__list li { border-bottom: 1px solid rgba(255,255,255,.14); }
.peru__list a { display: flex; align-items: center; gap: 1rem; padding: .95rem .25rem; color: #fff; text-decoration: none; transition: background-color .25s var(--ease), padding .25s var(--ease); }
.peru__list a:hover, .peru__list a:focus-visible, .peru__list a.is-on { background: rgba(255,255,255,.06); padding-inline: .85rem; }
.peru__num { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; transition: background-color .25s var(--ease); }
.peru__num svg { width: 18px; height: 18px; }
.peru__num.is-live { background: var(--sgm-red); }
.peru__list a:hover .peru__num, .peru__list a.is-on .peru__num { background: var(--sgm-red); }
.peru__txt strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: var(--fs-md); line-height: 1.25; }
.peru__txt small { display: block; margin-top: .15rem; color: #9fb0cb; font-size: var(--fs-xs); }
.peru__legend { display: flex; align-items: center; gap: .6rem; font-size: var(--fs-xs); color: #9fb0cb; margin: 0; }
.peru__legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.peru__legend .dot--live { background: var(--sgm-red); }
.peru__legend .dot--done { background: #fff; margin-left: 1rem; }
.peru__map svg { display: block; width: 100%; max-width: 470px; height: auto; margin-inline: auto; overflow: visible; }
.peru__land path { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-linejoin: round; transition: fill .3s var(--ease); }
.peru__land path.has-work { fill: rgba(228,29,35,.38); stroke: rgba(255,255,255,.5); }
.peru__ref circle { fill: rgba(255,255,255,.35); }
.peru__ref text { fill: #8fa3c4; font: 600 12px var(--font-sans); letter-spacing: .04em; }
.peru__pt { cursor: pointer; outline: none; }
.peru__hit { fill: transparent; }
.peru__dot { fill: #fff; stroke: var(--sgm-ink); stroke-width: 3; transition: fill .2s var(--ease), r .2s var(--ease); }
.peru__pt.is-live .peru__dot { fill: var(--sgm-red); stroke: #fff; stroke-width: 2.5; }
.peru__pulse { fill: none; stroke: #fff; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.peru__pt.is-live .peru__pulse { stroke: var(--sgm-red); animation: peru-pulse 2.4s var(--ease) infinite; }
.peru__pt:hover .peru__dot, .peru__pt:focus-visible .peru__dot, .peru__pt.is-on .peru__dot { fill: var(--sgm-red); stroke: #fff; r: 10.5; }
.peru__pt:focus-visible .peru__dot { stroke: var(--sgm-signal); }
.peru__tip { opacity: 0; pointer-events: none; transform-box: fill-box; transition: opacity .2s var(--ease); }
.peru__tip rect { fill: #fff; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.peru__tip text { fill: var(--sgm-ink); font: 700 15px var(--font-head); }
.peru__pt:hover .peru__tip, .peru__pt:focus-visible .peru__tip, .peru__pt.is-on .peru__tip { opacity: 1; }
@keyframes peru-pulse { 0% { opacity: .75; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3.1); } }
@media (prefers-reduced-motion: reduce) { .peru__pt.is-live .peru__pulse { animation: none; } .peru__tip, .peru__dot, .peru__list a { transition: none; } }
