/* ============================================================
   Listing Cinema Studio
   A projection booth: the page is the screen, the rail is the reels.
   ============================================================ */

:root{
  /* Palette pulled from the plates themselves — dusk blue glass, lantern brass, limestone */
  --dusk-0:#04070E;
  --dusk-1:#0A101C;
  --dusk-2:#141D2E;
  --limestone:#EFE9DE;
  --slate:#8A99B0;
  --brass:#C9A05C;
  --brass-lit:#EBCE96;

  --card:#0B1220;
  --card-line:rgba(255,255,255,.60);   /* thin white edge, lifts the card off the plate */
  --glass:rgba(239,233,222,.055);
  --glass-line:rgba(239,233,222,.14);

  --gut:clamp(20px, 4vw, 56px);
  --pad-b:clamp(18px, 2.6vh, 30px);

  --ease:cubic-bezier(.22,.61,.36,1);
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  min-height:100dvh;
  background:var(--dusk-0);
  color:var(--limestone);
  font-family:"Instrument Sans",system-ui,sans-serif;
  font-size:16px;
  line-height:1.55;
  overflow-x:hidden;
}

img,svg,video{display:block;max-width:100%}

::selection{background:var(--brass);color:var(--dusk-0)}

/* ---------- The screen ---------------------------------- */

.screen{position:fixed;inset:0;z-index:0;overflow:hidden;background:var(--dusk-0)}

.plate{
  position:absolute;inset:0;
  background-size:cover;background-position:center;
}

/* Vignette + colour wash so type always clears the plate */
.screen__wash{
  position:absolute;inset:0;
  background:
    linear-gradient(to top, rgba(4,7,14,.96) 0%, rgba(4,7,14,.72) 28%, rgba(4,7,14,.30) 58%, rgba(4,7,14,.55) 100%),
    linear-gradient(to right, rgba(4,7,14,.88) 0%, rgba(4,7,14,.38) 46%, rgba(4,7,14,.24) 100%),
    radial-gradient(120% 88% at 50% 46%, transparent 40%, rgba(4,7,14,.72) 100%);
}

