/* ===== From the heavens to the High Court — scroll-driven backdrop ===== */
.cosSec{position:relative;height:520vh;background:#0c0603;color:#f7ecda}
.cosSticky{position:sticky;top:0;height:100vh;height:100svh;min-height:480px;overflow:hidden;isolation:isolate}
.cosSticky canvas{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:0}

/* the page dims into night at the top edge and lifts back out at the bottom */
.cosSec::before,.cosSec::after{content:"";position:absolute;left:0;right:0;height:26vh;z-index:4;pointer-events:none}
.cosSec::before{top:0;background:linear-gradient(180deg,var(--white,#fffdf9) 0%,rgba(255,253,249,.82) 22%,rgba(23,13,5,0) 100%)}
.cosSec::after{bottom:0;background:linear-gradient(0deg,var(--white,#fffdf9) 0%,rgba(255,253,249,.82) 22%,rgba(12,6,3,0) 100%)}

/* the words, held to the left like the rest of the page */
.cosText{position:absolute;inset:0;z-index:2;display:flex;align-items:center;pointer-events:none}
.cosText .wrap{width:100%}
.cosKick{font:600 .74rem/1 "Mukta",system-ui,sans-serif;letter-spacing:.26em;text-transform:uppercase;color:#e8b069;
  display:flex;align-items:center;gap:12px;margin-bottom:18px;opacity:calc(var(--cosFade,1))}
.cosKick::before{content:"";width:42px;height:1px;background:linear-gradient(90deg,transparent,#c49a3c)}
.cosCaps{position:relative;max-width:30ch;min-height:clamp(170px,26vh,250px)}
.cosCap{position:absolute;inset:0;opacity:0;transform:translateY(22px);transition:opacity .6s ease,transform .7s cubic-bezier(.2,.75,.25,1);will-change:opacity,transform}
.cosCap.on{opacity:1;transform:none}
.cosCap em{display:block;font:600 .78rem/1 "Mukta",system-ui,sans-serif;letter-spacing:.2em;color:#b8884a;font-style:normal;margin-bottom:10px}
.cosCap b,.cosCap h2{display:block;font-family:"Cormorant Garamond",Georgia,serif;font-weight:600;font-size:clamp(2rem,4.6vw,3.4rem);line-height:1.08;margin:0 0 12px;
  background:linear-gradient(100deg,#fff1d2,#ffb04a 50%,#f3d48a);-webkit-background-clip:text;background-clip:text;color:transparent}
.cosCap span{display:block;color:#d9c2a4;font-size:clamp(.95rem,1.3vw,1.1rem);line-height:1.6;max-width:34ch}
.cosCap i{display:block;font-style:normal;font-family:"Mukta",system-ui,sans-serif;color:#b99a76;font-size:.95rem;margin-top:8px}

/* the step marks */
.cosTicks{position:absolute;right:clamp(14px,2.4vw,34px);top:50%;transform:translateY(-50%);z-index:3;
  list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;opacity:calc(var(--cosFade,1))}
.cosTick{width:2px;height:26px;border-radius:2px;background:rgba(236,197,108,.22);transition:background .4s ease,box-shadow .4s ease}
.cosTick.on{background:linear-gradient(180deg,#ffc06a,#f0932c);box-shadow:0 0 10px rgba(244,123,22,.55)}

/* the closing scene */
.cosCourt{position:absolute;inset:0;z-index:2;display:grid;place-items:center;opacity:0;pointer-events:none;transition:opacity .6s ease;padding:7vh 16px}
.cosCourt.on{opacity:1}
.cosCourt svg{width:min(60%,560px);height:auto;filter:drop-shadow(0 26px 60px rgba(0,0,0,.72))}
.cosCourt.on svg{animation:cosRise 1s cubic-bezier(.2,.75,.25,1) both}
@keyframes cosRise{from{opacity:0;transform:translateY(30px) scale(.965)}to{opacity:1;transform:none}}
.cosCourt .cRays{transform-origin:320px 150px;animation:cosSpin 54s linear infinite}
@keyframes cosSpin{to{transform:rotate(360deg)}}

/* scroll cue, only while the first step is showing */
.cosCue{position:absolute;left:50%;bottom:4.5vh;transform:translateX(-50%);z-index:3;display:flex;flex-direction:column;align-items:center;gap:8px;
  font:600 .68rem/1 "Mukta",system-ui,sans-serif;letter-spacing:.24em;text-transform:uppercase;color:#d9ab6c;pointer-events:none;
  opacity:calc(var(--cosCue,1));transition:opacity .5s ease}
.cosCue i{display:block;width:1px;height:38px;background:linear-gradient(180deg,rgba(236,197,108,0),#ecc56c);animation:cosDrop 1.9s ease-in-out infinite}
@keyframes cosDrop{0%,100%{transform:scaleY(.55);opacity:.5}50%{transform:scaleY(1);opacity:1}}

@media(max-width:900px){
  .cosSec{height:460vh}
  .cosText{align-items:flex-end;padding-bottom:13vh}
  .cosKick{font-size:.64rem;letter-spacing:.18em;margin-bottom:12px}
  .cosKick::before{width:26px}
  .cosCaps{max-width:30ch;min-height:190px}
  .cosCap b,.cosCap h2{font-size:clamp(1.8rem,8vw,2.4rem)}
  .cosCap span{font-size:.95rem}
  .cosCourt svg{width:88%}
  .cosCourt{align-items:start;justify-items:center;padding:7vh 12px 36vh}
  /* the words below already name the court; the drawing's own lines would collide with them */
  .cosCourt svg text{display:none}
  .cosTicks{right:10px;gap:9px}
  .cosTick{height:18px}
}
@media(prefers-reduced-motion:reduce){
  .cosCap,.cosCourt{transition:none}
  .cosCourt.on svg,.cosCourt .cRays,.cosCue i{animation:none}
}

/* the closing scene sits in the picture column, clear of the words */
@media(min-width:901px){.cosCourt{padding-left:40%}}
