/* ===================================================================
   ARKA — Sistema editorial institucional
   Cada sección fluye de forma natural, con ritmo vertical ajustado.

   Paleta: un único matiz azul (217°) en intensidades distintas + neutros
   de matiz frío, con saturación contenida. Proporción 60-30-10:
   fondo azulado claro (60), superficies y secciones azul marino con
   texto (30), azul de acento (10). El azul marino se reserva para
   secciones de contenido; cabecera y pie permanecen en superficie clara.
   =================================================================== */

:root {
  /* ---------- FONDOS Y SUPERFICIES ---------- */
  --bg: #F4F6FA;              /* fondo base claro, azul muy frío */
  --surface: #E9EDF4;         /* secciones secundarias */
  --surface-raised: #FFFFFF;  /* tarjetas y paneles elevados sobre claro */
  --surface-sunken: #D8DFEA;  /* marcador de imagen en secciones claras */
  --surface-inverse: rgba(244, 246, 250, 0.10); /* marcador de imagen en oscuro */

  /* ---------- TEXTO ---------- */
  --text: #16202B;                          /* texto principal sobre claro */
  --text-secondary: #5A6675;                /* texto secundario sobre claro */
  --text-inverse: #F4F6FA;                  /* texto principal sobre azul marino */
  --text-inverse-secondary: rgba(244, 246, 250, 0.72);

  /* ---------- LÍNEAS ---------- */
  --line: #D8DFEA;                          /* separadores decorativos */
  --line-strong: #74849B;                   /* bordes de control (filtros) */
  --line-inverse: rgba(226, 234, 244, 0.18);
  --line-inverse-strong: rgba(226, 234, 244, 0.38);

  /* ---------- OSCURO ---------- */
  --dark: #0F1E2E;           /* secciones oscuras */
  --dark-raised: #17293D;    /* tarjetas apoyadas sobre el azul marino */

  /* ---------- ACENTO ---------- */
  --accent: #2E5FAF;           /* azul de acento sobre fondo claro (S≈45%) */
  --accent-hover: #204A8C;
  --accent-on-dark: #8FB0D8;   /* acento legible sobre azul marino */
  --accent-on-dark-hover: #B4C9E4;
  --accent-contrast: #FFFFFF;
  --accent-ring: rgba(46, 95, 175, 0.30);
  --accent-ring-dark: rgba(143, 176, 216, 0.24);

  /* ---------- VELOS Y CAPAS ---------- */
  --header-bg: rgba(244, 246, 250, 0.94);
  --overlay: rgba(11, 20, 31, 0.76);            /* modal */
  --overlay-strong: rgba(11, 20, 31, 0.94);     /* visor de imagen */
  --scrim-dark: rgba(11, 20, 31, 0.66);         /* controles de galería */
  --scrim-dark-strong: rgba(11, 20, 31, 0.84);
  --scrim-light: rgba(244, 246, 250, 0.80);
  --scrim-light-soft: rgba(244, 246, 250, 0.72);

  /* ---------- CAMPOS Y ESTADOS ---------- */
  --field-bg: rgba(244, 246, 250, 0.06);
  --field-bg-focus: rgba(244, 246, 250, 0.10);
  --field-border: rgba(244, 246, 250, 0.38);
  --placeholder: rgba(244, 246, 250, 0.48);
  --success: #7EC9B4;              /* estado de éxito, armonizado con la paleta */
  --danger: #E9A3A0;               /* estado de error */
  --danger-ring: rgba(233, 163, 160, 0.22);

  /* ---------- SELECCIÓN ---------- */
  --selection-bg: rgba(46, 95, 175, 0.24);
  --selection-bg-dark: rgba(143, 176, 216, 0.30);
  --selection-text: #16202B;
  --selection-text-dark: #F4F6FA;

  /* ---------- SOMBRAS (muy suaves, baja opacidad) ---------- */
  --shadow-xs: 0 1px 2px rgba(16, 28, 44, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 28, 44, 0.05), 0 3px 10px rgba(16, 28, 44, 0.05);
  --shadow-md: 0 2px 6px rgba(16, 28, 44, 0.06), 0 12px 28px rgba(16, 28, 44, 0.08);
  --shadow-lg: 0 10px 24px rgba(11, 22, 36, 0.12), 0 30px 60px rgba(11, 22, 36, 0.16);
  --shadow-dark: 0 2px 6px rgba(6, 14, 24, 0.18), 0 14px 32px rgba(6, 14, 24, 0.22);

  /* ---------- RADIOS ---------- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: clamp(20px, 5vw, 80px);
  --max: 1440px;
  --section-y: clamp(48px, 5vw, 84px);
  --section-top-first: clamp(24px, 2.6vw, 38px);
  --header-height: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}
.section--ink ::selection {
  background: var(--selection-bg-dark);
  color: var(--selection-text-dark);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.022em;
}

h2 { font-size: clamp(30px, 4.5vw, 52px); }
h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 400; }
.expertise-item h2 { font-size: 20px; margin-bottom: 10px; color: var(--text-inverse); }
.modal-info h2 { margin-bottom: 12px; font-size: 26px; }
p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 62ch;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--dark); color: var(--text-inverse);
  padding: 12px 18px; z-index: 999;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { left: 12px; top: 12px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 20px;
  text-align: left;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.section--ink :focus-visible,
.modal :focus-visible,
.lightbox :focus-visible { outline-color: var(--accent-on-dark); }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 8px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  --brand-logo-size: clamp(48px, 4.5vw, 60px);
}
.brand-logo {
  height: var(--brand-logo-size);
  width: auto;
  aspect-ratio: 451.25 / 398.78;
  flex: 0 0 auto;
  color: inherit;
  fill: currentColor;
}
.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 0.82;
  white-space: nowrap;
}
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 31px);
  letter-spacing: 0.02em;
  font-weight: 500;
}
.brand-subname {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  font-weight: 400;
}

.main-nav { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; }
.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-secondary);
  background: none;
  border: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, font-weight 0.2s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a:active { color: var(--text); font-weight: 500; }
.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a:active::after { transform: scaleX(1); }
.main-nav a.is-current { color: var(--text); font-weight: 600; }
.main-nav a.is-current::after { transform: scaleX(1); }

.header-right { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  flex-direction: column; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 8px;
  border-radius: var(--radius-sm);
}
.nav-toggle span,
.nav-toggle::after { width: 20px; height: 1px; background: var(--text); display: block; content: ""; border-radius: 1px; }

/* ---------- SECCIÓN BASE (flujo natural, sin 100vh) ---------- */
.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
  border-top: 1px solid var(--line);
}
.section:not(.hero) { padding-top: clamp(20px, 2.5vw, 32px); }
.section:first-of-type { padding-top: var(--section-top-first); }
.section:first-of-type:not(.hero) { padding-top: clamp(20px, 2.5vw, 32px); }
.projects-section { padding-top: clamp(20px, 2.5vw, 32px) !important; }
.projects-section .section-head { margin-bottom: clamp(4px, 0.8vw, 10px); }
.section:first-of-type { border-top: none; }
.section--paper { background: var(--bg); color: var(--text); }
.section--stone { background: var(--surface); color: var(--text); }
.section--ink   { background: var(--dark);   color: var(--text-inverse); min-height: calc(100vh - var(--header-height)); min-height: calc(100svh - var(--header-height)); display: flex; flex-direction: column; justify-content: flex-start; border-top-color: var(--line-inverse); }
.section--ink .section-head { margin: 0 auto clamp(12px, 2vw, 24px); }
.section--ink p { color: var(--text-inverse-secondary); }
.section--ink .section-label { color: var(--text-inverse-secondary); }
.section--ink.section--compact { min-height: auto; }

