/* =====================================================================
   Movimiento — danielsalinasremax.com
   Lo que hace llamativa la entrada: apertura de marca, video aéreo real de
   fondo en la portada, marco de luz en el retrato, palabras que se
   encienden, cursor con etiqueta y detalles de las pestañas.
   Lo usan index.html y en/index.html junto con assets/movimiento.js.
   Con "reducir movimiento" (o sin JavaScript) todo queda quieto y completo.
   ===================================================================== */
:root { --mov-suave: cubic-bezier(.16, 1, .3, 1); }

/* ---------------------------------------------------------------------
   APERTURA DE MARCA
   Una vez por sesión y solo al entrar por Inicio (lo decide el <head>, que
   pone html.intro; el telón es .telon para no chocar con esa clase). Es solo CSS: aunque fallara el JavaScript, el telón sube.
   --------------------------------------------------------------------- */
.telon { display: none; }
html.intro .telon {
  position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center;
  background: radial-gradient(90% 70% at 50% 42%, #0d2360 0%, #061235 45%, #050a18 100%);
  animation: introSube .8s cubic-bezier(.76, 0, .24, 1) .95s forwards;
}
html.intro .telon::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue-light));
}
html.intro-fin .telon { display: none; }
.telon-marca { text-align: center; color: #fff; padding: 0 1.5rem; }
.telon-marca b {
  display: block; font: 700 clamp(2.1rem, 6.4vw, 3.6rem)/1 'Playfair Display', serif; letter-spacing: -.01em;
  opacity: 0; transform: translateY(20px); animation: introTexto .75s var(--mov-suave) .08s forwards;
}
.telon-marca i {
  display: block; width: 0; height: 2px; margin: 1.15rem auto 1rem; background: var(--red);
  animation: introLinea .85s var(--mov-suave) .22s forwards;
}
.telon-marca small {
  display: block; font: 600 .62rem/1.5 'Inter', sans-serif; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255, 255, 255, .62); opacity: 0; transform: translateY(10px);
  animation: introTexto .75s var(--mov-suave) .38s forwards;
}
@keyframes introTexto { to { opacity: 1; transform: none; } }
@keyframes introLinea { to { width: min(190px, 42vw); } }
@keyframes introSube { to { transform: translateY(-101%); visibility: hidden; } }

/* la coreografía de la portada espera a que suba el telón */
html.intro nav#nav { animation-delay: 1.1s; }
html.intro .hero-v2 .hero-tag { animation-delay: 1.25s; }
html.intro .hero-v2 .hl-1 .hli { animation-delay: 1.15s; }
html.intro .hero-v2 .hl-2 .hli { animation-delay: 1.3s; }
html.intro .hero-v2 .hero-role { animation-delay: 1.65s; }
html.intro .hero-v2 .hero-slogan { animation-delay: 1.85s; }
html.intro .hero-v2 .hero-btns { animation-delay: 2.05s; }
html.intro .hero-v2 .busca { animation-delay: 2.25s; }
html.intro .hero-retrato, html.intro .hero-retrato img { animation-delay: 1.25s; }
html.intro .hero-chip.chip-a { animation-delay: 2.05s, 3.2s; }
html.intro .hero-chip.chip-b { animation-delay: 2.25s, 3.9s; }
html.intro .hero-chip.chip-c { animation-delay: 2.45s, 4.6s; }

/* ---------------------------------------------------------------------
   PORTADA: video aéreo real de fondo
   (paneo sobre la foto 360° del dron en San Antonio de las Minas; lo carga
   movimiento.js cuando la portada ya se pintó, y aparece con un fundido)
   --------------------------------------------------------------------- */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.8s ease; pointer-events: none;
}
.hero-velo {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.8s ease;
  background:
    linear-gradient(100deg, rgba(5, 10, 30, .94) 0%, rgba(6, 16, 52, .86) 34%, rgba(7, 26, 86, .58) 62%, rgba(8, 30, 100, .42) 100%),
    linear-gradient(0deg, rgba(5, 10, 24, .9) 0%, rgba(5, 10, 24, 0) 38%),
    linear-gradient(180deg, rgba(5, 10, 24, .62) 0%, rgba(5, 10, 24, 0) 24%);
}
.hero.con-video .hero-video, .hero.con-video .hero-velo { opacity: 1; }
@media (max-width: 900px) {
  .hero-velo {
    background: linear-gradient(180deg, rgba(5, 10, 30, .78) 0%, rgba(6, 16, 52, .74) 38%, rgba(5, 10, 24, .95) 100%);
  }
}

