/* Troiana — /work/ index: screening room + editorial index.
   Loaded only by work/index.html, after site.css; uses its tokens. */

/* ---------- Head ---------- */
.wx-head { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(32px, 3.6vw, 52px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 34ch); column-gap: clamp(32px, 5vw, 96px); align-items: end; }
.wx-head__main .eyebrow { margin-bottom: clamp(20px, 2.4vw, 32px); }
.wx-head__side { display: grid; gap: 22px; padding-bottom: .5em; }
.wx-count { display: flex; align-items: baseline; gap: 12px; }
.wx-count strong { font-size: clamp(56px, 7vw, 104px); font-weight: 300; letter-spacing: -.05em; line-height: .8; color: var(--signal); font-variant-numeric: tabular-nums; }
.wx-count span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); max-width: 8ch; line-height: 1.3; }
.wx-title {
  margin: 0; max-width: 15ch;
  font-size: clamp(44px, 6.6vw, 104px); font-weight: 300; letter-spacing: -.045em; line-height: .96;
}
.wx-title em { font-style: normal; color: var(--graphite); }
.wx-lede { max-width: 40ch; margin: 0; color: var(--graphite); font-size: 17px; line-height: 1.6; }

/* ---------- Screening room ---------- */
.wx-screen {
  --sr-bg: #0B0B10; --sr-line: rgba(255,255,255,.1); --sr-soft: #8A8A96;
  background: var(--sr-bg); color: #fff;
  padding: clamp(28px, 4vw, 56px) 0 clamp(20px, 3vw, 36px);
}
.wx-screen[hidden] { display: none; }
.wx-screen__inner {
  max-width: calc(var(--container-max) + 240px); margin: 0 auto; padding: 0 var(--edge);
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 380px); gap: clamp(28px, 3.4vw, 56px); align-items: stretch;
}
.wx-stage__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.wx-stage__poster, .wx-stage__film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wx-stage__film { opacity: 0; transition: opacity .5s var(--ease-standard); }
.wx-screen.is-playing .wx-stage__film { opacity: 1; }
.wx-screen.is-switching .wx-stage__frame > img, .wx-screen.is-switching .wx-stage__film { animation: wx-cut .38s var(--ease-reveal); }
@keyframes wx-cut { from { opacity: .2; transform: scale(1.015); } to { opacity: 1; transform: none; } }
.wx-stage__toggle {
  position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(11,11,16,.62); border: 1px solid rgba(255,255,255,.18); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .2s var(--ease-standard);
}
.wx-stage:hover .wx-stage__toggle, .wx-stage__toggle:focus-visible, .wx-screen.is-paused .wx-stage__toggle { opacity: 1; }
.wx-stage__toggle span { width: 10px; height: 12px; border-left: 3px solid #fff; border-right: 3px solid #fff; }
.wx-screen.is-paused .wx-stage__toggle span { width: 0; height: 0; border: 0; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.wx-stage__toggle:focus-visible { outline: 2px solid var(--signal-soft); outline-offset: 2px; }

.wx-prog { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.wx-prog__now { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--sr-soft); }
.wx-prog__now b { color: #fff; font-weight: 500; }
.wx-prog__dot { width: 8px; height: 8px; background: var(--negative); box-shadow: 0 0 0 4px rgba(255,90,95,.18); animation: wx-rec 1.6s steps(1) infinite; }
.wx-screen.is-paused .wx-prog__dot { animation: none; background: var(--sr-soft); box-shadow: none; }
@keyframes wx-rec { 50% { opacity: .25; } }
.wx-prog__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 28px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sr-soft); }
.wx-prog__meta span + span::before { content: '·'; margin-right: 14px; color: rgba(255,255,255,.3); }
.wx-prog__title { margin: 14px 0 0; font-size: clamp(34px, 3.6vw, 52px); font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.wx-prog__text { margin: 16px 0 0; color: #C9C9D2; font-size: 16px; line-height: 1.55; }
.wx-prog__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 26px 0 0; border-top: 1px solid var(--sr-line); }
.wx-prog__stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 16px 12px 0 0; }
.wx-prog__stats > div + div { padding-left: 14px; border-left: 1px solid var(--sr-line); }
.wx-prog__stats dd { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -.03em; line-height: 1; color: #fff; white-space: nowrap; }
.wx-prog__stats dt { font-size: 12px; line-height: 1.35; color: var(--sr-soft); }
.wx-prog__actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; }
.wx-screen .btn--primary { background: #fff; color: var(--ink); }
.wx-screen .btn--primary:hover { background: #fff; transform: scale(1.02); }
.wx-prog .btn { gap: 10px; }
.wx-prog__nav { display: flex; }
.wx-prog__nav button {
  width: 48px; height: 48px; cursor: pointer; font-size: 18px;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.22);
  transition: background var(--dur-micro) var(--ease-standard), border-color var(--dur-micro) var(--ease-standard);
}
.wx-prog__nav button + button { border-left: 0; }
.wx-prog__nav button:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.wx-prog__nav button:focus-visible, .wx-rail__item:focus-visible { outline: 2px solid var(--signal-soft); outline-offset: 2px; }

/* the rail: every case, as a strip of posters */
.wx-rail-wrap { max-width: calc(var(--container-max) + 240px); margin: clamp(24px, 3vw, 40px) auto 0; padding: 0 var(--edge); }
.wx-rail {
  list-style: none; margin: 0; padding: 0 0 14px;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(132px, 11vw, 168px); gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.wx-rail li { scroll-snap-align: start; }
.wx-rail__item { display: block; width: 100%; padding: 0; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.wx-rail__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #17171F; }
.wx-rail__img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .42; filter: saturate(.7); transition: opacity .25s var(--ease-standard), filter .25s var(--ease-standard), transform .4s var(--ease-reveal); }
.wx-rail__item:hover .wx-rail__img { opacity: .8; filter: none; }
.wx-rail__item.is-active .wx-rail__img { opacity: 1; filter: none; }
.wx-rail__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.12); opacity: 0; }
.wx-rail__bar b { display: block; height: 100%; width: 100%; background: var(--signal-soft); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .25s linear; }
.wx-rail__item.is-active .wx-rail__bar { opacity: 1; }
.wx-rail__label { display: flex; gap: 8px; margin-top: 10px; font-size: 13px; line-height: 1.3; color: var(--sr-soft); transition: color .2s var(--ease-standard); }
.wx-rail__label em { font-style: normal; font-family: var(--font-mono); font-size: 11px; padding-top: 1px; color: rgba(255,255,255,.35); }
.wx-rail__item:hover .wx-rail__label, .wx-rail__item.is-active .wx-rail__label { color: #fff; }
.wx-rail__item.is-active .wx-rail__label em { color: var(--signal-soft); }

/* ---------- Index ---------- */
.wx-index-wrap { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.wx-index__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: clamp(36px, 5vw, 64px); }
.wx-index__head .eyebrow { margin-bottom: 16px; }
.wx-index__head h2 { margin: 0; }
.wx-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wx-filters[hidden] { display: none; }
.wx-filters button {
  height: 40px; padding: 0 16px; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink);
  background: transparent; border: 1px solid var(--hairline);
  transition: background var(--dur-micro) var(--ease-standard), border-color var(--dur-micro) var(--ease-standard), color var(--dur-micro) var(--ease-standard);
}
.wx-filters button span { margin-left: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--graphite); }
.wx-filters button:hover { border-color: var(--ink); }
.wx-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.wx-filters button[aria-pressed="true"] span { color: rgba(255,255,255,.6); }
.wx-filters button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.wx-index { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 36px); row-gap: clamp(56px, 6vw, 96px); align-items: start; }
.wx-index > div { grid-column: span 6; }            /* the no-JS link list */
.wx-tile { display: block; grid-column: span 6; color: inherit; text-decoration: none; }
.wx-tile[hidden] { display: none; }
.wx-tile.wx-r-w7 { grid-column: span 7; }
.wx-tile.wx-r-n5 { grid-column: span 5; }
.wx-tile.wx-r-c4 { grid-column: span 4; }
.wx-tile.wx-r-h6 { grid-column: span 6; }
.wx-tile.wx-r-drop { margin-top: clamp(48px, 9vw, 140px); }
.wx-tile.wx-r-drop-s { margin-top: clamp(24px, 4vw, 64px); }
.wx-index.is-short .wx-tile { grid-column: span 6; margin-top: 0; }