#destacados .section-head {
  max-width: none;
}
#destacados .section-note {
  max-width: none;
  width: 100%;
}

.section-head {
  max-width: 900px;
  width: 100%;
  margin: 0 auto clamp(24px, 3vw, 40px);
  display: grid;
  gap: 10px;
}

.section-title { max-width: 24ch; }
.section-title--single-line { max-width: none; text-align: center; white-space: nowrap; font-size: clamp(24px, 4.5vw, 48px); }
.section-title--center { max-width: none; text-align: center; white-space: nowrap; font-size: clamp(24px, 3vw, 44px); }
.projects-title { max-width: none; font-size: clamp(28px, 3.2vw, 48px); white-space: nowrap; }
.services-title { max-width: none; white-space: nowrap; text-align: center; }
.section-note,
.hero-sub {
  font-size: clamp(16px, 1.5vw, 18px);
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-secondary);
  width: 100%;
  max-width: none;
  text-align: center;
  text-justify: inter-word;
  hyphens: none;
}
.section-note.is-justified,
.hero-sub.is-justified,
.section-note--center.is-justified {
  text-align: justify;
}
.section--ink .section-note { color: var(--text-inverse-secondary); }

/* ---------- HERO ---------- */
.hero {
  padding-top: var(--section-top-first);
  padding-bottom: clamp(40px, 5vw, 72px);
}

.hero-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.hero-inner { width: 100%; max-width: 680px; margin: 0 auto; padding-top: 0; }
.hero-title {
  font-size: clamp(40px, 6vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.032em;
  margin: 0 0 24px;
  text-align: center;
}
.hero-sub {
  max-width: 100%;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }

.hero-media {
  width: 100%;
  height: clamp(420px, 62svh, 600px);
  overflow: hidden;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero:hover .hero-media img { transform: scale(1.03); }

/* CTA principal: mismo diseño para el envío del formulario y los enlaces que redirigen */
.link-arrow {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  min-height: 48px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.link-arrow:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.link-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.section--ink .link-arrow:focus-visible { outline-color: var(--accent-on-dark); }

.section-actions {
  max-width: var(--max);
  width: 100%;
  margin: clamp(24px, 3vw, 40px) auto 0;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.section--ink .section-actions { max-width: 900px; }
.section-title--lead { max-width: 20ch; text-align: center; font-size: clamp(28px, 3.6vw, 50px); }
.section-note--center {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

@media (max-width: 640px) {
  .section-title--lead { font-size: clamp(26px, 7.5vw, 34px); }
  .section-actions { gap: 20px; }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: none;
  }
  .hero-inner {
    width: 100%;
    max-width: none;
    padding-top: 0;
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .hero-media,
  .about-media { order: 0; }
  .hero-media {
    width: 100%;
    height: clamp(280px, 58svh, 460px);
    border-radius: 0;
  }
  .hero-title { width: 100%; text-align: left; }
}

@media (max-width: 640px) {
  .hero-grid {
    width: 100%;
    margin: 0;
    gap: 16px;
  }
  .hero-media { order: 0; }
  .hero-inner {
    order: 1;
    gap: 18px;
    min-width: 0;
  }
  .hero-title {
    width: 100%;
    max-width: 240px;
    font-size: clamp(30px, 9vw, 52px);
    line-height: 0.88;
    letter-spacing: -0.04em;
    text-align: center;
    margin: 0 auto;
  }
  .hero-title span {
    display: block;
    width: 100%;
  }
  .hero-sub {
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
    max-width: 100%;
    margin: 0 0 20px;
  }
  .hero-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    margin: 0;
    gap: 10px;
    padding: 0;
    overflow-x: visible;
  }
  .hero-actions::-webkit-scrollbar { display: none; }
  .hero-actions .link-arrow {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    letter-spacing: 0.1em;
    white-space: normal;
  }
  .link-arrow {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    padding: 12px 8px;
    font-size: clamp(9px, 2.1vw, 12px);
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .hero-media {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-inline: 0;
    border-radius: 0;
  }
}

/* ---------- PORTFOLIO ---------- */
.filters {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}

.grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 22px;
}
.card {
  cursor: pointer;
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card[hidden] { display: none; }
.card:focus-visible { box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-md); }

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: var(--surface-sunken);
  border-radius: 0;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card-media img { transform: scale(1.04); }

.card-tag {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--dark);
  color: var(--text-inverse);
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.card:hover .card-tag,
.card.is-tag-visible .card-tag { opacity: 1; }

.card-body { padding: 16px 18px 20px; }
.card-body h3 { font-size: 20px; margin-bottom: 6px; color: var(--text); }
.card-meta {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .card-meta { display: none; }
}

/* ---------- EXPERTISE (dark) ---------- */
#servicios {
  padding-top: clamp(20px, 2.5vw, 32px);
  padding-bottom: clamp(24px, 3vw, 40px);
}
#servicios .section-head {
  margin-bottom: 16px;
}
#servicios .expertise-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(64px, auto));
  grid-auto-flow: column;
  column-gap: 12px;
  row-gap: 10px;
  border-top: 0;
}
.expertise-item {
  padding: 4px 20px;
  border: 1px solid var(--line-inverse);
  border-radius: var(--radius-md);
  background: var(--dark-raised);
  box-shadow: var(--shadow-dark);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 64px;
}.expertise-num {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--accent-on-dark);
  padding-top: 6px;
}
.expertise-item h3 { font-size: 20px; margin-bottom: 10px; color: var(--text-inverse); }
.expertise-item p { font-size: 16px; max-width: 46ch; }
.expertise-item p,
.about-text,
.modal-info > p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  word-spacing: normal;
}

@media (max-width: 980px) {
  #servicios .expertise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}

@media (max-width: 780px) {
  .section-title--single-line { max-width: 24ch; white-space: normal; }
  #servicios .expertise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(64px, auto));
    grid-auto-flow: column;
    column-gap: 10px;
    row-gap: 10px;
  }
  .expertise-item { grid-template-columns: 32px 1fr; gap: 14px; padding: 20px; }
  #servicios .expertise-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 8px;
  }
  #servicios .expertise-num {
    display: none;
  }
  #servicios .expertise-item h3 {
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 0;
    overflow-wrap: normal;
  }
}

