@layer components {
  .home-main { position: relative; align-items: start; padding-block-start: 0; }
  .patrol-radio:not([hidden]) { display: grid; justify-items: center; }
  .patrol-radio {
    position: absolute;
    z-index: 4;
    top: max(12px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    min-width: 48px;
    min-height: 48px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #adb5b4;
    cursor: pointer;
    font: 10px/1.2 ui-monospace, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .radio-dial { fill: #60685e; }
  .patrol-radio[aria-pressed="true"] { color: #f4c77c; }
  .patrol-radio[aria-pressed="true"] .radio-dial { fill: #e6b765; }
  .patrol-radio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .hero-lockup {
    --art-size: clamp(220px, 27vw, 295px);
    --sky-room: clamp(156px, 27svh, 480px);
    position: relative;
    isolation: isolate;
    padding-top: var(--sky-room);
  }

  .hero-art {
    position: relative;
    container-type: inline-size;
    width: var(--art-size);
    margin: 0 auto 12px;
  }

  .hero-art img { width: 100%; }
  .car-details { position: absolute; inset: 0; width: 100%; pointer-events: none; }
  .wheel { animation: wheel-roll .38s steps(4) infinite; }
  @keyframes wheel-roll { to { transform: translateX(-128px); } }
  .wiper { animation: wipe 2.4s steps(9) infinite; }
  @keyframes wipe {
    0%, 49%, 100% { transform: rotate(0); }
    24% { transform: rotate(75deg); }
  }

  .patrol-panorama {
    position: absolute;
    width: 400%;
    left: -150%;
    top: calc(var(--art-size) * -.45652);
    pointer-events: none;
  }
  .sky {
    z-index: 1;
    top: max(4px, env(safe-area-inset-top));
    width: calc(var(--art-size) * 4);
    left: 50%;
    transform: translateX(-50%);
    overflow: visible;
  }
  .cloud-drift { animation: cloud-drift 48s ease-in-out infinite alternate; }
  @keyframes cloud-drift { from { transform: translateX(-36px); } to { transform: translateX(45px); } }
  .landscape { --storm-cycle: 11.5s; }
  .bank-travel { animation: bank-pass var(--storm-cycle) linear infinite; }
  @keyframes bank-pass { to { transform: translateX(-358px); } }
  .lightning { opacity: 0; animation: distant-strike var(--storm-cycle) linear infinite; }
  @keyframes distant-strike {
    0%, 1.3% { opacity: 0; }
    2%, 10% { opacity: 1; }
    18% { opacity: .74; }
    30% { opacity: .26; }
    45%, 100% { opacity: 0; }
  }
  .strike-fire { animation: smolder var(--storm-cycle) linear infinite; }
  .lightning, .strike-fire, .bank-travel { animation-delay: 2s; }
  .strike-fire { opacity: 0; }
  @keyframes smolder {
    0%, 6%, 93%, 100% { opacity: 0; }
    12% { opacity: .8; }
    18% { opacity: 1; }
    45% { opacity: .62; }
    72% { opacity: .2; }
  }
  .pixel-flame { animation: flame-lick .58s steps(3) infinite alternate; }
  @keyframes flame-lick { to { transform: skewX(9deg) scale(.85, .76); } }
  .smoke-puff { animation: smoke-drift 3.6s linear var(--drift-delay, 0s) infinite; }
  @keyframes smoke-drift {
    0% { transform: translate(0, 0) scale(.46); opacity: 0; }
    18% { transform: translate(-3px, -12px) scale(.75); opacity: .68; }
    55% { transform: translate(-18px, -39px) scale(1.15); opacity: .48; }
    100% { transform: translate(-49px, -66px) scale(1.65); opacity: 0; }
  }
  .hero-lockup[data-effects-off] :is(.patrol-panorama, .car-details) { display: none; }
  .landscape {
    z-index: -1;
    top: calc(var(--art-size) * -420 / 460);
    mask-image: radial-gradient(ellipse 53% 54% at 50% 52%, #000 54%, transparent 100%);
  }
  .treeline { animation: forest-pass 18s linear infinite; }
  @keyframes forest-pass { to { transform: translateX(-179px); } }
  .road-travel { animation: road-travel .54s linear infinite; }
  @keyframes road-travel { to { transform: scale(.75); } }
  .rain { mask-image: radial-gradient(ellipse 55% 55% at 50% 47%, #000 20%, transparent 100%); }
  .drizzle { animation: drizzle .94s steps(20) infinite; }
  .downpour { animation: downpour .68s steps(16) infinite; }
  @keyframes drizzle { to { transform: translateY(148px); } }
  @keyframes downpour { to { transform: translateY(236px); } }
  .hero-lockup:is([data-lighting-paused], [data-effects-off]) .scene-motion { animation-play-state: paused; }

  /* Keep the light above BOTH the artwork and the lettering. Blending inside
     the artwork's size container cannot illuminate its sibling wordmark. */
  .headlights {
    display: none;
    position: absolute;
    z-index: 2;
    top: var(--sky-room);
    left: 50%;
    width: var(--art-size);
    height: var(--art-size);
    transform: translateX(-50%);
    overflow: visible;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: .56;
  }

  .siren, .lamp { display: none; position: absolute; pointer-events: none; }
  /* One clock per color keeps the emitter, glass and wet pavement in phase. */
  .beacon-red { --light: 255 47 35; --phase: -.22s; }
  .beacon-blue { --light: 55 113 255; --phase: -1.02s; }
  .beacon-pulse { color: rgb(var(--light)); animation: beacon-sweep 1.6s linear var(--phase) infinite; }
  @keyframes beacon-sweep {
    0%, 50%, 100% { opacity: .035; }
    8% { opacity: .25; }
    13%, 16% { opacity: 1; }
    22% { opacity: .58; }
    35% { opacity: .15; }
  }
  .siren {
    width: 5.65%;
    height: 2.9%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, #fffdf5 0 18%, #ffe9df 25%, currentColor 66%);
  }
  .siren.beacon-red { left: 52.8%; top: 22.3%; }
  .siren.beacon-blue { left: 38.5%; top: 29.1%; }
  .siren::before, .siren::after { content: ""; position: absolute; }
  /* A broad, low-intensity halo in the rain surrounds a narrow optical streak. */
  .siren::before {
    inset: -600% -320%;
    background: radial-gradient(ellipse, rgb(var(--light) / .65), rgb(var(--light) / .28) 30%, transparent 71%);
  }
  .siren::after {
    inset: 32% -215%;
    background: radial-gradient(ellipse, #fff 3%, rgb(var(--light) / .94) 25%, transparent 72%);
  }
  .hero-lockup[data-lighting-paused] .beacon-pulse { animation-play-state: paused; }

  /* Cover the painted cruiser rather than just its roof lights. */
  .siren-toggle {
    position: absolute;
    z-index: 3;
    left: 4%;
    top: 17%;
    width: 92%;
    height: 65%;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
  }
  .siren-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  .lamp {
    width: 4.35%;
    height: 4.35%;
    background: #fff9d6;
    border-radius: 25%;
    filter: blur(.65cqw);
    box-shadow: 0 0 3cqw 1cqw #fff0a970, 0 0 7cqw 2cqw #fff0a91a;
  }
  .lamp-left { left: 61.52%; top: 60.43%; }
  .lamp-right { left: 78.7%; top: 51.96%; }

  .wordmark img { filter: invert(.75); }
  :is(.headlights, .siren, .lamp) { display: block; }
  :root .hero-lockup[data-effects-off] .siren { display: none; }
  .hero-lockup:not([data-effects-off]) { touch-action: pan-y pinch-zoom; }
  .hero-lockup img { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }

  @media (max-width: 700px) {
    .hero-lockup { --art-size: clamp(165px, 49vw, 240px); --sky-room: clamp(132px, 32svh, 360px); }
  }

}
