/* Home page "Our works": sliding row of video covers (loaded only on the home page) */
.works { background: var(--black); overflow: hidden; position: relative; isolation: isolate; padding-bottom: clamp(64px, 8vw, 104px); }
/* Spotlight behind the row */
.works::before { content: ''; position: absolute; left: 50%; bottom: 4%; width: min(1100px, 120vw); height: 70%; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 255, 255, .09), transparent 70%); z-index: -1; pointer-events: none; }
/* Giant outlined title drifting the other way */
.works-bigtext { position: absolute; left: 0; right: 0; top: 46%; z-index: -1; pointer-events: none; white-space: nowrap; overflow: hidden; }
.works-bigtext span { display: inline-block; font: 700 clamp(90px, 15vw, 230px)/1 var(--serif); letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .13); animation: works-bigtext 70s linear infinite; }
.works-bigtext i { font-style: normal; font-size: .4em; vertical-align: middle; -webkit-text-stroke: 0; color: rgba(255, 255, 255, .08); margin: 0 .3em; }
@keyframes works-bigtext { from { transform: translateX(-50%); } to { transform: translateX(0); } }

.works .section-head { margin-bottom: 8px; }
.works-side { justify-self: end; max-width: 440px; display: grid; gap: 16px; }
.works-side p { color: var(--muted-d); font-size: 17px; }
.works-count { display: inline-flex; align-items: center; gap: 10px; justify-self: start; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 8px 14px; font: 600 13px/1 var(--sans); color: var(--ivory); background: rgba(255, 255, 255, .04); }
.works-live { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); animation: works-live 2s ease-out infinite; }
@keyframes works-live { to { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }

.works-track-wrap { position: relative; padding: 76px 0 30px; overflow: hidden; }
.works-track-wrap::before, .works-track-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: min(10vw, 140px); z-index: 3; pointer-events: none; }
.works-track-wrap::before { left: 0; background: linear-gradient(90deg, var(--black), transparent); }
.works-track-wrap::after { right: 0; background: linear-gradient(-90deg, var(--black), transparent); }
.works-track { display: flex; align-items: center; gap: 26px; width: max-content; list-style: none; margin: 0; padding: 0 0 0 26px; animation: works-slide var(--works-speed, 40s) linear infinite; }
.works.is-js .works-track { animation: none; will-change: transform; }
.works.is-js .works-track-wrap { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.works.is-js .works-track-wrap.is-dragging { cursor: grabbing; }
.works.is-js .works-track-wrap img { -webkit-user-drag: none; pointer-events: none; }
@keyframes works-slide { to { transform: translateX(-50%); } }

.work { position: relative; flex: 0 0 auto; --focus: 1; }
/* Cards grow and light up as they pass the centre (works.js sets --focus from 0 to 1) */
.work-card { display: block; position: relative; width: 268px; aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden; padding: 0; border: 1px solid rgba(255, 255, 255, calc(.08 + var(--focus) * .22)); background: linear-gradient(160deg, #2a2a2a, #0e0e0e 70%); cursor: pointer; color: var(--ivory); text-align: left;
  transform: scale(calc(.86 + var(--focus) * .14)); filter: brightness(calc(.5 + var(--focus) * .5)) saturate(calc(.6 + var(--focus) * .4));
  box-shadow: 0 calc(10px + var(--focus) * 30px) calc(30px + var(--focus) * 50px) -20px rgba(0, 0, 0, .9), 0 0 calc(var(--focus) * 60px) calc(var(--focus) * -10px) rgba(255, 255, 255, .12);
  outline: 2px solid transparent; outline-offset: 5px; transition: outline-color .25s ease, filter .25s ease; }
.work-card:hover { filter: brightness(1) saturate(1); }
.work-card:focus-visible { outline-color: #fff; filter: brightness(1) saturate(1); }
.work-fallback { position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, #3a3a3a, #111 70%); }
.work-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: works-drift 14s ease-in-out infinite alternate; }
.work:nth-child(2n) .work-media { animation-delay: -7s; }
@keyframes works-drift { from { transform: scale(1.02); } to { transform: scale(1.12) translateY(-2%); } }
/* Film-style top and bottom shading */
.work-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .35), transparent 22%, transparent 55%, rgba(0, 0, 0, .88)); pointer-events: none; }