.wx-tile__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper); border: 1px solid var(--hairline); }
.wx-tile__img, .wx-tile__film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wx-tile__img { transition: transform .9s var(--ease-reveal); }
.wx-tile__img.is-still { object-position: top center; }
.wx-tile__film { opacity: 0; transition: opacity .35s var(--ease-standard); }
.wx-tile.is-playing .wx-tile__film { opacity: 1; }
.wx-tile:hover .wx-tile__img { transform: scale(1.035); }
.wx-tile__chip {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: rgba(11,11,16,.66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-4px); transition: opacity .2s var(--ease-standard), transform .2s var(--ease-standard);
}
.wx-tile__chip i { width: 6px; height: 6px; background: var(--negative); }
.wx-tile.is-playing .wx-tile__chip { opacity: 1; transform: none; }
.wx-tile.no-film .wx-tile__chip { display: none; }

.wx-tile__cap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding-top: 20px; }
.wx-tile__num { font-size: clamp(32px, 3.2vw, 48px); font-weight: 300; letter-spacing: -.05em; line-height: .85; color: var(--signal); font-variant-numeric: tabular-nums; }
.wx-tile__num small { font-size: 12px; letter-spacing: 0; color: var(--placeholder); font-family: var(--font-mono); margin-left: 2px; vertical-align: top; }
.wx-tile__body { display: block; min-width: 0; }
.wx-tile__meta { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.wx-tile__title { display: block; margin-top: 8px; font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; }
.wx-r-w7 .wx-tile__title { font-size: clamp(26px, 2.6vw, 38px); }
.wx-tile__arrow { display: inline-block; color: var(--signal); font-size: .7em; transition: transform .2s var(--ease-standard); }
.wx-tile:hover .wx-tile__arrow { transform: translate(3px, -3px); }
.wx-tile__text { display: block; max-width: 52ch; margin-top: 10px; color: var(--graphite); font-size: 15.5px; line-height: 1.5; }
.wx-tile:focus-visible { outline: 2px solid var(--signal); outline-offset: 6px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1080px) {
  .wx-head { grid-template-columns: 1fr; }
  .wx-head__side { margin-top: 28px; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 28px; }
  .wx-lede { max-width: 58ch; }
  .wx-screen__inner { grid-template-columns: 1fr; }
  .wx-prog__meta { margin-top: 0; padding-top: 18px; }
  .wx-prog__now { order: -1; }
  .wx-tile.wx-r-w7, .wx-tile.wx-r-n5, .wx-tile.wx-r-c4 { grid-column: span 6; }
  .wx-tile.wx-r-drop, .wx-tile.wx-r-drop-s { margin-top: 0; }
  .wx-tile:nth-child(even):not([hidden]) { margin-top: 0; }
}
@media (max-width: 720px) {
  .wx-head__side { grid-template-columns: 1fr; gap: 18px; }
  .wx-count strong { font-size: 56px; }
  .wx-lede { font-size: 17px; }
  .wx-screen { padding-top: 20px; }
  .wx-screen__inner { padding: 0; gap: 22px; }
  .wx-prog { padding: 0 var(--edge); }
  .wx-prog__stats dd { font-size: 22px; }
  .wx-prog__actions { gap: 10px; }
  .wx-prog__actions .btn { flex: 1; padding: 0 16px; }
  .wx-stage__toggle { opacity: 1; width: 36px; height: 36px; right: 10px; bottom: 10px; }
  .wx-index__head { flex-direction: column; align-items: flex-start; }
  .wx-filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; margin: 0 calc(var(--edge) * -1); padding: 0 var(--edge) 4px; scrollbar-width: none; }
  .wx-filters button { flex: none; }
  .wx-index { grid-template-columns: 1fr; row-gap: 48px; }
  .wx-index > div, .wx-tile, .wx-tile.wx-r-w7, .wx-tile.wx-r-n5, .wx-tile.wx-r-c4, .wx-tile.wx-r-h6, .wx-index.is-short .wx-tile { grid-column: 1 / -1; }
  .wx-tile__cap { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .wx-prog__dot { animation: none; }
  .wx-screen.is-switching .wx-stage__frame > img, .wx-screen.is-switching .wx-stage__film { animation: none; }
  .wx-tile__img, .wx-rail__img { transition: none; }
}
