:root {
  /* paleta tomada de inmobiliariaimperium.com */
  --bg: #0a0a0a;
  --bg-raised: #161513;
  --bg-raised-hover: #1d1c19;
  --fg: #f0ede6;
  --muted: #a9a297;
  --accent: #d8bf82;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  /* el scroll suave lo maneja Lenis (script.js); scroll-behavior nativo entraría en conflicto */
}

/* estado inicial de los elementos que aparecen animados al hacer scroll (ver script.js) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

/* etiqueta pequeña en dorado, mayúsculas, tracking amplio (estilo "EMPECEMOS" de Imperium) */
.hero-eyebrow,
.section-eyebrow,
.feature-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- NAV ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.75rem;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(216, 191, 130, 0.15);
}
.brand-logo { height: 34px; width: auto; display: block; }
.cta-nav { padding: 0.55rem 1.3rem; font-size: 0.85rem; }

/* ---------- RIEL DE NAVEGACIÓN POR AMBIENTE ---------- */
.room-rail {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}
.rail-line {
  position: absolute;
  right: 3.5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(240, 237, 230, 0.15);
  z-index: -1;
}
.rail-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.rail-stop:hover { opacity: 0.8; }
.rail-stop.active { opacity: 1; }
.rail-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  white-space: nowrap;
}
.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  flex-shrink: 0;
  transition: background 0.3s ease, width 0.3s ease, height 0.3s ease;
}
.rail-stop.active .rail-dot {
  background: var(--accent);
  width: 9px;
  height: 9px;
}
@media (max-width: 900px) {
  .room-rail { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh; /* evita saltos por la barra de direcciones en mobile */
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -30px; /* margen extra: deja lugar para el paralax sin mostrar bordes */
  z-index: 0;
}
.hero-bg-inner {
  /* background-image se define inline en el index.html de cada propiedad
     (este archivo es compartido, no puede apuntar a la foto de una en particular) */
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: heroKenBurns 24s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.55) 45%, rgba(10,10,10,0.94) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  gap: 0.4rem;
}
.hero h1 {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
  will-change: transform, opacity;
}
.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  margin: 0;
  will-change: transform, opacity;
}
.hero-meta {
  display: flex;
  gap: 2.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(216, 191, 130, 0.2);
}
.hero-meta div {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.hero-meta div span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  font-style: normal;
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ---------- SCROLLYTELLING (video que avanza con el scroll) ---------- */
.scrolly {
  position: relative;
  height: 500vh; /* alto total del "recorrido": más alto = scroll más lento/largo */
  height: 500dvh;
}

.scrolly-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh; /* evita saltos por la barra de direcciones en mobile */
  overflow: hidden;
  background: #000;
}

#tour-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  z-index: 5;
  transition: opacity 0.4s ease;
}
.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* velo oscuro para que el texto siempre se lea */
.scrolly-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.feature {
  position: absolute;
  left: 6%;
  right: 6%; /* junto con max-width: se angosta sola en pantallas chicas, se limita en las grandes */
  bottom: 10%;
  max-width: 520px;
  pointer-events: none;
  z-index: 2;
  visibility: hidden; /* GSAP (autoAlpha) controla opacity/visibility/transform en tiempo de scroll */
}
.feature-eyebrow { margin-bottom: 0.5rem; }
.feature h2 { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2.6rem); margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 1rem; margin: 0; line-height: 1.5; }

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.15);
  z-index: 3;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

/* ---------- GALERÍA ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: #000;
}
.gallery-item { position: relative; overflow: hidden; }
.gallery-item img {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item h3 {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  margin: 0;
  font-size: 1.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.gallery-item p {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  margin: 0;
  color: var(--muted);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ---------- FICHA TÉCNICA ---------- */
