/* The banner as a hero: the big traffic light, its halo, the state heading
   and the counters. */

/* Hero: the banner, with the big traffic light. */
.banner {
  text-align: center;
  padding: 56px 0 24px;
  --lit: var(--grey);
}
.banner.state-green { --lit: var(--green); }
.banner.state-yellow { --lit: var(--yellow); }
.banner.state-red { --lit: var(--red); }

.beacon { position: relative; width: 140px; height: 256px; margin: 0 auto 30px; }
.halo {
  position: absolute;
  inset: -40px -90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--tone-rgb), 0.35), transparent 75%);
  filter: blur(6px);
  transition: background 1.2s ease;
}
.light { position: relative; width: 100%; height: 100%; overflow: visible; }
.housing-top { stop-color: var(--housing-top); }
.housing-bottom { stop-color: var(--housing-bottom); }
.housing-edge { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 2; }
.pole { fill: var(--housing-bottom); }
.visor { fill: rgba(0, 0, 0, 0.45); }
.lamp { fill: var(--lamp-off); transition: fill 0.6s ease, filter 0.6s ease; }
.shine { pointer-events: none; }
.banner.state-red .lamp-red { fill: var(--red); filter: drop-shadow(0 0 10px var(--red)) drop-shadow(0 0 26px var(--red)); }
.banner.state-yellow .lamp-yellow { fill: var(--yellow); filter: drop-shadow(0 0 10px var(--yellow)) drop-shadow(0 0 26px var(--yellow)); }
.banner.state-green .lamp-green { fill: var(--green); filter: drop-shadow(0 0 10px var(--green)) drop-shadow(0 0 26px var(--green)); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(140, 198, 63, 0.08);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
}
.banner-text {
  margin: 0 auto 12px;
  max-width: 18ch;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--lit);
}
.hero-sub { margin: 0 auto 26px; max-width: 46ch; color: var(--muted); font-size: 1.08rem; }

.counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.counts:empty { display: none; }
.count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Dots carry the colour of a state everywhere. */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); flex: none; }
.state-green > .dot, .instance.state-green .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.state-yellow > .dot, .instance.state-yellow .dot { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.state-red > .dot, .instance.state-red .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

@media (max-width: 520px) {
  .banner { padding-top: 36px; }
  .beacon { width: 96px; height: 176px; }
}

@media (prefers-reduced-motion: no-preference) {
  .banner.state-red .lamp-red,
  .banner.state-yellow .lamp-yellow,
  .banner.state-green .lamp-green { animation: glow 2.8s ease-in-out infinite; }
  /* While checking, the light runs through its lamps. */
  .banner[data-message="checking"] .lamp { animation: scan 1.8s ease-in-out infinite; }
  .banner[data-message="checking"] .lamp-yellow { animation-delay: 0.6s; }
  .banner[data-message="checking"] .lamp-green { animation-delay: 1.2s; }
  .halo { animation: breathe 6s ease-in-out infinite; }
}
@keyframes glow { 50% { opacity: 0.82; } }
@keyframes scan {
  0%, 100% { fill: var(--lamp-off); }
  30% { fill: var(--grey); filter: drop-shadow(0 0 10px var(--grey)); }
}
@keyframes breathe { 50% { transform: scale(1.06); opacity: 0.8; } }
