/* Harlow Ridge · layout y componentes.
   Sin valores de marca: todo color y tipografía sale de brand.css.
   Variantes con color-mix() sobre tokens. */

/* ---------- Sistema ---------- */
:root {
  --ink-soft: color-mix(in srgb, var(--text) 82%, var(--bg));
  --primary-hover: color-mix(in srgb, var(--brand-primary) 80%, var(--bg));
  --on-dark-muted: color-mix(in srgb, var(--brand-primary-contrast) 74%, var(--brand-primary));
  --on-dark-line: color-mix(in srgb, var(--brand-primary-contrast) 22%, var(--brand-primary));
  --focus: var(--brand-label);
  --rule-data: var(--brand-accent);   /* filetes finos en bronce entre datos */
  --label-on-dark: color-mix(in srgb, var(--brand-accent) 65%, var(--brand-primary-contrast));
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent), 0 18px 48px -12px color-mix(in srgb, var(--text) 22%, transparent);

  /* Fuente de display: opsz medio para que los trazos finos aguanten en 390 px y en pantallas 1x.
     Mobile usa el mínimo (36); desktop sube a 56 o 64 en los títulos grandes. */
  --opsz-hero: 36;
  --opsz-title: 36;
  --opsz-small: 36;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --section-y: clamp(72px, 9vw, 136px);
  --header-h: 64px;
  --bar-h: calc(70px + env(safe-area-inset-bottom));

  /* Escala tipográfica (razón ~1.333, 17 px base) */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.5rem, 1.15rem + 1.1vw, 2.125rem);
  --fs-xl: clamp(2.375rem, 1.1rem + 4.2vw, 5rem);
  --fs-2xl: clamp(2.625rem, 1rem + 6vw, 6rem);
  --fs-data: clamp(2.25rem, 1.6rem + 2vw, 3.5rem);

  color-scheme: light;
  accent-color: var(--brand-primary);
  caret-color: var(--brand-label);
}

::selection { background: color-mix(in srgb, var(--brand-primary) 22%, var(--bg)); color: var(--text); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" var(--opsz-title);
  letter-spacing: -0.015em;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}
h3, h4 { font-weight: 600; letter-spacing: -0.005em; text-wrap: balance; }
p { text-wrap: pretty; }

.num, .specs dd, .hero-strip dd, .hood-stats dd, .listing-price, .hero-card-price, .est-amount, .est-breakdown dd {
  font-variant-numeric: tabular-nums lining-nums;
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px;
  background: var(--brand-primary); color: var(--brand-primary-contrast);
  transition: transform 160ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

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

.eyebrow {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--brand-label);
  margin-bottom: 14px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-sm { min-height: 44px; padding: 0 18px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand-primary); color: var(--brand-primary-contrast); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--text); }

.btn-text {
  display: inline-block;
  padding: 8px 0;
  line-height: 28px;
  background: none; border: 0;
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--text);
  /* Acento de los CTA secundarios: filete bronce grueso y flecha que avanza. */
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em;
  text-decoration-color: var(--brand-accent);
  cursor: pointer;
  transition: text-decoration-color 180ms ease, transform 160ms var(--ease-out);
}
.btn-text:not([type="reset"])::after,
.link-call::after {
  content: "\2192";
  /* inline-grid es atómico: el subrayado del link no lo atraviesa. */
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  margin-left: 10px;
  vertical-align: middle;
  border: 1px solid var(--brand-accent);
  font-size: 0.9375rem; line-height: 1;
  transition: transform 200ms var(--ease-out), background-color 180ms ease, color 180ms ease;
}
.btn-text:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-outline:hover { background: var(--text); color: var(--bg); }
  .btn-text:hover { text-decoration-color: currentColor; }
  .btn-text:hover::after, .link-call:hover::after {
    transform: translateX(4px);
    background: var(--brand-accent); color: var(--brand-primary);
  }
}

/* ---------- Header ----------
   Fijo arriba. Sobre la foto del hero va transparente con texto claro (.is-over);
   apenas se hace scroll pasa a fondo --bg con texto oscuro. Sin JS queda sólido. */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  isolation: isolate;
  color: var(--text);
}
/* Fondo sólido como capa aparte: el cambio de estado anima solo su opacidad. */
.site-header::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* La transición se habilita después del primer estado, así la carga no muestra un destello sólido. */
.site-header.is-ready::before { transition: opacity 200ms ease; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
@media (min-width: 900px) { :root { --header-h: 72px; --opsz-hero: 64; --opsz-title: 56; } }
.header-logo { display: inline-flex; flex: none; }
.header-logo .brand-logo { width: auto; height: 40px; }
.header-logo .logo-inverse { display: none; }
.site-nav { display: none; margin-left: auto; }
.site-nav ul { display: flex; gap: clamp(18px, 2vw, 32px); }
.site-nav a {
  font-size: var(--fs-sm); font-weight: 500;
  text-decoration: none;
  padding-block: 10px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 220ms var(--ease-out);
}
.header-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.header-phone { display: none; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; font-variant-numeric: tabular-nums; }
.header-actions .btn { display: none; }
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background-size: 100% 1px; }
  .header-phone:hover { text-decoration: underline; }
}
@media (min-width: 1100px) {
  .site-nav { display: block; }
  .header-actions { margin-left: 0; }
  .header-actions .btn, .header-phone { display: inline-flex; }
}
@media (max-width: 1099px) {
  .header-phone { display: inline-flex; }
}

