/* Illustrated layers retain the original 3:2 scroll footprint. The light
   CSS theatre stays visible until both decorative images have decoded. */
.reveal-video{container-type:inline-size}
.reveal-video .video-window{
  position:relative;
  isolation:isolate;
  aspect-ratio:3/2;
  padding:0;
  border:0;
  border-radius:14% 14% 3% 3% / 16% 16% 3% 3%;
  color:#fff3d8;
  background:
    radial-gradient(ellipse at 50% 0%,#bda76f22,transparent 65%),
    linear-gradient(105deg,#123f43,#1b5758 48%,#123f43);
  box-shadow:inset 0 0 0 2px #664220,inset 0 0 0 4px #edcf85aa,
    inset 0 -7px 0 #623e24,inset 0 -9px 0 #c59a55,
    0 5px 0 #5d3b23,0 12px 25px #06243166;
  overflow:visible;
}
.reveal-video .video-window[data-theater-assets=ready]{background:none;box-shadow:none;border-radius:0}
.reveal-video .video-window .theater-art{position:absolute;inset:0;z-index:4;width:100%;height:100%;aspect-ratio:3/2;object-fit:contain;border:0;border-radius:0;box-shadow:none;pointer-events:none;user-select:none}
.reveal-video .video-window::before,
.reveal-video .video-window::after{
  content:'';
  position:absolute;
  z-index:3;
  top:26%;
  bottom:7%;
  width:35.5%;
  pointer-events:none;
  background:repeating-linear-gradient(90deg,#0b363a 0%,#216468 12%,#387b79 20%,#15464b 30%,#082e33 36%);
  border-bottom:2px solid #d7b36f;
  box-shadow:0 5px 8px #031d2c44;
  transform:scaleX(calc(1 - var(--theater-open,0)));
}
.reveal-video .video-window::before{left:14.5%;transform-origin:left center;border-right:2px solid #d7b36f;border-radius:0 0 12% 0}
.reveal-video .video-window::after{right:14.5%;transform-origin:right center;border-left:2px solid #d7b36f;border-radius:0 0 0 12%}
.reveal-video .video-window[data-theater-assets=ready]::before,
.reveal-video .video-window[data-theater-assets=ready]::after{background-image:url('assets/theatre-rideaux-illustres.webp');background-repeat:no-repeat;background-size:200% 100%;border:0;border-radius:0;box-shadow:none}
.reveal-video .video-window[data-theater-assets=ready]::before{background-position:left center}
.reveal-video .video-window[data-theater-assets=ready]::after{background-position:right center}
.reveal-video .video-window-title{
  position:absolute;
  inset:29% 15% auto;
  z-index:2;
  justify-content:center;
  gap:7%;
  height:7%;
  margin:0;
  color:#ffe5a8;
  font-size:clamp(7px,2.55cqw,14px);
  line-height:1.15;
  text-align:center;
  text-shadow:0 1px 3px #06243188;
}
.reveal-video .video-window-title span{color:#f1cc7c;font-size:1.05em}
.reveal-video .video-window-picks{
  position:absolute;
  inset:37% 14.5% 9%;
  z-index:2;
  display:block;
  margin:0;
}
.reveal-video .video-window figure{
  position:absolute;
  top:50%;
  width:47%;
  opacity:var(--pick-reveal,0);
  transform:translateY(calc(-50% + (1 - var(--pick-reveal,0)) * 14px));
}
.reveal-video .video-window figure:first-child{left:calc(10% * (1 - var(--theater-duet,0)));width:calc(80% - 33% * var(--theater-duet,0))}
.reveal-video .video-window figure:nth-child(2){right:0}
.reveal-video .video-window-link img{
  height:auto;
  aspect-ratio:16/9;
  border:1px solid #ebc77b;
  border-radius:5%;
  box-shadow:0 3px 7px #031e2d66;
}
.reveal-video .video-pick-label{
  display:block;
  color:#fff2d6;
  font-size:clamp(7px,2.4cqw,13px);
  line-height:1.22;
  font-weight:700;
  margin-top:4%;
  text-align:center;
  text-shadow:0 1px 3px #06243177;
}

/* The frame contains real links. Only its visible choices enter the tab order. */
.scene-object.reveal-video:not([inert]){pointer-events:auto}
.video-window-link{display:block;color:inherit;text-decoration:none;border-radius:5%}
.video-window-link:focus-visible{outline:3px solid #fff4d1;outline-offset:4px}
.video-window-link:hover img{border-color:#fff6d8;filter:brightness(1.08)}
.reveal-video .video-window figure[aria-hidden=true]{visibility:hidden}
.theater-switch{display:none}
@media(max-width:819px){
  .reveal-video .video-window-title{width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .reveal-video .video-window-picks{inset:29.5% 14.5% 8%;}
  .reveal-video .video-window figure,
  .reveal-video .video-window figure:first-child{inset:0;width:100%;transform:none}
  .reveal-video .video-window-link{height:100%;position:relative;overflow:hidden;min-height:44px}
  .reveal-video .video-window-link img{height:100%;min-height:0;object-fit:cover;border-radius:5%;aspect-ratio:auto}
  .reveal-video .video-pick-label{position:absolute;inset:auto 0 0;font-size:clamp(8px,3.4cqw,12px);margin:0;padding:10px 2px 4px;background:linear-gradient(transparent,#062b36e8);line-height:1.2}
  .theater-switch{position:absolute;inset:38% 0 auto;z-index:5;display:flex;justify-content:space-between;pointer-events:none}
  .theater-switch button{width:44px;height:44px;padding:0;border:1px solid #f1ce89;border-radius:50%;background:#123f43ed;color:#ffe7b7;font-size:13px;font-weight:bold;pointer-events:auto;box-shadow:0 2px 7px #06243155}
  .theater-switch button[aria-pressed=true]{background:#ffe7b7;color:#123f43}
  .theater-switch button:focus-visible{outline:3px solid white;outline-offset:2px}
  .theater-switch button[hidden]{display:none}
}

/* Ambient detail follows the scroll, never an independent running animation. */
.palace-atmosphere{position:absolute;inset:0;z-index:2;overflow:hidden;pointer-events:none;user-select:none;opacity:0;contain:strict}
.palace-atmosphere .palace-light{position:absolute;left:62%;top:5%;width:23%;height:70%;background:linear-gradient(158deg,#ffe0a514,transparent 65%);clip-path:polygon(42% 0,57% 0,100% 100%,0 100%);transform:rotate(-9deg);transform-origin:50% 0;opacity:var(--ambient-glow,0)}
.palace-atmosphere .palace-dust{position:absolute;width:3px;height:3px;border-radius:50%;background:#fff0be;box-shadow:0 0 5px 1px #ffe4a055;opacity:var(--dust-alpha,.2);transform:translate(var(--dust-x,0px),var(--dust-y,0px))}
.palace-atmosphere .palace-dust:nth-of-type(3n){width:2px;height:2px;box-shadow:0 0 3px #ffe4a055}
body.calm .palace-atmosphere{display:none}
@media(prefers-reduced-motion:reduce){.palace-atmosphere{display:none}}
