/* Display Stage — Live → Wall → Killchain videowall shell */

:root {
  color-scheme: dark;
  --stage-bg: #07090c;
  --stage-cyan: #2de1c2;
  --stage-text: #f2f7f6;
  --stage-muted: #8ea29f;
  --stage-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --stage-fade-ms: 1400ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--stage-bg);
}

body.stage-page {
  color: var(--stage-text);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
}

.stage-app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--stage-bg);
}

.stage-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.012);
  transition:
    opacity var(--stage-fade-ms) var(--stage-ease),
    transform var(--stage-fade-ms) var(--stage-ease),
    visibility 0s linear var(--stage-fade-ms);
}

.stage-panel.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  transition:
    opacity var(--stage-fade-ms) var(--stage-ease),
    transform var(--stage-fade-ms) var(--stage-ease),
    visibility 0s linear 0s;
}

.stage-panel.is-leaving {
  z-index: 3;
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: scale(0.992);
  transition:
    opacity var(--stage-fade-ms) var(--stage-ease),
    transform var(--stage-fade-ms) var(--stage-ease),
    visibility 0s linear var(--stage-fade-ms);
}

.stage-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--stage-bg);
}

.stage-veil {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: rgba(7, 9, 12, 0);
  opacity: 0;
  transition: background 500ms var(--stage-ease), opacity 500ms var(--stage-ease);
}

.stage-veil.is-on {
  background: rgba(7, 9, 12, 0.42);
  opacity: 1;
}

.stage-bridge {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 9;
  max-width: min(720px, 78vw);
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.98);
  transition:
    opacity 520ms var(--stage-ease),
    transform 720ms var(--stage-ease);
}

.stage-bridge.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.stage-bridge__kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--stage-cyan);
  font-size: clamp(12px, 1.1vw, 18px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.stage-bridge__title {
  display: block;
  color: var(--stage-text);
  font-size: clamp(22px, 2.6vw, 42px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-shadow: 0 0 40px rgba(45, 225, 194, 0.28);
}

.stage-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  height: 3px;
  background: rgba(45, 225, 194, 0.08);
  pointer-events: none;
}

.stage-progress__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(45, 225, 194, 0.2), var(--stage-cyan));
  transform-origin: left center;
}

.stage-progress__fill.is-running {
  animation-name: stage-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.stage-progress__fill.is-paused {
  animation-play-state: paused;
}

@keyframes stage-progress {
  from { width: 0%; }
  to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-panel,
  .stage-panel.is-active,
  .stage-panel.is-leaving,
  .stage-veil,
  .stage-bridge {
    transition-duration: 1ms !important;
  }

  .stage-progress__fill.is-running {
    animation: none;
    width: 100%;
  }
}
