/* ── Norrmalm dot-reveal chapter ── */

#guided-norrmalm {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: #050510;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
  overflow: hidden;
  z-index: 2;
}

.guided-graph-wrapper.norrmalm-active #guided-norrmalm {
  opacity: 1;
  pointer-events: auto;
}

.guided-graph-wrapper.norrmalm-active #guided-graph {
  opacity: 0;
  pointer-events: none;
}

/* ── Map wrap ── */

.norrmalm-map-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transform-origin: 0 0;
}

.norrmalm-map-wrap svg {
  width: 100%;
  height: 100%;
}

/* ── Vignette ── */

.norrmalm-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 5, 16, 0.75) 100%);
  z-index: 10;
}

/* ── Clock ── */

.norrmalm-clock {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: #e84040;
  text-shadow: 0 0 20px rgba(220, 30, 25, 0.5), 0 0 60px rgba(220, 30, 25, 0.2);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.norrmalm-clock.visible {
  opacity: 1;
}

.norrmalm-clock.norrmalm-clock-flash {
  animation: norrmalm-clock-flash 0.6s ease-out;
}

@keyframes norrmalm-clock-flash {
  0%   { color: #fff; text-shadow: 0 0 40px rgba(255, 255, 255, 0.9), 0 0 80px rgba(220, 30, 25, 0.8); }
  100% { color: #e84040; text-shadow: 0 0 20px rgba(220, 30, 25, 0.5), 0 0 60px rgba(220, 30, 25, 0.2); }
}

.norrmalm-clock-fadeout {
  opacity: 0 !important;
  transition: opacity 2s ease-out !important;
}

/* ── Date label ── */

.norrmalm-clock-date {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(232, 64, 64, 0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.norrmalm-clock-date.visible {
  opacity: 1;
}

/* ── Observation dots (SVG circles) ── */

#guided-norrmalm .obs-dot {
  opacity: 0;
  transition: opacity 0.6s ease;
}

#guided-norrmalm .obs-dot.revealed {
  opacity: 1;
  animation: norrmalm-throb 2s ease-in-out infinite;
}

#guided-norrmalm .obs-dot.dimmed {
  opacity: 0.4;
  animation: none;
  transition: opacity 0.8s ease;
}

#guided-norrmalm .obs-dot.idle {
  opacity: 0.85;
  transition: none;
  transform-origin: center;
  transform-box: fill-box;
  animation: norrmalm-idle 3.5s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
}

@keyframes norrmalm-throb {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

@keyframes norrmalm-idle {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
    filter: url(#norrmalm-dot-glow) brightness(1.25);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    filter: url(#norrmalm-dot-glow) brightness(1.25);
  }
}

/* ── Dissolving text labels ── */

#guided-norrmalm .obs-label {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.3;
  color: rgba(232, 230, 227, 0.92);
  text-shadow: 0 0 8px rgba(5, 5, 16, 0.95), 0 1px 4px rgba(5, 5, 16, 0.9);
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: norrmalm-label-reveal 1.6s ease-out forwards;
}

@keyframes norrmalm-label-reveal {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  40%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(-50%, -55%); }
}

/* ── Hover tooltip ── */

.norrmalm-tooltip {
  position: absolute;
  z-index: 80;
  pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 8px 12px;
  background: rgba(10, 10, 24, 0.92);
  border: 1px solid rgba(220, 30, 25, 0.35);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(232, 230, 227, 0.92);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.norrmalm-tooltip.visible {
  opacity: 1;
}

.norrmalm-tooltip .tt-time {
  color: #e84040;
  font-weight: 600;
  font-size: 13px;
}

.norrmalm-tooltip .tt-date {
  color: rgba(220, 200, 180, 0.7);
  font-size: 10px;
}

.norrmalm-tooltip .tt-place {
  color: rgba(232, 230, 227, 0.85);
}

.norrmalm-tooltip .tt-observer {
  color: rgba(200, 190, 180, 0.6);
  font-size: 10px;
  font-style: italic;
}

.norrmalm-tooltip .tt-ref {
  color: rgba(180, 170, 160, 0.45);
  font-size: 9px;
}

/* ── Mobile ── */

@media (max-width: 768px) {
  .norrmalm-clock {
    font-size: 24px;
    top: calc(40vh + 12px);
  }
  .norrmalm-clock-date {
    top: calc(40vh + 40px);
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .norrmalm-clock {
    top: calc(35vh + 10px);
  }
  .norrmalm-clock-date {
    top: calc(35vh + 36px);
  }
}
