:root {
  --azul: #2e3092;
  --azul-profundo: #1a1b5c;
  --celeste: #27aae1;
  --papel: #f3f5fb;
  --tinta: #14153d;
  --tinta-suave: #4a4c78;
  --linea: #d9ddef;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gut: clamp(20px, 5vw, 72px);
  font-family: "Montserrat", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { margin: 0; font-weight: 900; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--celeste);
}
.eyebrow--dark { color: var(--azul); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: 0 1.5rem;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 .9375rem/1 "Montserrat", sans-serif; text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: #fff; color: var(--azul); }
.btn--primary svg { transition: transform .3s var(--ease); }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--lg { min-height: 56px; padding: 0 2rem; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--celeste); color: #fff; }
  .btn--primary:hover svg { transform: translateX(4px); }
  .btn--ghost:hover { background: #fff; color: var(--azul); border-color: #fff; }
}
:focus-visible { outline: 3px solid var(--celeste); outline-offset: 3px; }

/* Header */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) var(--gut) 0;
}
.top__logo img { width: clamp(124px, 14vw, 160px); height: auto; }
.top__cta { min-height: 42px; padding: 0 1.25rem; font-size: .8125rem; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(39,170,225,.28), transparent 60%),
    var(--azul);
  color: #fff;
  padding: 120px var(--gut) 260px;
}
.hero__inner { position: relative; z-index: 2; max-width: 1100px; }
.hero__title {
  font-size: clamp(2.6rem, 8.5vw, 6.5rem);
  margin-bottom: 2.25rem;
}
.hero__title em { font-style: normal; color: var(--celeste); }
.line { display: block; overflow: hidden; padding-bottom: .08em; }
.line > span { display: inline-block; animation: rise 1s var(--ease) both; }
.line:nth-child(2) > span { animation-delay: .12s; }
@keyframes rise { from { transform: translateY(105%); } }

.plates { display: flex; gap: clamp(10px, 2vw, 20px); list-style: none; margin: 0 0 2.5rem; padding: 0; perspective: 800px; }
.plate {
  width: clamp(88px, 17vw, 150px); aspect-ratio: 1;
  display: grid; place-items: center; align-content: center; gap: 2px;
  border: 2px solid rgba(255,255,255,.7); border-radius: 18px;
  background: rgba(255,255,255,.06);
  animation: flip .9s var(--ease) both; animation-delay: calc(.5s + var(--i) * .14s);
  transform-origin: top center;
}
.plate b { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 900; line-height: 1; }
.plate span { font-size: .625rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.plate--key { background: #fff; color: var(--azul); border-color: #fff; }
@keyframes flip { from { opacity: 0; transform: rotateX(-90deg); } }

.hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.5rem; }
.price { margin: 0; line-height: 1; }
.price small { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--celeste); margin-bottom: .5rem; }
.price strong { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Fachada */
.facade { position: absolute; inset: auto 0 0 0; width: 100%; height: clamp(170px, 26vw, 300px); z-index: 1; }
.facade__lines { stroke: rgba(255,255,255,.55); stroke-width: 2; }
.facade__lines path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s var(--ease) forwards; animation-delay: .6s; }
.facade__lines rect { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) forwards; animation-delay: calc(1.6s + var(--d, 0s)); }
.facade__lines rect.on { fill: rgba(39,170,225,.35); stroke: var(--celeste); animation: draw 1.2s var(--ease) forwards, glow 4s ease-in-out infinite; animation-delay: calc(1.6s + var(--d, 0s)), calc(3s + var(--d, 0s)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { 50% { fill: rgba(39,170,225,.1); } }
.facade__sun circle { fill: none; stroke: var(--celeste); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) 1s forwards; }
.facade__sun circle { pathLength: 1; }

/* Datos */
.specs { background: #fff; border-bottom: 1px solid var(--linea); }
.specs__grid { max-width: 1200px; margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); }
.specs__grid li { padding: clamp(28px, 5vw, 56px) var(--gut) clamp(28px, 5vw, 56px) clamp(16px, 3vw, 40px); border-left: 1px solid var(--linea); }
.specs__grid li:first-child { border-left: 0; }
.specs__grid b { display: block; font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 900; color: var(--azul); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.specs__grid b i { font-style: normal; font-size: .45em; margin-left: .1em; }
.specs__grid li > span { display: block; margin-top: .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-suave); }
@media (max-width: 720px) {
  .specs__grid { grid-template-columns: 1fr 1fr; }
  .specs__grid li:nth-child(3) { border-left: 0; }
  .specs__grid li:nth-child(n+3) { border-top: 1px solid var(--linea); }
}

/* Descripción */
.about, .place { max-width: 1200px; margin: 0 auto; padding: clamp(64px, 10vw, 140px) var(--gut); display: grid; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about { grid-template-columns: 1.1fr .9fr; }
.about h2, .place h2, .gallery h2 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); color: var(--azul); margin-bottom: 1.5rem; }
.about__photo { margin: 0; }
.about__frame { position: relative; isolation: isolate; }
.about__frame img { border-radius: 20px; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; box-shadow: 0 30px 60px -30px rgba(26,27,92,.45); }
.about__frame::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--celeste); border-radius: 20px; z-index: -1; }
.about__photo figcaption { margin-top: 2rem; font-size: .8125rem; color: var(--tinta-suave); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; margin: 2rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--linea); }
.facts dt { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tinta-suave); }
.facts dd { margin: .2rem 0 0; font-weight: 500; }
@media (max-width: 860px) {
  .about, .place { grid-template-columns: 1fr; }
  .about__photo { max-width: 420px; margin: 0 18px 18px 0; }
}

