/* ── TARVOS SECTOR boot loader ──
   Brand palette only (cyan / purple / pink). No phosphor green/black.
   Maximalist-but-tasteful cyberpunk intro. Full-screen, fully isolated from the
   homepage (the loader injects its own overlay + effect layers; index.html is
   never modified by this file). */

#doai-boot {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 800px at 50% 30%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(900px 700px at 50% 80%, rgba(34,211,238,0.10), transparent 60%),
    #050510;
  color: #e8f6ff;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  overflow: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
#doai-boot.boot-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* lock scroll while booting so the overlay is exactly full-bleed (no scrollbar gutter) */
html.doai-booting, html.doai-booting body { overflow: hidden; }

/* ── faint grid backdrop (perspective floor) ── */
#doai-boot::before {
  content: ""; position: absolute; inset: -2px; pointer-events: none; opacity: 0.28;
  background-image:
    linear-gradient(rgba(0,245,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
}
/* ── scanline sweep (moving bright bar) ── */
#doai-boot::after {
  content: ""; position: absolute; left: 0; right: 0; height: 160px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,245,255,0.07) 50%, transparent);
  animation: bootScan 3.2s linear infinite;
  z-index: 3;
}
@keyframes bootScan { 0% { top: -160px; } 100% { top: 100%; } }

/* ── effect layers (behind the centered panel, non-interactive) ── */
.boot-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* drifting starfield — two parallax depths */
.boot-stars {
  background-repeat: repeat;
  will-change: background-position;
}
.boot-stars-a {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(0,245,255,0.9), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(168,85,247,0.8), transparent),
    radial-gradient(1px 1px at 40% 82%, rgba(255,45,149,0.7), transparent),
    radial-gradient(2px 2px at 86% 22%, rgba(0,245,255,0.6), transparent),
    radial-gradient(1px 1px at 12% 70%, rgba(0,245,255,0.7), transparent),
    radial-gradient(1px 1px at 58% 14%, rgba(168,85,247,0.6), transparent);
  background-size: 280px 280px;
  opacity: 0.55;
  animation: bootStarsA 48s linear infinite;
}
.boot-stars-b {
  background-image:
    radial-gradient(2px 2px at 33% 45%, rgba(255,45,149,0.5), transparent),
    radial-gradient(1px 1px at 78% 75%, rgba(0,245,255,0.6), transparent),
    radial-gradient(1px 1px at 8% 18%, rgba(168,85,247,0.5), transparent),
    radial-gradient(2px 2px at 64% 88%, rgba(0,245,255,0.4), transparent);
  background-size: 440px 440px;
  opacity: 0.35;
  animation: bootStarsB 82s linear infinite;
}
@keyframes bootStarsA { from { background-position: 0 0; } to { background-position: 0 -560px; } }
@keyframes bootStarsB { from { background-position: 0 0; } to { background-position: -440px 440px; } }

/* vignette + chromatic edge glow */
.boot-vignette {
  background:
    radial-gradient(120% 120% at 50% 50%, transparent 52%, rgba(5,5,16,0.88) 100%),
    radial-gradient(150% 90% at 50% 0%, rgba(0,245,255,0.10), transparent 42%),
    radial-gradient(150% 90% at 50% 100%, rgba(255,45,149,0.10), transparent 42%),
    radial-gradient(90% 150% at 0% 50%, rgba(168,85,247,0.08), transparent 42%),
    radial-gradient(90% 150% at 100% 50%, rgba(0,245,255,0.08), transparent 42%);
}

/* full-screen CRT scanlines + subtle flicker */
.boot-crt {
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.16) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
  animation: bootFlicker 5s steps(1) infinite;
}
@keyframes bootFlicker {
  0%, 100% { opacity: 0.6; }
  47% { opacity: 0.52; }
  48% { opacity: 0.72; }
  49% { opacity: 0.5; }
  92% { opacity: 0.66; }
}

.boot-inner { position: relative; z-index: 4; width: min(560px, 86vw); text-align: center; }

