/* The closing band (plan 2026-11-11-2305 U9, R39; docs/site-relaunch/round-three/specs/closing-band.md).
   lib/site/parts/closing-band.ts prints it, once, as the last thing inside <main> on every site page. Linked on every
   site page through SITE_ROUND_THREE_CSS (lib/site/SiteChrome.tsx), never in a page's own list. `cb-` classes only.

   One night ground for the whole band so it reads as one scene. --cb-ground is the street navy sampled from the
   window pictures' bottom edge (#2b2a46, #262944, #24243e: averaged); --navy (#111627) is too far from it to stand in.
   The picture's frame and the tile crops come from custom properties the part sets per picture (--cb-frame,
   --cb-top, --cb-pic, --cb-src, --cb-scale, each lamp's --x/--y and each glow's --d/--o). */

.cb {
  --cb-ground: #2a2a45;
  --cb-glow: rgba(255, 196, 122, 0.95);
  position: relative;
  background: var(--cb-ground);
  color: var(--on-dark);
  overflow: hidden;
}

/* ---- The windows: full width, the frame showing the picture's middle 46% (the window row). ---- */
.cb__windows { position: relative; }
.cb__frame { position: relative; aspect-ratio: var(--cb-frame); overflow: hidden; }
.cb__pic { position: absolute; left: 0; top: var(--cb-top); width: 100%; aspect-ratio: var(--cb-pic); }
.cb__pic img { display: block; width: 100%; max-width: none; height: auto; }
/* The street becomes the band: the frame's foot fades into the ground over 40px. */
.cb__frame::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(to bottom, transparent, var(--cb-ground)); pointer-events: none; }

/* Living windows: a soft warm glow over each lamp, each on its own period (4 s to 7 s), CSS only. */
.cb__glow { position: absolute; inset: 0; pointer-events: none; }
.cb__glow i,
.cb__tile i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 9%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--cb-glow), rgba(255, 170, 80, 0.35) 45%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  animation: cb-glow var(--d) ease-in-out var(--o) infinite alternate;
}
.cb__glow i:nth-child(n + 5) { width: 6%; } /* the two street lamps are smaller than the ceiling lamps */
@keyframes cb-glow { from { opacity: 0; } to { opacity: 0.3; } }

/* Phones get the same picture as four window tiles, two by two, each a crop of one window. */
.cb__tiles { display: none; }

/* ---- The ask, the three steps, the one button ---- */
/* Build five SW4 (Sarah 72f2iHJXqktX): breathing room between the foot of the picture and the heading under it, at every
   width (was 4px under the frame and 20px under the phone tiles). */
.cb__copy { position: relative; padding: clamp(28px, 3vw, 44px) 0 clamp(36px, 4vw, 52px); text-align: center; }
.cb__copy h2 { font-size: clamp(1.5rem, 2.3vw, 2rem); max-width: 34ch; margin: 0 auto 18px; color: var(--on-dark); }
.cb__steps { list-style: none; counter-reset: cb-step; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; margin: 0 auto 24px; padding: 0; font-size: 0.95rem; line-height: 1.4; color: var(--on-dark-2); }
.cb__steps li { display: flex; align-items: center; gap: 10px; counter-increment: cb-step; }
.cb__steps li::before { content: counter(cb-step); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--on-dark-3); border-radius: 50%; font-size: 0.75rem; font-weight: 700; color: var(--on-dark); }
.cb__go { display: flex; justify-content: center; }
.cb__go .btn { margin: 0; }
/* Round four W8: the agents line under the button, quieter than the button, its link plain and underlined. */
.cb__connect { margin: 16px auto 0; max-width: 60ch; font-size: 0.95rem; line-height: 1.5; color: var(--on-dark-2); }
.cb__connect a { color: var(--on-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cb__connect a:hover { text-decoration-thickness: 2px; }
/* Home: the steps alone under its own close scene. */
.cb--steps-only .cb__steps { margin-bottom: 0; }

@media (max-width: 720px) {
  .cb__frame { display: none; }
  .cb__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin: 0 auto; padding-top: 24px; }
  .cb__tile {
    position: relative;
    aspect-ratio: 0.9;
    overflow: hidden;
    border-radius: 50% 50% 8px 8px / 26% 26% 8px 8px; /* the window's arched top */
    background: var(--cb-src) var(--tx) 50% / var(--cb-scale) auto no-repeat;
  }
  /* One glow per tile, on its lamp. */
  .cb__tile i { --x: 50%; --y: 10%; width: 34%; }
  .cb__copy { padding-top: 32px; }
  .cb__copy h2 { font-size: 1.4rem; }
  .cb__steps { flex-direction: column; align-items: flex-start; width: fit-content; max-width: 100%; text-align: left; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cb__glow i,
  .cb__tile i { animation: none; opacity: 0; }
}