/* Galería */
.gallery { background: var(--azul-profundo); color: #fff; padding: clamp(64px, 9vw, 120px) 0; overflow: hidden; }
.gallery__head { padding: 0 var(--gut); max-width: 1200px; margin: 0 auto 2.5rem; }
.gallery h2 { color: #fff; margin-bottom: .75rem; }
.gallery__head p { opacity: .75; margin: 0; }
.gallery__track {
  display: flex; gap: clamp(12px, 2vw, 22px);
  overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  padding: 0 var(--gut) 8px; scrollbar-width: none; cursor: grab;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.drag { cursor: grabbing; scroll-snap-type: none; }
.shot {
  flex: 0 0 clamp(210px, 62vw, 330px); aspect-ratio: 3 / 4;
  padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #000; cursor: zoom-in;
  scroll-snap-align: start; position: relative;
  transition: transform .5s var(--ease);
}
.shot:nth-child(even) { transform: translateY(28px); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.shot::after { content: attr(data-n); position: absolute; left: 14px; bottom: 12px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
@media (hover: hover) { .shot:hover img { transform: scale(1.05); } }
.gallery__track { padding-bottom: 44px; }
.gallery__bar { margin: 1.5rem var(--gut) 0; height: 2px; background: rgba(255,255,255,.18); border-radius: 2px; }
.gallery__bar i { display: block; height: 100%; width: 20%; background: var(--celeste); border-radius: 2px; transform-origin: left; }

/* Barrio */
.place { grid-template-columns: 1.2fr .8fr; }
.place__photo { margin: 0; }
.place__photo img { width: 100%; border-radius: 20px; aspect-ratio: 16 / 9; object-fit: cover; }
.link { font-weight: 700; color: var(--azul); text-decoration: none; border-bottom: 2px solid var(--celeste); padding-bottom: 2px; }
@media (max-width: 860px) { .place { grid-template-columns: 1fr; } .place__photo { order: 2; } }

/* Contacto */
.contact { background: var(--azul); color: #fff; padding: clamp(72px, 11vw, 150px) var(--gut); position: relative; overflow: hidden; }
.contact::after { content: "D"; position: absolute; right: -2vw; bottom: -.22em; font-size: clamp(14rem, 38vw, 34rem); font-weight: 900; line-height: 1; color: rgba(255,255,255,.05); pointer-events: none; }
.contact__inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto 0 0; }
.contact h2 { font-size: clamp(2.2rem, 6vw, 4.5rem); margin-bottom: 1.25rem; }
.contact .key { color: var(--celeste); white-space: nowrap; }
.contact p:not(.eyebrow) { max-width: 46ch; opacity: .85; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

/* Footer */
.foot { background: var(--azul-profundo); color: rgba(255,255,255,.8); padding: 56px var(--gut) calc(56px + env(safe-area-inset-bottom)); font-size: .875rem; }
.foot__logo { width: 148px; height: auto; margin-bottom: 1.5rem; }
.foot address { font-style: normal; margin-bottom: 1.5rem; line-height: 1.9; }
.foot a { text-decoration-color: var(--celeste); text-underline-offset: 3px; }
.foot__legal { max-width: 80ch; font-size: .75rem; opacity: .7; margin: 0; }

/* FAB */
.fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--celeste); color: #fff; box-shadow: 0 10px 30px -8px rgba(26,27,92,.6);
  transform: translateY(90px); transition: transform .5s var(--ease);
}
.fab.show { transform: none; }
.fab:active { transform: scale(.94); }

/* Lightbox */
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; }
dialog::backdrop { background: rgba(10,10,40,.92); }
dialog[open] { display: grid; place-items: center; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
#lbImg { max-height: 88dvh; max-width: 92vw; width: auto; border-radius: 12px; }
.lb__close, .lb__nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.lb__close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lb__nav { top: 50%; translate: 0 -50%; }
.lb__nav--prev { left: 12px; } .lb__nav--next { right: 12px; }

/* Reveal */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
