:root {
  --ivory: #f3eee6;
  --stone: #e4dacb;
  --ink: #1c1b19;
  --ink-soft: #5b564e;
  --night: #121722;
  --night-2: #1b2230;
  --brass: #a07f4f;
  --brass-soft: #c9ad7f;
  --ok: #6f8f6a;
  --hold: #c19a52;
  --sold: #8a8580;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --section: clamp(80px, 12vw, 160px);
  --r-sm: 8px;
  --r-md: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--ivory); }
body { font-variant-numeric: lining-nums; font-family: var(--sans); color: var(--ink); background: var(--ivory); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--brass-soft); margin-bottom: 18px; }
.eyebrow--dark { color: var(--brass); }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -.01em; max-width: 16ch; }
.h2--light { color: var(--ivory); }

.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 14px; letter-spacing: .02em; transition: background .3s, color .3s, transform .3s; }
.btn:active { transform: scale(.97); }
.btn--ghost { border: 1px solid currentColor; }
.btn--ghost:hover, .btn--ghost:active { background: var(--ivory); color: var(--ink); }
.btn--light { background: var(--ivory); color: var(--ink); }
.btn--light:hover, .btn--light:active { background: var(--brass-soft); }

/* NAV */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px var(--gutter); color: var(--ivory); transition: background .4s, color .4s, padding .4s; }
.nav.is-solid { background: rgba(243, 238, 230, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); padding-block: 12px; }
.nav__brand { font-family: var(--serif); font-size: 26px; letter-spacing: .04em; }
.nav__links { display: flex; gap: 28px; font-size: 13px; letter-spacing: .04em; }
.nav__links a { opacity: .8; transition: opacity .2s; }
.nav__links a:hover, .nav__links a:active { opacity: 1; }
.nav__cta { min-height: 40px; padding: 0 18px; font-size: 13px; }
@media (max-width: 900px) { .nav__links { display: none; } }

/* HERO */
.hero { position: relative; height: 100dvh; min-height: 560px; overflow: hidden; color: var(--ivory); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { transform-origin: 50% 40%; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,22,.45) 0%, rgba(10,14,22,0) 30%, rgba(10,14,22,0) 50%, rgba(10,14,22,.7) 100%); }
.hero__content { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(56px, 10vh, 110px); }
.hero__title { font-family: var(--serif); font-weight: 400; font-size: clamp(64px, 13vw, 200px); line-height: .9; letter-spacing: -.02em; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
@media (max-width: 760px) { .hero__scrim { background: linear-gradient(180deg, rgba(10,14,22,.45) 0%, rgba(10,14,22,0) 25%, rgba(10,14,22,.1) 45%, rgba(10,14,22,.85) 100%); } .hero__scroll { display: none; } }
.hero__title span { display: inline-block; }
.hero__lead { margin-top: 18px; max-width: 34ch; font-size: clamp(17px, 1.6vw, 21px); opacity: .9; }
.hero__scroll { position: absolute; right: var(--gutter); bottom: clamp(56px, 10vh, 110px); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; writing-mode: vertical-rl; opacity: .8; }
.hero__scroll::after { content: ""; display: inline-block; width: 1px; height: 48px; margin-top: 12px; background: currentColor; }

/* INTRO */
.intro { padding: var(--section) var(--gutter); }
.intro__text { font-family: var(--serif); font-size: clamp(26px, 3.2vw, 44px); line-height: 1.25; max-width: 30ch; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; margin-top: clamp(56px, 8vw, 110px); border-top: 1px solid rgba(28,27,25,.15); padding-top: 28px; }
.stat dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.stat dd { font-family: var(--serif); font-size: clamp(40px, 5vw, 72px); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:last-child { grid-column: span 2; } }

/* CASONA */
.casona { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: 0 var(--gutter) var(--section); }
.casona__media { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-sm); }
.casona__copy p:not(.eyebrow) { margin-top: 22px; max-width: 46ch; color: var(--ink-soft); }
.casona__copy .h2 { margin-bottom: 8px; }
.casona .sign { font-size: 13px; letter-spacing: .04em; color: var(--brass) !important; }
@media (max-width: 860px) { .casona { grid-template-columns: 1fr; } .casona__media { aspect-ratio: 4 / 3; } }