/* Menú bajo 1100 px: el panel baja desde el header; abierto, el header pasa a sólido. */
.menu-toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: transparent; color: inherit; border: 1px solid currentColor; border-radius: var(--radius);
  font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 180ms ease;
}
.menu-toggle:active { transform: scale(0.97); }
@media (max-width: 599px) { .header-phone { display: none; } }
@media (max-width: 1099px) {
  .site-nav {
    display: block; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    padding: 4px var(--gutter) 20px; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding-block: 14px; font-size: var(--fs-base); border-bottom: 1px solid var(--line); background: none; }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-header.menu-open::before, .site-header.is-over.menu-open::before { opacity: 1; }
  .site-header.is-over.menu-open { color: var(--text); }
  .site-header.is-over.menu-open .logo-default { display: block; }
  .site-header.is-over.menu-open .logo-inverse { display: none; }
  .site-header.is-over.menu-open :focus-visible { outline-color: var(--text); }
}
@media (min-width: 1100px) { .menu-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .site-nav, .site-nav.is-open { transition: none; transform: none; } }

.site-header.is-over { color: var(--brand-primary-contrast); }
.site-header.is-over::before { opacity: 0; }
.site-header.is-over .logo-default { display: none; }
.site-header.is-over .logo-inverse { display: block; }
.site-header.is-over .btn-primary { background: var(--brand-primary-contrast); color: var(--brand-primary); }
.site-header.is-over :focus-visible { outline-color: var(--brand-primary-contrast); }
@media (hover: hover) and (pointer: fine) {
  .site-header.is-over .btn-primary:hover { background: color-mix(in srgb, var(--brand-primary-contrast) 84%, var(--brand-primary)); }
}

/* ---------- Placeholders de imagen ---------- */
figure[data-slot] { position: relative; background: var(--surface); overflow: hidden; }
figure[data-slot] > img { width: 100%; height: 100%; object-fit: cover; }
figure.is-missing > img { opacity: 0; }
figure.is-missing::after {
  content: attr(data-slot);
  position: absolute; left: 12px; bottom: 12px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--line);
}

/* ---------- Hero ----------
   Mobile y tablet: foto arriba (debajo del header), texto y ficha debajo, CTA en la barra fija.
   Desktop (900 px o más): una pantalla exacta. Foto a sangre de fondo, degradés oscuros
   desde abajo y desde la izquierda para el texto claro, ficha abajo a la derecha. */
.hero h1, .schedule h2 { font-variation-settings: "opsz" var(--opsz-hero); }
.hero-screen { position: relative; }

.hero-window[data-slot] { position: relative; width: 100%; aspect-ratio: 4 / 5; }
/* Tono oscuro también mientras la foto falta o carga: el texto claro y el header se leen igual. */
.hero-window[data-slot] { background: color-mix(in srgb, var(--brand-primary) 90%, var(--brand-accent)); }
/* La foto cubre toda la figura: los atributos width/height quedan para evitar CLS,
   pero aspect-ratio: auto anula la proporción que heredan. */
.hero-window[data-slot] > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: 42% 50%;
}
.hero-window::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  /* Franja superior para el header transparente sobre el cielo. */
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--brand-primary) 82%, transparent) 0,
    color-mix(in srgb, var(--brand-primary) 62%, transparent) var(--header-h),
    transparent calc(var(--header-h) * 2.6));
}
.hero-window.is-missing::after {
  top: calc(var(--header-h) + 12px); bottom: auto; z-index: 2;
  color: var(--on-dark-muted); background: transparent;
  border-color: var(--on-dark-line);
}
@media (min-width: 640px) and (max-width: 899px) {
  .hero-window[data-slot] { aspect-ratio: 3 / 2; }
}

/* Parteluces de la ventana: cruz de 2 px en el centro de la abertura.
   En reposo invisible; el JS la muestra solo mientras la ventana se abre. */
.hero-mullions {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: 0;
  color: var(--bg);
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat;
}

.hero-inner { display: grid; gap: 28px; padding-top: 28px; }
.hero h1 {
  font-size: var(--fs-2xl);
  line-height: 0.96;
  max-width: 14ch;
}
.hero-sub { font-size: var(--fs-md); line-height: 1.5; color: var(--ink-soft); max-width: 36ch; margin-top: 16px; }
.link-call {
  display: inline-block;
  padding-block: 9px; margin-top: 4px;
  line-height: 26px; font-size: var(--fs-sm); font-weight: 600;
  text-decoration-thickness: 2px; text-underline-offset: 0.35em;
  text-decoration-color: var(--brand-accent);
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) { .link-call:hover { text-decoration-color: currentColor; } }