/* ---------- CATÁLOGO DE SERVICIOS ---------- */
.service-catalog {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--line-inverse);
}
.service-group {
  padding: clamp(28px, 3vw, 44px) 0;
  border-bottom: 1px solid var(--line-inverse);
}
.service-group-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: clamp(18px, 2vw, 26px);
}
.service-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--text-inverse);
  max-width: 32ch;
}
.service-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: center;
}
.service-gallery { display: grid; gap: 8px; min-width: 0; }
.service-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--surface-inverse);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  touch-action: pan-y;
  box-shadow: var(--shadow-dark);
}
.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.service-group:hover .service-media img { transform: scale(1.03); }
.service-media.slide-from-right img { animation: project-slide-from-right 0.28s ease-out; }
.service-media.slide-from-left img { animation: project-slide-from-left 0.28s ease-out; }
.service-gallery-controls { display: none; }
.service-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.service-thumb {
  display: block;
  padding: 0;
  border: 0;
  margin: 0;
  background: var(--surface-inverse);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  line-height: 0;
}
.service-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
  transition: filter 0.35s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.service-thumb:hover img { filter: brightness(1); transform: scale(1.05); }
.service-thumb:focus-visible { outline: 2px solid var(--accent-on-dark); outline-offset: 2px; }
.service-thumb:focus-visible img { filter: brightness(1); }
.service-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(18px, 2vw, 32px);
  align-items: start;
  justify-items: center;
}
.subsection-title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-inverse);
}
.service-subsection,
.service-list {
  width: 100%;
  max-width: 48ch;
}
.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.service-list li {
  position: relative;
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  color: var(--text-inverse-secondary);
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 1px;
  background: var(--accent-on-dark);
}

@media (max-width: 860px) {
  .service-layout { grid-template-columns: 1fr; align-items: start; }
  .service-body { grid-template-columns: 1fr; }
  .service-thumbs { display: none; }
  .service-gallery-controls {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(8px, 3vw, 18px);
    pointer-events: none;
  }
  .service-gallery-controls .gallery-arrow { opacity: 0.9; }
  .service-gallery-controls .gallery-dots { bottom: clamp(10px, 2.5vw, 18px); }
  .service-group:hover .service-media img { transform: none; }
}
@media (max-width: 560px) {
  .service-group-head { gap: 12px; }
  .service-title { font-size: 22px; }
}

/* ---------- ESTUDIO ---------- */
.about-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas: "media content";
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  justify-items: center;
}

.about-inner { grid-area: content; max-width: 700px; width: 100%; justify-self: center; }
.about-title {
  width: 100%;
  margin: 0 auto 24px;
  font-size: clamp(18px, 5.4vw, 48px);
  text-align: center;
  white-space: nowrap;
}
.about-text { font-size: 16px; margin-bottom: 18px; max-width: 68ch; }
.about-text:last-of-type { margin-bottom: 40px; }

.about-facts-wrap {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}
.about-facts-wrap .section-label { margin-bottom: 14px; }

.about-facts {
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
  max-width: 900px;
  width: 100%;
}
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.about-facts dd { margin: 0; font-size: 16px; }
.section--ink .about-facts { border-top-color: var(--line-inverse); max-width: 900px; width: 100%; margin: 0 auto; }
.section--ink .about-facts dt { color: var(--text-inverse-secondary); }
.section--ink .about-facts dd { color: var(--text-inverse); }

/* ---------- MISION / VISION / OBJETIVO ---------- */
.statement {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  justify-items: center;
}
.statement-head {
  display: grid;
  gap: 14px;
  width: 100%;
  align-content: center;
}
.statement-media {
  margin: 10px 0 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-inverse);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dark);
}
.statement-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section--paper .statement-media { background: var(--surface-sunken); box-shadow: var(--shadow-md); }
.statement-term {
  font-size: clamp(34px, 5.2vw, 62px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 12ch;
}
.statement-body {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 66ch;
  justify-self: center;
  align-content: center;
}
.statement--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
.statement--reverse .statement-head { order: 2; }
.statement--reverse .statement-body { order: 1; }
.statement-body p {
  font-size: 16px;
  line-height: 1.65;
  text-align: justify;
  hyphens: none;
}
.statement-lead {
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.012em;
  font-weight: 500;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-inverse);
}
.section--paper .statement-lead { border-bottom-color: var(--line); }

@media (max-width: 900px) {
  .statement { grid-template-columns: 1fr; gap: 24px; justify-items: stretch; }
  .statement--reverse { grid-template-columns: 1fr; }
  .statement--reverse .statement-head,
  .statement--reverse .statement-body { order: 0; }
  .statement-term { max-width: none; }
  .statement-body { max-width: none; justify-self: stretch; }
  .statement-body p { text-align: left; }
  .statement-media { margin-top: 6px; aspect-ratio: 16 / 9; }
}

.section--statements { justify-content: center; }
.statement-columns {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 36px);
}
.statement-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 16px;
}
.section--statements .statement-term {
  max-width: none;
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.05;
}
.section--statements .statement-media {
  margin: 0;
  aspect-ratio: 16 / 9;
}
.section--statements .statement-body {
  max-width: none;
  justify-self: stretch;
  align-content: start;
  gap: 12px;
}
.section--statements .statement-body p {
  max-width: none;
  text-align: left;
  font-size: 15px;
}

@media (max-width: 900px) {
  .statement-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .statement-columns { grid-template-columns: 1fr; }
  .section--statements .statement-term { font-size: 32px; }
}

.about-media {
  grid-area: media;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; grid-template-areas: "media" "content"; gap: 40px; }
}
@media (max-width: 480px) {
  .about-facts { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- CONTACTO (dark) ---------- */
.contact-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 2.5vw, 36px);
  align-items: stretch;
}

.contact-form { grid-column: 1; display: grid; gap: 16px; align-content: start; color-scheme: dark; }
.contact-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; }
.contact-fields .contact-field--full { grid-column: 1 / -1; }
.contact-survey { display: grid; gap: 16px; }
.survey-heading { display: grid; gap: 6px; }
.survey-heading > p:last-child,
.survey-hint {
  margin: 0;
  color: var(--text-inverse-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.survey-hint { min-height: 1.5em; }
.contact-survey select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.contact-aside { grid-column: 2; min-width: 0; align-self: center; }
.contact-aside .contact-address-label {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse);
}
.contact-aside .contact-address {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-inverse-secondary);
}
.contact-form label { display: grid; gap: 6px; }
.contact-form label[hidden] { display: none; }
.label-text {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-inverse-secondary);
}

