/* ==========================================================================
   PROLEGOS — Hoja de estilos principal
   Merge de design-system + estilos de componentes.
   Fuente de verdad de tokens: DESIGN.md (raíz del repo).
   ========================================================================== */

/* ==========================================================================
   1. TOKENS DE DISEÑO
   ========================================================================== */
:root {
  /* Colores de marca */
  --color-primary:    #449dd7; /* azul — comercializadora · headings, focus ring */
  --color-accent:     #aecc53; /* verde lima — consultoría · botones, decorativo */
  --color-text:       #333333; /* texto cuerpo — 12.6:1 sobre blanco ✅ */
  --color-text-muted: #666666; /* texto secundario, metadatos */
  --color-bg:         #ffffff;
  --color-bg-subtle:  #f2f2f2;
  --color-border:     #d9d9d9;

  /* Text-on-brand (⚠ nunca blanco sobre primary o accent — falla WCAG) */
  --color-on-primary: #333333; /* 4.34:1 ✅ válido solo para bold ≥ 14pt */
  --color-on-accent:  #333333; /* 6.6:1 ✅ */

  /* Alias semánticos */
  --fg-1: var(--color-text);
  --fg-2: var(--color-text-muted);
  --bg-1: var(--color-bg);
  --bg-2: var(--color-bg-subtle);
  --border-1: var(--color-border);

  /* Tipografía */
  --font-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.5625rem;
  --text-lg:   1.953rem;
  --text-xl:   2.441rem;
  --text-2xl:  2.75rem;
  --text-3xl:  3.375rem;

  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.5;
  --leading-loose:  1.7;

  /* Espaciado */
  --space-xs:     0.5rem;
  --space-sm:     1rem;
  --space-md:     1.5rem;
  --space-lg:     2rem;
  --space-xl:     3rem;
  --space-2xl:    5rem;
  --space-gutter: 9.375rem;

  /* Misc */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   1rem;
  --radius-full: 999px;

  --transition: 200ms ease;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);

  --z-nav:     100;
  --z-popover: 150;
  --z-modal:   200;
  --z-toast:   300;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
html {
  color-scheme: light;
  font-size: clamp(10px, 0.35rem + 2.87vw, 18px);
  scroll-behavior: smooth;
}
@media (min-width: 768px) {
  html { font-size: clamp(14px, 0.35rem + 1.15vw, 22px); }
}

*,*::before,*::after { box-sizing: border-box }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--fg-1);
  background: var(--bg-1);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 18px;
}

p, .body { font-size: var(--text-md); font-weight: 400; color: var(--fg-1); line-height: var(--leading-normal); margin: 0 0 var(--space-sm); }
small, .small, .legal { font-size: var(--text-sm); font-weight: 400; color: var(--fg-2); }

