*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #060d0c;
  color: #eef3f1;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Stage ─────────────────────────────────────────────── */

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background: #060d0c;
  display: flex;
  align-items: center;
  justify-content: center;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #060d0c;
}

/* ── Header overlay ─────────────────────────────────────── */

.stage-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 22px 26px 64px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62) 0%, transparent 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand h1 {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.45rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.brand p {
  margin: 5px 0 0;
  font-size: clamp(0.6rem, 0.9vw, 0.75rem);
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 400;
}

/* ── Status indicator ───────────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding-top: 2px;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ca8a04;
  flex-shrink: 0;
}

.status[data-state="online"] .status-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
  animation: glow 2.4s ease-in-out infinite;
}

.status[data-state="offline"] .status-dot {
  background: #f87171;
}

@keyframes glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Footer overlay (clock) ─────────────────────────────── */

.stage-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 48px 20px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.32) 0%, transparent 100%);
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

#clock {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.3);
  font-variant-numeric: tabular-nums;
}

/* ── Offline overlay ─────────────────────────────────────── */

.offline {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  background: rgba(4, 9, 8, 0.92);
  text-align: center;
}

.offline.is-visible {
  display: flex;
}

.offline p {
  margin: 0;
}

.offline p:first-child {
  font-size: clamp(1.1rem, 2.8vw, 1.65rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
}

.offline p:last-child {
  font-size: clamp(0.72rem, 1.3vw, 0.88rem);
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.03em;
}

/* ── Debug affordance ────────────────────────────────────── */

.debug {
  position: fixed;
  bottom: 10px;
  left: 12px;
  z-index: 100;
  font-size: 0.7rem;
  font-family: ui-monospace, "Menlo", "Cascadia Code", monospace;
}

.debug summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: rgba(255, 255, 255, 0.15);
  font-size: 1.4rem;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.2s;
}

.debug summary::-webkit-details-marker {
  display: none;
}

.debug summary:hover {
  color: rgba(255, 255, 255, 0.4);
}

.debug[open] summary {
  color: rgba(255, 255, 255, 0.5);
}

.debug-grid {
  margin-top: 6px;
  padding: 10px 14px;
  background: rgba(4, 9, 8, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  align-items: center;
  color: rgba(255, 255, 255, 0.35);
}

.debug-grid strong {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}
