/* r228 (David 19 Nov): the homepage button IS David's picture. The key was cut out of his image (scripts/image-key-r228-cut.py:
   dark surround removed, chrome frame, glow and rounded corners kept, text baked in and unchanged) and replaces the
   CSS-built chrome key of r223 on phones and desktop. Same element (#cta) and handler (night-shift-v3.js): it opens step 1
   of the request line. Layers, all from the picture (assets/, 2x, WebP with PNG fallback):
     - .ik-face   the whole key (image-key-r228), fixed aspect ratio 1086:320 so it never stretches;
     - .ik-dial   the speaker dial with its play triangle, cut on its own and laid exactly over its place in the key;
     - .ik-shade  a darker shade in the key's own shape (masked by the key picture), shown while pressed;
     - .ik-glow   the play triangle alone, twice: a blurred copy (.ik-halo) and a sharp one (.ik-play), screened over
                  the dial so the triangle glows, pulsing slowly (2.4s). With reduced motion: no pulse, the glow stays on.
   Layer places (% of the key) come from assets/image-key-r228.json (written by the cut script).
   Press (image-key.js adds .is-pressed on pointerdown / touchstart / mousedown anywhere on the picture, removes it on up,
   leave, cancel or blur): scale .97, 2px down, the shade on; released, it springs back. No text selection, no image
   drag, no long-press menu. The name for screen readers is the button's aria-label. Focus ring: night-shift-v3.css
   (.cta:focus-visible, 3px white), rounded to the key here. #cta in the selectors so the older .cta rules (green
   slanted button, phone and desktop paddings) never reach the picture. */
#cta.image-key {
  position: relative;
  display: block;
  width: 100%;
  max-width: 543px;
  height: auto;
  aspect-ratio: 1086 / 320;
  margin: 10px auto 2px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  box-shadow: none;
  color: inherit;
  transform: none;
  transform-origin: 50% 50%;
  transition: transform .24s cubic-bezier(.34, 1.56, .64, 1);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#cta.image-key:hover { transform: none; box-shadow: none; }
#cta.image-key * { pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
#cta.image-key picture { display: contents; }
#cta.image-key img { position: absolute; display: block; max-width: none; margin: 0; }
#cta.image-key .ik-face { left: 0; top: 0; width: 100%; height: 100%; }
#cta.image-key .ik-dial { left: 4.42%; top: 10%; width: 19.153%; height: 65%; }
#cta.image-key .ik-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .34);
  -webkit-mask: url(assets/image-key-r228.webp) 0 0 / 100% 100% no-repeat;
  mask: url(assets/image-key-r228.webp) 0 0 / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity .24s ease-out;
}
#cta.image-key .ik-glow { position: absolute; left: 11.05%; top: 28.438%; width: 6.63%; height: 24.688%; }
#cta.image-key .ik-glow img { left: 0; top: 0; width: 100%; height: 100%; mix-blend-mode: screen; }

/* pressed: a little smaller, 2px down, darker; springs back on release (transition above) */
#cta.image-key.is-pressed { transform: translateY(2px) scale(.97); transition-duration: .06s; }
#cta.image-key.is-pressed .ik-shade { opacity: 1; transition-duration: .06s; }

/* the play triangle: a blurred copy (the glow) under a sharp one, both screened over the dial, pulsing slowly */
#cta.image-key .ik-halo { filter: blur(4px) brightness(1.5) saturate(1.3); transform-origin: 45% 50%; animation: ik-halo-pulse 2.4s ease-in-out infinite; }
#cta.image-key .ik-play { animation: ik-play-pulse 2.4s ease-in-out infinite; }
@keyframes ik-halo-pulse {
  0%, 100% { opacity: .3; transform: scale(1.05); }
  50% { opacity: 1; transform: scale(1.35); }
}
@keyframes ik-play-pulse {
  0%, 100% { opacity: .1; }
  50% { opacity: .85; }
}
@media (prefers-reduced-motion: reduce) {
  #cta.image-key .ik-halo,
  #cta.image-key .ik-play { animation: none; }
  #cta.image-key .ik-halo { opacity: .85; transform: scale(1.2); }
  #cta.image-key .ik-play { opacity: .5; }
  #cta.image-key { transition-timing-function: ease-out; }
}

/* Phones (portrait): the picture fills the hero's column (351px at 375 wide, 336px at 360). The bottom 11% of the
   picture is the faint glow under the key, so the line under it tucks up into that. */
@media (max-width:600px) and (orientation:portrait) {
  html.phone-panels .phone-dashboard > .hero #cta.image-key { display: block; width: 100%; max-width: 543px; height: auto; margin: 6px auto -6px; padding: 0; }
}

/* Desktop (night-shift-desktop.css boundary; the 1440x900 scene is scaled as a whole): capped at 290px wide (85px tall),
   which is what fits between the headline and the sample strip with the note still under it; the note tucks up into
   the faint glow under the key. */
@media (min-width:1001px) and (min-height:541px) {
  .desktop-radio #cta.image-key { width: 290px; max-width: 290px; margin: 3px auto -8px; padding: 0; }
  .desktop-radio #cta.image-key .ik-halo { filter: blur(3px) brightness(1.5) saturate(1.3); }
  .desktop-radio .hero .free-note { margin-top: 0; }
}