.hero-card {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  padding: 22px 24px 24px;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
}
.hero-card-title, .listing-title, .plan-name h4 { font-variant-numeric: lining-nums; }
.hero-card-title { font-family: var(--font-display); font-weight: 450; font-variation-settings: "opsz" var(--opsz-small); font-size: var(--fs-lg); line-height: 1.1; letter-spacing: -0.015em; margin-top: 8px; }
.hero-card-area { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.hero-card-price { font-size: 2rem; font-weight: 300; letter-spacing: -0.01em; line-height: 1.1; margin-top: 12px; }
.hero-card .specs { margin-block: 12px 18px; padding-top: 12px; border-top: 1px solid var(--rule-data); }
.hero-card .tag-pre { color: var(--label-on-dark); }
.hero-card-area, .hero-card .specs dt { color: var(--on-dark-muted); }
.hero-card .btn-primary { background: var(--brand-primary-contrast); color: var(--brand-primary); }
.hero-card :focus-visible { outline-color: var(--brand-primary-contrast); }
@media (hover: hover) and (pointer: fine) {
  .hero-card .btn-primary:hover { background: color-mix(in srgb, var(--brand-primary-contrast) 84%, var(--brand-primary)); }
}

/* Mobile y tablet: ficha compacta debajo del texto. */
@media (max-width: 899px) {
  .hero-card {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 0 16px;
    padding: 18px 20px 20px;
  }
  .hero-card .tag, .hero-card-title, .hero-card-area, .hero-card .btn { flex-basis: 100%; }
  .hero-card-title { font-size: 1.375rem; margin-top: 4px; }
  .hero-card-price { font-size: 1.625rem; margin-top: 10px; }
  .hero-card .specs { margin: 10px 0 0; padding-top: 0; border-top: 0; column-gap: 16px; }
  .hero-card .specs dd { font-size: var(--fs-base); }
  .hero-card .btn { margin-top: 16px; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: end; column-gap: 32px; }
}

/* Desktop: una pantalla exacta, todo sobre la foto. */
@media (min-width: 900px) {
  .hero-screen {
    height: 100vh;
    height: 100svh;
    min-height: 640px;
    max-height: 960px;
    overflow: hidden;
  }
  .hero-window[data-slot] { position: absolute; inset: 0; aspect-ratio: auto; }
  /* x 0 %: con cover, la casa queda lo más a la derecha que permite el recorte.
     y 80 %: en pantallas más anchas que la foto el recorte es vertical; así entran
     el techo, la base de la casa y una franja de jardín. */
  .hero-window[data-slot] > img { object-position: 0% 80%; }
  .hero-window::before {
    background:
      linear-gradient(to bottom,
        color-mix(in srgb, var(--brand-primary) 82%, transparent) 0,
        color-mix(in srgb, var(--brand-primary) 62%, transparent) var(--header-h),
        transparent calc(var(--header-h) * 2.6)),
      linear-gradient(to top,
        color-mix(in srgb, var(--brand-primary) 60%, transparent) 0,
        color-mix(in srgb, var(--brand-primary) 40%, transparent) 30%,
        transparent 60%),
      linear-gradient(to right,
        color-mix(in srgb, var(--brand-primary) 80%, transparent) 0,
        color-mix(in srgb, var(--brand-primary) 52%, transparent) 40%,
        transparent 66%);
  }
  .hero-inner {
    position: relative; z-index: 2;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: clamp(32px, 4vw, 72px);
    align-items: end;
    padding-top: calc(var(--header-h) + 24px);
    padding-bottom: clamp(32px, 5.5vh, 64px);
  }
  .hero-copy { color: var(--brand-primary-contrast); max-width: 46rem; }
  .hero-copy .eyebrow { color: var(--brand-primary-contrast); }
  .hero h1 { max-width: 13.5ch; font-size: min(var(--fs-2xl), 9.5vh, 5.125rem); }
  .hero-sub { color: var(--brand-primary-contrast); margin-top: 20px; }
  .hero-copy :focus-visible { outline-color: var(--brand-primary-contrast); }
  .hero-card {
    width: 340px;
    border: 1px solid color-mix(in srgb, var(--brand-primary-contrast) 16%, transparent);
  }
}

/* Etiquetas de estado */
.tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.tag-pre { color: var(--brand-label); }

/* Specs (dormitorios, baños, sq ft) */
.specs { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 28px; }
.specs div { display: flex; flex-direction: column-reverse; }
.specs dt { font-size: var(--fs-xs); color: var(--text-muted); }
.specs dd { font-size: var(--fs-md); font-weight: 500; line-height: 1.2; }

/* Franja de datos */
.hero-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule-data);
  margin-top: clamp(28px, 4vw, 48px);
}
.hero-strip div {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px;
  padding: 20px 16px 24px 0;
  border-top: 1px solid var(--rule-data);
}
.hero-strip div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule-data); }
.hero-strip dd { font-size: var(--fs-data); font-weight: 300; letter-spacing: -0.012em; line-height: 1; }
.hero-strip dt { font-size: var(--fs-sm); color: var(--text-muted); max-width: 24ch; line-height: 1.4; }
@media (min-width: 900px) {
  .hero-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-strip div { padding: 28px 24px 32px; border-left: 1px solid var(--rule-data); }
  .hero-strip div:first-child { padding-left: 0; border-left: 0; }
}