.label-optional {
  opacity: 0.55;
  text-transform: none;
  letter-spacing: 0.04em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.contact-form input::placeholder { color: var(--placeholder); }
.contact-form select.is-placeholder { color: var(--placeholder); opacity: 0.68; }
.contact-form select.is-placeholder:focus { opacity: 1; }
.contact-form label.is-searching { position: relative; }
.select-search {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--dark);
  border: 1px solid var(--accent-on-dark);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.select-search__input {
  border: 0 !important;
  border-bottom: 1px solid var(--field-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.select-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.select-search__list li {
  padding: 11px 14px;
  color: var(--text-inverse);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}
.select-search__list li.is-active,
.select-search__list li:hover { background: var(--accent-ring-dark); }
.select-search__list li.is-selected { color: var(--accent-on-dark); font-weight: 600; }
.select-search__list li.select-search__empty { cursor: default; opacity: 0.6; background: none; }
.contact-form label:focus-within .label-text {
  color: var(--accent-on-dark);
  opacity: 1;
}
.contact-form label:focus-within select {
  opacity: 1;
  border-color: var(--accent-on-dark);
  box-shadow: 0 0 0 3px var(--accent-ring-dark);
}
.contact-form textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  background: var(--field-bg-focus);
  border-color: var(--accent-on-dark);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring-dark);
}
.contact-form select option { background: var(--dark); color: var(--text-inverse); }
.contact-form input.is-pending,
.contact-form select.is-pending,
.contact-form textarea.is-pending {
  border-color: #D0B783;
  box-shadow: 0 0 0 2px rgba(208, 183, 131, 0.2);
  animation: pending-field-arrive 420ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
  animation-delay: var(--pending-delay, 0ms);
}
.contact-form label.is-invalid .label-text::after {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 1px solid #D0B783;
  border-radius: 50%;
  color: #D0B783;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: 1px;
}
.contact-form input.is-invalid,
.contact-form select.is-invalid,
.contact-form textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}
@keyframes pending-field-arrive {
  from { opacity: 0.78; transform: scale(0.975); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-form input.is-pending,
  .contact-form select.is-pending,
  .contact-form textarea.is-pending { animation: none; }
}

.contact-form button {
  justify-self: center;
  margin-top: 14px;
}
.contact-form .survey-continue {
  justify-self: start;
  margin: 0;
  padding: 2px 0;
  min-height: 28px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-on-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
}
.contact-form .survey-continue:hover,
.contact-form .survey-continue:focus-visible {
  color: var(--text-inverse);
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
  box-shadow: none;
}
.contact-form .survey-continue[hidden] { display: none; }
.contact-form label:has(.survey-unknown-option) { position: relative; }
.contact-form .survey-unknown-option {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 100%;
  max-height: 52px;
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text-inverse-secondary);
  cursor: pointer;
}
.contact-form label:has(.survey-unknown-option) input[name="superficie"] { padding-right: 104px; }
.contact-form .survey-unknown-option input {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent-on-dark);
  cursor: pointer;
}
.contact-form input[readonly] { opacity: 0.6; }

.form-note { font-size: 16px; min-height: 20px; font-family: var(--font-mono); color: var(--text-inverse-secondary); }
.form-note.is-success { color: var(--success); }
.form-note.is-error { color: var(--danger); }

.contact-link {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-on-dark);
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.section:not(.section--ink) .contact-link { color: var(--accent); }
.contact-link:hover { color: var(--accent-on-dark-hover); }
.section:not(.section--ink) .contact-link:hover { color: var(--accent-hover); }

@media (max-width: 640px) {
  .section-title--center { white-space: normal; font-size: clamp(24px, 7.5vw, 34px); }
  .contact-fields { grid-template-columns: 1fr; gap: 16px; }
  .contact-fields .contact-survey { grid-column: 1; }
  .contact-grid { gap: 28px; }
  .contact-form button { padding: 10px 22px; min-height: 44px; font-size: 16px; margin-top: 10px; }
}

@media (max-width: 480px) {
  .contact-form button[type="submit"] { width: 100%; }
}

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form,
  .contact-aside { grid-column: 1; }
  .section--ink { min-height: auto; justify-content: flex-start; }
}

/* ---------- MAPA DE GOOGLE ---------- */
.contact-map {
  width: 100%;
  aspect-ratio: 1.618 / 1;
  overflow: hidden;
  border: 1px solid var(--line-inverse);
  border-radius: var(--radius-md);
  background: var(--dark);
  position: relative;
  box-shadow: var(--shadow-dark);
}
.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: grayscale(1) contrast(1.05) brightness(0.92);
  transition: filter 0.4s ease;
}
.contact-map:hover iframe {
  filter: grayscale(0) contrast(1) brightness(1);
}

.map-route-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-lg);
}
.map-route-btn:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
  border-color: var(--accent-hover);
  transform: translate(-50%, -2px);
}
.map-route-btn svg { flex-shrink: 0; }

@media (max-width: 720px) {
  .contact-map { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) {
  .map-route-btn {
    padding: 11px 20px;
    font-size: 16px;
  }
}

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 1100; display: none; align-items: center; justify-content: center; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }

.modal-panel {
  position: relative;
  width: min(92vw, 1440px);
  height: min(92dvh, 900px);
  max-width: none;
  max-height: none;
  overflow: hidden;
  background: var(--surface-raised);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(min(320px, 38vw), 0.85fr);
  touch-action: pan-y;
}

/* ---------- VISOR DE IMÁGENES ---------- */
.is-zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  touch-action: pan-y;
  outline: none;
}
.lightbox.is-open { display: flex; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-strong);
}
.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1200px, 94vw);
  height: min(90svh, 900px);
}
.lightbox-panel::before {
  display: none;
  content: "";
}
.lightbox-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-xs);
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 720px) {
  .lightbox-panel::before {
    display: block;
    position: absolute;
    top: -16px;
    left: 50%;
    width: 48px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--scrim-light);
    transform: translateX(-50%);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--scrim-dark-strong);
  color: var(--text-inverse);
  border: 1px solid var(--scrim-light-soft);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  z-index: 5;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.modal-media { background: var(--surface); overflow: hidden; min-height: 0; display: flex; align-items: center; justify-content: center; }
.modal-media img { width: 100%; height: 100%; object-fit: contain; }
.modal-media.slide-from-right img { animation: project-slide-from-right 0.28s ease-out; }
.modal-media.slide-from-left img { animation: project-slide-from-left 0.28s ease-out; }

