/* Reel tiles and the reel dialog (assets/js/reels.js). Loaded on the home page and work/cuan.html. */

/* home: the tile sits above the card's own link overlay, so a click on a reel plays it */
.wk-frames li.has-reel { position: relative; z-index: 1; }
.wk-frames video.wk-shot { opacity: .9; }
.reel-btn { all: unset; box-sizing: border-box; cursor: pointer; }
.wk-frames .reel-btn { font: inherit; color: inherit; }
.wk-frames .reel-btn::after, .reel-btn--cover { position: absolute; inset: 0; border-radius: inherit; }
.wk-frames .reel-btn::after { content: ""; }
.reel-btn--cover { z-index: 3; }
.reel-btn:focus-visible { outline: none; }
.has-reel:has(.reel-btn:focus-visible) { outline: 2px solid var(--signal, #FF5A1F); outline-offset: 3px; }

/* play mark, top right; it stays visible when the tile does not move (reduced motion, Save-Data) */
.has-reel .reel-btn::before {
  content: ""; position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
  background: rgb(15 13 12 / .55) url("reel-play.svg") center / 16px no-repeat;
  border: 1px solid rgb(243 237 228 / .28); opacity: 0; transition: opacity var(--dur-2, .24s) var(--ease, ease);
}
.has-reel.is-still .reel-btn::before, .has-reel:hover .reel-btn::before, .has-reel:has(.reel-btn:focus-visible) .reel-btn::before { opacity: 1; }

/* case page: the video sits under the slate; the slate becomes a scrim so its title and credit stay readable (AA) */
.shot.has-reel video { z-index: 0; }
.shot.has-reel .slate { z-index: 2; background: linear-gradient(to bottom, rgb(15 13 12 / .82), rgb(15 13 12 / 0) 26%, rgb(15 13 12 / 0) 52%, rgb(15 13 12 / .92) 88%); }
.shot.has-reel .reel-btn::before { top: auto; right: auto; bottom: 50%; left: 50%; width: 48px; height: 48px; margin: 0 0 -24px -24px; background-size: 22px; }

/* the dialog */
.reel-box {
  box-sizing: border-box; width: auto; max-width: calc(100vw - 32px); height: min(88svh, 920px); aspect-ratio: 9 / 16;
  margin: auto; padding: 0; overflow: visible; color: var(--paper, #F3EDE4);
  background: var(--ink-900, #161210); border: 1px solid var(--gold-line, rgb(199 162 102 / .3)); border-radius: 12px;
  box-shadow: 0 24px 80px rgb(0 0 0 / .55);
}
@supports not (aspect-ratio: 9 / 16) { .reel-box { width: calc(min(88svh, 920px) * 9 / 16); } }
.reel-box::backdrop { background: rgb(15 13 12 / .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.reel-box__v { display: block; width: 100%; height: 100%; border-radius: 11px; background: #000; object-fit: contain; }
.reel-box__x {
  position: absolute; top: -14px; right: -14px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--paper, #F3EDE4); background: rgb(28 22 19 / .94); border: 1px solid var(--gold-line, rgb(199 162 102 / .3)); cursor: pointer;
}
.reel-box__x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.reel-box__x:focus-visible { outline: 2px solid var(--signal, #FF5A1F); outline-offset: 2px; }
@media (max-width: 520px) { .reel-box { height: auto; width: calc(100vw - 32px); max-height: calc(100svh - 72px); } .reel-box__x { top: -52px; right: 0; } }
@media (prefers-reduced-motion: reduce) { .has-reel .reel-btn::before { transition: none; } }
/* case page: client and length at the top, title and credit together at the bottom, over the darker scrim */
.shot.has-reel .slate { justify-content: flex-start; background: linear-gradient(to bottom, rgb(15 13 12 / .9), rgb(15 13 12 / .55) 14%, rgb(15 13 12 / 0) 30%, rgb(15 13 12 / 0) 38%, rgb(15 13 12 / .88) 58%, rgb(15 13 12 / .96)); }
.shot.has-reel .slate__title { margin-top: auto; font-size: clamp(13px, 6cqi, 22px); text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
/* 16:9 videos (data-wide on the button): a wide dialog instead of the 9:16 reel one */
.reel-box.reel-box--wide { aspect-ratio: 16 / 9; height: auto; max-height: none; width: min(calc(100vw - 32px), 1280px, calc((100svh - 96px) * 16 / 9)); }
@media (max-width: 520px) { .reel-box.reel-box--wide { width: calc(100vw - 32px); } }
/* wide videos on a case page: the video plays clean, and its title, length and credit sit under it as a caption */
.shot--h.has-reel { overflow: visible; margin-bottom: 72px; }
.shot--h.has-reel video { border-radius: inherit; }
.shot--h.has-reel .reel-btn--cover { border-radius: inherit; }
.shot--h.has-reel .slate { inset: 100% 0 auto 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0 0; background: none; }
.shot--h.has-reel .slate__top { display: contents; }
.shot--h.has-reel .slate__client { display: none; }
.shot--h.has-reel .slate__chips { grid-column: 2; grid-row: 1; }
.shot--h.has-reel .slate__title { grid-column: 1; grid-row: 1; margin: 0; font-size: 14px; text-shadow: none; }
.shot--h.has-reel .slate__credit { grid-column: 1 / -1; padding: 0; border: 0; }
/* tall reels on a case page: the video shows clean; only the title stays, on a short fade at the foot */
.shot--v.has-reel .slate { background: linear-gradient(to top, rgb(15 13 12 / .88), rgb(15 13 12 / 0) 30%); }
.shot--v.has-reel .slate__client, .shot--v.has-reel .slate__credit { display: none; }
.shot--v.has-reel .slate__top { justify-content: flex-end; }

/* Video tiles on the home work cards show the clip only: no format icon, no title, no dark fade (Sarthak, 4 Dec 2026). The title stays for screen readers. */
.wk-frames li.has-reel::before, .wk-frames li.has-reel::after { display: none; }
