/* ==========================================================================
   Proiectus SAC — hoja de estilos única
   ========================================================================== */

/* --- Tipografía autoalojada (Inter variable) ------------------------------ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens de diseño ----------------------------------------------------- */
:root {
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --color-primary: #f3b62c;
  --color-primary-on-dark: #f4cb6d;
  --color-canvas: #ffffff;
  --color-canvas-parchment: #f5f5f7;
  --color-surface-tile-1: #272729;
  --color-ink: #1d1d1f;
  --color-ink-muted-80: #333333;
  --color-ink-muted-48: #7a7a7a;
  --color-body-on-dark: #ffffff;
  --color-body-muted: #cccccc;
  --color-hairline: #e0e0e0;

  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shell: 1440px;
  --gutter: 24px;

  --lift: 0 6px 18px rgba(0, 0, 0, .16);
  --lift-card: 0 14px 34px rgba(0, 0, 0, .22);
}

/* --- Base ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

/* Imágenes fluidas por defecto. Las que necesitan alto fijo (hero, tarjetas,
   modal) lo redeclaran con mayor especificidad, así que no se ven afectadas. */
img {
  max-width: 100%;
  height: auto;
}

/* [hidden] debe ganar a cualquier display posterior (p. ej. la imagen del modal). */
[hidden] { display: none !important; }

a { color: var(--color-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--color-primary); color: var(--color-ink); }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { list-style: none; padding: 0; }

/* --- Utilidades ----------------------------------------------------------- */
.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--color-ink);
  color: #fff;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --- Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--lift); transform: translateY(-1px); }
.btn--primary { background: var(--color-primary); color: var(--color-ink); border: 1px solid var(--color-primary); }
.btn--outline { background: transparent; color: var(--color-ink); border: 1px solid var(--color-ink); }
.btn--on-dark:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

.link-underline {
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --- Cabecera ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-hairline);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-block: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .2em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }

/* Botón hamburguesa: oculto en escritorio, se activa por debajo de 768px.
   Al estar oculto no altera en nada la maquetación de escritorio. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  cursor: pointer;
}
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform .2s ease;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.site-header.is-nav-open .nav-toggle__bars { background: transparent; }
.site-header.is-nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 20px;
}
.nav__link {
  font-size: 15px;
  color: var(--color-ink-muted-80);
  text-decoration: none;
}
.nav__link[aria-current='page'] {
  font-weight: 600;
  color: var(--color-ink);
  padding-bottom: 2px;
  border-bottom: 2px solid var(--color-primary);
}
.nav__cta {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-ink);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease;
}
.nav__cta:hover { text-decoration: none; box-shadow: var(--lift); transform: translateY(-1px); }

/* --- Secciones ------------------------------------------------------------ */
.section { padding-block: 80px; }
.section--tight { padding-block: 64px; }
.section--parchment { background: var(--color-canvas-parchment); }
.section--top-rule { border-top: 1px solid var(--color-hairline); }
.section--bottom-rule { border-bottom: 1px solid var(--color-hairline); }

.page-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 48px;
  padding-block: 80px 48px;
}
.page-head--baseline { align-items: end; }
.page-head--start { align-items: start; }

.page-title {
  font-size: clamp(32px, 4.2vw, 58px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.02em;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-ink-muted-80);
}
.lede--lg { font-size: 20px; }

.section-title {
  font-size: clamp(30px, 3.4vw, 47px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 24px;
}
.rule-accent { border-top: 3px solid var(--color-primary); padding-top: 20px; }

/* --- Portada (hero) ------------------------------------------------------- */
.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 68px);
  min-height: 560px;
  overflow: hidden;
  background: #111;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: #0c0c0c;
}
.hero__slab,
.hero__pane {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
}
.hero__pane img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(.78);
}
.hero__pane--bright img { filter: grayscale(1) contrast(1.06) brightness(.9); }
.hero__tint {
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  mix-blend-mode: multiply;
  opacity: .9;
}
.hero__scrim {
  position: absolute;
  inset: 0 auto 0 0;
  width: 56%;
  height: 100%;
  background: linear-gradient(90deg, rgba(12, 12, 12, .97) 0%, rgba(12, 12, 12, .92) 60%, rgba(12, 12, 12, 0) 100%);
}
.hero__seam {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(160, 160, 160, .35);
}
.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(56px, 8vw, 104px);
}
.hero__eyebrow {
  margin-bottom: 18px;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}