@keyframes project-slide-from-right {
  from { opacity: 0.35; transform: translateX(8%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes project-slide-from-left {
  from { opacity: 0.35; transform: translateX(-8%); }
  to { opacity: 1; transform: translateX(0); }
}

.modal-info { padding: clamp(32px, 5vw, 80px); display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.modal-info h3 { margin-bottom: 12px; font-size: 26px; }
.modal-info p { font-size: 16px; margin-bottom: 24px; color: var(--text-secondary); }

.modal-facts {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin: 0;
}
.modal-facts div { display: flex; justify-content: space-between; gap: 12px; }
.modal-facts dt { font-family: var(--font-mono); font-size: 17px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.modal-facts dd { margin: 0; font-size: 16px; text-align: right; }

.project-gallery-controls {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(8px, 2vw, 28px);
  pointer-events: none;
}
.gallery-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(38px, 4vw, 54px);
  height: clamp(38px, 4vw, 54px);
  padding: 0;
  border: 1px solid var(--scrim-light-soft);
  border-radius: 50%;
  background: var(--scrim-dark);
  color: var(--text-inverse);
  font-family: Georgia, serif;
  font-size: clamp(31px, 3vw, 45px);
  line-height: 0.7;
  padding-bottom: 4px;
  cursor: pointer;
  opacity: var(--gallery-arrow-opacity, 0.28);
  pointer-events: auto;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  transform: scale(1.06);
}
.gallery-arrow:disabled { visibility: hidden; }
.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vh, 28px);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--scrim-dark);
  transition: background 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}
.gallery-dots.is-changing,
.gallery-dots.at-start,
.gallery-dots.at-end { background: var(--scrim-dark-strong); }
.gallery-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid var(--scrim-light);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.72;
  transition: width 0.28s ease, height 0.28s ease, opacity 0.28s ease, transform 0.28s ease, background 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
.gallery-dot.is-ghost { opacity: 0.16; transform: scale(0.72); cursor: default; }
.gallery-dots.at-start .gallery-dot.is-before,
.gallery-dots.at-end .gallery-dot.is-after { visibility: hidden; opacity: 0; transform: scale(0.4); }
.gallery-dot.is-neighbor { width: 9px; height: 9px; opacity: 0.86; }
.gallery-dot.is-active {
  width: 13px;
  height: 13px;
  background: var(--accent-on-dark);
  border-color: var(--accent-on-dark);
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-ring-dark);
  animation: gallery-dot-change 0.36s ease-out;
}
.gallery-dot:hover { opacity: 1; }

