/* ═══════════════════════════════════════════════════════════════════════
   PAGE TRANSITION — Military Boot Sequence + Scroll Progress
   z-index layer: 99000 (above everything including modals at 1080)
   No conflicts: all classes prefixed with .zt-
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Boot Sequence Overlay ── */
.zt-boot {
  position: fixed;
  inset: 0;
  z-index: 99000;
  background: var(--z-bg-deep, #0a101e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s;
}

.zt-boot.zt-boot--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Scanline grid background */
.zt-boot::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: zt-gridScan 12s linear infinite;
}

@keyframes zt-gridScan {
  0%   { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Vignette */
.zt-boot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

/* ── Boot Content ── */
.zt-boot__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  padding: 0 2rem;
  text-align: center;
}

/* Logo / Shield */
.zt-boot__logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 2rem;
  position: relative;
}

.zt-boot__logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.3));
}

.zt-boot__logo-ring {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 50%;
  animation: zt-ringPulse 2s ease-out infinite;
}

.zt-boot__logo-ring:nth-child(2) {
  animation-delay: 0.7s;
}

@keyframes zt-ringPulse {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Title */
.zt-boot__title {
  font-family: var(--z-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--z-accent, #f59e0b);
  margin-bottom: 2rem;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

/* ── Terminal Log ── */
.zt-boot__terminal {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
  max-height: 180px;
  overflow: hidden;
  position: relative;
}

.zt-boot__terminal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, rgba(0,0,0,0.4));
  pointer-events: none;
}

.zt-boot__line {
  font-family: var(--z-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.6875rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  animation: zt-lineIn 0.3s ease forwards;
}

.zt-boot__line--ok { color: rgba(0, 255, 136, 0.7); }
.zt-boot__line--warn { color: rgba(255, 191, 36, 0.7); }
.zt-boot__line--accent { color: var(--z-accent, #f59e0b); }
.zt-boot__line--dim { color: rgba(255, 255, 255, 0.25); }

@keyframes zt-lineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Progress Bar ── */
.zt-boot__progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.zt-boot__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--z-accent, #f59e0b), var(--z-accent-light, #fbbf24));
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.zt-boot__progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  bottom: -2px;
  width: 12px;
  background: var(--z-accent-light, #fbbf24);
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.8;
}

/* Progress Label */
.zt-boot__progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--z-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.zt-boot__progress-pct {
  color: var(--z-accent, #f59e0b);
  font-weight: 600;
}

/* ── Glitch Flash (page exit/enter) ── */
.zt-glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 98999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.zt-glitch-overlay.zt-glitch--active {
  visibility: visible;
  animation: zt-glitchFlash 0.4s ease;
}

@keyframes zt-glitchFlash {
  0%   { opacity: 0; }
  8%   { opacity: 1; background: rgba(245, 158, 11, 0.04); transform: translateX(3px); }
  16%  { opacity: 0; transform: translateX(-2px); }
  24%  { opacity: 1; background: rgba(0, 229, 255, 0.03); transform: skewX(-0.5deg); }
  32%  { opacity: 0; transform: skewX(0); }
  48%  { opacity: 0.6; background: rgba(245, 158, 11, 0.02); }
  56%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ── Horizontal scanline on boot ── */
.zt-boot__scanline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.15), transparent);
  z-index: 3;
  animation: zt-scanMove 3s linear infinite;
}

@keyframes zt-scanMove {
  0%   { top: -2px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Floating Data Fragments (visual candy) ── */
.zt-boot__fragments {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.zt-boot__frag {
  position: absolute;
  font-family: var(--z-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.5rem;
  color: rgba(0, 229, 255, 0.08);
  white-space: nowrap;
  animation: zt-fragFloat linear infinite;
}

.zt-boot__frag:nth-child(1) { left: 5%;  animation-duration: 18s; animation-delay: 0s; }
.zt-boot__frag:nth-child(2) { left: 20%; animation-duration: 22s; animation-delay: 2s; }
.zt-boot__frag:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: 1s; }
.zt-boot__frag:nth-child(4) { left: 60%; animation-duration: 20s; animation-delay: 3s; }
.zt-boot__frag:nth-child(5) { left: 80%; animation-duration: 19s; animation-delay: 0.5s; }
.zt-boot__frag:nth-child(6) { left: 92%; animation-duration: 24s; animation-delay: 4s; }

@keyframes zt-fragFloat {
  0%   { top: 110%; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: -10%; opacity: 0; }
}

/* ── Scroll Progress Bar (fixed below navbar, never overlaps navbar) ── */
.zt-scroll-progress {
  position: fixed;
  top: 75px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9;
  pointer-events: none;
  background: transparent;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zt-scroll-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
    var(--z-accent, #f59e0b),
    var(--z-accent-light, #fbbf24),
    var(--z-accent, #f59e0b)
  );
  background-size: 200% 100%;
  animation: zt-scrollGradient 3s linear infinite;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  position: relative;
}

.zt-scroll-progress__fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 80px;
  height: 5px;
  background: linear-gradient(90deg, transparent, var(--z-accent-light, #fbbf24));
  filter: blur(3px);
  opacity: 0.6;
}

@keyframes zt-scrollGradient {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ── Page Exit Transition (for link clicks) ── */
.zt-page-exit {
  animation: zt-pageExit 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes zt-pageExit {
  0%   { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(0.99); filter: blur(2px); }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .zt-boot,
  .zt-boot__line,
  .zt-boot__progress-fill,
  .zt-boot__scanline,
  .zt-boot__frag,
  .zt-boot__logo-ring,
  .zt-glitch-overlay,
  .zt-scroll-progress__fill,
  .zt-page-exit {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .zt-boot {
    display: none !important;
  }

  .zt-boot__line {
    opacity: 1;
    transform: none;
  }
}

/* ── Mobile ── */
@media (max-width: 576px) {
  .zt-boot__terminal {
    padding: 1rem;
    max-height: 140px;
  }

  .zt-boot__line {
    font-size: 0.5625rem;
  }

  .zt-boot__title {
    font-size: 0.5625rem;
  }

  .zt-boot__fragments {
    display: none;
  }
}
