/* Two-phase boot — BIOS POST → Win98 cloud splash → click dismiss. spec §4.5 */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.boot-phase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}

.boot-phase.visible {
  opacity: 1;
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

/* ========== Phase 1: authentic BIOS POST ========== */

#boot-bios {
  background: #000;
  color: #c8c8c8;
  /* VT323 reads as period-correct VGA text mode, not dark-mode IDE.
     Consolas fallback if the web font isn't loaded yet; ' Lucida Console'
     + 'Courier New' fallback beyond that. Port of main commit 96435f6. */
  font-family: 'VT323', 'Consolas', 'Lucida Console', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.45;
}

/* Printr cyan tint on the BIOS header — the one manufacturer-brand line */
.boot-bios-line:first-child {
  color: #01aef0;
}

.boot-bios-inner {
  width: min(600px, 92vw);
  white-space: pre-wrap;
}

.boot-bios-line {
  opacity: 0;
}

.boot-bios-line.visible {
  opacity: 1;
}

/* Blinking block cursor on the last BIOS line ("Booting from Primary
   IDE..."). Only renders once the line is visible so it doesn't flash
   ahead of the type-in. Pure CSS via ::after + animation. */
.boot-bios-line.last.visible::after {
  content: '█';
  margin-left: 6px;
  animation: bios-cursor-blink 1.05s steps(2) infinite;
  color: #c8c8c8;
}

@keyframes bios-cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.boot-bios-spacer {
  height: 0.8em;
}

/* ========== Phase 2: Win98 cloud splash ========== */

#boot-splash {
  color: #fff;
  font-family: 'Pixelated MS Sans Serif', 'Microsoft Sans Serif', Tahoma, sans-serif;
  flex-direction: column;
  /* Real cloud photo, tinted blue for Win98 continuity */
  background:
    linear-gradient(180deg, rgba(122, 176, 220, 0.35) 0%, rgba(42, 82, 133, 0.55) 100%),
    url('../assets/sky-clouds.jpg?v=18') center/cover no-repeat;
}

.boot-splash-content {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Printr Mark SVG — real brand asset, gentle wave */
.boot-splash-flag {
  width: 88px;
  height: auto;
  transform-origin: left center;
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
  animation: flag-wave 4.2s ease-in-out infinite;
}

@keyframes flag-wave {
  0%, 100% { transform: perspective(220px) rotateY(-14deg); }
  50%      { transform: perspective(220px) rotateY(-22deg) translateY(-2px); }
}

/* Italic serif wordmark — echoes the Windows 98 logo feel */
.boot-splash-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 700;
  font-style: italic;
  color: #ffffff;
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.35),
    4px 4px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: -1px;
}

.boot-splash-98 {
  color: #01aef0;
  margin-left: 0.15em;
  font-style: normal;
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.4),
    4px 4px 10px rgba(0, 0, 0, 0.35);
}

.boot-splash-sub {
  position: absolute;
  bottom: 104px;
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
}

.boot-splash-progress {
  position: absolute;
  bottom: 56px;
  width: min(320px, 72vw);
  height: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.boot-splash-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  /* Printr CMYK — cyan → magenta → orange → yellow */
  background: linear-gradient(
    90deg,
    #01aef0 0%,
    #d1157a 40%,
    #f26a1d 70%,
    #f8ec1d 100%
  );
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  /* Fill 0→100% once over splash lifetime (matches BootSequence's
     SPLASH_TO_PROMPT_MS = 1500ms). Port of main commit 96435f6 —
     the older infinite slide loop implied "loading forever"; a
     single fill reads as "boot completing". */
  animation: splash-fill 1500ms ease-out forwards;
}

@keyframes splash-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

.boot-click {
  position: absolute;
  bottom: 22px;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transition: opacity 0.4s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}

.boot-click.visible {
  opacity: 1;
  animation: splash-click-blink 1.2s steps(2) infinite;
}

@keyframes splash-click-blink {
  50% { opacity: 0.3; }
}
