:root {
  --bg: #ffffff;
  --surface: #eef0f3;
  --surface-hover: #dfe3e9;
  --ink: #0a0a0a;
  --muted: #4a4f57;
  --accent: #0a2351;
  --accent-hover: #123a80;
  --accent-ink: #ffffff;
  --acento-oscuro: #0a2351;
  --campo: #0a2351;
  --tierra: #1a3a75;
  --tierra-hover: #2f5499;
  --vecino: #132f63;
  --papel: #ffffff;
  --cierre: #0a0a0a;
  --cierre-hover: #8fb2ee;

  --step-small: 0.8125rem;
  --step-body: 0.9375rem;
  --step-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-head: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  --step-word: 8.2vw;

  --stage-w: 47vw;
  --margen: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--acento-oscuro); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 800; word-spacing: 0.06em; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
h2 { font-size: var(--step-head); }
.proy h3 { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); letter-spacing: -0.025em; line-height: 1.1; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Escenario y columna de lectura */
.split { position: relative; display: grid; grid-template-columns: var(--stage-w) 1fr; align-items: start; }
.stage {
  position: sticky; top: 0; height: 100svh; padding: var(--margen) 0 var(--margen) var(--margen);
  overflow: hidden;
}
.stage-foto, .stage-mapa, .sb {
  position: absolute; inset: var(--margen) 0 var(--margen) var(--margen);
  width: calc(100% - var(--margen)); height: calc(100% - 2 * var(--margen));
  transition: opacity 600ms ease;
}
.stage-foto, .sb, .proy-foto, .clases-fotos img, .carta-fotos img, .pie-foto, .carta-foto { filter: grayscale(1) contrast(1.06); }
.stage-foto { object-fit: cover; object-position: 50% 30%; animation: deriva 22s ease-in-out infinite alternate; }
.stage-mapa {
  background: var(--campo); color: var(--papel); opacity: 0; pointer-events: none;
  overflow: hidden; display: flex; flex-direction: column; justify-content: center;
}
.stage[data-view="mapa"] .stage-foto { opacity: 0; }
.stage[data-view="mapa"] .stage-mapa { opacity: 1; pointer-events: auto; }
.stage[data-view="retrato"] .lugar, .stage[data-view="retrato"] .lugar-nota { visibility: hidden; }

@keyframes deriva { from { transform: scale(1); } to { transform: scale(1.05); } }

#mapa { width: 100%; height: auto; overflow: visible; flex: none; }
#mapa-g { transition: transform 950ms var(--ease-in-out); transform-origin: 0 0; }
#mapa path {
  fill: var(--tierra); stroke: var(--campo); stroke-width: 0.8; vector-effect: non-scaling-stroke;
  transition: fill 420ms ease; cursor: pointer;
}
#mapa path.pais { fill: var(--vecino); stroke: var(--campo); cursor: default; transition: fill 420ms ease; }
#mapa path.pais.tocable { cursor: pointer; }
#mapa path.estado { fill: var(--vecino); stroke: none; pointer-events: none; }
#mapa path.agua { fill: var(--campo); pointer-events: none; }
#mapa path.hov { fill: var(--tierra-hover); }
#mapa path.on { fill: var(--papel); }
.lugar {
  word-spacing: 0.06em;
  position: absolute; top: clamp(20px, 4vh, 40px); left: 28px; right: 28px;
  font-size: var(--step-head); font-weight: 800; letter-spacing: -0.035em; line-height: 1; text-wrap: balance;
}
.lugar-nota { position: absolute; bottom: clamp(20px, 4vh, 36px); left: 28px; right: 28px; font-size: var(--step-lead); line-height: 1.2; }

.word {
  position: absolute; left: 0; right: 0; top: calc(100svh - var(--step-word) * 1.3); height: 1.1em;
  margin: 0; z-index: 3; pointer-events: none;
  font-size: var(--step-word); line-height: 1; letter-spacing: -0.045em; font-weight: 800; white-space: nowrap; text-transform: uppercase; word-spacing: 0.1em;
  transform-origin: 100% 100%;
}
.word span { position: absolute; right: 24px; top: 0; }
.word-tinta { color: var(--ink); }
/* Copia en papel recortada al ancho del escenario: el nombre cruza la frontera sin mezclar colores */
.word-papel { color: var(--ink); left: 0; right: 0 !important; text-align: right; padding-right: 24px; clip-path: inset(0 calc(100% - var(--stage-w)) 0 0); }
.word-tinta { clip-path: none; }

.lectura { min-width: 0; padding: 0 clamp(24px, 5vw, 80px); }
.lectura > section, .lectura > header { max-width: 600px; }
section { scroll-margin-top: 24px; }

