.scenes {
  color: white;
  background: radial-gradient(ellipse at 100% 0%, var(--purple), transparent 59%), #28105e;
}

.scenes-container {
  max-width: 1010px;
}

.scenes .eyebrow { color: var(--lime); }
.scenes .section-heading p:not(.eyebrow) { color: var(--white); }

.scenes-grid {
  display: grid;
  gap: 20px;
}

.scene-card {
  --scene-light: #7938da66;
  --scene-shadow: #221044c7;
  --scene-stripe: #a8ff0080;
  --scene-stripe-fine: #a8ff0040;
  --scene-sample-base: var(--purple);
  --scene-sample-alt: var(--lime);
  --scene-sample-on-base: #fff;
  --scene-sample-on-alt: var(--ink);
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  margin: 0;
  border-radius: 26px;
  background: white;
  color: var(--ink);
  box-shadow: 0 22px 52px #12052a57;
}

.scene-card:nth-child(2) {
  --scene-light: #00a67047;
  --scene-shadow: #102d2ec4;
  --scene-stripe: #00e58a99;
  --scene-stripe-fine: #00e58a55;
  --scene-sample-base: var(--lime);
  --scene-sample-alt: var(--purple);
  --scene-sample-on-base: var(--ink);
  --scene-sample-on-alt: #fff;
}

.scene-frame {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  justify-items: end;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  padding: clamp(12px, 3vw, 22px);
  background: linear-gradient(153deg, #42258a, #210b49 73%);
}

.scene-frame img,
.scene-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.06);
}

.scene-frame video { opacity: 0; }
.scene-frame[data-show-video] video { opacity: 1; }

.scene-frame::before,
.scene-frame::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.scene-video-caption {
  position: absolute;
  z-index: 3;
  left: clamp(12px, 3vw, 22px);
  bottom: calc(clamp(12px, 3vw, 22px) + 57px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 32px);
  padding: 7px 11px;
  border: 1px solid #ffffff75;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font: 800 clamp(.83rem, 2vw, 1.06rem)/1.25 var(--display);
  box-shadow: 0 6px 19px #170b337a;
}

.scene-frame::before {
  z-index: 1;
  inset: 0;
  background: linear-gradient(151deg, var(--scene-light), transparent 52%, var(--scene-shadow));
}

.scene-frame::after {
  z-index: 2;
  inset: -34px;
  background: repeating-linear-gradient(134deg,
    transparent 0 26px,
    var(--scene-stripe) 26px 28px,
    transparent 28px 36px,
    var(--scene-stripe-fine) 36px 37px,
    transparent 37px 65px);
  -webkit-mask-image: linear-gradient(151deg, #000 10%, transparent 45% 64%, #0009 100%);
  mask-image: linear-gradient(151deg, #000 10%, transparent 45% 64%, #0009 100%);
}

.scene-sample {
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px;
  border-radius: 13px;
  background: var(--scene-sample-base);
  color: var(--scene-sample-on-base);
  box-shadow: 0 8px 24px #170b33a3, 0 0 0 1px #ffffff85;
}

.scene-time {
  flex: none;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--scene-sample-alt);
  color: var(--scene-sample-on-alt);
  font-size: .72rem;
  font-weight: 800;
}

.scene-event strong,
.scene-event small { display: block; }
.scene-event strong { font-size: .82rem; line-height: 1.18; }
.scene-event small { font-size: .66rem; }

.scene-state {
  padding: 4px 7px;
  border-radius: 20px;
  background: var(--scene-sample-alt);
  color: var(--scene-sample-on-alt);
  font-size: .64rem;
  font-weight: 800;
  white-space: nowrap;
}

.scene-frame[data-confirmed] .scene-state {
  box-shadow: inset 0 0 0 1px currentColor;
}

.scene-caption {
  display: flex;
  flex-wrap: wrap;
  align-content: space-between;
  align-items: center;
  justify-content: space-between;
  gap: 13px 18px;
  padding: clamp(15px, 2.7vw, 26px);
}

.scene-caption h3 {
  font: 800 clamp(1.13rem, 2vw, 1.45rem)/1.2 var(--display);
  letter-spacing: -.032em;
}

.scene-caption p {
  max-width: 36ch;
  margin-top: 5px;
  color: var(--muted);
  font-size: .9rem;
}

.scene-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid #ddcef0;
  border-radius: 999px;
  color: var(--white);
  background: var(--purple);
  font-size: .8rem;
  font-weight: 800;
}

.scene-control:hover { background: var(--ink); }
.scene-caption .scene-status { flex-basis: 100%; margin: 0; }

@media (min-width: 640px) {
  .scenes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.7vw, 30px); }
}

@media (prefers-reduced-motion: no-preference) {
  .scene-frame video { transition: opacity 240ms ease-out; }

  .scene-frame[data-show-video]::after {
    animation: scene-stripes-drift 12s linear both paused;
  }

  .scene-frame[data-playing]::after { animation-play-state: running; }

  @keyframes scene-stripes-drift {
    from { transform: none; }
    to { transform: translate(7px, 4px); }
  }
}