.hero__title {
  font-size: clamp(42px, 7vw, 108px);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.035em;
  color: #fff;
  max-width: 14ch;
}
.hero__tagline {
  margin: 24px 0 32px;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.4;
  font-weight: 300;
  color: rgba(255, 255, 255, .82);
  max-width: 30ch;
}
.hero__cta { align-self: flex-start; }

/* --- Lista de servicios (portada) ----------------------------------------- */
.service-list { display: grid; border-bottom: 1px solid var(--color-hairline); }
.service-list__item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--color-hairline);
  text-decoration: none;
  transition: padding-left .2s ease;
}
.service-list__item:hover { padding-left: 12px; text-decoration: none; }
.service-list__num {
  font-size: 13px;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--color-primary);
}
.service-list__name {
  font-size: clamp(21px, 2.2vw, 30px);
  font-weight: 400;
  letter-spacing: -.01em;
}

/* --- Rejilla de proyectos destacados -------------------------------------- */
/* Proyectos destacados de la portada: algo más de aire antes de la sección
   siguiente, para que la ubicación de cada tarjeta no quede pegada al borde. */
.section-featured { padding-bottom: 104px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 40px;
}

.project-card__frame {
  /* Imprescindible: en la portada el marco es un <a>, que por defecto es
     inline e ignoraría width/height/aspect-ratio, desbordando la tarjeta. */
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--color-canvas-parchment);
  overflow: hidden;
  transition: box-shadow .22s ease;
}
.project-card__frame:hover { box-shadow: var(--lift-card); }
.project-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
}
.project-card__title {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}
.project-card__meta {
  margin-top: 6px;
  font-size: 15px;
  color: var(--color-ink-muted-48);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .22s ease;
}
.card-overlay:hover,
.card-overlay:focus-visible { opacity: 1; text-decoration: none; }
.card-overlay span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--color-primary);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}

/* --- Bandas de servicio (página Servicios) -------------------------------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 48px;
  align-items: center;
  padding-block: 64px;
}
.split__media {
  position: relative;
  width: 100%;
  height: clamp(240px, 30vw, 440px);
  overflow: hidden;
  background: var(--color-canvas-parchment);
}
.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
}
.split__media--first { order: -1; }
.step-num {
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--color-ink);
}
.step-title {
  margin-bottom: 16px;
  font-size: clamp(28px, 3vw, 41px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.measure { max-width: 52ch; }

.subservices { display: grid; gap: 20px; margin-top: 28px; }
.subservice { border-top: 1px solid var(--color-hairline); padding-top: 16px; }
.subservice h3 { margin-bottom: 8px; font-size: 18px; font-weight: 600; }
.subservice p { font-size: 17px; line-height: 1.6; color: var(--color-ink-muted-80); }

/* --- Nosotros ------------------------------------------------------------- */
.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(32px, 5vw, 72px);
  padding-block: 56px;
}
.pillar { border-top: 3px solid var(--color-primary); padding-top: 18px; }
.pillar h2 {
  margin-bottom: 12px;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
}
.pillar p { font-size: 17px; line-height: 1.6; color: var(--color-ink-muted-80); }

.commit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 20px;
}
.commit-card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
}
.commit-card__num {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: .18em;
  font-weight: 600;
}
.commit-card h3 { margin-bottom: 12px; font-size: 20px; font-weight: 600; }
.commit-card p { font-size: 17px; line-height: 1.6; color: var(--color-ink-muted-80); }

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 8vw, 96px);
  text-align: center;
  padding-block: 80px;
}
.stat__value {
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
}
.stat__label {
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
}

