/* =========================================================================
   FORGE 01 · motion.css
   Intro, revelados con máscara y microanimaciones.
   Todo el contenido es visible en reposo: las animaciones parten de un
   estado legible y se desactivan con "reducir movimiento".
   ========================================================================= */

/* ---------- 01 · Intro: líneas técnicas y encendido ---------- */
.intro {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: var(--bg); transition: opacity 0.7s var(--ease-out), visibility 0s 0.7s;
}
.intro.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro:not(.is-playing) { display: none; }
.intro__lines { position: absolute; width: min(90vw, 760px); height: auto; opacity: 0.5; }
.intro__lines path, .intro__lines rect {
  fill: none; stroke: var(--volt); stroke-width: 0.8;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: draw 1.6s var(--ease-in-out) forwards;
}
.intro__lines path:nth-child(2) { animation-delay: 0.15s; }
.intro__lines path:nth-child(3) { animation-delay: 0.3s; stroke: var(--line-strong); }
.intro__lines rect { animation-delay: 0.45s; stroke: var(--frost); }
.intro__brand { position: relative; display: grid; gap: 0.75rem; justify-items: center; text-align: center; padding: 0 16px; }
.intro__logo {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(3.6rem, 14vw, 9rem); line-height: 0.85; letter-spacing: 0.03em;
  color: var(--frost); opacity: 0.08; animation: power-on 1.4s 0.6s steps(1) forwards, glow 1.2s 1.2s var(--ease-out) forwards;
}
.intro__logo span { color: var(--volt-text); margin-left: 0.1em; }
.intro__tag { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); opacity: 0; animation: fade 0.8s 1.5s forwards; }
.intro__skip {
  position: absolute; right: var(--gutter); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: none; border: 1px solid var(--line-strong); color: var(--steel); border-radius: var(--radius);
  min-height: 40px; padding: 0 1rem; cursor: pointer; font-size: 0.85rem;
}
.intro__skip:hover { color: var(--frost); border-color: var(--frost); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
/* Parpadeo de encendido, como un tubo de luz que arranca */
@keyframes power-on {
  0% { opacity: 0.08; } 12% { opacity: 0.6; } 18% { opacity: 0.15; } 30% { opacity: 0.9; } 36% { opacity: 0.4; } 50%, 100% { opacity: 1; }
}
@keyframes glow { to { text-shadow: 0 0 40px rgba(47, 123, 255, 0.45); } }

/* ---------- Revelados del contenido (activados por JS con .is-in) ---------- */
.reveal { transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out), clip-path 0.9s var(--ease-out); }
.js .reveal-ready .reveal:not(.is-in) { opacity: 0.001; transform: translateY(18px); }
.js .reveal-ready .step:not(.is-in) { clip-path: inset(0 0 100% 0); }
.step { clip-path: inset(0 0 0 0); }
.js .reveal-ready .perf__row:not(.is-in) [role="cell"]::before { background-size: 0% 100%; }
.perf__row [role="cell"]::before { background-repeat: no-repeat; transition: background-size 1s var(--ease-out); }

/* Indicador de scroll del hero */
.hero__hint span { display: block; width: 1px; height: 28px; background: linear-gradient(var(--frost), transparent); animation: hint 2s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: scaleY(0.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* ---------- Reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-enabled) *, html:not(.motion-enabled) *::before, html:not(.motion-enabled) *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  html:not(.motion-enabled) .intro { display: none !important; }
  html.js:not(.motion-enabled) .reveal-ready .reveal:not(.is-in),
  html.js:not(.motion-enabled) .reveal-ready .step:not(.is-in) { opacity: 1; transform: none; clip-path: none; }
}