.specs {
  padding: 6rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.section-eyebrow { display: block; margin-bottom: 0.6rem; }
.specs h2 { font-weight: 800; font-size: 2rem; letter-spacing: -0.01em; margin: 0 0 2.5rem; }
.specs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}
.specs li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-raised);
  border: 1px solid rgba(216, 191, 130, 0.12);
  border-radius: 14px;
  padding: 1.75rem 1.25rem;
  font-size: 1rem;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.specs li:hover {
  transform: translateY(-4px);
  background: var(--bg-raised-hover);
  border-color: rgba(216, 191, 130, 0.35);
}
.spec-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(216, 191, 130, 0.45);
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.spec-icon svg { width: 22px; height: 22px; }
.specs li strong { font-size: 1.15rem; font-weight: 700; }
.specs li span:last-child { color: var(--muted); font-size: 0.85rem; }

/* ---------- CONTACTO ---------- */
.contact {
  padding: 6rem 1.5rem;
  text-align: center;
  background: #000;
}
.contact-logo { height: 44px; width: auto; margin-bottom: 1.5rem; }
.contact h2 { font-weight: 800; font-size: 2rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.contact p { color: var(--muted); margin-bottom: 2.5rem; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.agent-card {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-raised);
  border: 1px solid rgba(216, 191, 130, 0.18);
  border-radius: 999px;
  padding: 0.6rem 1.5rem 0.6rem 0.6rem;
}
.agent-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.agent-initials { color: #1a1a1a; font-weight: 700; font-size: 1rem; }
.agent-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.agent-info { display: flex; flex-direction: column; text-align: left; gap: 0.15rem; }
.agent-info strong { font-size: 1rem; }
.agent-info span { font-size: 0.82rem; color: var(--muted); }
.agent-info .agent-phone { color: var(--accent); }
.cta {
  display: inline-block;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 999px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.cta:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(216, 191, 130, 0.35);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .gallery-item img { height: 50vh; height: 50dvh; }
}

@media (max-width: 640px) {
  .site-nav { padding: 0.75rem 1.1rem; }
  .brand-logo { height: 26px; }
  .cta-nav { padding: 0.5rem 1rem; font-size: 0.78rem; }

  .hero-meta {
    gap: 1.25rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
  }
  .hero-meta div { font-size: 0.7rem; }
  .hero-meta div span { font-size: 1.2rem; }

  .feature { bottom: 13%; }
  .feature p { font-size: 0.9rem; }

  .gallery-item img { height: 42vh; height: 42dvh; }
  .gallery-item h3 { top: 1rem; left: 1rem; font-size: 1.2rem; }
  .gallery-item p { bottom: 1rem; left: 1rem; right: 1rem; font-size: 0.85rem; }

  .specs { padding: 4rem 1.25rem; }
  .specs h2 { margin-bottom: 1.75rem; }
  .specs ul { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .specs li { padding: 1.35rem 1rem; }

  .contact { padding: 4rem 1.25rem; }
  .agent-card {
    padding: 0.6rem 1.1rem 0.6rem 0.6rem;
    width: 100%;
    max-width: 320px;
  }
  .cta { width: 100%; max-width: 320px; text-align: center; }
}

/* ---------- CATÁLOGO (site/index.html — listado de propiedades) ---------- */
.catalog {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 7rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}
.catalog-eyebrow { display: block; margin-bottom: 0.6rem; text-align: center; }
.catalog-title {
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 3rem;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.catalog-card {
  display: block;
  position: relative;
  width: 100%;
  max-width: 360px; /* con pocas propiedades, evita que la tarjeta se estire a lo ancho de toda la grilla */
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid rgba(216, 191, 130, 0.15);
}
.catalog-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.catalog-card:hover img { transform: scale(1.08); }
.catalog-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.05) 0%, rgba(10,10,10,0.85) 100%);
}
.catalog-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1.25rem;
}
.catalog-card-info span { display: block; color: var(--accent); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.35rem; }
.catalog-card-info h2 { font-size: 1.3rem; margin: 0 0 0.2rem; }
.catalog-card-info p { margin: 0; color: var(--muted); font-size: 0.9rem; }