@keyframes gallery-dot-change {
  0% { transform: scale(0.5); opacity: 0.35; }
  65% { transform: scale(1.22); }
  100% { transform: scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-dot { transition: none; animation: none; }
}

@media (max-width: 720px) {
  .modal-panel {
    display: flex;
    flex-direction: column;
    width: 94vw;
    height: 94dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .modal-media {
    width: 100%;
    flex: 0 0 clamp(240px, 42dvh, 440px);
    min-height: 0;
    max-height: none;
  }
  .modal-info {
    flex: 1 1 auto;
    min-height: 0;
    padding: 34px var(--gutter) 48px;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    overflow-y: auto;
  }
  .modal-info .section-label,
  .modal-info h3,
  .modal-info p { width: 100%; max-width: 56ch; }
  .modal-info p { text-align: center; }
  .modal-facts { width: 100%; max-width: 520px; }
  .modal-close { top: 12px; right: 12px; }
  .project-gallery-controls { padding: 0 6px; }
  .gallery-arrow { opacity: 0.64; }
  .gallery-dots { bottom: 12px; }
}

/* ---------- WHATSAPP / CORREO FLOTANTES ---------- */
.whatsapp-float,
.email-float {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  width: clamp(42px, 4vw, 52px);
  height: clamp(42px, 4vw, 52px);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 150;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float { bottom: clamp(14px, 2vw, 28px); }
.email-float { bottom: calc(clamp(14px, 2vw, 28px) + clamp(42px, 4vw, 52px) + 5px); }
.whatsapp-float:hover,
.email-float:hover { transform: scale(1.08); background: var(--accent-hover); box-shadow: var(--shadow-lg); }
.whatsapp-float svg,
.email-float svg { width: 58%; height: 58%; fill: currentColor; }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 7px var(--gutter);
  text-align: center;
  background: var(--bg);
}
.site-footer p {
  font-size: clamp(5px, 1.35vw, 14px);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 auto;
  width: fit-content;
  max-width: none;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
}

/* ---------- REDES SOCIALES (header) ---------- */
.header-socials { display: flex; align-items: center; }
.main-nav .header-socials { display: none; }
.social-bar { display: flex; align-items: center; gap: 4px; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.social-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}
a.social-link:hover {
  color: var(--text);
  transform: translateY(-2px);
}
a.social-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-link.is-pending {
  opacity: 0.32;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .header-right { gap: 10px; }
}

@media (min-width: 1025px) {
  .site-header .header-socials { margin-right: calc(var(--gutter) * -1); }
  .site-header .social-bar { gap: 0; }
}

@media (max-width: 860px) {
  .header-inner { gap: 18px; }
  .header-right { min-width: 0; }
  .header-socials {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
  }
  .social-link {
    flex: 0 1 auto;
    width: clamp(28px, 6.6vw, 36px);
    height: clamp(32px, 7.4vw, 38px);
  }
  .social-link svg {
    flex: 0 1 auto;
    min-width: 0;
    width: clamp(15px, 3.9vw, 20px);
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 18px; }
}

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1001;
    flex-direction: column;
    padding: 28px var(--gutter) 36px;
    gap: 8px;
    font-size: clamp(16px, 3.4vw, 20px);
    letter-spacing: 0.08em;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .main-nav a {
    justify-content: flex-start;
    width: 100%;
    padding: 14px 0;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
  }
  .main-nav a::after { left: 0; right: auto; width: 56px; bottom: 6px; }
  .main-nav a:hover,
  .main-nav a:focus-visible,
  .main-nav a:active,
  .main-nav a.is-current { color: var(--text); background: none; border: 0; }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav .header-socials {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
  .main-nav .social-bar { justify-content: center; gap: 8px; }
  .main-nav .social-link::after { display: none; }
  .main-nav .social-link {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .main-nav a.social-link:hover,
  .main-nav a.social-link:focus-visible {
    color: var(--accent);
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 560px) {
  :root { --header-height: 70px; }
  .header-inner { min-height: 70px; }
  .brand-logo { height: clamp(42px, 12vw, 50px); }
  .brand-name { font-size: 24px; }
  .brand-subname { font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-actions { gap: 20px; }
  .projects-title { white-space: normal; }
  .services-title { white-space: normal; }
  .hero-sub,
  .expertise-item p,
  .about-text,
  .modal-info > p { text-align: left; }
}

@media (max-width: 420px) {
  .header-inner { padding-left: 14px; padding-right: 14px; gap: 14px; }
  .brand { gap: 9px; }
  .brand-logo { height: 38px; }
  .header-right { gap: 6px; }
  .nav-toggle { padding: 6px 4px; }
}

/* ---------- PORTADA: CUADRÍCULA DE PROYECTOS ---------- */
.grid--four { grid-template-columns: repeat(4, 1fr); gap: 30px 20px; }

@media (max-width: 640px) {
  .grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
}

@media (max-width: 360px) {
  .grid--four .card-body h3 { font-size: 18px; }
}

@media (max-width: 1180px) {
  .hero-grid { row-gap: 24px; }
  .hero-media { order: 0; }
  .hero-inner { display: block; order: 1; }
  .hero-title { order: 0; margin-bottom: 0; }
  .hero-sub { order: 1; }
  .hero-actions { order: 2; }
}

@media (max-width: 640px) {
  .hero-title { margin-bottom: 24px; }
}

/* ---------- PORTADA: ÍTEM IMPAR DE LA REJILLA PAR ---------- */
#servicios .expertise-item:last-child:nth-child(2n + 1) {
  grid-column: auto;
}
a.expertise-item { color: inherit; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
[data-home-services] .expertise-item { grid-template-columns: minmax(0, 1fr); }
a.expertise-item:hover, a.expertise-item:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
[data-home-services] a.expertise-item {
  position: relative;
  min-height: 56px;
  padding: 10px 54px 10px 20px;
  border: 1px solid var(--text-inverse);
  border-radius: 999px;
  background: var(--text-inverse);
  box-shadow: 0 3px 10px rgba(6, 14, 24, 0.2);
  color: var(--dark);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
[data-home-services] a.expertise-item h3 {
  margin: 0;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.25;
  color: var(--dark);
}
[data-home-services] a.expertise-item::after {
  content: "\2197";
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--dark);
  color: var(--text-inverse);
  font-size: 19px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
[data-home-services] a.expertise-item:focus-visible {
  outline: 3px solid var(--accent-on-dark);
  outline-offset: 3px;
}
[data-home-services] a.expertise-item:hover {
  border-color: var(--accent-on-dark);
  background: #fff;
  box-shadow: 0 6px 16px rgba(6, 14, 24, 0.3);
  transform: translateY(-2px);
}
[data-home-services] a.expertise-item:hover::after,
[data-home-services] a.expertise-item:focus-visible::after {
  background: var(--accent);
  transform: translate(1px, -50%);
}
[data-home-services] a.expertise-item:active {
  box-shadow: 0 1px 4px rgba(6, 14, 24, 0.2);
  transform: translateY(0);
}
@media (max-width: 780px) {
  #servicios [data-home-services] a.expertise-item { padding: 10px 44px 10px 14px; }
  #servicios [data-home-services] a.expertise-item::after { right: 5px; width: 34px; height: 34px; }
}
.service-group-head[id] { scroll-margin-top: calc(var(--header-height) + 16px); }
#servicios .section-actions {
  margin-top: 18px;
}

/* ---------- REJILLA CLARA SOBRE SUPERFICIE ---------- */
.expertise-grid--light .expertise-item {
  background: var(--surface-raised);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.expertise-grid--light .expertise-item h3 { color: var(--text); }
.expertise-grid--light .expertise-num { color: var(--accent); }
.expertise-grid--light .expertise-item p { color: var(--text-secondary); }
.expertise-grid--light .expertise-item strong { font-weight: 500; color: var(--text); }

/* ---------- SERVICIOS: CATÁLOGO EDITORIAL ---------- */
.page-services .section--ink {
  padding-top: clamp(12px, 2vw, 24px);
  padding-bottom: clamp(52px, 7vw, 100px);
}
.page-services .section:first-of-type {
  padding-top: clamp(8px, 1vw, 12px);
}
.page-services .section-head {
  max-width: none;
  margin-bottom: clamp(20px, 2.5vw, 32px);
}
.page-services .section-label {
  color: var(--accent-on-dark);
}
.page-services .services-title {
  max-width: 18ch;
  margin: 0 auto;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.98;
  white-space: normal;
}
.page-services .section-head .services-title { margin-bottom: 4px; }
.page-services .service-catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  border: 0;
}
.page-services .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin-bottom: 24px;
  background: var(--dark);
  border-bottom-color: var(--line-inverse);
}
.page-services .services-filter-toggle { display: none; }
.page-services .services-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.page-services .services-layout .filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: start;
  margin-bottom: 0;
  top: var(--header-height);
  height: calc(100vh - var(--header-height) - 8px);
  max-height: 720px;
  overflow: hidden;
}
.page-services .services-layout .filter-btn {
  flex: 1 1 0;
  min-height: 0;
  padding: 2px 10px;
  font-size: clamp(10px, 1.45vh, 13px);
  line-height: 1.15;
}
.page-services .services-main { min-width: 0; }
@media (min-width: 861px) {
  html:has(body.page-services) { height: 100%; overflow: hidden; }
  body.page-services {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.page-services > header { flex: none; }
  body.page-services > footer { flex: none; }
  body.page-services > main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .page-services main > .section--ink {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
    overflow: hidden;
  }
  .page-services main > .section--ink > .section-head { flex: none; margin-bottom: 12px; }
  .page-services .services-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .page-services .services-layout .filters {
    position: static;
    height: 100%;
    max-height: none;
  }
  .page-services .services-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-on-dark) transparent;
  }
}
@media (max-width: 860px) {
  .page-services .services-layout { grid-template-columns: 1fr; }
  .page-services .services-main { display: contents; }
  .page-services .services-filter-toggle {
    order: 1;
    position: sticky;
    top: calc(var(--header-height) + 8px);
    z-index: 40;
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-inverse);
    background: var(--dark-raised);
    border: 1px solid var(--line-inverse);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
  }
  .page-services .services-filter-toggle:hover,
  .page-services .services-filter-toggle:focus-visible {
    border-color: var(--accent-on-dark);
  }
  .page-services .services-filter-toggle:focus-visible { outline: 2px solid var(--accent-on-dark); outline-offset: 2px; }
  .page-services .services-filter-icon { display: flex; flex: 0 0 20px; flex-direction: column; gap: 4px; }
  .page-services .services-filter-icon span { width: 20px; height: 2px; background: var(--accent-on-dark); border-radius: 2px; }
  .page-services .services-filter-label { font-weight: 600; }
  .page-services .services-filter-count {
    margin-left: auto;
    color: var(--text-inverse-secondary);
    font-size: 12px;
    white-space: nowrap;
  }
  .page-services #service-filters {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 68px);
    right: var(--gutter);
    left: var(--gutter);
    z-index: 50;
    width: auto;
    height: auto;
    max-height: calc(100vh - var(--header-height) - 84px);
    max-height: calc(100dvh - var(--header-height) - 84px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: var(--shadow-lg);
  }
  body.page-services.service-filters-open #service-filters { display: grid; }
  .page-services .services-layout .filter-btn { min-height: 44px; flex: none; font-size: 13px; }
  .page-services .services-main .service-catalog { order: 3; }
}
.page-services .filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  color: var(--accent-on-dark);
  border-color: var(--line-inverse);
}
.page-services .filter-btn:hover { color: #fff; border-color: var(--accent-on-dark); }
.page-services .filter-btn.is-active { background: var(--accent-on-dark); border-color: var(--accent-on-dark); color: var(--dark); }
.page-services .service-card[hidden] { display: none; }
.page-services .service-card {
  min-width: 0;
  padding: clamp(22px, 2.5vw, 36px);
  border: 1px solid var(--line-inverse);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--dark-raised), rgba(23, 41, 61, 0.68));
  box-shadow: var(--shadow-dark);
}
.page-services .service-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-inverse);
}
.page-services .service-title {
  max-width: none;
  margin: 0 0 8px;
  font-size: clamp(23px, 2.4vw, 32px);
}
.page-services .service-card-head p {
  max-width: 52ch;
  font-size: 15px;
  text-align: left;
}
.page-services .service-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}
.page-services .service-card-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-inverse);
}
.page-services .service-card-list h3 {
  margin: 0 0 6px;
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}
.page-services .service-card-list p {
  max-width: 44ch;
  color: var(--text-inverse-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.page-services .service-package-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}
.page-services .service-package-list--single > .service-package {
  grid-column: 1 / -1;
}
.page-services .service-package-list--odd > .service-package:last-of-type {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - 14px) / 2);
}
.page-services .service-package {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line-inverse);
  border-radius: var(--radius-sm);
  background: rgba(5, 13, 23, 0.2);
}
.page-services .service-package h3,
.page-services .service-addons h3 {
  margin: 6px 0 8px;
  color: var(--text-inverse);
  font-family: var(--font-display);
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.2;
}
.page-services .service-package-description,
.page-services .service-package-includes,
.page-services .service-addons p {
  color: var(--text-inverse-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.page-services .service-package-includes {
  margin: 12px 0 4px;
}
.page-services .service-package ul,
.page-services .service-addons ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-inverse-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.page-services .service-package-cta {
  align-self: center;
  margin-top: auto;
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
}
.page-services .service-addons {
  padding: 18px;
  border: 1px dashed var(--line-inverse);
  border-radius: var(--radius-sm);
}
.page-services .service-addons h3 { margin-top: 0; }
.survey-addons {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line-inverse);
  border-radius: var(--radius-sm);
}
.survey-addons[hidden] { display: none; }
.survey-addons legend {
  padding: 0 6px;
  color: var(--text-inverse);
  font-weight: 600;
}
.survey-addons > p {
  margin: 0 0 12px;
  color: var(--text-inverse-secondary);
  font-size: 14px;
}
.survey-addon-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.survey-addon-options label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  margin: 0;
}
.survey-addon-options input {
  width: auto;
  margin: 0;
  accent-color: var(--accent-on-dark);
}
.survey-addon-options span {
  color: var(--text-inverse);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .page-services .service-package-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-services .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-services .service-catalog { grid-template-columns: 1fr; }
  .page-services .service-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .page-services .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-services .service-package-list { grid-template-columns: 1fr; }
  .page-services .service-package-list--odd > .service-package:last-of-type {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
  .page-services .service-card { padding: 22px 18px; }
  .page-services .service-card-list { grid-template-columns: 1fr; }
  .survey-addon-options { grid-template-columns: 1fr; }
  .page-services .services-title { font-size: clamp(38px, 12vw, 58px); }
}

/* ---------- PORTADA: COMPROMISOS ---------- */
.commit-grid {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  border-top: 0;
}
.commit-item {
  container-type: inline-size;
  padding: clamp(20px, 2.2vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.section--ink .commit-item p { color: var(--text-secondary); }
.commit-term {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 12px;
}
.commit-item p { font-size: 16px; max-width: 44ch; }

@media (max-width: 900px) {
  .commit-grid { grid-template-columns: 1fr; }
}

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.is-visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* =====================================================================
   SISTEMA TIPOGRÁFICO
   Todo estilo de texto (familia, tamaño, peso, altura de línea, espaciado,
   mayúsculas) se define aquí con variables. Cada grupo tiene niveles con
   jerarquía fija; el orden se valida con `node check-tipografia.js`.

   Protocolo de cambios:
   - Un cambio pedido a un nivel se aplica a TODA la página.
   - Si el cambio es del grupo completo, se escala parejo conservando la
     jerarquía; si es de un solo nivel, se avisa si rompe el orden.

   GRUPOS Y NIVELES (de mayor a menor jerarquía)
   1. Títulos:             title-1 principal > title-2 subtítulo > title-3 tarjeta > title-4 ítem
   2. Cuerpo de texto:     body-lead introductorio > body párrafo > body-sm secundario > body-xs nota
   3. Etiquetas y datos:   label rótulo > meta dato > badge insignia
   4. Navegación y marca:  brand-name > nav / brand-sub
   5. Botones y enlaces:   btn botón > btn-sm filtro > link enlace
   6. Formularios:         form-label / form-input / form-note
   ===================================================================== */
:root {
  /* 1. Títulos */
  --title-1-size: 38px;
  --title-1-line: 1.05;
  --title-1-weight: 400;
  --title-1-tracking: -0.025em;
  --title-2-size: 26px;
  --title-2-line: 1.1;
  --title-2-weight: 400;
  --title-2-tracking: -0.022em;
  --title-3-size: 20px;
  --title-3-line: 1.2;
  --title-3-weight: 400;
  --title-3-tracking: -0.02em;
  --title-4-size: 15px;
  --title-4-line: 1.35;
  --title-4-weight: 600;
  --title-4-tracking: 0;

  /* 2. Cuerpo de texto */
  --body-lead-size: 18px;
  --body-lead-line: 1.6;
  --body-size: 16px;
  --body-line: 1.6;
  --body-sm-size: 14px;
  --body-sm-line: 1.5;
  --body-xs-size: 13px;
  --body-xs-line: 1.45;

  /* 3. Etiquetas y datos */
  --label-size: 16px;
  --label-weight: 500;
  --label-tracking: 0.14em;
  --meta-size: 14px;
  --meta-tracking: 0.1em;
  --badge-size: 12px;
  --badge-tracking: 0.12em;

  /* 4. Navegación y marca */
  --brand-name-size: 28px;
  --brand-sub-size: 16px;
  --nav-size: 16px;

  /* 5. Botones y enlaces */
  --btn-size: 16px;
  --btn-tracking: 0.14em;
  --btn-sm-size: 13px;
  --link-size: 16px;

  /* 6. Formularios */
  --form-label-size: 16px;
  --form-input-size: 16px;
  --form-note-size: 16px;
}

/* 1. Títulos */
.hero-title,
.section-title,
.section-title--single-line,
.section-title--center,
.section-title--lead,
.projects-title,
.about-title,
.statement-term,
.page-services .services-title {
  font-family: var(--font-display);
  font-size: var(--title-1-size);
  line-height: var(--title-1-line);
  font-weight: var(--title-1-weight);
  letter-spacing: var(--title-1-tracking);
}
.service-title,
.page-services .service-title,
.modal-info h2,
.modal-info h3 {
  font-family: var(--font-display);
  font-size: var(--title-2-size);
  line-height: var(--title-2-line);
  font-weight: var(--title-2-weight);
  letter-spacing: var(--title-2-tracking);
}
.card-body h3,
.grid--four .card-body h3,
.expertise-item h2,
.expertise-item h3,
.page-services .service-package h3,
.page-services .service-addons h3 {
  font-family: var(--font-display);
  font-size: var(--title-3-size);
  line-height: var(--title-3-line);
  font-weight: var(--title-3-weight);
  letter-spacing: var(--title-3-tracking);
}
.page-services .service-card-list h3 {
  font-family: var(--font-body);
  font-size: var(--title-4-size);
  line-height: var(--title-4-line);
  font-weight: var(--title-4-weight);
  letter-spacing: var(--title-4-tracking);
}

/* 2. Cuerpo de texto */
.section-note,
.hero-sub,
.statement-lead {
  font-size: var(--body-lead-size);
  line-height: var(--body-lead-line);
}
.about-text,
.expertise-item p,
.statement-body p,
.commit-item p,
.modal-info p,
.service-list li,
.about-facts dd,
.modal-facts dd {
  font-size: var(--body-size);
  line-height: var(--body-line);
}
.page-services .service-card-head p,
.page-services .service-card-list p,
.page-services .service-package-description,
.page-services .service-package-includes,
.page-services .service-addons p,
.survey-heading > p:last-child,
.survey-hint,
.survey-addons > p,
.survey-addon-options span {
  font-size: var(--body-sm-size);
  line-height: var(--body-sm-line);
}
.page-services .service-package ul,
.page-services .service-addons ul {
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
}

/* 3. Etiquetas y datos */
.section-label,
.subsection-title,
.commit-term,
.contact-aside .contact-address-label {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
}
.card-meta,
.contact-aside .contact-address,
.about-facts dt,
.modal-facts dt {
  font-family: var(--font-mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-tracking);
  text-transform: uppercase;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: var(--badge-size);
  letter-spacing: var(--badge-tracking);
  text-transform: uppercase;
}
.expertise-num { font-size: var(--label-size); }

/* 4. Navegación y marca */
.brand-name { font-size: var(--brand-name-size); }
.brand-subname { font-size: var(--brand-sub-size); }
.main-nav { font-size: var(--nav-size); }

/* 5. Botones y enlaces */
.link-arrow {
  font-size: var(--btn-size);
  letter-spacing: var(--btn-tracking);
}
.page-services .filter-btn { font-size: var(--btn-sm-size); }
.contact-link { font-size: var(--link-size); }

/* 6. Formularios */
.label-text { font-size: var(--form-label-size); }
.contact-form input,
.contact-form select,
.contact-form textarea { font-size: var(--form-input-size); }
.form-note { font-size: var(--form-note-size); }

/* Un único paso móvil por nivel (no escala fluida) */
@media (max-width: 640px) {
  :root {
    --title-1-size: 30px;
    --title-2-size: 22px;
    --body-lead-size: 17px;
    --brand-name-size: 24px;
  }
  .about-title { white-space: normal; }
}

/* =====================================================================
   SISTEMA DE ESPACIOS Y DIMENSIONES
   Mismos grupos y niveles que el sistema tipográfico. El espacio de cada
   nivel se calcula como (tamaño del texto × factor), así que al cambiar el
   tamaño del texto su espacio se ajusta solo. Cada nivel conserva además su
   propio factor (-k) y su propio ancho (-width) para ajustarlo por separado.

   - width:  ancho máximo del bloque de texto (ch o none)
   - gap-k:  separación con lo que sigue (margen inferior)
   - pad-*-k: separación entre el texto y el borde de su área (relleno)
   El orden de los factores se valida con `node check-tipografia.js`.
   ===================================================================== */
:root {
  /* 1. Títulos */
  --title-1-width: none;
  --title-1-gap-k: 0.4;
  --title-2-width: 32ch;
  --title-2-gap-k: 0.35;
  --title-3-width: none;
  --title-3-gap-k: 0.3;
  --title-4-width: none;
  --title-4-gap-k: 0.3;

  /* 2. Cuerpo de texto (ancho de línea) */
  --body-lead-width: none;
  --body-width: 62ch;
  --body-sm-width: 52ch;
  --body-xs-width: 52ch;

  /* 3. Etiquetas y datos */
  --label-gap-k: 1;
  --badge-pad-y-k: 0.42;
  --badge-pad-x-k: 0.75;

  /* 4. Navegación y marca */
  --nav-pad-y-k: 0.5625;
  --nav-pad-x-k: 0.625;

  /* 5. Botones y enlaces */
  --btn-pad-y-k: 0.75;
  --btn-pad-x-k: 1.875;
  --btn-sm-pad-y-k: 0.6;
  --btn-sm-pad-x-k: 0.9;

  /* 6. Formularios */
  --form-input-pad-y-k: 0.75;
  --form-input-pad-x-k: 0.875;
}

/* 1. Títulos */
.hero-title,
.section-title,
.section-title--single-line,
.section-title--center,
.section-title--lead,
.projects-title,
.about-title,
.statement-term,
.page-services .services-title {
  max-width: var(--title-1-width);
  margin-bottom: calc(var(--title-1-size) * var(--title-1-gap-k));
}
.service-title,
.page-services .service-title,
.modal-info h2,
.modal-info h3 {
  max-width: var(--title-2-width);
  margin-bottom: calc(var(--title-2-size) * var(--title-2-gap-k));
}
.card-body h3,
.grid--four .card-body h3,
.expertise-item h2,
.expertise-item h3,
.page-services .service-package h3,
.page-services .service-addons h3 {
  max-width: var(--title-3-width);
  margin-bottom: calc(var(--title-3-size) * var(--title-3-gap-k));
}
.page-services .service-card-list h3 {
  max-width: var(--title-4-width);
  margin-bottom: calc(var(--title-4-size) * var(--title-4-gap-k));
}
.section-head { gap: 0; }

/* 2. Cuerpo de texto */
.section-note,
.hero-sub,
.statement-lead { max-width: var(--body-lead-width); }
.about-text,
.expertise-item p,
.statement-body p,
.commit-item p,
.modal-info p { max-width: var(--body-width); }
.commit-item p {
  max-width: 100%;
  font-size: clamp(14px, 4cqi, var(--body-size));
}
.page-services .service-card-head p,
.page-services .service-card-list p,
.page-services .service-package-description,
.page-services .service-package-includes,
.page-services .service-addons p { max-width: var(--body-sm-width); }

/* 3. Etiquetas y datos */
.section-label,
.subsection-title,
.commit-term,
.contact-aside .contact-address-label {
  margin-bottom: calc(var(--label-size) * var(--label-gap-k));
}
.card-tag {
  padding: calc(var(--badge-size) * var(--badge-pad-y-k)) calc(var(--badge-size) * var(--badge-pad-x-k));
}

/* 4. Navegación y marca */
.main-nav a {
  padding: calc(var(--nav-size) * var(--nav-pad-y-k)) calc(var(--nav-size) * var(--nav-pad-x-k));
}

/* 5. Botones y enlaces */
.link-arrow {
  padding: calc(var(--btn-size) * var(--btn-pad-y-k)) calc(var(--btn-size) * var(--btn-pad-x-k));
}
.page-services .filter-btn {
  padding: calc(var(--btn-sm-size) * var(--btn-sm-pad-y-k)) calc(var(--btn-sm-size) * var(--btn-sm-pad-x-k));
}

/* 6. Formularios */
.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: calc(var(--form-input-size) * var(--form-input-pad-y-k)) calc(var(--form-input-size) * var(--form-input-pad-x-k));
}