/* Film grain — static texture, animated only when motion is welcome */
.screen__grain{
  position:absolute;inset:-120px;
  opacity:.32;mix-blend-mode:overlay;pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- Shell -------------------------------------- */

.shell{
  position:relative;z-index:1;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  padding:clamp(16px,2.4vh,26px) var(--gut) var(--pad-b);
  gap:clamp(14px,2.2vh,26px);
}

/* ---------- Topbar ------------------------------------- */

.topbar{display:flex;align-items:center;gap:18px}

.mark{
  display:inline-flex;align-items:center;gap:11px;
  color:var(--limestone);text-decoration:none;
}
.mark__gate{width:24px;height:24px;color:var(--brass);flex:none;transition:transform 600ms var(--ease)}
.mark:hover .mark__gate{transform:rotate(90deg)}

.mark__type{
  display:grid;row-gap:3px;
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:11px;line-height:1.1;
  letter-spacing:.2em;text-transform:uppercase;
}
.mark__name{color:var(--limestone)}
.mark__craft{color:var(--slate);font-weight:300;letter-spacing:.17em}

/* ---------- Stage — the title card ---------------------- */

.stage{
  min-height:0;
  margin-top:clamp(2px,1vh,14px);
  text-align:center;
}

.headline{
  margin:0;
  font-family:"Fraunces",Georgia,serif;
  font-variation-settings:"opsz" 144,"SOFT" 0,"WONK" 1;
  font-weight:300;
  font-size:clamp(2.4rem,min(8vw,15vh),7.5rem);
  line-height:.98;
  letter-spacing:-.028em;
  text-wrap:balance;
  text-shadow:0 2px 46px rgba(4,7,14,.7);
}

.subtitle{
  margin:clamp(24px,3.3vh,38px) auto 0;
  max-width:54ch;
  font-size:clamp(1.07rem,1.2vw,1.19rem);
  line-height:1.62;
  color:rgba(239,233,222,.72);
  text-wrap:balance;
}

/* ---------- Rail --------------------------------------- */

/* The rail is a full-bleed dark floor the cards sit on */
.rail{
  margin-top:auto;              /* hero stays high, reels sit on the floor */
  margin-left:calc(-1 * var(--gut));
  margin-right:calc(-1 * var(--gut));
  margin-bottom:calc(-1 * var(--pad-b));
  padding:clamp(34px,6.4vh,80px) var(--gut) clamp(26px,3.6vh,44px);
  background:linear-gradient(to bottom,
    rgba(4,7,14,0) 0%,
    rgba(4,7,14,.62) 18%,
    rgba(4,7,14,.90) 48%,
    rgba(4,7,14,.97) 100%);
  display:grid;
  /* Six tracks, cards spanning two — same widths as a 3-up grid, but a row of
     two can start on track 2 and land dead centre. */
  grid-template-columns:repeat(6,1fr);
  gap:clamp(28px,3.6vh,48px) clamp(14px,1.5vw,24px);
}

/* Section heading — spans the grid so it sits between the two rows */
.rail__head{
  grid-column:1 / -1;
  margin:clamp(6px,1.4vh,18px) 0 0;
  display:flex;align-items:center;gap:18px;
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:12px;font-weight:400;
  letter-spacing:.3em;text-transform:uppercase;
  color:var(--brass);
}
.rail__head::after{
  content:"";height:1px;flex:1;
  background:linear-gradient(to right,rgba(201,160,92,.45),transparent);
}

/* Stat panel — fills the third cell. Deliberately not a card: no border, no
   photo, so it reads as commentary rather than something to click. */
.stats{
  grid-column:span 2;
  align-self:start;              /* sits level with the tops of the cards */
  padding-left:clamp(20px,1.8vw,30px);
  border-left:1px solid rgba(201,160,92,.4);
}

.stats__lead{
  margin:0 0 clamp(20px,2.3vh,30px);
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:16px;letter-spacing:.26em;text-transform:uppercase;
  color:var(--brass);
}

.stats__list{
  margin:0;padding:0;list-style:none;
  counter-reset:stat;
  display:grid;gap:clamp(18px,2.2vh,28px);
}

.stat{
  counter-increment:stat;
  display:grid;grid-template-columns:auto 1fr;column-gap:14px;align-items:start;
  font-size:clamp(1.12rem,1.32vw,1.3rem);
  line-height:1.42;
  color:rgba(239,233,222,.82);
}
.stat::before{
  content:counter(stat) ".";
  font-family:"DM Mono",ui-monospace,monospace;
  font-weight:400;
  color:var(--brass);
  font-variant-numeric:lining-nums;
}

/* A card is one solid object: plate on top, text on an opaque body beneath it */
.reel{
  position:relative;
  grid-column:span 2;
  display:grid;
  grid-template-rows:auto 1fr;
  padding:0;margin:0;
  overflow:hidden;
  border:1px solid var(--card-line);
  border-radius:14px;
  background:var(--card);
  color:inherit;text-align:left;text-decoration:none;
  font:inherit;cursor:pointer;
  box-shadow:0 26px 54px -34px rgba(0,0,0,.95);
  transition:transform 480ms var(--ease),border-color 420ms var(--ease);
}
.reel:hover,.reel:focus-visible{transform:translateY(-6px);border-color:rgba(255,255,255,.95)}
.reel:focus{outline:none}
.reel:focus-visible{box-shadow:0 0 0 2px var(--brass-lit),0 26px 50px -28px #000}

.reel__frame{
  position:relative;
  aspect-ratio:16/9;          /* the still sets the card's height */
  overflow:hidden;
  background:var(--dusk-2);
  border-bottom:1px solid var(--glass-line);
}

.reel__still,.reel__loop{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
}
.reel__still{
  filter:saturate(.72) brightness(.72);
  transition:filter 620ms var(--ease),transform 900ms var(--ease);
}
.reel:hover .reel__still,.reel:focus-visible .reel__still{filter:saturate(1) brightness(1);transform:scale(1.03)}

.reel__loop{opacity:0;transition:opacity 620ms var(--ease)}
.reel.is-playing .reel__loop{opacity:1}

.reel__badge{
  position:absolute;top:10px;left:10px;
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 9px;
  border-radius:99px;
  background:rgba(4,7,14,.62);
  backdrop-filter:blur(6px);
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:9.5px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--brass-lit);
}
.reel__badge::before{
  content:"";width:5px;height:5px;border-radius:50%;background:var(--brass);
}

/* Empty gate — academy leader marks, no fake photography */
.gate{
  position:absolute;inset:0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 20.4%, rgba(201,160,92,.26) 20.4% 20.9%, transparent 21%),
    radial-gradient(circle at 50% 50%, transparent 0 31%, rgba(201,160,92,.13) 31% 31.4%, transparent 31.5%),
    linear-gradient(to right, transparent calc(50% - .5px), rgba(201,160,92,.20) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom, transparent calc(50% - .5px), rgba(201,160,92,.20) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(155deg,#0D1523,#080D18 58%,#04070E);
  transition:opacity 420ms var(--ease);
}
/* Leader countdown numeral */
.gate::before{
  content:attr(data-n);
  position:absolute;inset:0;z-index:1;
  display:flex;align-items:center;justify-content:center;
  font-family:"DM Mono",ui-monospace,monospace;
  font-weight:300;
  font-size:clamp(40px,6vw,92px);
  letter-spacing:.02em;
  color:rgba(201,160,92,.17);
  transition:color 480ms var(--ease);
}
.reel.is-empty:hover .gate::before,
.reel.is-empty:focus-visible .gate::before{color:rgba(235,206,150,.34)}
.gate::after{
  content:"";
  position:absolute;top:50%;left:50%;
  height:62%;aspect-ratio:1;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:conic-gradient(from -90deg, rgba(201,160,92,.22), rgba(201,160,92,.03) 26%, transparent 27%);
}
.reel.is-empty:hover .gate::after,
.reel.is-empty:focus-visible .gate::after{animation:sweep 2.4s linear infinite}
@keyframes sweep{to{transform:translate(-50%,-50%) rotate(360deg)}}

.reel__meta{
  display:grid;grid-template-columns:auto 1fr;column-gap:12px;row-gap:2px;align-items:baseline;
  padding:15px 17px 17px;
}
.reel__no{
  grid-column:1;grid-row:1;
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:1.35rem;font-weight:300;line-height:1;
  color:var(--brass);
  transition:color 380ms var(--ease)
}
.reel__name{
  grid-column:2;grid-row:1;
  font-family:"Fraunces",Georgia,serif;
  font-variation-settings:"opsz" 40,"SOFT" 0,"WONK" 0;
  font-weight:400;font-size:1rem;line-height:1.25;
}
.reel__copy{
  grid-column:2;grid-row:2;
  margin-top:3px;
  font-size:.82rem;line-height:1.45;
  color:rgba(239,233,222,.56);
}
.reel.is-empty .reel__name{color:rgba(239,233,222,.72)}
.reel.is-empty .reel__no{color:rgba(201,160,92,.5)}
.reel.is-empty:hover .reel__no{color:var(--brass)}

/* ---------- Load sequence — the gate opens -------------- */

@media (prefers-reduced-motion:no-preference){
  .topbar,.stage,.rail__head,.reel{animation:rise 900ms var(--ease) backwards}
  .topbar{animation-delay:120ms}
  .stage{animation-delay:260ms}
  .rail__head{animation-delay:915ms}
  /* by type, so the section heading between the rows doesn't shift the count */
  .reel:nth-of-type(1){animation-delay:640ms}
  .reel:nth-of-type(2){animation-delay:695ms}
  .reel:nth-of-type(3){animation-delay:750ms}
  .reel:nth-of-type(4){animation-delay:805ms}
  .reel:nth-of-type(5){animation-delay:860ms}
  .reel:nth-of-type(6){animation-delay:970ms}
  .reel:nth-of-type(7){animation-delay:1025ms}
  .reel:nth-of-type(8){animation-delay:1080ms}
  @keyframes rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}

  .screen__grain{animation:weave 620ms steps(2,end) infinite}
  @keyframes weave{
    0%{transform:translate3d(0,0,0)}
    50%{transform:translate3d(-14px,9px,0)}
    100%{transform:translate3d(7px,-11px,0)}
  }
}

/* ---------- Responsive --------------------------------- */

@media (max-width:1080px){
  .rail{grid-template-columns:repeat(4,1fr)}
}

@media (max-width:720px){
  .shell{min-height:auto;padding-bottom:40px;gap:30px}
  .stage{margin-top:6vh}
  .screen__wash{
    background:
      linear-gradient(to top, rgba(4,7,14,.97) 0%, rgba(4,7,14,.80) 40%, rgba(4,7,14,.55) 100%),
      radial-gradient(120% 80% at 50% 40%, transparent 30%, rgba(4,7,14,.7) 100%);
  }
}

/* Phones: one reel per row so the copy under each card keeps its measure */
@media (max-width:560px){
  .rail{grid-template-columns:repeat(2,1fr);gap:26px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
  .plate{transform:none}
}
