* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #1a1a1a; overflow: hidden; cursor: grab; }
body:active { cursor: grabbing; }
#canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; }

/* ── Intro ─────────────────────────────────────────────── */
#intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: intro-sequence 5s ease forwards;
  pointer-events: none;
}

#intro-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(52px, 10vw, 110px);
  letter-spacing: -0.02em;
  color: #ffffff;
  opacity: 0;
  animation: text-appear 5s ease forwards;
}

#intro-text span {
  color: #FF5C00;
}

@keyframes intro-sequence {
  0%   { opacity: 1; }
  15%  { opacity: 1; }   /* fade in complete */
  75%  { opacity: 1; }   /* hold */
  100% { opacity: 0; pointer-events: none; }
}

@keyframes text-appear {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

#intro.done {
  display: none;
}

/* ── Popup ─────────────────────────────────────────────── */
.popup {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 24px));
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
}

.popup.visible {
  opacity: 1;
  pointer-events: all;
}

.popup-inner {
  position: relative;
  width: 260px;
  background: rgba(10, 10, 10, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 20px 20px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Courier New', monospace;
  color: #ddd;
}

/* vertical connector line from popup to box */
.popup-inner::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
}

/* dot at the end of connector */
.popup-inner::before {
  content: '';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.popup-tag {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 8px;
}

.popup-title {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: #FF5C00;
  margin-bottom: 10px;
}

.popup-body {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 16px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.15s;
}
.popup-close:hover { color: rgba(255,255,255,0.8); }

/* ── Ambient toggle ─────────────────────────────────────── */
#ambient-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 10, 0.6);
  color: rgba(255, 255, 255, 0.3);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ambient-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

#ambient-btn.active {
  color: #FF5C00;
  border-color: #FF5C00;
  box-shadow: 0 0 12px rgba(255, 92, 0, 0.35);
}

/* ── Focus label ────────────────────────────────────────── */
#focus-label {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  display: none;
  transition: opacity 0.3s ease;
}

#focus-label.visible {
  display: block;
  opacity: 1;
}

#focus-label.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* ── Easter egg ─────────────────────────────────────────── */
#calm-down {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.15em;
  color: #ffffff;
  white-space: nowrap;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#calm-down.visible {
  display: block;
  opacity: 1;
}