/* ---------- Encabezado de sección ---------- */
.section-head { max-width: 64ch; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head h2, .dev-head h2, .hood-body h2, .steps h2, .faq-head h2, .schedule h2 {
  font-size: var(--fs-xl);
  line-height: 0.98;
}
.section-head p { margin-top: 16px; color: var(--text-muted); max-width: 56ch; }

/* ---------- Filtros ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  padding-block: 20px;
  border-block: 1px solid var(--line);
}
.filters .segmented { grid-column: 1 / -1; }
.filters-reset { justify-self: start; }
@media (min-width: 900px) {
  .filters { grid-template-columns: auto repeat(3, minmax(140px, 180px)) 1fr; gap: 24px; }
  .filters .segmented { grid-column: auto; }
  .filters-reset { justify-self: end; }
}

.field { display: grid; gap: 6px; min-width: 0; }
.field label, fieldset legend { font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-row output { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-muted); }

select, input[type="text"], input[type="tel"], input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--text) 45%, var(--bg));
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 160ms ease;
}
select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  select:hover, input[type="text"]:hover, input[type="tel"]:hover, input[type="number"]:hover { border-color: var(--text); }
}
select:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--text); }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: 6px; }
.segmented-options { display: flex; flex-wrap: wrap; border: 1px solid color-mix(in srgb, var(--text) 45%, var(--bg)); width: max-content; max-width: 100%; }
.segmented label { position: relative; display: flex; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: inline-flex; align-items: center;
  min-height: 46px; padding: 0 16px;
  font-size: var(--fs-sm); font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease;
}
.segmented label + label span { border-left: 1px solid color-mix(in srgb, var(--text) 25%, var(--bg)); }
.segmented input:checked + span { background: var(--text); color: var(--bg); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .segmented input:not(:checked) + span:hover { background: var(--surface); }
}

.results-count { margin-block: 24px; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- Grilla de propiedades ---------- */
.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px 24px;
}
@media (min-width: 640px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing-featured { grid-column: span 2; }
}
@media (min-width: 1200px) {
  .listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.listing article { display: flex; flex-direction: column; height: 100%; }
.listing-media { aspect-ratio: 4 / 3; }
.listing-media > img { transition: transform 600ms var(--ease-out); }
@media (min-width: 640px) {
  .listing-featured .listing-media { aspect-ratio: 16 / 9; }
}
@media (min-width: 1200px) {
  /* Misma altura de foto en toda la fila: alto = 3/4 del ancho de una columna. */
  .listing-media, .listing-featured .listing-media {
    aspect-ratio: auto;
    height: calc((min(100vw - 2 * var(--gutter), var(--maxw)) - 72px) / 4 * 0.75);
  }
}
@media (hover: hover) and (pointer: fine) {
  .listing article:hover .listing-media > img { transform: scale(1.03); }
}
.listing-body { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
.listing-title { font-family: var(--font-display); font-weight: 450; font-variation-settings: "opsz" var(--opsz-small); letter-spacing: -0.01em; font-size: var(--fs-lg); line-height: 1.15; margin-top: 6px; }
.listing-area { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.listing-price { font-size: 1.625rem; font-weight: 300; letter-spacing: -0.01em; margin-top: 12px; line-height: 1.2; }
.specs-inline { margin-top: 10px; }
.specs-inline dd { font-size: var(--fs-base); }
.listing-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: auto; padding-top: 20px; }

.empty-state { padding: 40px; background: var(--surface); max-width: 64ch; }
.empty-title { font-family: var(--font-display); font-weight: 450; font-variation-settings: "opsz" var(--opsz-small); font-size: var(--fs-lg); margin-bottom: 8px; }
.empty-state a { font-variant-numeric: tabular-nums; }

/* ---------- Estimador ---------- */
.estimator {
  display: grid;
  margin-top: clamp(64px, 8vw, 112px);
  background: var(--surface);
}
.est-inputs, .est-result { padding: clamp(24px, 4vw, 56px); }
.est-inputs h3 { font-family: var(--font-display); font-weight: 450; font-variation-settings: "opsz" var(--opsz-small); letter-spacing: -0.015em; font-size: var(--fs-lg); line-height: 1.15; }
.est-intro { color: var(--text-muted); margin-top: 6px; }
.est-form { display: grid; gap: 24px; margin-top: 28px; }
.affix { position: relative; display: flex; align-items: center; }
.affix-sign { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.affix input { padding-left: 30px; font-variant-numeric: tabular-nums; }
.affix-end .affix-sign { left: auto; right: 14px; }
.affix-end input { padding-left: 14px; padding-right: 36px; }

input[type="range"] {
  width: 100%; height: 44px; margin: 0;
  background: transparent;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--text); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--text); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -10px;
  background: var(--brand-primary); border: 3px solid var(--surface); border-radius: 50%;
  box-shadow: 0 0 0 1px var(--brand-primary);
  transition: transform 160ms var(--ease-out);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--brand-primary); border: 3px solid var(--surface); border-radius: 50%;
  box-shadow: 0 0 0 1px var(--brand-primary);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible { outline-offset: 2px; }

.est-result {
  display: flex; flex-direction: column; align-items: flex-start;
  border-top: 1px solid var(--line);
}
.est-label { font-size: var(--fs-sm); color: var(--text-muted); }
.est-amount {
  font-size: clamp(3.5rem, 2.4rem + 4.4vw, 6.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-top: 8px;
}
.est-breakdown { display: grid; gap: 0; width: 100%; margin-top: 28px; border-top: 1px solid var(--rule-data); }
.est-breakdown div { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--rule-data); }
.est-breakdown dt { color: var(--text-muted); font-size: var(--fs-sm); }
.est-breakdown dd { font-weight: 500; }
.est-note { font-size: var(--fs-xs); color: var(--text-muted); margin-block: 16px 28px; max-width: 46ch; }
@media (min-width: 900px) {
  .estimator { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .est-result { border-top: 0; border-left: 1px solid var(--line); }
}

/* ---------- Desarrollo nuevo ---------- */
.dev { border-top: 1px solid var(--line); }
.dev-head { padding-bottom: clamp(32px, 4vw, 56px); }
.dev-head h2 { max-width: 18ch; }
.dev-head p:not(.eyebrow) { margin-top: 18px; max-width: 58ch; color: var(--ink-soft); font-size: var(--fs-md); line-height: 1.5; }

.dev-render { aspect-ratio: 4 / 3; }
@media (min-width: 640px) { .dev-render { aspect-ratio: 21 / 9; } }
.dev-render figcaption {
  position: absolute; right: var(--gutter); bottom: 12px;
  font-size: var(--fs-xs); color: var(--text-muted);
  background: var(--bg); padding: 2px 8px;
}
.dev-render.is-missing figcaption { display: none; }

.plans { padding-top: clamp(40px, 5vw, 72px); }
.plans-title, .amenities h3, .progress h3 { font-size: var(--fs-md); }
.plan-list { margin-top: 20px; border-top: 1px solid var(--rule-data); }
.plan {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 20px;
  align-items: center;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}
.plan-svg { grid-row: span 4; width: 120px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.5; color: var(--text); }
.plan-svg text { fill: var(--text-muted); stroke: none; font-family: var(--font-body); font-size: 9px; }
.plan-name h4 { font-family: var(--font-display); font-weight: 450; font-variation-settings: "opsz" var(--opsz-small); font-size: var(--fs-lg); }
.plan-name p, .plan-size, .plan-price, .plan-left { font-size: var(--fs-sm); color: var(--text-muted); }
.plan .num { color: var(--text); font-weight: 500; font-size: var(--fs-md); }
@media (min-width: 900px) {
  .plan { grid-template-columns: 160px minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
  .plan-svg { grid-row: auto; width: 160px; }
  .plan-left { text-align: right; }
}

.dev-lower { display: grid; gap: 40px; padding-top: clamp(48px, 6vw, 88px); }
.dev-interior { aspect-ratio: 4 / 5; }
.amenities ul { margin-top: 16px; border-top: 1px solid var(--line); }
.amenities li { padding-block: 12px; border-bottom: 1px solid var(--line); }
.amenities .btn { margin-top: 28px; }
.progress-pct { font-size: var(--fs-data); font-weight: 300; letter-spacing: -0.012em; line-height: 1; margin-top: 16px; }
.progress-pct .num { font-weight: 300; font-size: inherit; color: inherit; }
.progress-date { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; }
.progress-bar { position: relative; height: 2px; margin-top: 18px; background: var(--line); overflow: hidden; }
.progress-bar span {
  position: absolute; inset: 0;
  background: var(--text);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

.timeline { margin-top: 24px; position: relative; }
.timeline li {
  position: relative;
  display: grid; gap: 2px;
  padding: 0 0 18px 28px;
}
.timeline li::before {
  content: "";
  position: absolute; left: 0; top: 6px;
  width: 11px; height: 11px;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  background: var(--surface);
}
.timeline li::after {
  content: "";
  position: absolute; left: 5px; top: 19px; bottom: 0;
  width: 1px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline li.is-done::before { background: var(--text); }
.timeline li.is-current::before { background: var(--brand-accent); border-color: var(--brand-label); }
.tl-name { font-weight: 500; }
.tl-date { font-size: var(--fs-sm); color: var(--text-muted); }
.is-current .tl-date { color: var(--brand-label); }
.dev-lower .progress { padding: clamp(24px, 3vw, 36px); background: var(--surface); }
.dev-lower .progress .timeline li::before { background: var(--surface); }
.dev-lower .progress .timeline li.is-done::before { background: var(--text); }
.dev-lower .progress .timeline li.is-current::before { background: var(--brand-accent); }

@media (min-width: 640px) and (max-width: 959px) {
  .dev-lower { grid-template-columns: 1fr 1fr; }
  .dev-interior { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .dev-lower > .reveal-wrap:has(> .dev-interior) { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .dev-lower { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3.4fr); gap: clamp(32px, 4vw, 56px); align-items: start; }
}

/* ---------- Barrio ---------- */
.hood { background: var(--surface); }
.hood-grid { display: grid; gap: 40px; }
.hood-photo[data-slot] { aspect-ratio: 4 / 5; background: var(--bg); }
.hood-photo.is-missing::after { background: var(--surface); }
.hood-intro { margin-top: 18px; color: var(--ink-soft); font-size: var(--fs-md); line-height: 1.5; max-width: 46ch; }
.hood-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  margin-top: clamp(32px, 4vw, 48px);
  position: relative;
}
.hood-stats div {
  position: relative;
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px;
  padding: 20px 16px 24px 0;
}
/* Filetes de bronce como pseudo-elementos: se pueden dibujar con scaleX. */
.hood-stats::before,
.hood-stats div::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--rule-data);
  transform-origin: left;
}
.hood-stats::before { top: 0; }
.hood-stats div::after { bottom: 0; }
.hood-stats dd { font-size: clamp(2rem, 1.4rem + 1.6vw, 3rem); font-weight: 300; letter-spacing: -0.012em; line-height: 1; }
.hood-stats dt { font-size: var(--fs-sm); color: var(--text-muted); max-width: 22ch; }
.source { margin-top: 16px; font-size: var(--fs-xs); color: var(--text-muted); }
@media (min-width: 960px) {
  .hood-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
  .hood-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Pasos ---------- */
.step-flow { position: relative; margin-top: clamp(32px, 4vw, 56px); }
.step-list {
  display: grid;
  gap: 0;
}
.step-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-content: start;
  column-gap: 16px;
  padding-block: 24px;
  padding-left: 24px;
  border-top: 1px solid var(--line);
}
/* Mobile: línea vertical a la izquierda. Desktop: horizontal sobre los cuatro pasos. */
.step-track {
  position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: var(--line);
}
.step-track span {
  position: absolute; inset: 0;
  background: var(--rule-data);
  transform-origin: top;
  transform: scaleY(var(--steps-p, 1));
  transition: transform 600ms var(--ease-out);
}
.step-num {
  grid-row: span 3;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" var(--opsz-title);
  font-size: 3rem;
  line-height: 0.9;
  font-variant-numeric: lining-nums;
  color: var(--brand-primary);
}
.step-time { font-size: var(--fs-xs); font-weight: 600; color: var(--brand-label); font-variant-numeric: tabular-nums; }
.step-list h3 { font-size: var(--fs-md); margin-top: 4px; }
.step-list li p:last-child { color: var(--text-muted); margin-top: 8px; max-width: 40ch; }
@media (min-width: 900px) {
  .step-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .step-list li { grid-template-columns: 1fr; padding-top: 28px; padding-left: 0; border-top: 0; }
  .step-track { top: 0; right: 0; bottom: auto; width: auto; height: 1px; }
  .step-track span { transform-origin: left; transform: scaleX(var(--steps-p, 1)); }
  .step-num { grid-row: auto; font-size: clamp(3.5rem, 2rem + 3vw, 5.5rem); margin-bottom: 20px; }
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-grid { display: grid; gap: 32px; }
.faq-head p { margin-top: 16px; color: var(--text-muted); max-width: 32ch; }
.faq-head a { color: var(--text); font-variant-numeric: tabular-nums; }
.faq-list { border-top: 1px solid var(--text); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 22px;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary h3 { font-size: var(--fs-md); font-weight: 500; line-height: 1.35; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 14px no-repeat;
  transition: transform 220ms var(--ease-out);
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding-bottom: 24px; max-width: 64ch; color: var(--ink-soft); }
.faq-list details[open] p { animation: faq-answer 200ms var(--ease-out); }
@keyframes faq-answer { from { opacity: 0; transform: translateY(-4px); } }
@media (hover: hover) and (pointer: fine) {
  .faq-list summary:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
}
@media (min-width: 960px) {
  .faq-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
  .faq-head { position: sticky; top: 32px; align-self: start; }
}

/* ---------- Agendar visita (bloque oscuro de cierre) ---------- */
.schedule {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  padding-block: var(--section-y);
}
.schedule-grid { display: grid; gap: 40px; }
.schedule h2 { font-size: var(--fs-2xl); line-height: 1.02; }
.schedule-lede { margin-top: 20px; font-size: var(--fs-md); line-height: 1.5; color: var(--on-dark-muted); max-width: 36ch; }
.contact-list { margin-top: 36px; border-top: 1px solid var(--rule-data); }
.contact-list div { padding-block: 14px; border-bottom: 1px solid var(--rule-data); }
.contact-list dt { font-size: var(--fs-xs); color: var(--on-dark-muted); }
.contact-list dd { margin-top: 2px; }
.contact-list a { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; text-decoration-color: var(--on-dark-line); }
@media (hover: hover) and (pointer: fine) { .contact-list a:hover { text-decoration-color: currentColor; } }
.schedule :focus-visible { outline-color: var(--brand-primary-contrast); }

.book-card {
  background: var(--bg);
  color: var(--text);
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
  align-self: start;
}
.book-card :focus-visible { outline-color: var(--focus); }
.book-form { display: grid; gap: 20px; }
.book-form .btn { margin-top: 8px; min-height: 52px; }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }
.book-form input:user-invalid, .book-form select:user-invalid { border-color: var(--brand-label); }
.form-error { font-size: var(--fs-sm); color: var(--brand-label); }
.form-success { outline: none; }
.success-title { font-family: var(--font-display); font-weight: 400; font-variation-settings: "opsz" var(--opsz-small); font-size: var(--fs-xl); line-height: 1; margin-bottom: 12px; }
@media (min-width: 960px) {
  .schedule-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(48px, 7vw, 112px); }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-primary);
  color: var(--brand-primary-contrast);
  border-top: 1px solid var(--on-dark-line);
  padding-block: 56px 32px;
  font-size: var(--fs-sm);
}
.site-footer :focus-visible { outline-color: var(--brand-primary-contrast); }
.footer-grid { display: grid; gap: 36px; }
.footer-brand .brand-logo { width: auto; height: 40px; }
.footer-brand p { margin-top: 14px; color: var(--on-dark-muted); max-width: 30ch; }
.footer-contact { display: grid; gap: 12px; }
.footer-contact dt { font-size: var(--fs-xs); color: var(--on-dark-muted); }
.footer-contact a { text-decoration-color: var(--on-dark-line); }
.footer-nav ul { display: grid; gap: 0; }
.footer-nav a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .footer-nav a:hover, .footer-contact a:hover { text-decoration: underline; text-decoration-color: currentColor; }
}
.footer-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 48px; padding-top: 20px;
  border-top: 1px solid var(--on-dark-line);
  color: var(--on-dark-muted);
  font-size: var(--fs-xs);
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); }
}