/* GALERÍA */
.gallery { padding: var(--section) 0; background: var(--stone); overflow: hidden; }
.gallery__head { padding: 0 var(--gutter); margin-bottom: 48px; }
.gallery__track { display: flex; gap: 20px; padding: 0 var(--gutter); width: max-content; }
.g-item { position: relative; height: clamp(320px, 62vh, 640px); aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-sm); cursor: zoom-in; }
.g-item--wide { aspect-ratio: 16 / 10; }
.g-item img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.g-item:hover img { transform: scale(1.04); }
.g-item figcaption { position: absolute; left: 16px; bottom: 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory); text-shadow: 0 1px 12px rgba(0,0,0,.5); }
@media (max-width: 860px) {
  .gallery__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .gallery__track::-webkit-scrollbar { display: none; }
  .g-item { flex: 0 0 auto; height: 58vh; scroll-snap-align: center; }
  .g-item--wide { height: 42vh; align-self: center; }
}

/* RESIDENCIAS */
.res { background: var(--night); color: var(--ivory); padding: var(--section) var(--gutter); }
.res__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 48px; }
.res__head .eyebrow { width: 100%; margin-bottom: -8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(243,238,230,.25); font-size: 13px; transition: background .25s, color .25s, border-color .25s; }
.chip:hover, .chip:active { border-color: var(--ivory); }
.chip.is-on { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.res__body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.stack { list-style: none; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 96px; }
.stack button { width: 100%; min-height: 40px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 0 14px; border-radius: var(--r-sm); background: var(--night-2); text-align: left; font-size: 13px; transition: background .25s, opacity .25s, transform .25s; }
.stack button:hover, .stack button:active { background: #263043; }
.stack button.is-on { background: var(--ivory); color: var(--ink); }
.stack button.is-dim { opacity: .3; }
.stack__n { font-family: var(--serif); font-size: 20px; }
.stack__uso { color: inherit; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack__pips { display: flex; gap: 4px; }
.pip { width: 8px; height: 8px; border-radius: 999px; }
.floor__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.floor__uso { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass-soft); }
.floor__name { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.tag-muestra { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; border: 1px dashed var(--brass-soft); color: var(--brass-soft); white-space: nowrap; }
.floor__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.floor__plan { background: #fff; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1 / 1; }
.floor__plan img { object-fit: contain; padding: 8px; transform: scale(1.18); }
.floor__detail { color: rgba(243,238,230,.75); max-width: 60ch; }
.floor__detail:empty { display: none; }
.units { list-style: none; display: grid; gap: 12px; margin-top: 16px; }
.floor__detail:empty + .units { margin-top: 0; }
@media (max-width: 1100px) { .floor__grid { grid-template-columns: 1fr; } .floor__plan { aspect-ratio: 4 / 3; } .units { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.unit { padding: 18px 20px; border-radius: var(--r-md); background: var(--night-2); transition: opacity .3s; }
.unit.is-dim { opacity: .3; }
.unit__top { display: flex; justify-content: space-between; align-items: center; }
.unit__id { font-family: var(--serif); font-size: 30px; }
.unit__state { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.unit__meta { margin-top: 6px; font-size: 14px; color: rgba(243,238,230,.75); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin: 0 6px 0 18px; }
.dot:first-child { margin-left: 0; }
.dot--disponible, .pip--disponible { background: var(--ok); }
.dot--reservada, .pip--reservada { background: var(--hold); }
.dot--vendida, .pip--vendida { background: var(--sold); }
.legend { margin-top: 40px; font-size: 13px; color: rgba(243,238,230,.7); }
@media (max-width: 860px) {
  .res__body { grid-template-columns: 1fr; }
  .stack { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
  .stack::-webkit-scrollbar { display: none; }
  .stack li { flex: 0 0 auto; }
  .stack button { grid-template-columns: auto; justify-items: center; min-height: 56px; min-width: 64px; gap: 4px; padding: 8px 12px; }
  .stack__uso { display: none; }
}

/* AMENITIES */
.amen { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: var(--section) var(--gutter); }
.amen__list { list-style: none; margin-top: 36px; border-top: 1px solid rgba(28,27,25,.15); }
.amen__list li { padding: 16px 0; border-bottom: 1px solid rgba(28,27,25,.15); font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); }
.amen__plan { background: #fff; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3; }
.amen__plan img { object-fit: contain; padding: 16px; }
.amen__plan figcaption { display: none; }
@media (max-width: 860px) { .amen { grid-template-columns: 1fr; } }

/* TERMINACIONES */
.spec { padding: 0 var(--gutter) var(--section); }
.spec__head { margin-bottom: 48px; }
.spec__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(28,27,25,.15); border: 1px solid rgba(28,27,25,.15); border-radius: var(--r-md); overflow: hidden; }
.spec__grid article { background: var(--ivory); padding: clamp(24px, 3vw, 40px); }
.spec__grid h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin-bottom: 10px; }
.spec__grid p { color: var(--ink-soft); font-size: 15px; }
.tbc { border-bottom: 1px dashed var(--brass); color: var(--brass); }
@media (max-width: 860px) { .spec__grid { grid-template-columns: 1fr; } }

/* AVANCE */
.prog { background: var(--night); color: var(--ivory); padding: var(--section) var(--gutter); }
.prog__head { margin-bottom: 64px; }
.prog__note { margin-top: 18px; max-width: 52ch; color: rgba(243,238,230,.7); }
.timeline { list-style: none; position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: rgba(243,238,230,.2); }
.timeline__fill { position: absolute; left: 0; top: 7px; height: 1px; background: var(--brass-soft); width: 0; }
.hito { position: relative; padding-top: 32px; }
.hito::before { content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 999px; background: var(--night); border: 1px solid rgba(243,238,230,.4); }
.hito--hecho::before { background: var(--brass-soft); border-color: var(--brass-soft); }
.hito--actual::before { background: var(--night); border: 2px solid var(--brass-soft); box-shadow: 0 0 0 6px rgba(201,173,127,.18); }
.hito__t { font-family: var(--serif); font-size: 22px; line-height: 1.15; }
.hito__d { margin-top: 8px; font-size: 13px; color: rgba(243,238,230,.65); }
.hito__s { margin-top: 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-soft); }
.hito--pendiente .hito__s { color: rgba(243,238,230,.45); }
@media (max-width: 960px) {
  .timeline { grid-template-columns: 1fr; gap: 28px; padding-left: 36px; }
  .timeline::before, .timeline__fill { left: 7px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .timeline__fill { height: 0; bottom: auto; }
  .hito { padding-top: 0; }
  .hito::before { left: -36px; }
}

/* UBICACIÓN */
.loc { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: var(--section) var(--gutter); }
.loc__copy p:not(.eyebrow) { margin-top: 22px; color: var(--ink-soft); max-width: 46ch; }
.loc__addr { font-weight: 600; color: var(--ink) !important; }
.loc__map { aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--stone); }
.loc__map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.85) contrast(1.05); }
@media (max-width: 860px) { .loc { grid-template-columns: 1fr; } }

/* CTA */
.cta { position: relative; min-height: 80vh; display: grid; place-items: center; text-align: center; overflow: hidden; }
.cta__media { position: absolute; inset: 0; }
.cta__scrim { position: absolute; inset: 0; background: rgba(10,14,22,.55); }
.cta__content { position: relative; display: grid; justify-items: center; gap: 36px; padding: 0 var(--gutter); }
.cta .h2 { max-width: 18ch; }

/* FOOTER */
.foot { padding: 48px var(--gutter); display: grid; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.foot__brand { font-family: var(--serif); font-size: 28px; color: var(--ink); }
.foot__ver { color: var(--brass); }

/* LIGHTBOX */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,14,.94); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { width: auto; height: auto; max-width: 100%; max-height: 90dvh; object-fit: contain; border-radius: var(--r-sm); }
.lightbox__close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 999px; background: rgba(243,238,230,.12); color: var(--ivory); font-size: 18px; }

/* REVEAL (solo con JS) */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal-img { clip-path: inset(12% 0 12% 0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal-img { clip-path: none; }
}

/* Galería fijada en escritorio: entra entera en el viewport */
@media (min-width: 861px) {
  .gallery { height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 96px 0 40px; }
  .gallery__head { margin-bottom: 32px; display: flex; align-items: baseline; gap: 32px; }
  .gallery__head .eyebrow { margin: 0; }
  .gallery__head .h2 { max-width: none; font-size: clamp(32px, 3.4vw, 52px); }
  .g-item { height: calc(100dvh - 260px); max-height: 640px; }
}
