/* Licensed decorative front-car photograph; independent of menu layout and focus handling. */
.menu-visual {
  --menu-car-slot-height: clamp(80px, 16svh, 160px);
  --menu-car-open-duration: .6s;
  --menu-car-menu-settle-duration: .75s;
  --menu-car-flash-pause: .5s;
  --menu-car-flash-duration: 2.5s;
  --menu-car-acid: var(--acid, #dfff00);
  position: relative;
  display: flex;
  flex: 1 1 116px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--menu-car-slot-height);
  min-height: 80px;
  max-height: 160px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity var(--menu-car-open-duration) ease, transform var(--menu-car-open-duration) ease;
}

.menu-open .menu-visual {
  opacity: 1;
  transform: translateY(0);
}

.menu-visual__stage {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 560px, calc(var(--menu-car-slot-height) * 4));
  aspect-ratio: 4 / 1;
  isolation: isolate;
}

.menu-visual__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  /* The 4:1 centre crop is y=250…550 in the 1200×800 source. Keep it fixed so
     the flare coordinates stay aligned at every viewport size. */
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 34%, #000 48%, transparent 82%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 34%, #000 48%, transparent 82%);
}

.menu-visual__flare {
  position: absolute;
  z-index: 1;
  width: clamp(38px, 11vw, 74px);
  aspect-ratio: 2.3 / 1;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.8);
  transform-origin: center;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse at center,
    #fff 0%, #fff 6%, rgba(255,255,255,.92) 12%,
    color-mix(in srgb, var(--menu-car-acid) 72%, transparent) 25%,
    color-mix(in srgb, var(--menu-car-acid) 24%, transparent) 45%, transparent 72%);
  filter: blur(.3px);
  animation: none;
}

.menu-visual__flare::after {
  content: "";
  position: absolute;
  inset: calc(50% - 1px) -18% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85) 45%, #fff 50%, rgba(255,255,255,.85) 55%, transparent);
  filter: blur(.4px);
}

.menu-visual__flare--left {
  left: 34.294%;
  top: 51.638%;
}

.menu-visual__flare--right {
  left: 64.234%;
  top: 51.897%;
}

.menu-open .menu-visual__flare {
  /* The final menu entrance ends at .35 s delay + .4 s transition.
     Wait another .5 s, then repeat a double flash every 2.5 s. Closing
     the menu removes the animation, so each reopening starts afresh. */
  animation-name: redspot-menu-highbeam;
  animation-duration: var(--menu-car-flash-duration);
  animation-delay: calc(var(--menu-car-menu-settle-duration) + var(--menu-car-flash-pause));
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

@keyframes redspot-menu-highbeam {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
  1.8% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  4.8% { opacity: .85; transform: translate(-50%, -50%) scale(1.15); }
  6.6% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
  9.6% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  12.6% { opacity: .8; transform: translate(-50%, -50%) scale(1.2); }
  16.2%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65); }
}

@media (prefers-reduced-motion: reduce) {
  .menu-visual { transition: none; transform: none; }
  .menu-visual__flare,
  .menu-open .menu-visual__flare { animation: none !important; opacity: 0 !important; }
}

@media print {
  .menu-visual { display: none; }
}