.boot-mark {
  font-family: 'Orbitron', sans-serif; font-weight: 900; letter-spacing: 0.18em;
  font-size: clamp(26px, 6vw, 46px);
  color: #00f5ff;
  text-shadow: 0 0 24px rgba(0,245,255,0.55);
  position: relative; margin-bottom: 6px;
  animation: bootMarkJolt 7s steps(1) infinite;
}
.boot-mark .glitch { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; }
.boot-mark .g1 { color: #22d3ee; animation: bootGlitch1 4.5s steps(1) infinite; }
.boot-mark .g2 { color: #ff2d95; animation: bootGlitch2 4.5s steps(1) infinite; }
@keyframes bootGlitch1 {
  0%, 92%, 100% { opacity: 0; transform: translate(0); }
  93% { opacity: 0.7; transform: translate(-3px, 1px); }
  96% { opacity: 0.5; transform: translate(3px, -1px); }
}
@keyframes bootGlitch2 {
  0%, 90%, 100% { opacity: 0; transform: translate(0); }
  91% { opacity: 0.6; transform: translate(2px, -1px); }
  95% { opacity: 0.4; transform: translate(-2px, 1px); }
}
/* periodic hard datamosh jolt on the whole title */
@keyframes bootMarkJolt {
  0%, 96%, 100% { clip-path: none; transform: translate(0,0); }
  97% { clip-path: inset(0 0 58% 0); transform: translate(-5px, 1px); }
  98% { clip-path: inset(46% 0 0 0); transform: translate(5px, -1px); }
  99% { clip-path: inset(20% 0 40% 0); transform: translate(-3px, 0); }
}
/* when we go LIVE, the mark glows hotter */
#doai-boot.live .boot-mark {
  color: #fff;
  text-shadow: 0 0 10px #fff, 0 0 34px rgba(0,245,255,0.9), 0 0 60px rgba(168,85,247,0.6);
}

.boot-sub {
  font-size: 10px; letter-spacing: 0.42em; text-transform: uppercase;
  color: rgba(34,211,238,0.65); margin-bottom: 26px;
}

.boot-log {
  text-align: left; min-height: 176px; font-size: 12px; line-height: 1.7;
  color: rgba(0,245,255,0.85);
  border: 1px solid rgba(0,245,255,0.16); border-radius: 10px;
  background: rgba(10,12,28,0.55); backdrop-filter: blur(6px);
  padding: 14px 16px; margin-bottom: 18px;
  box-shadow: inset 0 0 24px rgba(0,245,255,0.05), 0 0 18px rgba(0,245,255,0.06);
}
/* decrypt glitch pulse when the final line resolves */
.boot-log.decrypt { animation: bootDecrypt 0.9s steps(1) 1; }
@keyframes bootDecrypt {
  0% { transform: translateX(0); opacity: 1; }
  20% { transform: translateX(-4px); clip-path: inset(0 0 30% 0); opacity: 0.7; }
  40% { transform: translateX(4px); clip-path: inset(40% 0 0 0); }
  60% { transform: translateX(-2px); clip-path: inset(10% 0 50% 0); }
  80% { transform: translateX(2px); clip-path: none; }
  100% { transform: translateX(0); opacity: 1; }
}
.boot-line { white-space: pre-wrap; }
.boot-line .ok { color: #2dd4bf; }
.boot-line .warn { color: #ff2d95; text-shadow: 0 0 8px rgba(255,45,149,0.5); }
.boot-caret { display: inline-block; width: 8px; height: 14px; background: #00f5ff; margin-left: 2px; vertical-align: -2px; animation: bootBlink 1s steps(1) infinite; box-shadow: 0 0 8px #00f5ff; }
@keyframes bootBlink { 50% { opacity: 0; } }

.boot-bar { height: 3px; width: 100%; background: rgba(0,245,255,0.12); border-radius: 4px; overflow: hidden; }
.boot-bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #22d3ee, #00f5ff, #6366f1, #ff2d95); box-shadow: 0 0 12px rgba(0,245,255,0.7); transition: width 0.3s ease; }
.boot-pct { margin-top: 8px; font-size: 10px; letter-spacing: 0.3em; color: rgba(0,245,255,0.6); }

.boot-skip {
  margin-top: 18px; font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); background: transparent; border: 1px solid rgba(255,255,255,0.15);
  padding: 7px 16px; border-radius: 20px; cursor: pointer; transition: all 0.2s; font-family: inherit;
  position: relative; z-index: 5;
}
.boot-skip:hover { color: #00f5ff; border-color: rgba(0,245,255,0.5); box-shadow: 0 0 12px rgba(0,245,255,0.2); }

@media (prefers-reduced-motion: reduce) {
  #doai-boot::after,
  .boot-mark, .boot-mark .glitch, .boot-caret,
  .boot-stars-a, .boot-stars-b, .boot-crt,
  .boot-log.decrypt { animation: none !important; }
  .boot-crt { opacity: 0.35; }
}
