/* ═══════════════════════════════════════════════════════════════════════════
   splash.css  —  Wisdom Oracle retro boot screen
   Standalone file. Zero dependency on styles.css.
   Typeface: monospace stack (terminal aesthetic)
   Palette mirrors app: --bg-base #1e1f22, --accent #f5a623
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin:     0;
  padding:    0;
}

/* ─── Root vars (keep in sync with styles.css palette) ───────────────────── */
:root {
  /* Blend splash with app palette */
  --bg:          #1e1f22;               /* match PWA --bg-base */
  --accent:      #f5a623;               /* saffron (Gita) */
  --accent-dim:  #c07d10;
  --accent-glow: rgba(245, 166, 35, 0.22);

  --lilac:       #512f86;               /* from app lilac buttons */
  --lilac-dim:   #7334d3;

  --green:       #39ff6e;               /* keep for terminal flavor */
  --green-dim:   rgba(57, 255, 110, 0.55);

  --text-muted:  #5c6068;               /* match app text-muted */
  --crt-line:    rgba(255, 255, 255, 0.03);
}

/* ─── Full-screen stage ──────────────────────────────────────────────────── */
html, body {
  width:            100%;
  height:           100%;
  overflow:         hidden;
  background-color: var(--bg);
  color:            var(--green);
  font-family:      'Courier New', Courier, 'Lucida Console', monospace;
  font-size:        15px;
  line-height:      1.6;

  /* Block ALL interaction during boot */
  -webkit-user-drag:     none;
  -webkit-touch-callout: none;
  user-select:           none;
  pointer-events:        none;
}

/* ─── CRT scanline overlay (pseudo element on body) ─────────────────────── */
body::after {
  content:    '';
  position:   fixed;
  inset:      0;
  z-index:    999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--crt-line) 0px,
    var(--crt-line) 1px,
    transparent    1px,
    transparent    3px
  );
  /* Very subtle — just enough to read "CRT" */
  opacity: 0.55;
}

/* ─── CRT vignette (edges darker) ───────────────────────────────────────── */
body::before {
  content:  '';
  position: fixed;
  inset:    0;
  z-index:  998;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

/* ─── Main container ─────────────────────────────────────────────────────── */
.splash-wrap {
  position:        fixed;
  inset:           0;
  z-index:         100;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  padding:         40px 24px;
  gap:             32px;
}

/* ─── Terminal window ────────────────────────────────────────────────────── */
.terminal {
  width:         100%;
  max-width:     520px;
  background:    rgba(13, 14, 16, 0.92);
  border:        1px solid rgba(57, 255, 110, 0.18);
  border-radius: 6px;
  overflow:      hidden;
  box-shadow:    0 0 40px rgba(57, 255, 110, 0.06),
                 0 0 80px rgba(57, 255, 110, 0.03);
}

/* Terminal title bar */
.terminal-bar {
  display:         flex;
  align-items:     center;
  gap:             7px;
  padding:         9px 14px;
  background:      rgba(255, 255, 255, 0.04);
  border-bottom:   1px solid rgba(57, 255, 110, 0.10);
}

.terminal-dot {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--text-muted);
  opacity:       0.55;
}