.section-heading-rule {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-hairline);
  font-size: clamp(28px, 3.2vw, 43px);
  font-weight: 600;
  letter-spacing: -.02em;
}

/* --- Carruseles (página Proyectos) ---------------------------------------- */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: flex-end;
  padding-bottom: 14px;
}
.cat-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink-muted-80);
  text-decoration: none;
  transition: color .2s ease;
}
.cat-nav a:hover { color: var(--color-ink); text-decoration: none; }

.group-title {
  margin-bottom: 32px;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -.02em;
}

.track-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 20px;
}
.track-head__label {
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
}
.track-nav { display: flex; gap: 10px; }
.track-nav button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}
.track-nav button:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  transform: translateY(-1px);
}
.track-nav button:disabled { opacity: .3; cursor: default; }

/* El desplazamiento suave lo controla main.js (respeta prefers-reduced-motion). */
.track {
  display: flex;
  gap: 40px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.track::-webkit-scrollbar { display: none; }
.track > article {
  flex: 0 0 clamp(230px, 24vw, 290px);
  scroll-snap-align: start;
}

/* --- Modal de proyecto ---------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
}
.modal[open],
.modal.is-open { display: flex; }
.modal__panel {
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.modal__media {
  position: relative;
  background: var(--color-canvas-parchment);
  min-height: 320px;
}
.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal__body {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal__close-row { display: flex; justify-content: flex-end; }
.modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  background: var(--color-canvas);
  color: var(--color-ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.modal__foot {
  margin-top: auto;
  border-top: 1px solid var(--color-hairline);
  padding-top: 20px;
}
.modal__title {
  margin-bottom: 8px;
  font-size: clamp(21px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.modal__meta {
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
}

/* --- Contacto ------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 64px;
  align-items: start;
  padding-block: 56px 80px;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 48px;
}
.contact-dl { display: grid; gap: 28px; }
.contact-dl > div { border-top: 1px solid var(--color-hairline); padding-top: 20px; }
.contact-dl dt {
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--color-ink-muted-48);
}
.contact-dl dd { font-size: 18px; line-height: 1.5; }
.map-frame {
  width: 100%;
  height: clamp(320px, 34vw, 460px);
  border: 1px solid var(--color-hairline);
  display: block;
}
.map-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 16px;
}

/* --- Llamado a la acción -------------------------------------------------- */
.cta-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 32px;
  align-items: center;
  padding-block: 72px;
}
.cta-band__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cta-band__title {
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.cta-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
  padding-block: 80px;
}
.cta-center h2 {
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 600;
  letter-spacing: -.02em;
  max-width: 26ch;
}
.cta-center__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Pie de página -------------------------------------------------------- */
.site-footer {
  background: var(--color-surface-tile-1);
  color: var(--color-body-on-dark);
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px 64px;
  /* padding-block, no el atajo `padding`: este elemento también lleva la clase
     .shell y el atajo ponía los laterales a 0, dejando el texto pegado al
     borde de la pantalla y desalineado respecto a la cabecera. */
  padding-block: 64px 32px;
}
.site-footer__logo {
  width: 138px;
  height: auto;
  display: block;
  margin-bottom: 14px;
}
.site-footer__brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--color-body-muted);
}
.site-footer__tagline {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-body-muted);
}
.site-footer h2 {
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-primary-on-dark);
  font-weight: 400;
}
.site-footer ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer a,
.site-footer address {
  font-size: 16px;
  color: var(--color-body-muted);
  text-decoration: none;
}
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__legal { border-top: 1px solid rgba(255, 255, 255, .16); }
.site-footer__legal .shell {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-block: 20px;
  font-size: 13px;
  color: var(--color-body-muted);
}

/* ==========================================================================
   Responsive
   Todo lo que sigue usa max-width, de modo que el diseño de escritorio
   (por encima de 1200px) queda exactamente igual que antes.
   ========================================================================== */