.work-play { position: absolute; z-index: 2; top: 50%; left: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 34px -8px rgba(0, 0, 0, .7); transition: transform .3s ease; }
.work-play::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .55); animation: works-ring 2.4s ease-out infinite; }
.work-play::after { content: ''; position: absolute; left: 24px; top: 19px; border-left: 19px solid #000; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
@keyframes works-ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.work-card:hover .work-play { transform: scale(1.1); }

.work-top { position: absolute; z-index: 2; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; font: 600 11px/1 var(--sans); }
.work-top span:not(:empty) { background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 6px 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.work-meta { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 18px 20px; display: grid; gap: 4px; }
.work-meta small { color: #b5b5b5; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.work-meta b { font: 600 18px/1.2 var(--serif); }
.work-hint { position: absolute; z-index: 2; left: 50%; top: calc(50% + 46px); transform: translate(-50%, 6px); font: 600 12px/1 var(--sans); letter-spacing: .04em; color: #fff; opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.work-card:hover .work-hint { opacity: 1; transform: translate(-50%, 0); }

/* Pop-up card (the row keeps moving behind it) */
.work-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.work-modal[hidden] { display: none; }
.work-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: work-fade .25s ease; }
.work-modal-card { position: relative; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 320px); align-items: center; gap: 28px; background: linear-gradient(180deg, #171717, #0c0c0c); border: 1px solid rgba(255, 255, 255, .14); border-radius: 26px; padding: 22px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9); animation: work-pop-in .32s cubic-bezier(.2, .9, .3, 1.2); max-height: calc(100vh - 40px); overflow: auto; }
.work-modal-cover { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 38%, #3a3a3a, #111 70%); }
.work-modal-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-modal-cover img:not([src]), .work-modal-cover img[src=""] { display: none; }
.work-modal-body { display: grid; gap: 12px; justify-items: start; padding-right: 10px; }
.work-modal-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.work-modal-tags span { border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 6px 11px; font: 600 12px/1 var(--sans); color: #d4d4d4; }
.work-modal-body h3 { font: 600 clamp(26px, 3vw, 34px)/1.1 var(--serif); letter-spacing: -.02em; margin: 0; }
.work-modal-cat { color: var(--muted-d); margin: 0; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.work-modal-go { margin-top: 10px; }
.work-modal-go[hidden] { display: none; }
.work-modal-note { color: var(--muted-d); font-size: 13px; margin: 0; }
.work-modal-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .4); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; }
.work-modal-x:hover { background: #fff; color: #000; }
@keyframes work-fade { from { opacity: 0; } }
@keyframes work-pop-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@media (max-width: 700px) {
  .work-modal-card { grid-template-columns: 1fr; gap: 16px; padding: 16px; width: min(360px, 100%); }
  .work-modal-cover { max-height: 52vh; aspect-ratio: auto; height: 52vh; }
  .work-modal-body { padding: 0 4px 6px; }
}
@media (max-width: 960px) {
  .works-side { justify-self: start; }
}
@media (max-width: 640px) {
  .work-card { width: 190px; border-radius: 18px; }
  .work-meta b { font-size: 15px; }
  .work-play { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .work-play::after { left: 20px; top: 15px; border-left-width: 16px; border-top-width: 11px; border-bottom-width: 11px; }
  .works-track { gap: 14px; }
  .works-track-wrap { padding-top: 66px; }
  .works-bigtext { top: 52%; }
}
@media (prefers-reduced-motion: reduce) {
  .works-track, .work-media, .works-bigtext span, .work-play::before, .works-live, .work-modal-card, .work-modal-backdrop { animation: none; }
  .works-track-wrap { overflow-x: auto; }
  .work.is-copy { display: none; }
}