a:hover { color: #2f7fb3; }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; }
p { margin: 0 0 1em; }

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1, h2 { color: var(--color-primary); }
h1 { font-size: 54px; line-height: 1.1; }
h2 { font-size: 46px; line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.25; }

/* Utility */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ==========================================================================
   3. ALIAS VARIABLES POR SITIO
   ========================================================================== */
:root {
  --green:       var(--color-accent);
  --green-soft:  #cde08a;
  --green-dark:  #9bb947;
  --blue:        var(--color-primary);
  --blue-soft:   #7dbce4;
  --blue-dark:   #3a8cc1;
  --ink:         var(--color-text);
  --ink-soft:    var(--color-text-muted);
  --line:        var(--color-border);
  --box:         var(--color-bg-subtle);
  --gray-bg:     var(--color-bg-subtle);
  --bg:          var(--color-bg);
  --watermark:   #ededed;
  --radius-pill: var(--radius-full);
  --radius-card: var(--radius-sm);
  --max:         1480px;
  --gutter:      80px;

  /* Accent dinámico por línea de negocio */
  --accent:      var(--color-primary);
  --accent-soft: var(--blue-soft);
  --accent-dark: var(--blue-dark);
  --on-accent:   var(--color-text);
}

/* Override de links en el sitio (nav, logo, etc.) */
a { color: inherit; text-decoration: none; transition: color var(--transition); }

/* ==========================================================================
   4. VISTAS
   ========================================================================== */
.view { display: none; }
.view.is-active { display: block; }

/* Por línea de negocio */
.view--c {
  --accent:      var(--color-accent);
  --accent-soft: var(--green-soft);
  --accent-dark: #9bb947;
  --heading:     var(--color-accent);
}
.view--m {
  --accent:      var(--color-primary);
  --accent-soft: var(--blue-soft);
  --accent-dark: var(--blue-dark);
  --heading:     var(--color-primary);
}
:root { --heading: var(--color-primary); }

/* ==========================================================================
   5. LAYOUT BASE
   ========================================================================== */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ==========================================================================
   6. HEADER
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 48px; width: auto; }
.header .logo { padding: 5px 0; align-self: stretch; align-items: center; }
.header .logo img { height: 100%; width: auto; }
.logo__fallback { font-weight: 700; font-size: 22px; letter-spacing: .18em; color: var(--ink); }
.nav { display: flex; align-items: center; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 32px; }
.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
  white-space: nowrap;
}
.nav a:hover { color: var(--accent-dark); }
.nav a.is-active { font-weight: 700; color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-toggle { display: none; }

/* ==========================================================================
   7. BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--color-text);
  background: var(--accent);
  transition: background var(--transition), opacity var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--accent-dark); opacity: .95; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn--green { background: var(--color-accent); color: #fff; }
.btn--green:hover { background: #9bb947; }
.btn--blue { background: var(--color-primary); color: #fff; }
.btn--blue:hover { background: #3a8cc1; }

.btn--pill {
  border-radius: var(--radius-full);
  padding: 14px 44px;
  color: #fff;
}
.btn--pill.btn--green { color: #fff; }
.btn--pill.btn--blue  { color: #fff; }

/* ==========================================================================
   8. VISTA 0 — INICIO
   ========================================================================== */
.home {
  position: relative;
  background: var(--gray-bg);
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}
.home__watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("../img/textura.png");
  background-repeat: no-repeat;
  background-position: -12.5% 75%;
  background-size: auto 100%;
  opacity: 1;
}
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -6%;
  transform: translateY(-50%);
  width: 55%;
  height: 130%;
  background-image: url("../img/textura.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}
.hero__inner,
.hero__copy,
.hero__media { position: relative; z-index: 1; }

.home__stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 614px 1fr 614px;
  align-items: start;
  min-height: 560px;
  width: 100%;
}
.home__side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.home__side--left  { align-items: center; }
.home__side--right { align-items: center; }
.home__side > img {
  width: 614px;
  height: auto;
  display: block;
  max-width: none;
}
.home__center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  align-self: center;
}
.home__center h1 {
  font-size: 54px;
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0;
  line-height: 1.1;
}
.home__center h1 .l1 { display: block; color: var(--color-accent); margin-bottom: 18px; }
.home__center h1 .l2 { display: block; color: var(--color-primary); }
.home__cta {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  padding: 0 16px;
}
.door__copy { font-size: 17px; color: var(--color-text); line-height: 1.5; margin: 0; }
.door__copy strong { display: block; margin-top: 18px; font-weight: 700; font-size: 17px; }
.door__btn { margin-top: 26px; }

/* ==========================================================================
   9. HERO DE LÍNEA DE NEGOCIO
   ========================================================================== */