/* Primera pantalla */
.hero { position: relative; min-height: 100svh; }
.nav {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; padding-top: 28px;
  font-size: var(--step-small);
}
.nav a { text-decoration: none; padding: 4px 0; transition: color var(--t-hover) ease; }
.nav a:hover { text-decoration: underline; }
.nav-accion { font-weight: 700; color: var(--acento-oscuro); }
.hero-texto { position: absolute; top: 34%; left: 0; max-width: 30ch; }
.hero-frase { font-size: var(--step-lead); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 28px; }
.boton {
  display: inline-block; padding: 11px 20px; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; font-weight: 700; font-size: var(--step-body);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.boton:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-2px); }
.boton:active { transform: translateY(1px) scale(0.98); }

/* Secciones de lectura: cada una con otra composición */
.intro { padding: 56px 0 40px; max-width: 58ch !important; }
.intro p + p { margin-top: 1.1em; }
.intro .fuerte { font-size: var(--step-lead); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }

.explora { padding: 24px 0 48px; }
.explora > p { margin-top: 14px; }
.deptos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.deptos button {
  font: inherit; font-size: var(--step-small); color: var(--ink); background: var(--surface);
  border: 0; border-radius: 0; padding: 6px 9px; cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.deptos button:hover { background: var(--surface-hover); }
.deptos button:active { transform: scale(0.97); }
.deptos button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.deptos-corte { flex-basis: 100%; margin-top: 6px; font-size: var(--step-small); color: var(--muted); }
.resultado { margin-top: 20px; }
.resultado h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.1; }
.resultado ul { margin-top: 8px; }
.resultado li { padding-left: 1.1em; text-indent: -1.1em; margin-top: 5px; }
.resultado li::before { content: "•\00a0\00a0"; color: var(--accent); }
.res-nacional { margin-top: 10px; font-size: var(--step-small); color: var(--muted); }

.proyectos { padding: 24px 0 24px; }
.proy { padding: 36px 0 0; min-height: 34vh; }
.proy-meta { margin-top: 8px; margin-bottom: 8px; font-size: var(--step-small); color: var(--muted); }
.proy p + p { margin-top: 16px; }
.proy-foto { width: min(100%, 360px); margin-top: 14px; }

