/* ============================================================================
   IFRIT LABS · transition.css
   Overlay de transición compartido entre páginas (paneles + terminal).
   ============================================================================ */

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  --boot-ease: cubic-bezier(0.86, 0, 0.07, 1);
}
.boot-overlay.is-active { pointer-events: auto; }

/* ---------- Paneles superior e inferior ---------- */
.boot-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--black);
  display: block;
  will-change: transform;
  z-index: 1;
}
.boot-panel-top {
  top: 0;
  transform: translateY(-101%);
  transition: transform 0.65s var(--boot-ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.boot-panel-bot {
  bottom: 0;
  transform: translateY(101%);
  transition: transform 0.65s var(--boot-ease);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.7);
}

/* Cuando el overlay está cerrado: paneles ocupan toda la pantalla */
.boot-overlay.is-closed .boot-panel-top { transform: translateY(0); }
.boot-overlay.is-closed .boot-panel-bot { transform: translateY(0); }

/* ---------- Línea central roja ---------- */
.boot-line,
.boot-line-2 {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  transform: translateY(-50%) scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.45s var(--boot-ease),
    opacity 0.3s ease;
  box-shadow:
    0 0 14px var(--red),
    0 0 32px var(--red-glow-soft);
  z-index: 2;
}
.boot-line-2 { height: 1px; opacity: 0; transition-delay: 0.05s; }

.boot-overlay.is-active .boot-line,
.boot-overlay.is-closed .boot-line {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}
.boot-overlay.is-active .boot-line-2,
.boot-overlay.is-closed .boot-line-2 {
  transform: translateY(-50%) scaleX(1);
  opacity: 0.4;
}

/* ---------- Barras decorativas (gauges) — mobile base ---------- */
.boot-bars {
  position: absolute;
  bottom: calc(50% - 70px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}
.boot-overlay.is-closed.is-active .boot-bars { opacity: 1; }
.boot-bars .bar {
  display: block;
  width: 18px;
  height: 100%;
  background: linear-gradient(180deg, var(--red) 0%, transparent 100%);
  opacity: 0.4;
  animation: barPulse 0.9s ease-in-out infinite;
}
.boot-bars .bar:nth-child(2) { animation-delay: 0.1s; }
.boot-bars .bar:nth-child(3) { animation-delay: 0.2s; }
.boot-bars .bar:nth-child(4) { animation-delay: 0.3s; }
.boot-bars .bar:nth-child(5) { animation-delay: 0.4s; }
@keyframes barPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50%      { opacity: 1;   transform: scaleY(1);   }
}

/* ---------- Terminal de texto centrado ---------- */
.boot-terminal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--red);
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 2rem 1rem;
  pointer-events: none;
  z-index: 4;
}
.boot-overlay.is-active.is-closed .boot-terminal { opacity: 1; }

.boot-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 30px;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray-text);
  text-align: center;
}
.boot-headline-mark {
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
}
.boot-headline-text { font-weight: 800; color: var(--white); letter-spacing: 0.28em; }
.boot-headline-id   { color: var(--red); font-weight: 700; letter-spacing: 0.18em; }

.boot-log {
  width: min(640px, 92vw);
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.85;
  letter-spacing: 0.05em;
  color: var(--gray-text);
  white-space: pre-wrap;
  text-align: left;
  min-height: 160px;
  max-height: 50vh;
  overflow: hidden;
  word-break: break-word;
}
.boot-log .line {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  animation: bootLineIn 0.22s var(--ease-out) forwards;
  /* halo oscuro para que el texto destaque siempre por encima del glow rojo */
  text-shadow:
    0 0 4px var(--black),
    0 0 10px var(--black),
    0 0 16px rgba(0, 0, 0, 0.85);
}
.boot-log .line.ok    {
  color: var(--white);
  text-shadow:
    0 0 4px var(--black),
    0 0 10px var(--black),
    0 0 14px var(--white-glow);
}
.boot-log .line.warn  {
  color: var(--red);
  text-shadow:
    0 0 4px var(--black),
    0 0 10px var(--black),
    0 0 14px var(--red-glow);
}
.boot-log .line.dim   {
  color: var(--gray-mute);
  text-shadow: 0 0 4px var(--black), 0 0 10px var(--black);
}
.boot-log .line .arrow { color: var(--red); margin-right: 0.4em; font-weight: 800; }
.boot-log .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--red);
  vertical-align: text-bottom;
  margin-left: 0.2em;
  box-shadow: 0 0 8px var(--red-glow);
  animation: bootCursorBlink 0.7s steps(2) infinite;
}
@keyframes bootLineIn {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bootCursorBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============================================================================
   ▲ Tablet (≥ 720px) — texto más amplio
   ============================================================================ */
@media (min-width: 720px) {
  .boot-headline {
    margin-top: 60px;
    font-size: 0.75rem;
    letter-spacing: 0.28em;
    gap: 0.6rem;
  }
  .boot-headline-text { letter-spacing: 0.32em; }
  .boot-log {
    font-size: 0.85rem;
    line-height: 1.9;
    letter-spacing: 0.06em;
    min-height: 220px;
    margin-top: 1.2rem;
  }
  .boot-bars { bottom: calc(50% - 90px); }
  .boot-bars .bar { width: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-panel-top, .boot-panel-bot { transition-duration: 0.001s !important; }
  .boot-line, .boot-line-2 { transition-duration: 0.001s !important; }
  .boot-bars .bar { animation: none; opacity: 0.6; }
  .boot-log .line { animation-duration: 0.001s !important; }
}
