/* ═══════════════════════════════════════════════════════════════════════════
   STYLES.CSS — Global styles for the 40-second cinematic reveal
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000810;
  font-family: 'Courier New', Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── START SCREEN ─────────────────────────────────────────────────────────── */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000810;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

#start-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    rgba(0, 212, 255, 0.07) 0%,
    transparent 65%
  );
  animation: startPulse 2.4s ease-in-out infinite;
}

@keyframes startPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.04); }
}

.start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: startFadeIn 0.8s ease forwards;
}

@keyframes startFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.start-icon {
  opacity: 0.85;
  animation: iconPulse 1.8s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%       { transform: scale(1.08); opacity: 1; }
}

.start-label {
  color: #00d4ff;
  font-family: 'Courier New', monospace;
  font-size: clamp(13px, 2vw, 20px);
  letter-spacing: 0.5em;
  font-weight: 400;
  text-transform: uppercase;
}

.start-sub {
  color: rgba(0, 212, 255, 0.4);
  font-family: 'Courier New', monospace;
  font-size: clamp(9px, 1.1vw, 12px);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-top: -8px;
}

/* ── Main stage layers ────────────────────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

/* Canvas underneath SVG */
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* SVG over canvas */
#svg-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* ── Loading screen (kept for fallback, hidden once start-screen exists) ──── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000810;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d4ff;
  font-size: clamp(11px, 1.4vw, 16px);
  letter-spacing: 0.5em;
  font-family: 'Courier New', monospace;
}

#loader::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 16px;
  border: 2px solid #00d4ff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Controls HUD ────────────────────────────────────────────────────────── */
#controls-hud {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  gap: 10px;
  opacity: 0.8;
  transition: opacity 1s ease;
  pointer-events: none;
}

.hud-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 4px;
  padding: 5px 10px;
  color: #00d4ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-family: 'Courier New', monospace;
  min-width: 40px;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
}

.hud-key em {
  font-style: normal;
  font-size: 8px;
  color: rgba(0, 212, 255, 0.5);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ── Toast notification ──────────────────────────────────────────────────── */
#hud-toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 4px;
  padding: 8px 24px;
  color: #00d4ff;
  font-size: 13px;
  letter-spacing: 0.4em;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* ── Scanline texture overlay ─────────────────────────────────────────────── */
#app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
}

/* ── Vignette overlay ────────────────────────────────────────────────────── */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 4, 16, 0.7) 100%
  );
  pointer-events: none;
}

/* ── Mobile / projector adjustments ─────────────────────────────────────── */
@media (max-width: 768px) {
  #controls-hud {
    bottom: 12px;
    right: 12px;
    gap: 6px;
  }
  .hud-key {
    padding: 4px 7px;
    font-size: 9px;
  }
}

/* ── Robot SVG animations ─────────────────────────────────────────────────── */

/* Eye glow pulse — both .rb-eye ellipses */
.rb-eye {
  animation: robotEyePulse 2.2s ease-in-out infinite;
}
@keyframes robotEyePulse {
  0%, 100% { opacity: 1;    filter: none; }
  45%       { opacity: 0.65; }
  50%       { opacity: 0.82; }
  55%       { opacity: 0.65; }
}

/* Antenna glow breathe */
.rb-ant-glow {
  animation: robotAntPulse 1.8s ease-in-out infinite;
}
@keyframes robotAntPulse {
  0%, 100% { opacity: 0.75; r: 14; }
  50%       { opacity: 1.00; r: 17; }
}

/* Chest screen scan line scrolls down */
.rb-scan {
  animation: robotScan 1.6s linear infinite;
}
@keyframes robotScan {
  0%   { transform: translateY(0px);  opacity: 0.18; }
  80%  { transform: translateY(60px); opacity: 0.28; }
  100% { transform: translateY(65px); opacity: 0;    }
}

/* Data lines shimmer in sequence */
.rb-dl-1 { animation: rbLine 2.4s 0.0s ease-in-out infinite; }
.rb-dl-2 { animation: rbLine 2.4s 0.3s ease-in-out infinite; }
.rb-dl-3 { animation: rbLine 2.4s 0.6s ease-in-out infinite; }
.rb-dl-4 { animation: rbLine 2.4s 0.9s ease-in-out infinite; }
.rb-dl-5 { animation: rbLine 2.4s 1.2s ease-in-out infinite; }
.rb-dl-6 { animation: rbLine 2.4s 1.5s ease-in-out infinite; }
.rb-dl-7 { animation: rbLine 2.4s 1.8s ease-in-out infinite; }

@keyframes rbLine {
  0%, 100% { opacity: 0.4;  }
  50%       { opacity: 0.95; }
}

/* ── Print / static fallback (projector safe) ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
