/* The showreel layer. House tokens stay in house.css; this adds light, motion and sharing.
   Every rule here only applies once showreel.js has run (html.sr-on), so the page without
   JavaScript is exactly the approved house. Reduced motion keeps the light and drops the motion. */
:root{--hour-a:#cf6f8c;--hour-b:#584a94;--hour-tint:#b2689c;--hour-strength:.4;--sun:0;--ease:cubic-bezier(.16,1,.3,1)}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* 1. The light of the visitor’s hour */
.sr-on .room{position:relative;isolation:isolate;overflow:hidden}
.sr-on .room>header{position:relative;display:flex;justify-content:space-between;align-items:baseline;gap:16px}
.room .line{position:relative}

/* The trees: tinted by the hour, opening from a framed window to full bleed */
.sr-on .open{position:relative;overflow:hidden;isolation:isolate;
  clip-path:inset(0 calc(var(--open,0)*var(--gut)) round calc(var(--open,0)*10px));}
.sr-on .open img{translate:0 var(--drift,0px);scale:1.12;will-change:translate}
.sr-on .open::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,var(--hour-tint),var(--hour-b));mix-blend-mode:soft-light;opacity:calc(var(--hour-strength)*1.6);transition:opacity 2s}
/* Selection carries the light */
.sr-on ::selection{background:color-mix(in srgb,var(--hour-a) 45%,var(--ink));color:var(--paper)}

/* 2. The landing line surfaces, slowly, once */
.rise{animation:rise 1.8s var(--ease) .15s both}
@keyframes rise{from{opacity:0;translate:0 14px;clip-path:inset(100% 0 -20% 0)}to{opacity:1;translate:0 0;clip-path:inset(-20% 0 -20% 0)}}

/* 3. Scroll choreography */
@media (prefers-reduced-motion:no-preference){
  .rv{opacity:0;translate:0 16px;transition:opacity 1.3s var(--ease),translate 1.4s var(--ease);transition-delay:calc(var(--w,0)*110ms)}
  .rv.in{opacity:1;translate:0 0}
  .me .portrait.rv{translate:none;opacity:1;clip-path:inset(100% 0 0 0);transition:clip-path 1.4s var(--ease)}
  .me .portrait.rv.in{clip-path:inset(0 0 0 0)}
  .rv-path li{position:relative;border-top-color:transparent}
  .rv-path li::before{content:"";position:absolute;left:0;right:0;top:-1px;height:1px;background:var(--line);transform-origin:left;transform:scaleX(0);
    transition:transform 1.2s var(--ease),background .5s;transition-delay:calc(var(--w,0)*140ms + 120ms)}
  .rv-path li.in::before{transform:scaleX(1)}
  .rv-path li:hover::before,.rv-path li:focus-within::before{background:var(--quiet)}
  .strip.sideways li.rv{translate:24px 0}
  .strip.sideways li.rv.in{translate:0 0}
}
.intro.lit .lw{opacity:.34;transition:opacity .9s var(--ease)}
.intro.lit .lw.on{opacity:1}

/* 4. Links: the underline settles closer on hover. No colour, no movement. */
.sr-on .index .w a,.sr-on .more>summary{transition:text-decoration-color .5s,text-underline-offset .5s var(--ease)}
.sr-on .index .w a:hover,.sr-on .more>summary:hover{opacity:1;text-decoration-color:var(--ink);text-underline-offset:6px}
.sr-on .more .pl{transition:transform .7s var(--ease)}

/* 5. The reel: focus pull, a quiet position line, and mouse dragging */
.strip.sideways .reel{cursor:grab}
.strip.dragging .reel{cursor:grabbing;scroll-snap-type:none;scroll-behavior:auto}
.strip.dragging img{pointer-events:none}
.strip.sideways li{opacity:var(--focus,1);transition:opacity .5s}
.strip li.rv.in{opacity:var(--focus,1)}
.reel-progress{height:1px;margin:28px var(--gut) 0;background:var(--line)}
.reel-progress[hidden]{display:none}
.reel-progress span{display:block;height:1px;width:0;background:var(--hour-a);transition:width .25s}
.strip img,.strip video{transition:filter .6s}
.strip li.arrived img,.strip li.arrived video{animation:arrive 2.8s var(--ease)}
@keyframes arrive{0%{filter:brightness(1)}25%{filter:brightness(1.25) saturate(1.15)}100%{filter:none}}

/* Theme changes open like a lamp, from the toggle */
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
.theme-swap::view-transition-new(root){animation:lamp .7s var(--ease)}
@keyframes lamp{from{clip-path:circle(0 at var(--vt-x,100%) var(--vt-y,100%))}to{clip-path:circle(var(--vt-r,150vmax) at var(--vt-x,100%) var(--vt-y,100%))}}

@media (prefers-reduced-motion:reduce){
  .sr-on .open img{translate:none;scale:1}
}