/* ---------- Ir arriba (solo desktop) ----------
   Cuadrado con marco interior en bronce, el mismo gesto de ventana del hero.
   Aparece al pasar el hero y se invierte sobre el bloque oscuro de cierre. */
.to-top { display: none; }
@media (min-width: 900px) {
  .to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 40;
    display: grid; place-items: center;
    width: 52px; height: 52px;
    background: var(--brand-primary);
    color: var(--brand-primary-contrast);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms,
                background-color 180ms ease, color 180ms ease;
  }
  .to-top::before {
    content: "";
    position: absolute; inset: 5px;
    border: 1px solid var(--rule-data);
    pointer-events: none;
  }
  .to-top svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 1.5;
    transition: transform 200ms var(--ease-out);
  }
  .to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .to-top:active { transform: scale(0.97); }
  /* Filete oscuro: invisible sobre el bloque oscuro, delimita el botón si cae sobre la tarjeta clara del formulario. */
  .to-top.on-dark { background: var(--brand-primary-contrast); color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary); }
  .to-top.on-dark:focus-visible { outline-color: var(--brand-primary-contrast); }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .to-top:hover { background: var(--primary-hover); }
  .to-top.on-dark:hover { background: color-mix(in srgb, var(--brand-primary-contrast) 84%, var(--brand-primary)); }
  .to-top:hover svg { transform: translateY(-3px); }
}

