/* The opening reel: films travel sideways along a curved reel and keep playing while they move. */
.loop-reel{--w:clamp(17.5rem,min(40vw,95vh),72rem);--spread:.8;position:relative;height:calc(var(--w) * .5625 + clamp(2.6rem,5vw,5rem));margin:clamp(.9rem,2vw,1.6rem) auto 0;perspective:1100px;perspective-origin:50% 40%;isolation:isolate;touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:grab}
.loop-reel:active{cursor:grabbing}
.loop-halo,.loop-floor{position:absolute;pointer-events:none;z-index:-1;left:50%;transform:translateX(-50%);border-radius:50%}
.loop-halo{width:calc(var(--w)*2.55);height:92%;border:1px solid #ad7d4430;top:5%;box-shadow:0 0 0 13px #fff9ef38,0 0 0 14px #b1845c17}
.loop-floor{width:calc(var(--w)*1.7);height:22%;bottom:2%;background:radial-gradient(ellipse,#68452b44 0%,#8c654c1c 44%,transparent 70%);filter:blur(8px)}
.loop-card{position:absolute;left:50%;top:46%;width:var(--w);aspect-ratio:16/9;margin:calc(var(--w) * -.28125) 0 0 calc(var(--w) * -.5);border-radius:clamp(1.1rem,2.6vw,2.6rem);overflow:hidden;background:#1d1713;border:2px solid #fff8ed;box-shadow:0 1.6rem 3.4rem -1.4rem #2b1b0f99,0 .5rem 1rem -.6rem #2b1b0f55;transform-origin:50% 50%;will-change:transform;backface-visibility:hidden}
.loop-card video,.loop-card img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.loop-card:focus-visible{outline:3px solid #1674a3;outline-offset:4px}
.loop-caption{display:flex;align-items:baseline;justify-content:center;gap:1.6rem;min-height:2rem;width:min(calc(100% - 2.5rem),var(--cap,43rem));margin:clamp(.55rem,1vw,.9rem) auto 0;text-align:left}
.loop-caption p{display:flex;align-items:baseline;gap:.7rem;min-width:0}
.loop-caption strong{white-space:nowrap}
.loop-caption span{font-size:.9rem;color:#6d5642}
.loop-caption strong{font-size:clamp(1.05rem,1.4vw,1.3rem);letter-spacing:-.03em;font-weight:750;transition:opacity .35s}
.loop-caption a{flex:none;display:inline-flex;align-items:center;gap:.45rem;font-weight:700;color:var(--copper);font-size:.95rem}
.loop-caption a i{width:0;height:0;border-top:.3rem solid transparent;border-bottom:.3rem solid transparent;border-left:.46rem solid currentColor}
.loop-caption strong,.loop-caption span{transition:opacity .18s ease-out}
.loop-caption.swap strong,.loop-caption.swap span{opacity:0}
/* Until the reel has laid itself out, show only the first film. */
.loop-reel:not(.ready) .loop-card:not(:nth-of-type(1)){opacity:0}

/* A clean edge between the opening and the next section. */
.opening-reel{position:relative;z-index:1;border-radius:0 0 clamp(2rem,5vw,5rem) clamp(2rem,5vw,5rem);box-shadow:0 1px 0 #cdb594,0 1.4rem 2.6rem -1.8rem #6b4a2c66}
@media (max-width:700px){
  .loop-reel{--w:min(76vw,20rem);--spread:.7;height:calc(var(--w) * .5625 + 2.3rem);margin-top:1rem}
  .loop-caption{width:calc(100% - 2.2rem);align-items:flex-end;justify-content:space-between;min-height:3.1rem}
  .loop-caption p{flex-direction:column;align-items:flex-start;gap:.1rem}
  .loop-caption span{font-size:.82rem}
}
@media (prefers-reduced-motion:reduce){.loop-card{transition:none}}

/* A soft blur on the films at full speed, as a camera would see them move. */
/* side cards are dimmed by a shade layer that fades, so the videos themselves are never filtered */
.loop-card::after{content:"";position:absolute;inset:0;border-radius:inherit;background:#0b0806;opacity:var(--dim,0);transition:opacity 1200ms cubic-bezier(.65,0,.35,1);pointer-events:none}
/* phones: lighter shadows on the moving cards */
@media (hover:none),(max-width:760px){.loop-card{box-shadow:0 1rem 2rem -1.2rem #00000099}}

/* Each card carries its own perspective (in reel.js), so the reel itself is flat: Safari then stacks the cards
   by z-index instead of slicing tilted cards into each other as they pass. */
.loop-reel{perspective:none}
