/* =====================================================================
   Animación de entrada de AgendaVirtual (la arma intro.js).
   Un solo movimiento de cámara: empezamos DENTRO de la hoja del día
   (horas, dos citas y la línea roja de "ahora"), la cámara se aleja y
   descubre que todo era el ícono de la app; luego aparece el nombre.
   Tiempos en ms sobre un total de ~2 900.
   ===================================================================== */
.intro {
  --tinta: #1b1f3b;
  --papel: #f6f6fb;
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--papel);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.intro-escena {
  position: absolute; left: 50%; top: 50%;
  width: var(--s0); height: var(--s0);
  transform: translate(calc(-50% + var(--dx)), -50%);
  border-radius: 23%;
  will-change: transform;
  animation: intro-camara 700ms cubic-bezier(.76, 0, .24, 1) 1050ms both;
}
.intro-escena svg { display: block; width: 100%; height: 100%; }
.intro-escena::after {   /* sombra que aparece al alejarse */
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  box-shadow: 0 calc(var(--s0) * .09) calc(var(--s0) * .16) calc(var(--s0) * -.06) rgba(27, 31, 59, .45);
  opacity: 0;
  animation: intro-aparecer 400ms ease-out 1500ms both;
}
@keyframes intro-camara {
  from { transform: translate(calc(-50% + var(--dx)), -50%) scale(1); }
  to   { transform: translate(-50%, calc(-50% - var(--sube))) scale(var(--k)); }
}

/* Piezas del ícono (coordenadas del viewBox 0-100). */
.intro .i-hora {
  stroke-dasharray: 64; stroke-dashoffset: 64;
  animation: intro-trazar 500ms cubic-bezier(.6, 0, .2, 1) both;
}
.intro .i-hora:nth-of-type(1) { animation-delay: 80ms; }
.intro .i-hora:nth-of-type(2) { animation-delay: 200ms; }
.intro .i-cita {
  transform-box: fill-box; transform-origin: 50% 0;
  animation: intro-asentar 520ms cubic-bezier(.2, .9, .3, 1.25) both;
}
.intro .i-cita-a { animation-delay: 260ms; }
.intro .i-cita-b { animation-delay: 430ms; }
.intro .i-linea {
  stroke-dasharray: 67; stroke-dashoffset: 67;
  animation: intro-trazar 430ms cubic-bezier(.6, 0, .2, 1) 660ms both;
}
.intro .i-punto {
  transform-box: fill-box; transform-origin: center;
  animation: intro-punto 380ms cubic-bezier(.3, 1.6, .5, 1) 600ms both;
}
.intro .i-pulso {
  transform-box: fill-box; transform-origin: center;
  opacity: 0;
  animation: intro-pulso 700ms ease-out 960ms both;
}
@keyframes intro-trazar  { to { stroke-dashoffset: 0; } }
@keyframes intro-asentar { from { opacity: 0; transform: translateY(-14%) scaleY(.55); } to { opacity: 1; transform: none; } }
@keyframes intro-punto   { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes intro-pulso   { 0% { opacity: 0; transform: scale(1); } 1% { opacity: .55; } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes intro-aparecer { to { opacity: 1; } }

/* Nombre: letra por letra desde una línea base oculta. */
.intro-marca {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(calc(var(--final) * .5 - var(--sube) + 26px));
  text-align: center; color: var(--tinta);
  pointer-events: none;
}
.intro-nombre {
  display: inline-flex; overflow: hidden; padding-bottom: .08em;
  font: 700 clamp(1.9rem, 6vw, 2.6rem)/1.05 "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  letter-spacing: -0.035em;
}
.intro-nombre span {
  display: inline-block;
  animation: intro-letra 520ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(1480ms + var(--i) * 26ms);
}
@keyframes intro-letra { from { transform: translateY(105%); } }
.intro-lema {
  display: block; margin-top: 6px;
  font: 500 .95rem/1.3 "Instrument Sans", system-ui, sans-serif; color: #5b5f7c;
  animation: intro-lema 500ms ease-out 1900ms both;
}
@keyframes intro-lema { from { opacity: 0; transform: translateY(6px); } }

/* Salida: el telón se desvanece y el ícono avanza un poco hacia la persona. */
.intro.saliendo { animation: intro-salir 420ms cubic-bezier(.4, 0, .2, 1) forwards; pointer-events: none; }
@keyframes intro-salir { to { opacity: 0; transform: scale(1.04); } }

/* Reducir movimiento: se muestra el logo quieto y se desvanece. */
@media (prefers-reduced-motion: reduce) {
  .intro *, .intro *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}