.hero {
  position: relative;
  background: transparent;
  overflow: hidden;
  padding: 0;
}
.hero__inner {
  position: relative;
  width: 100%;
  padding: 0;
  display: block;
}
.hero__media { position: relative; z-index: 0; display: block; width: 100%; }
.hero__media img { width: 100%; height: auto; display: block; max-width: 100%; }
.view--m .hero__media img { object-position: center left; }
.hero__copy {
  position: absolute;
  z-index: 1;
  top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
  padding: 0 56px;
  background: transparent;
  border-radius: 0;
}
.view--c .hero__copy { left: var(--gutter); right: auto; text-align: left; padding-left: 0; }
.view--m .hero__copy { right: var(--gutter); left: auto; text-align: left; padding-right: 0; }
.hero__copy h1 { font-size: 38px; line-height: 1.15; color: var(--heading); margin-bottom: 18px; }
.hero__copy p   { font-size: 15px; color: var(--color-text); margin: 0; line-height: 1.6; }
.hero__band { position: relative; background: var(--color-bg-subtle); }

/* ==========================================================================
   10. SECCIÓN BASE
   ========================================================================== */
.section { padding: 90px 0; position: relative; }
.section--tight { padding: 64px 0; }
.section__title {
  text-align: center;
  color: var(--heading);
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 60px;
}
.section__lede {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 56px;
  color: var(--ink);
  font-size: 16px;
}

/* ==========================================================================
   11. GRIDS DE ICONOS — ¿Qué hacemos? / Nuestro enfoque
   ========================================================================== */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 48px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.icon-grid--6 { grid-template-columns: repeat(3,1fr); max-width: 880px; gap: 60px 80px; }
.icon-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.icon-grid__item img { width: 96px; height: 96px; object-fit: contain; }
.icon-grid--6 .icon-grid__item img { width: 120px; height: 120px; }
.icon-grid__item span { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; max-width: 140px; }
.icon-grid--6 .icon-grid__item span { font-size: 14px; max-width: 200px; }

/* Grid de 9 (¿Qué hacemos?): 5+4 con la 2da fila centrada */
.icon-grid--9 { grid-template-columns: repeat(10,1fr); max-width: 1100px; gap: 48px 12px; }
.icon-grid--9 .icon-grid__item { grid-column: span 2; }
.icon-grid--9 .icon-grid__item:nth-child(6) { grid-column: 2 / span 2; }

/* ==========================================================================
   12. SPLIT — ¿Cómo lo hacemos? / ¿Qué gestionamos?
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.split--reverse .split__media { order: 2; }
.split--reverse .split__copy  { order: 1; }
.split__copy h2  { color: var(--heading); font-size: 34px; margin-bottom: 16px; }
.split__copy > p { font-size: 15px; color: var(--ink-soft); margin-bottom: 28px; max-width: 420px; }
.split__steps {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.split__steps li { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 16px; color: var(--ink); }
.split__steps .num {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.split__media img { width: 100%; height: auto; display: block; }

/* ==========================================================================
   13. ESPECIALIDADES — cards
   ========================================================================== */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.spec-card {
  position: relative;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1),
              box-shadow 320ms cubic-bezier(.2,.8,.2,1),
              background 320ms ease,
              border-color 320ms ease;
}
.spec-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1);
}
.spec-card:hover { transform: translateY(-4px); background: #fff; border-color: var(--accent); box-shadow: 0 12px 28px rgba(0,0,0,.10); }
.spec-card:hover::before { transform: scaleX(1); }
.spec-card h3 { color: var(--heading); font-size: 20px; font-weight: 600; margin-bottom: 18px; transition: transform 320ms cubic-bezier(.2,.8,.2,1); }
.spec-card:hover h3 { transform: translateX(4px); }
.spec-card ul { list-style: none; padding: 0; margin: 0; }
.spec-card li { position: relative; padding-left: 18px; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; transition: padding-left 280ms cubic-bezier(.2,.8,.2,1); }
.spec-card li:last-child { margin-bottom: 0; }
.spec-card li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; transition: transform 280ms cubic-bezier(.2,.8,.2,1); }
.spec-card:hover li { padding-left: 22px; }
.spec-card:hover li::before { transform: scale(1.6); }

/* Variante centrada (reemplaza inline style="text-align:center") */
.spec-card--centered { text-align: center; }
.spec-card--centered > p { font-size: 14px; margin-bottom: 14px; }
.spec-card--centered ul { text-align: left; display: inline-block; }

