/* The lighting mask uses the same cover crop and focal point as the kitchen picture. */
#space .hero-photo { isolation: isolate; }
.kitchen-light { display: none; }

@supports (width: 1cqw) and (mix-blend-mode: multiply) and (mask-size: 250% 100%) {
  @media (prefers-reduced-motion: no-preference) {
    body:not(.motion-off) #space:is([data-niche-light="off"], [data-niche-light="rising"]) .kitchen-light {
      display: block;
      position: absolute;
      inset: 0;
      overflow: hidden;
      container-type: size;
      mix-blend-mode: multiply;
      pointer-events: none;
    }
    .kitchen-light-plane {
      position: absolute;
      width: max(100cqw, calc(100cqh * 16 / 9));
      height: max(100cqh, calc(100cqw * 9 / 16));
      left: var(--room-focus, 50%);
      top: 51%;
      transform: translate(calc(-1 * var(--room-focus, 50%)), -51%);
    }
    .kitchen-light-plane::after {
      content: "";
      position: absolute;
      /* The mask covers (800,380)–(1306,510) in the 1920 × 1080 photograph. */
      left: 41.666667%;
      top: 35.185185%;
      width: 26.354167%;
      height: 12.037037%;
      background: url("/assets/film/niche-shadow.svg") center / 100% 100% no-repeat;
      mask-image: linear-gradient(to right, #000 44%, transparent 56%);
      mask-repeat: no-repeat;
      mask-size: 250% 100%;
      mask-position: 0% 50%;
    }
    #space[data-niche-light="rising"] .kitchen-light-plane::after {
      animation: kitchen-strip-ignite 1.9s cubic-bezier(.31,.05,.26,.99) .3s both;
    }
  }
}

@keyframes kitchen-strip-ignite {
  from { mask-position: 0% 50%; }
  to { mask-position: 100% 50%; }
}