/* ---------- Barra fija mobile ---------- */
.mobile-bar {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  transition: transform 220ms var(--ease-out);
}
.mobile-bar.is-hidden { transform: translateY(110%); }
@media (max-width: 899px) {
  body { padding-bottom: var(--bar-h); }
}
@media (min-width: 900px) {
  .mobile-bar { display: none; }
}

/* ---------- Odómetro (cuota del estimador y cifras del barrio) ----------
   Cada dígito es una columna 0-9 que se traslada con transform. El valor real
   queda en un span visually-hidden; las columnas van con aria-hidden. */
.odo { display: inline-flex; height: 1.1em; line-height: 1.1; vertical-align: top; overflow: hidden; }
.odo > span { display: block; height: 1.1em; }
.odo-col { position: relative; overflow: hidden; }
.odo-col::before { content: "0"; visibility: hidden; }
.odo-strip {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column;
  transition: transform 420ms var(--ease-out);
}
.odo-strip > span { display: block; height: 1.1em; }

/* ---------- Filtros: las tarjetas que vuelven a aparecer entran ---------- */
.listing-grid.is-filtered .listing {
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  transition-delay: calc(var(--fi, 0) * 30ms);
}
@starting-style {
  .listing-grid.is-filtered .listing { opacity: 0; transform: translateY(8px); }
}