/* La dirección del pie solo evita el salto de línea cuando hay sitio de sobra. */
@media (min-width: 992px) {
  .site-footer address { white-space: nowrap; }
}
/* El titular del CTA se mantiene en una línea solo en pantallas anchas. */
@media (min-width: 992px) {
  .cta-band__title { white-space: nowrap; }
}

/* --- 1200px · portátiles pequeños ----------------------------------------- */
@media (max-width: 1200px) {
  .feature-grid { gap: 32px; }
  .contact-grid { gap: 48px; }
  .split { gap: 40px; }
  .section-featured { padding-bottom: 80px; }
  .track { gap: 32px; }
}

/* --- 992px · tabletas en horizontal --------------------------------------- */
@media (max-width: 992px) {
  .section { padding-block: 64px; }
  .section--tight { padding-block: 48px; }
  .page-head { padding-block: 64px 40px; gap: 36px; }
  .split { padding-block: 48px; gap: 36px; }
  .duo { padding-block: 44px; }
  .stats { padding-block: 64px; gap: clamp(32px, 6vw, 64px); }
  .cta-band { padding-block: 56px; }
  .cta-center { padding-block: 64px; }
  .contact-grid { padding-block: 44px 64px; gap: 40px; }
  .site-footer__cols { padding-block: 48px 28px; gap: 32px 48px; }
  .section-featured { padding-bottom: 64px; }
}

/* --- 768px · tabletas en vertical y móviles grandes ----------------------- */
/* A partir de aquí la navegación pasa a menú desplegable: en móvil la barra
   original se partía en 3-4 líneas y la cabecera llegaba a medir 151px. */
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 8px 0 20px;
    background: var(--color-canvas);
    border-bottom: 1px solid var(--color-hairline);
    box-shadow: 0 18px 30px rgba(0, 0, 0, .10);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    /* visibility NO se transiciona a propósito: al ser una propiedad discreta,
       su conmutación con retardo no es fiable entre navegadores y el panel
       podía quedarse visible tras cerrarlo. Así el estado es siempre exacto
       (y queda fuera del foco y de los lectores de pantalla al cerrarse).
       La apertura conserva el fundido, que es el momento en que se nota. */
    transition: opacity .18s ease, transform .18s ease;
  }
  .site-header.is-nav-open .nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  /* Enlaces con área táctil holgada (mínimo 48px de alto).
     Se incluye el selector [aria-current] porque su regla base es más
     específica y, si no, le impondría su padding-bottom de 2px. */
  .nav__link,
  .nav__link[aria-current='page'] {
    padding: 14px var(--gutter);
    font-size: 17px;
  }
  .nav__link[aria-current='page'] {
    border-bottom: 0;
    box-shadow: inset 3px 0 0 var(--color-primary);
  }
  .nav__cta {
    margin: 12px var(--gutter) 0;
    padding: 14px 22px;
    font-size: 17px;
    text-align: center;
  }

  /* El hero descontaba una cabecera de 68px que en móvil no se cumplía. */
  .hero {
    height: calc(100vh - 68px);
    min-height: 520px;
  }
  /* Cubre todo el ancho para que el texto no quede sobre las fotos. */
  .hero__scrim {
    width: 100%;
    background: linear-gradient(90deg, rgba(12, 12, 12, .97) 0%, rgba(12, 12, 12, .92) 55%, rgba(12, 12, 12, .68) 100%);
  }
  .hero__content { padding-bottom: clamp(40px, 7vw, 72px); }

  /* Filas que pasan a columna */
  .page-head,
  .split,
  .duo,
  .contact-grid,
  .cta-band { grid-template-columns: 1fr; }

  .split__media { height: clamp(220px, 46vw, 340px); }
  .split__media--first { order: -1; }

  .cta-band { gap: 24px; }
  .cta-band__actions { justify-content: flex-start; }

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

  /* Enlaces del pie con área táctil cómoda: en escritorio miden 20px de alto,
     insuficiente para el dedo. Se compensa el alto extra reduciendo el hueco
     de la lista, así que el pie no crece de forma apreciable. */
  .site-footer ul { gap: 2px; }
  .site-footer ul a {
    display: block;
    padding-block: 9px;
  }

  .modal { padding: 16px; }
  .modal__panel { grid-template-columns: 1fr; max-height: 92vh; }
  .modal__media { min-height: 220px; max-height: 42vh; }
  .modal__body { padding: 24px 22px; }

  /* Los carruseles muestran una tarjeta más ancha y legible. */
  .track > article { flex: 0 0 clamp(240px, 52vw, 320px); }
}