/* ---------------------------------------------------------------------
   PORTADA: "Compra, vende o renta" se enciende palabra por palabra
   --------------------------------------------------------------------- */
.verbo { position: relative; white-space: nowrap; }
.verbo:nth-of-type(2) { --v: 1; }
.verbo:nth-of-type(3) { --v: 2; }
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-slogan .verbo { animation: verboLuz 7.5s ease-in-out infinite; animation-delay: calc(3.6s + var(--v, 0) * 2.5s); }
  html.js .hero-slogan .verbo::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 1px; height: 2px; border-radius: 2px;
    background: var(--red); transform: scaleX(0); transform-origin: 0 50%;
    animation: verboRaya 7.5s ease-in-out infinite; animation-delay: calc(3.6s + var(--v, 0) * 2.5s);
  }
}
@keyframes verboLuz { 0%, 31%, 100% { color: inherit; } 5%, 25% { color: #fff; } }
@keyframes verboRaya {
  0%, 100% { transform: scaleX(0); transform-origin: 0 50%; }
  7%, 24% { transform: scaleX(1); transform-origin: 0 50%; }
  24.1% { transform: scaleX(1); transform-origin: 100% 50%; }
  31% { transform: scaleX(0); transform-origin: 100% 50%; }
}

/* ---------------------------------------------------------------------
   PORTADA: marco de luz que recorre el retrato, inclinación 3D y brillo
   --------------------------------------------------------------------- */
@property --giro { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.hero-retrato::before {
  content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--giro), rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 235deg, rgba(243, 214, 141, .95) 300deg, #fff 322deg, rgba(255, 255, 255, 0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-retrato::before { animation: movGiro 7s linear 2.4s infinite, movAparece 1.4s ease 2.4s forwards; }
  html.intro .hero-retrato::before { animation-delay: 3.2s, 3.2s; }
  html.js .hero-btns .btn-red::before { animation: movBrillo 5.5s ease-in-out 4.2s infinite; }
}
@keyframes movGiro { to { --giro: 360deg; } }
@keyframes movAparece { to { opacity: 1; } }
@keyframes movBrillo { 0%, 78% { left: -80%; } 100% { left: 125%; } }
.hero-retrato { transition: transform .45s ease-out; }
.hero-brillo {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(460px circle at var(--bx, 50%) var(--by, 0%), rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 62%);
}
.hero-retrato.inclinado .hero-brillo { opacity: 1; }

/* ---------------------------------------------------------------------
   CURSOR CON ETIQUETA (solo computadora): "Ver", "Play", "360°"…
   --------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .md-ring::after {
    content: attr(data-txt); position: absolute; inset: 0; display: grid; place-items: center;
    font: 700 .62rem/1 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #fff;
    opacity: 0; transition: opacity .2s;
  }
  .md-ring.md-txt { width: 86px; height: 86px; background: rgba(227, 24, 55, .93); border-color: transparent; }
  .md-ring.md-txt::after { opacity: 1; }
  .md-ring.md-txt + .md-dot { opacity: 0; }
}

/* ---------------------------------------------------------------------
   DETALLES
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  /* las tarjetas de "Sigue explorando" llegan una tras otra */
  .bento.on .bento-c { animation: pesSube .9s var(--mov-suave) backwards; }
  .bento.on .bento-c:nth-child(2) { animation-delay: .07s; }
  .bento.on .bento-c:nth-child(3) { animation-delay: .14s; }
  .bento.on .bento-c:nth-child(4) { animation-delay: .21s; }
  .bento.on .bento-c:nth-child(5) { animation-delay: .28s; }
  .bento.on .bento-c:nth-child(6) { animation-delay: .35s; }
  .bento.on .bento-c:nth-child(7) { animation-delay: .42s; }
  /* el icono de la pestaña abierta da un saltito en la barra del celular */
  .barra-app .activo svg { animation: movSalto .55s var(--mov-suave); }
}
@keyframes movSalto { 0% { transform: scale(.78); } 55% { transform: translateY(-4px) scale(1.22); } 100% { transform: translateY(-1px) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  .hero-video, .hero-velo, .hero-brillo { display: none; }
  .hero-retrato { transition: none; }
}