.cifras { padding: 40px 0 64px; }
.cifras dl { margin: 16px 0 0; }
.cifras dl > div { display: grid; grid-template-columns: 76px 1fr; column-gap: 16px; align-items: baseline; margin-top: 10px; }
.cifras dt { text-align: right; font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cifras dd { margin: 0; max-width: 44ch; }

/* Galería de publicaciones */
.publicaciones { background: var(--campo); color: var(--papel); }
.pub-cuerpo { padding: 44px clamp(20px, 3vw, 48px) 40px; }
.pub-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.pub-galeria { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 20px 14px; margin-top: 20px; align-items: start; }
.pub-card a, .pub-card > div { display: block; color: inherit; text-decoration: none; }
.pub-tapa { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #fff; }
.pub-tapa img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform var(--t-hover) var(--ease-out); }
.pub-card a:hover .pub-tapa img { transform: scale(1.04); }
.pub-tapa-texto { background: var(--tierra); color: var(--papel); padding: 10px; font-size: var(--step-small); font-weight: 700; line-height: 1.2; }
.pub-tit, .pub-meta, .pub-muni span, .pub-tapa-texto { hyphens: auto; overflow-wrap: anywhere; }
.pub-tit { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin-top: 7px; font-size: var(--step-small); font-weight: 700; line-height: 1.22; }
.pub-card a:hover .pub-tit { color: var(--cierre-hover); }
.pub-meta { display: block; margin-top: 3px; font-size: var(--step-small); line-height: 1.25; color: #c7d5f0; }
.pub-pend { display: block; margin-top: 3px; font-size: var(--step-small); font-weight: 700; color: #ffcf66; }
.pub-sub { margin-top: 32px; font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.pub-sub-meta { margin-top: 3px; font-size: var(--step-small); color: #c7d5f0; }
.pub-muni { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pub-muni a { display: block; color: inherit; text-decoration: none; font-size: var(--step-small); line-height: 1.2; }
.pub-muni img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform var(--t-hover) var(--ease-out); }
.pub-muni a:hover img { transform: scale(1.04); }
.pub-muni span { display: block; margin-top: 4px; }
.anio { font-variant-numeric: tabular-nums; font-weight: 800; }

.registro { padding: 0 clamp(20px, 3vw, 48px) 56px; }
.registro > p { margin-top: 8px; max-width: 70ch; }
.reg-lista { columns: 3; column-gap: 32px; margin-top: 18px; font-size: var(--step-small); line-height: 1.3; }
.reg-lista li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 3px 0; break-inside: avoid; }
.reg-lista a { color: inherit; text-decoration: none; cursor: zoom-in; transition: color var(--t-hover) ease; }
.reg-lista a:hover { color: var(--cierre-hover); text-decoration: underline; }
.reg-lista strong { font-weight: 700; }

/* Segundo escenario */
.stage-b .sb { object-fit: cover; opacity: 0; transition: opacity 500ms ease; }
.stage-b .sb.on { opacity: 1; }
.servicios { padding: 56px 0 24px; }
.serv-lista { margin-top: 14px; }
details { padding: 1px 0; }
summary {
  list-style: none; cursor: pointer; font-size: var(--step-lead); line-height: 1.25; padding: 6px 0;
  color: var(--muted); transition: color var(--t-hover) ease, transform var(--t-hover) var(--ease-out);
}
summary::-webkit-details-marker { display: none; }
summary:hover { transform: translateX(6px); color: var(--ink); }
details[open] summary { color: var(--ink); font-weight: 800; letter-spacing: -0.015em; }
details p { max-width: 46ch; padding-bottom: 12px; }

.clases { padding: 24px 0 56px; }
.clases > p { margin-top: 10px; }
.clases-fotos { display: grid; grid-template-columns: 7fr 4fr; gap: 8px; margin-top: 14px; align-items: start; max-width: 460px; }
.clases-fotos img { width: 100%; }

/* Carta */
.carta { width: min(620px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0; }
.carta-foto { width: 44px; height: 44px; object-fit: cover; object-position: 50% 30%; border-radius: 50%; margin-bottom: 14px; }
.carta p + p { margin-top: 0.8em; }
.firma { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; margin-top: 1em !important; }
.firma-rol { font-size: var(--step-small); color: var(--muted); margin-top: 2px !important; }
.carta-fotos { display: grid; grid-template-columns: 5fr 8fr; gap: 8px; margin-top: 20px; align-items: end; max-width: 330px; }
.carta-fotos img { width: 100%; }

/* Contacto */
.contacto {
  background: var(--cierre); color: var(--papel);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(32px, 6vw, 96px); padding: 44px clamp(20px, 3vw, 48px);
}
.contacto-frase { margin-top: 8px; max-width: 42ch; }
.correo { display: inline-block; margin-top: 14px; font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; color: var(--papel); overflow-wrap: anywhere; transition: color var(--t-hover) ease; }
.correo:hover { color: var(--cierre-hover); }
.contacto-pie { margin-top: 14px; font-size: var(--step-small); }
.contacto-pie p + p { margin-top: 8px; }
.contacto a:not(.correo):hover { color: var(--cierre-hover); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.form label { display: block; font-size: var(--step-small); font-weight: 700; }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; font-size: var(--step-body); color: var(--ink); background: var(--papel); border: 0; border-radius: 0;
}
.form textarea { min-height: 112px; resize: vertical; }
.form .ancho { grid-column: 1 / -1; }
.form .trampa { position: absolute; left: -9999px; width: 0; height: 0; overflow: hidden; }
.form :focus-visible { outline-color: var(--cierre-hover); }
.form button {
  font: inherit; font-weight: 700; padding: 10px 22px; color: var(--ink); background: var(--papel); border: 0; border-radius: 0; cursor: pointer;
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.form button:hover { background: var(--cierre-hover); }
.form button:active { transform: scale(0.97); }
.form button[disabled] { opacity: 0.6; cursor: wait; }
.form-pie { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.form-estado { font-size: var(--step-small); min-height: 1.3em; }
.form-estado a { color: inherit; }

/* Pie */
.pie { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 460px; overflow: hidden; }
.pie-foto { width: 100%; height: 460px; object-fit: cover; object-position: 58% 62%; }
.pie-menu { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 80px) 18px; }
.pie-marca { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; }
.pie-menu nav { display: flex; flex-direction: column; gap: 5px; margin-top: 18px; }
.pie-menu nav a {
  font-size: var(--step-head); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; text-decoration: none; width: fit-content;
  transition: transform var(--t-hover) var(--ease-out), color var(--t-hover) ease;
}
.pie-menu nav a:hover { transform: translateX(12px); color: var(--acento-oscuro); }
.pie-legal { margin-top: auto; padding-top: 16px; font-size: var(--step-small); color: var(--muted); }

/* Visor de fichas */
.visor {
  width: min(960px, 100vw); height: 100dvh; max-width: 100vw; max-height: 100dvh;
  margin: 0 auto; padding: 0; border: 0; background: var(--bg); color: var(--ink); overflow: hidden;
}
.visor[open] { display: flex; flex-direction: column; animation: visor-entra 260ms var(--ease-out); }
.visor::backdrop { background: rgba(5, 15, 35, 0.86); }
@keyframes visor-entra { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.visor-barra { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--campo); color: var(--papel); }
.visor-titulo { font-weight: 700; font-size: var(--step-small); line-height: 1.25; min-width: 0; }
.visor-acciones { display: flex; align-items: center; gap: 6px; flex: none; font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.visor-acciones span { min-width: 54px; text-align: center; }
.visor-acciones button {
  font: inherit; font-weight: 700; color: var(--papel); background: var(--tierra); border: 0; border-radius: 0; min-width: 44px; min-height: 44px; padding: 0 12px; cursor: pointer;
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.visor-acciones button:hover { background: var(--tierra-hover); }
.visor-acciones button:active { transform: scale(0.96); }
.visor-acciones button:disabled { opacity: 0.4; cursor: default; }
.visor-acciones .visor-cerrar { background: var(--papel); color: var(--campo); margin-left: 6px; }
.visor-acciones .visor-cerrar:hover { background: var(--surface-hover); }
.visor :focus-visible { outline-color: #8fb2ee; }
.visor-hoja { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); -webkit-overflow-scrolling: touch; }
.visor-hoja img { width: 100%; height: auto; margin: 0 auto; }
.visor-hoja.grande { overflow: auto; }
.visor-hoja.grande img { width: 230%; max-width: none; margin: 0; }
.visor-zoom { display: none; }
body.con-visor { overflow: hidden; }

/* Entradas: solo se esconde con JS activo y sin preferencia de movimiento reducido */
@media (prefers-reduced-motion: no-preference) {
  .js [data-entra], .js .proy > *, .js .pub-card {
    opacity: 0; transform: translateY(22px);
    transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js .visto { opacity: 1 !important; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-foto { animation: none; }
  #mapa-g { transition: none; }
}

/* Tableta */
@media (max-width: 1000px) {
  .reg-lista { columns: 2; }
  .pub-galeria { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pub-muni { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .contacto { grid-template-columns: 1fr; }
}

/* Teléfono: composición propia, el escenario pasa arriba y queda fijo como banda */
@media (max-width: 760px) {
  :root { --margen: 12px; --step-word: 11.6vw; }
  .split { display: block; }
  .stage { position: relative; width: 100%; height: 46svh; padding: 0; }
  .stage-foto, .sb { inset: 0; width: 100%; height: 100%; }
  .stage-foto { object-position: 50% 22%; opacity: 1 !important; }
  .stage-b { height: 30svh; }
  /* En teléfono el mapa vive dentro de su sección (lo mueve sitio.js) y no queda fijo */
  .explora .stage-mapa {
    position: relative; inset: auto; width: calc(100% + 40px); height: auto; margin: 24px -20px 0;
    opacity: 1; pointer-events: auto; padding: 64px 0 56px;
  }
  .stage > .stage-mapa { display: none; }
  .lugar { top: 14px; left: 20px; right: 20px; font-size: 1.5rem; }
  .lugar-nota { bottom: 12px; left: 20px; right: 20px; font-size: 0.875rem; }
  .proy::before { content: attr(data-lugar); display: block; margin-bottom: 10px; color: var(--acento-oscuro); font-weight: 700; }
  .word { position: relative; top: auto; height: auto; margin: 6px 0 0; }
  .word span { position: relative; display: block; right: auto; padding: 0 12px; text-align: left; }
  .word-papel { display: none !important; }
  .lectura { padding: 0 20px; }
  .hero { min-height: 0; padding-bottom: 16px; }
  .nav { justify-content: flex-start; padding-top: 18px; order: 2; }
  .hero-texto { position: static; margin-top: 24px; max-width: 100%; }
  .intro { padding: 24px 0; max-width: 100% !important; }
  .explora { padding: 16px 0 32px; }
  .proyectos { padding: 8px 0 16px; }
  .proy { min-height: 0; padding-top: 24px; }
  .cifras { padding: 24px 0 36px; }
  .cifras dl > div { grid-template-columns: 64px 1fr; column-gap: 12px; }
  .pub-cuerpo { padding: 28px 20px 28px; }
  .pub-galeria { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .pub-muni { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .visor-barra { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .visor-acciones { justify-content: space-between; }
  .visor-zoom { display: block; }
  .visor-acciones .visor-cerrar { margin-left: auto; }
  .reg-lista { columns: 1; font-size: var(--step-small); }
  .registro { padding: 0 20px 36px; }
  .servicios { padding: 24px 0 12px; }
  .clases { padding: 16px 0 36px; }
  .carta { padding: 36px 0; }
  .contacto { padding: 28px 20px; }
  .form { grid-template-columns: 1fr; }
  .form > * { grid-column: 1 / -1; }
  .pie { display: block; }
  .pie-foto { height: 34svh; }
  .pie-menu { padding: 20px 20px 16px; }
  .pie-menu nav { margin-top: 12px; }
}