.terminal-dot:nth-child(1) { background: #ff5f57; opacity: 0.7; }
.terminal-dot:nth-child(2) { background: #febc2e; opacity: 0.7; }
.terminal-dot:nth-child(3) { background: #28c840; opacity: 0.7; }

.terminal-bar-title {
  margin-left: 8px;
  font-size:   0.72rem;
  color:       var(--text-muted);
  opacity:     0.6;
  letter-spacing: 0.08em;
}

/* Terminal body */
.terminal-body {
  padding:    22px 24px 26px;
  min-height: 200px;
}

/* ─── Boot lines ─────────────────────────────────────────────────────────── */
.boot-line {
  display:    block;
  opacity:    0;
  transform:  translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  overflow:   hidden;
  font-size:  0.9rem;
  color:      var(--lilac-dim);
  background: linear-gradient(90deg, var(--green-dim), var(--lilac-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.boot-line.visible {
  opacity:   1;
  transform: translateX(0);
}

/* Prefix bracket */
.boot-line .prefix {
  color:   var(--accent-dim);
  opacity: 0.7;
}

/* Dots after the text (ellipsis) */
.boot-line .dots {
  color:   var(--green-dim);
  opacity: 0.5;
}

/* The last line — brighter, accent-coloured */
.boot-line.boot-line--final {
  color:       var(--accent);
  font-weight: 600;
}

/* Blinking cursor appended to the active line */
.cursor {
  display:          inline-block;
  width:            9px;
  height:           1.1em;
  background:       var(--lilac);
  margin-left:      3px;
  vertical-align:   text-bottom;
  animation:        cursor-blink 0.78s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress-wrap {
  width:         100%;
  max-width:     520px;
  display:       flex;
  flex-direction: column;
  gap:           8px;
}

.progress-label {
  font-size:      0.72rem;
  color:          var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity:        0.6;
}

.progress-track {
  width:         100%;
  height:        3px;
  background:    rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow:      hidden;
  box-shadow:    0 0 6px rgba(57, 255, 110, 0.08);
}

.progress-fill {
  height:           100%;
  width:            0%;
  background:       linear-gradient(90deg, var(--green-dim), var(--lilac));
  border-radius:    2px;
  box-shadow:       0 0 10px var(--lilac),
                    0 0 20px rgba(115, 52, 211, 0.4);
  transition:       width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Logo block ─────────────────────────────────────────────────────────── */
.splash-logo-wrap {
  display:  flex;
  flex-direction: column;
  align-items: center;
  gap:      12px;
  opacity:  0;   /* revealed by JS */
}

.splash-logo {
  width:      clamp(180px, 55vw, 280px);
  height:     auto;
  filter:     drop-shadow(0 0 18px var(--accent-glow))
              drop-shadow(0 0 6px var(--lilac-dim));
}

.splash-tagline {
  font-size:      0.78rem;
  color:          var(--accent-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity:        0.75;
}

/* ─── CRT flicker keyframes (applied by JS on logo reveal) ──────────────── */
@keyframes crt-flicker {
   0% { opacity: 0;    filter: brightness(3)   blur(2px); }
   8% { opacity: 0.9;  filter: brightness(1.8) blur(0px); }
  12% { opacity: 0.3;  filter: brightness(0.5) blur(1px); }
  18% { opacity: 1;    filter: brightness(1.4) blur(0px); }
  22% { opacity: 0.6;  filter: brightness(0.8) blur(0.5px); }
  28% { opacity: 1;    filter: brightness(1.1) blur(0px); }
  35% { opacity: 0.85; filter: brightness(1.3) blur(0px); }
  42% { opacity: 1;    filter: brightness(1.0) blur(0px); }
  55% { opacity: 0.95; filter: brightness(1.1) blur(0px); }
  65% { opacity: 1;    filter: brightness(1.05) blur(0px); }
 100% { opacity: 1;    filter: brightness(1.0)  blur(0px); }
}

.splash-logo-wrap.flicker {
  animation: crt-flicker 1.1s ease-out forwards;
}

/* ─── Fade-to-black exit overlay ─────────────────────────────────────────── */
.fade-out-cover {
  position:         fixed;
  inset:            0;
  z-index:          9999;
  background:       #000;
  opacity:          0;
  pointer-events:   none;
  transition:       opacity 0.55s ease;
}

.fade-out-cover.active {
  opacity:        1;
  pointer-events: all;
}

/* ─── Mobile tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .terminal-body  { padding: 16px 16px 20px; }
  .boot-line      { font-size: 0.82rem; white-space: normal; }
  .splash-logo    { width: clamp(160px, 70vw, 240px); }
}