/* Especialidades comercializadora — cards con icono */
.spec-grid--icons {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}
.spec-card--icon {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-height: 180px;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.spec-card--icon img { width: 84px; height: 84px; object-fit: contain; transition: transform var(--transition); }
.spec-card--icon:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: #fff; }
.spec-card--icon:hover img { transform: scale(1.08); }
.spec-card--icon span { font-weight: 600; font-size: 14px; color: var(--color-text); }

/* ==========================================================================
   14. BENEFICIOS — banner de color
   ========================================================================== */
.beneficios { background: var(--accent); padding: 72px 0; color: #fff; }
.beneficios .section__title { color: #fff; margin-bottom: 48px; }
.beneficios__grid {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.beneficio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.beneficio__circle {
  width: 108px; height: 108px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.beneficio__circle img { width: 100%; height: 100%; object-fit: cover; }
.beneficio span { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; max-width: 130px; }

/* ==========================================================================
   15. SECTORES
   ========================================================================== */
.sectors {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.sector {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: var(--accent);
}
.sector img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.sector:hover img { opacity: 0; }
.sector__label {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 14px;
  transition: background .35s ease, font-size .35s cubic-bezier(.2,.8,.2,1);
}
.sector:hover .sector__label { background: transparent; font-size: 18px; }
.sector--solid { background: var(--accent); display: flex; align-items: center; justify-content: center; }
.sector--solid .sector__label { background: none; color: #fff; }

/* ==========================================================================
   16. CTA BANNER
   ========================================================================== */
.cta-banner { position: relative; overflow: hidden; }
.cta-banner__bg { display: block; width: 100%; height: auto; }
.cta-banner__inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.cta-banner__copy { text-align: center; grid-column: 2; }
.cta-banner__copy h2 { font-size: 32px; color: var(--heading); margin-bottom: 24px; line-height: 1.2; }

/* ==========================================================================
   17. ¿POR QUÉ PROLEGOS?
   ========================================================================== */
.why { text-align: center; padding: 90px 0 40px; }
.why h2 { color: var(--heading); font-size: 32px; margin-bottom: 6px; }
.why__lede { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 28px; }
.why p { max-width: 680px; margin: 0 auto 14px; color: var(--ink-soft); font-size: 15px; }

/* ==========================================================================
   18. DIFERENCIALES
   ========================================================================== */
.diff { padding: 60px 0 90px; }
.diff h2 { text-align: center; color: var(--heading); font-size: 32px; margin-bottom: 40px; }
.diff__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.diff__chip {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.diff__chip.is-active,
.diff__chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==========================================================================
   19. CONTACTO
   ========================================================================== */
.contact { padding: 60px 0 90px; text-align: center; }
.contact h2 { color: var(--heading); font-size: 32px; margin-bottom: 6px; }
.contact__sub  { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.contact__lede { color: var(--ink-soft); font-size: 14px; margin-bottom: 36px; }
.contact__form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}
.contact__form .field { border-bottom: 1px solid var(--ink); padding: 6px 0; }
.contact__form label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: center; margin-bottom: 4px; }
.contact__form input,
.contact__form textarea {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 6px 0;
  outline: none;
}
.contact__form .field--box { border: 1px solid var(--ink); border-radius: 6px; padding: 8px 12px; }
.contact__form textarea { min-height: 90px; resize: vertical; }
.contact__form .field:focus-within { border-color: var(--accent); }
.contact__form button { align-self: center; margin-top: 8px; }

/* Estados de validación del formulario */
.field[data-state="error"] { border-color: #c0392b; }
.field--box[data-state="error"] { border-color: #c0392b; }
.contact__msg { margin-top: 18px; font-size: 13px; min-height: 18px; }
.contact__msg[data-state="error"]   { color: #c0392b; }
.contact__msg[data-state="success"] { color: var(--green-dark); }

/* ==========================================================================
   20. FOOTER
   ========================================================================== */
.footer { padding: 60px 0 50px; text-align: center; border-top: 1px solid var(--line); background: #fff; }
.footer .logo { justify-content: center; }
/* Recorte del isotipo: muestra la zona superior del logo (el gráfico circular)
   ocultando el wordmark que queda fuera del encuadre cuadrado */
.footer .logo img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: center top;
}
.footer__copy { margin-top: 18px; font-size: 12px; color: var(--ink-soft); }

/* ==========================================================================
   21. WATERMARK
   ========================================================================== */
.watermark-letter {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 520px;
  line-height: 1;
  color: var(--watermark);
  letter-spacing: -.06em;
  opacity: .5;
}

/* ==========================================================================
   22. SCROLL REVEAL
   ========================================================================== */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   23. FAB — cambio de vista
   ========================================================================== */
.switch-fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: var(--z-nav);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
  transition: opacity 220ms ease, transform 220ms ease;
}
.switch-fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.switch-fab,
.switch-fab:visited,
.switch-fab:hover,
.switch-fab:active { color: #fff; }
.switch-fab__circle {
  flex: 0 0 auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  border: 4px solid #f4f4f4;
  transition: background var(--transition), transform 280ms cubic-bezier(.2,.8,.2,1);
  order: 2;
  animation: fabPulse 2.4s ease-in-out infinite;
}
@keyframes fabPulse {
  0%,100% { box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 0 rgba(68,157,215,.55); }
  50%      { box-shadow: 0 10px 28px rgba(0,0,0,.20), 0 0 0 14px rgba(68,157,215,0); }
}
.switch-fab__circle:hover {
  background: var(--blue-dark);
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
  transform: scale(1.04);
  animation: none;
}
.switch-fab--to-cons { right: auto; left: 32px; }
.switch-fab--to-cons .switch-fab__circle { background: var(--green); order: 1; animation-name: fabPulseGreen; }
.switch-fab--to-cons .switch-fab__circle:hover { background: var(--green-dark); }
.switch-fab--to-cons .switch-fab__pill { background: var(--green); order: 2; transform: translateX(-16px); }
@keyframes fabPulseGreen {
  0%,100% { box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 0 rgba(174,204,83,.65); }
  50%      { box-shadow: 0 10px 28px rgba(0,0,0,.20), 0 0 0 14px rgba(174,204,83,0); }
}
.switch-fab__pill {
  order: 1;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  opacity: 0;
  transform: translateX(16px);
  pointer-events: none;
  transition: opacity 260ms ease, transform 320ms cubic-bezier(.2,.8,.2,1);
}
.switch-fab__circle:hover + .switch-fab__pill { opacity: 1; transform: none; }
@media (max-width: 720px) {
  .switch-fab { right: 20px; bottom: 20px; gap: 10px; }
  .switch-fab__circle { width: 60px; height: 60px; }
  .switch-fab--to-cons { left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .switch-fab__circle { animation: none; }
  .nav { transition: none; }
}

/* ==========================================================================
   24. RESPONSIVE
   ========================================================================== */

/* --- 1479px: home images ------------------------------------------------ */
@media (max-width: 1479px) {
  .home__stage { grid-template-columns: 440px 1fr 440px; }
  .home__side > img { width: 440px; }
}

/* --- 1200px: gutters ---------------------------------------------------- */
@media (max-width: 1200px) {
  :root { --gutter: 48px; }
  .home__stage { grid-template-columns: 360px 1fr 360px; }
  .home__side > img { width: 360px; }
}

/* --- 1024px: tablet landscape ------------------------------------------ */
@media (max-width: 1024px) {
  :root { --gutter: 32px; }

  .header__inner { height: 72px; }
  .nav ul { gap: 20px; }
  .nav a  { font-size: 13px; }

  /* Home: h1 arriba, puertas lado a lado abajo; imágenes llegan al borde */
  .home__stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 32px;
  }
  .home__center    { grid-column: 1 / -1; grid-row: 1; padding: 0 var(--gutter); }
  .home__side--left  { grid-column: 1; grid-row: 2; }
  .home__side--right { grid-column: 2; grid-row: 2; }
  .home__side > img { width: 100%; max-width: 100%; }
  .home__cta { max-width: 100%; }

  /* Hero */
  .hero__copy { max-width: 380px; }
  .hero__copy h1 { font-size: 28px; }

  /* Grids */
  .icon-grid { grid-template-columns: repeat(4,1fr); }
  .icon-grid--9 {
    grid-template-columns: repeat(5,1fr);
    max-width: 100%;
    gap: 40px 20px;
  }
  .icon-grid--9 .icon-grid__item              { grid-column: span 1; }
  .icon-grid--9 .icon-grid__item:nth-child(6) { grid-column: 2 / span 1; }

  .beneficios__grid { grid-template-columns: repeat(3,1fr); }
  .sectors { grid-template-columns: repeat(2,1fr); }
  .split { gap: 48px; }

  .cta-banner__copy { grid-column: 1 / -1; }
}

/* --- 768px: tablet portrait -------------------------------------------- */
@media (max-width: 768px) {
  :root { --gutter: 24px; }

  h1 { font-size: 34px; }
  h2 { font-size: 28px; }

  /* Header: una sola fila logo + hamburguesa */
  .header__inner {
    height: auto;
    min-height: 60px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .header .logo { align-self: auto; padding: 0; }
  .header .logo img { height: 50px; }

  /* Hamburger toggle */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 9px;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 200ms ease, opacity 200ms ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Nav panel desplegable */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 0 16px;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    /* Al cerrar: primero desvanece, luego oculta de accesibilidad */
    transition: opacity 180ms ease, transform 180ms ease, visibility 0ms 180ms;
    pointer-events: none;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    /* Al abrir: ocultar de accesibilidad se cancela (delay 0) */
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
  }
  .nav ul { flex-direction: column; gap: 0; padding: 0; }
  .nav a { display: block; padding: 13px var(--gutter); font-size: 15px; border-bottom: 1px solid var(--border-1); }
  .nav li:last-child a { border-bottom: 0; }
  .nav a.is-active::after { display: none; }
  .nav a.is-active { color: var(--accent-dark); }

  /* Home: columna única; imágenes full-width pegadas al borde */
  .home { padding: 40px 0; }
  .home__stage { grid-template-columns: 1fr; }
  .home__center      { grid-column: 1; grid-row: 1; padding: 0 var(--gutter); }
  .home__side--left  { grid-column: 1; grid-row: 2; }
  .home__side--right { grid-column: 1; grid-row: 3; }
  .home__side > img { width: 100%; max-width: none; margin: 0; }
  .home__center h1 { font-size: 30px; }
  .home__cta { padding: 0 var(--gutter); }

  /* Textura del hero: no tiene sentido en layout estático */
  .hero::before { display: none; }

  /* Hero: copy sale de la imagen y fluye en el DOM */
  .view--c .hero__copy,
  .view--m .hero__copy {
    position: static;
    max-width: 100%;
    left: auto; right: auto;
    padding: 28px var(--gutter);
    background: var(--color-bg-subtle);
    text-align: left;
  }
  .view--c .hero__inner,
  .view--m .hero__inner { display: flex; flex-direction: column; }
  /* Comercializadora: media viene antes en el DOM pero en mobile debe ir debajo del copy */
  .view--m .hero__copy  { order: 1; }
  .view--m .hero__media { order: 2; }
  .view--c .hero__copy h1,
  .view--m .hero__copy h1 { font-size: 22px; }
  .view--c .hero__copy p,
  .view--m .hero__copy p  { font-size: 14px; }

  /* Hero images en mobile: 200% de ancho para mostrar la zona fotográfica.
     Consultoría: foto en mitad derecha → margin-left:-100% la desplaza al encuadre.
     Comercializadora: foto en mitad izquierda → sin desplazamiento. */
  .hero__media { overflow: hidden; }
  .view--c .hero__media img,
  .view--m .hero__media img { width: 200%; max-width: none; }
  .view--c .hero__media img { margin-left: -100%; }

  /* Secciones */
  .section        { padding: 56px 0; }
  .section--tight { padding: 36px 0; }
  .section__title { font-size: 24px; margin-bottom: 36px; }

  .split { grid-template-columns: 1fr; gap: 28px; }
  .split__media img { max-width: 400px; margin: 0 auto; }

  .spec-grid       { grid-template-columns: 1fr; }
  .spec-grid--icons { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  .spec-card--icon  { padding: 24px 16px; min-height: 150px; }

  .icon-grid    { grid-template-columns: repeat(3,1fr); gap: 28px 14px; }
  .icon-grid--6 { grid-template-columns: repeat(2,1fr); gap: 36px; }
  .icon-grid--6 .icon-grid__item img { width: 80px; height: 80px; }
  .icon-grid--9 {
    grid-template-columns: repeat(2,1fr);
    max-width: 100%;
    gap: 28px 16px;
  }
  .icon-grid--9 .icon-grid__item              { grid-column: span 1; }
  .icon-grid--9 .icon-grid__item:nth-child(6) { grid-column: span 1; }
  /* 9 items en 2 col → el 9º queda solo, se centra */
  .icon-grid--9 .icon-grid__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .icon-grid--9 .icon-grid__item img { width: 64px; height: 64px; }

  .beneficios__grid { grid-template-columns: repeat(3,1fr); }

  .sector { aspect-ratio: 2/3; }

  /* CTA banner: solo texto sobre fondo sutil */
  .cta-banner { background: var(--color-bg-subtle); }
  .cta-banner__bg { display: none; }
  .cta-banner__inner {
    position: static;
    grid-template-columns: 1fr;
    padding: 48px var(--gutter);
    text-align: center;
  }
  .cta-banner__copy { grid-column: 1; }
  .cta-banner__copy h2 { font-size: 22px; color: var(--heading); }

  .diff__chip { min-width: 100%; text-align: center; }

  .why  { padding: 56px 0 28px; }
  .diff { padding: 32px 0 56px; }

  .beneficios            { padding: 48px 0; }
  .beneficios .section__title { margin-bottom: 32px; }
}

/* --- 640px: móvil ------------------------------------------------------ */
@media (max-width: 640px) {
  :root { --gutter: 16px; }

  h1 { font-size: 28px; }
  h2 { font-size: 24px; }

  .home__center h1 { font-size: 26px; }

  .icon-grid    { grid-template-columns: repeat(2,1fr); gap: 20px 10px; }
  .icon-grid--6 { gap: 24px; }
  .icon-grid--9 { gap: 20px 12px; }

  .spec-grid--icons { gap: 12px; }
  .spec-card--icon  { padding: 20px 12px; min-height: 130px; gap: 10px; }
  .beneficios__grid { grid-template-columns: repeat(2,1fr); gap: 16px; }
  /* 5 beneficios en 2 col → huérfano centrado */
  .beneficios__grid .beneficio:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* 4 sectores cuadrados en 2 col: ~(358-20)/2 = 169px — manejable */
  .sectors { grid-template-columns: repeat(2,1fr); }

  .diff__chip { padding: 10px 16px; font-size: 13px; }

  .section        { padding: 36px 0; }
  .section__title { margin-bottom: 24px; }
  .split          { gap: 20px; }
  .spec-card      { padding: 24px 24px; }

  .beneficios            { padding: 36px 0; }
  .beneficios .section__title { margin-bottom: 24px; }

  .cta-banner__inner { padding: 32px var(--gutter); }

  .why  { padding: 40px 0 16px; }
  .diff { padding: 20px 0 40px; }
  .footer { padding: 36px 0 24px; }
}
