/* Hero de Torres Systems (solo index.html).
   Fusión del ambiente de "Onyx Glyph Preloader" (reflector que sigue al
   cursor, polvo, grano, viñeta) con la parvada del hero de Talinka: miles
   de partículas orbitan sobre un fondo vino y convergen en el logo de
   Torres Systems con su nombre. El comportamiento vive en hero-fusion.js. */

.tsf-root {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: #F7F4F4;
  --tsf-mx: 0;
  --tsf-my: 0;
  --tsf-y: 42%;
  /* Vino profundo de la marca, más claro al centro */
  background:
    radial-gradient(ellipse 70% 60% at 50% var(--tsf-y), #4a1724 0%, #2a0d15 48%, #13060a 100%);
}

/* Reflector cálido que sigue al cursor */
.tsf-spot {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(
    closest-side at calc(50% + var(--tsf-mx) * 6%) calc(var(--tsf-y) + var(--tsf-my) * 6%),
    rgba(255, 226, 220, 0.14),
    rgba(255, 226, 220, 0.04) 55%,
    transparent 100%
  );
  opacity: 0;
  animation: tsf-fade 2.4s ease 0.2s forwards;
}
.tsf-cone {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 110vmin;
  height: 75%;
  transform: translateX(-50%);
  pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%, transparent 160deg, rgba(255, 232, 226, 0.06) 180deg, transparent 200deg);
  filter: blur(20px);
}
.tsf-flock {
  position: absolute;
  inset: 0;
}
.tsf-flock canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  max-width: none;
}
/* El logo sólido en el que se funden las partículas */
.tsf-logo {
  position: absolute;
  display: block;
  max-width: none;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(255, 226, 220, 0.18));
}
.tsf-dust { position: absolute; inset: 0; pointer-events: none; }
.tsf-mote {
  position: absolute;
  border-radius: 50%;
  background: #fbeae6;
  box-shadow: 0 0 6px rgba(255, 236, 232, 0.6);
  opacity: 0;
  animation: tsf-drift linear infinite;
}
.tsf-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% var(--tsf-y), transparent 40%, rgba(8, 2, 4, 0.7) 100%);
}
.tsf-grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: overlay;
  background-image: var(--tsf-grain, none);
  background-size: 160px 160px;
  animation: tsf-grain 0.9s steps(6) infinite;
}

/* ---- frase y botón, bajo el logo ---- */
.tsf-text {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: var(--tsf-text-top, 72%);
  padding: 0 1.3rem;
  text-align: center;
  pointer-events: none;
}
.tsf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tsf-caption {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #eadfdb;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tsf-cta {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.9rem;
  padding: 0.75rem 1.6rem;
  background: #F7F4F4;
  color: var(--accent);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease 0.45s, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s, background 0.15s ease, color 0.15s ease;
}
.tsf-cta:hover { background: #fff; color: var(--accent-dark); }
.tsf-root.is-formed .tsf-caption,
.tsf-root.is-formed .tsf-cta { opacity: 1; transform: none; }

@keyframes tsf-fade { to { opacity: 1; } }
@keyframes tsf-grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-7%, 4%); }
  40% { transform: translate(5%, -6%); }
  60% { transform: translate(-3%, -9%); }
  80% { transform: translate(8%, 3%); }
  100% { transform: translate(-5%, 7%); }
}
@keyframes tsf-drift {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  20% { opacity: 0.7; }
  80% { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(3vmin, -14vmin, 0); }
}

@media (max-width: 700px) {
  .tsf-root { --tsf-y: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .tsf-grain, .tsf-mote, .tsf-spot { animation: none; }
  .tsf-spot { opacity: 1; }
  .tsf-dust { display: none; }
  .tsf-caption, .tsf-cta { transition: none; }
}

/* ---- Intro al llegar desde Talinka ---- */
.tsi {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 4vh, 2.2rem);
  padding: 0 16px;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #4a1724 0%, #2a0d15 48%, #13060a 100%);
}
html[data-ts-intro="full"] .tsi { display: flex; }
html.ts-intro-done .tsi { display: none; }
.tsi-mark {
  width: clamp(110px, 15vw, 170px);
  height: auto;
  aspect-ratio: 460 / 510;
  overflow: visible;
  transform-origin: 0 0;
}
.tsi-t { fill: #F7F4F4; transform-box: fill-box; transform-origin: 50% 0; }
.tsi-s { fill: none; stroke: #F7F4F4; stroke-width: 44; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tsi-welcome {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #eadfdb;
}
@keyframes tsi-baja { from { transform: scaleY(0); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes tsi-traza { to { stroke-dashoffset: 0; } }
@keyframes tsi-sube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
html[data-ts-intro="full"] .tsi-t { animation: tsi-baja 0.55s cubic-bezier(0.2, 0.7, 0.1, 1) 0.15s both; }
html[data-ts-intro="full"] .tsi-s { animation: tsi-traza 0.95s cubic-bezier(0.6, 0, 0.3, 1) 0.55s forwards; }
html[data-ts-intro="full"] .tsi-welcome { animation: tsi-sube 0.5s ease 1.35s both; }
/* Mientras dura la intro, el ícono de la cápsula espera a recibir el monograma */
html[data-ts-intro="full"]:not(.ts-intro-done) .nav-mark .ts-mark { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .tsi { display: none !important; } }