/* ---------- Capa de soporte de scroll ----------
   Los estados iniciales solo existen con html.motion, que el JS agrega si hay
   IntersectionObserver y no hay movimiento reducido. Sin JS, todo en su estado final.
   .is-in dispara la entrada; .is-done quita las transiciones de entrada al terminar. */
[data-reveal] { --reveal-y: 24px; --reveal-dur: 700ms; --reveal-ease: var(--ease-out); --stagger: 70ms; }
[data-reveal="card"] { --reveal-dur: 600ms; }
[data-reveal="block"] { --reveal-dur: 600ms; }
[data-reveal="item"] { --reveal-dur: 500ms; --reveal-y: 16px; --stagger: 80ms; }
.amenities [data-reveal="item"] { --stagger: 60ms; }
[data-reveal="soft"] { --reveal-dur: 500ms; --reveal-y: 12px; }
[data-reveal="clip-up"] { --reveal-dur: 900ms; }
[data-reveal="clip-x"] { --reveal-dur: 900ms; --reveal-ease: var(--ease-in-out); }
@media (max-width: 899px) {
  [data-reveal] { --reveal-y: 12px; }
}

.motion [data-reveal]:not(.is-done) {
  transition:
    opacity var(--reveal-dur) var(--ease-out),
    transform var(--reveal-dur) var(--ease-out),
    clip-path var(--reveal-dur) var(--reveal-ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
/* Activación: un cuadro sin transiciones para que nada anime su salida. */
.motion-setup [data-reveal],
.motion-setup [data-reveal] *,
.motion-setup [data-reveal]::before,
.motion-setup [data-reveal] *::before,
.motion-setup [data-reveal] *::after { transition: none !important; }

/* Entradas con fade y desplazamiento corto */
.motion :is([data-reveal=""], [data-reveal="fade"], [data-reveal="card"], [data-reveal="block"], [data-reveal="item"], [data-reveal="soft"]):not(.is-in) {
  opacity: 0;
  transform: translateY(var(--reveal-y));
}

/* Fotos: revelado de abajo hacia arriba (propiedades y calle) */
.motion [data-reveal="clip-up"]:not(.is-in),
.motion .listing:not(.is-in) .listing-media { clip-path: inset(100% 0 0 0); }
.motion [data-reveal="clip-up"]:not(.is-in) > img,
.motion .listing:not(.is-in) .listing-media > img { transform: scale(1.06); }
.motion .listing:not(.is-done) .listing-media {
  transition: clip-path 800ms var(--ease-out) calc(var(--i, 0) * 70ms);
}
.motion .listing:not(.is-done) .listing-media > img {
  transition: transform 800ms var(--ease-out) calc(var(--i, 0) * 70ms);
}

/* Renders: barrido horizontal de izquierda a derecha */
.motion [data-reveal="clip-x"]:not(.is-in) { clip-path: inset(0 100% 0 0); }
.motion [data-reveal="clip-x"]:not(.is-in) > img { transform: scale(1.04); }
.motion [data-reveal^="clip"]:not(.is-done) > img {
  transition: transform var(--reveal-dur) var(--ease-out) calc(var(--i, 0) * var(--stagger));
}
.motion .dev-render:not(.is-in) figcaption { opacity: 0; }
.motion .dev-render:not(.is-done) figcaption { transition: opacity 200ms ease 900ms; }

/* Avance de obra: la barra se llena y los puntos aparecen en cascada */
.motion .progress:not(.is-in) .progress-bar span { transform: scaleX(0); }
.motion .progress:not(.is-done) .progress-bar span { transition: transform 900ms var(--ease-out); }
.motion .progress:not(.is-in) .timeline li::before { opacity: 0; transform: scale(0.4); }
.motion .progress:not(.is-done) .timeline li::before {
  transition: opacity 250ms ease, transform 250ms var(--ease-out);
  transition-delay: calc(600ms + var(--ti, 0) * 80ms);
}
.timeline li:nth-child(2) { --ti: 1; }
.timeline li:nth-child(3) { --ti: 2; }
.timeline li:nth-child(4) { --ti: 3; }
.timeline li:nth-child(5) { --ti: 4; }

/* Barrio: filetes que se dibujan (el superior primero) */
.motion .hood-stats:not(.is-in)::before,
.motion .hood-stats:not(.is-in) div::after { transform: scaleX(0); }
.motion .hood-stats:not(.is-done)::before { transition: transform 700ms var(--ease-out); }
.motion .hood-stats:not(.is-done) div::after {
  transition: transform 700ms var(--ease-out);
  transition-delay: calc(80ms + var(--ci, 0) * 80ms);
}
.hood-stats div:nth-child(2) { --ci: 1; }
.hood-stats div:nth-child(3) { --ci: 2; }
.hood-stats div:nth-child(4) { --ci: 3; }
.hood-stats div:nth-child(5) { --ci: 4; }
.hood-stats div:nth-child(6) { --ci: 5; }

/* Pasos: el numeral se activa al pasar */
.motion .step-list li:not(.is-active) .step-num { opacity: 0.25; transform: translateY(12px); }

/* Parallax de la foto del hero: solo desktop, solo con scroll-driven animations.
   La foto no cambia de caja (sigue en inset 0): un zoom de 5 % le da margen para
   desplazarse 12 px hacia cada lado sin mostrar un borde, incluso con el hero de 640 px. */
@supports (animation-timeline: scroll()) {
  @media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .hero-window[data-slot] > img {
      animation: hero-parallax linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 100vh;
    }
    @keyframes hero-parallax {
      from { transform: translateY(-12px) scale(1.05); }
      to { transform: translateY(12px) scale(1.05); }
    }
  }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