/* Alturas de viewport dinámicas: evita el salto al ocultarse la barra del
   navegador en iOS/Android. Los navegadores que no lo soportan ignoran la regla. */
@media (max-width: 768px) {
  .hero { height: calc(100svh - 68px); }
  .nav { max-height: calc(100svh - 68px); }
}

/* --- 576px · móviles ------------------------------------------------------ */
@media (max-width: 576px) {
  .section { padding-block: 48px; }
  .section--tight { padding-block: 40px; }
  .page-head { padding-block: 48px 32px; gap: 28px; }
  .split { padding-block: 40px; gap: 28px; }
  .duo { padding-block: 36px; gap: 28px; }
  .stats { padding-block: 48px; gap: 32px; }
  .cta-band { padding-block: 44px; }
  .cta-center { padding-block: 48px; gap: 24px; }
  .contact-grid { padding-block: 36px 48px; gap: 32px; }
  .section-featured { padding-bottom: 48px; }
  .feature-grid { gap: 28px; }

  /* Botones a ancho completo: más cómodos de pulsar en móvil. */
  .hero__cta,
  .cta-band__actions .btn,
  .cta-center__actions .btn,
  .contact-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .cta-band__actions,
  .cta-center__actions,
  .contact-actions { width: 100%; gap: 10px; }
  .hero__cta { align-self: stretch; }

  /* Pie de página en una sola columna */
  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 40px 24px;
  }
  .site-footer__legal .shell { flex-direction: column; gap: 6px; }
  /* La lista de enlaces (5 elementos cortos) pasa a dos columnas: recupera
     el alto que ganan las áreas táctiles sin apretar los datos de contacto,
     que sí necesitan el ancho completo (correo y números de WhatsApp). */
  .site-footer nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .cat-nav { justify-content: flex-start; gap: 18px; }
  .track-head { align-items: center; }
  .commit-card { padding: 22px 18px; }
  .contact-dl { gap: 22px; }

  /* Titulares un punto más contenidos en pantallas pequeñas */
  .page-title { font-size: clamp(29px, 8vw, 34px); }
  .section-title { font-size: clamp(27px, 7.4vw, 32px); }
  .step-title { font-size: clamp(25px, 7vw, 30px); }
  .cta-center h2 { font-size: clamp(25px, 6.8vw, 30px); }
  .cta-band__title { font-size: clamp(23px, 6.4vw, 28px); }
  .section-heading-rule { font-size: clamp(25px, 7vw, 30px); margin-bottom: 28px; }
  .group-title { font-size: clamp(24px, 6.6vw, 29px); }
}

/* --- 390px · iPhone SE / 13-15 y Galaxy S23 ------------------------------- */
@media (max-width: 390px) {
  :root { --gutter: 18px; }

  .section { padding-block: 40px; }
  .page-head { padding-block: 40px 28px; }
  .split { padding-block: 32px; }
  .cta-center { padding-block: 40px; }
  .section-featured { padding-bottom: 40px; }

  .hero__title { font-size: 38px; }
  .hero__tagline { margin: 18px 0 26px; font-size: 18px; }
  .hero__eyebrow { margin-bottom: 14px; }

  .page-title { font-size: 27px; }
  .section-title { font-size: 25px; }
  .step-title { font-size: 24px; }

  .brand { font-size: 16px; letter-spacing: .16em; }
  .track > article { flex: 0 0 82vw; }
  .commit-card { padding: 20px 16px; }
  .modal__body { padding: 20px 18px; }
}

/* --- Preferencias del sistema --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
