/* ------------------------------------------------------------------
   Components: cursor, scroll indicator, player, compare, case view
   ------------------------------------------------------------------ */

/* --- custom cursor --------------------------------------------------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 400; width: 28px; height: 28px; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity 0.24s var(--ease); }
.cursor.is-on { opacity: 1; }
.cursor__frame {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%);
  transition: width 0.72s var(--ease-expo), height 0.72s var(--ease-expo), opacity 0.28s ease;
}
.cursor .c { position: absolute; width: 6px; height: 6px; border: 1px solid var(--brand-cursor); transition: width 0.52s var(--ease-expo), height 0.52s var(--ease-expo), border-color 0.36s ease; }
.cursor .c-tl { top: 0; left: 0; } .cursor .c-tr { top: 0; right: 0; }
.cursor .c-bl { bottom: 0; left: 0; } .cursor .c-br { bottom: 0; right: 0; }
.cursor .l { position: absolute; background: #fff; transition: opacity 0.22s ease; }
.cursor .l.v { width: 1px; height: 6px; left: 50%; transform: translateX(-50%); }
.cursor .l.h { height: 1px; width: 6px; top: 50%; transform: translateY(-50%); }
.cursor .l.t { top: 5px; } .cursor .l.b { bottom: 5px; }
.cursor .l.lft { left: 5px; } .cursor .l.rgt { right: 5px; }
.cursor.is-active .cursor__frame { width: 52px; height: 32px; }
.cursor.is-active .c { width: 8px; height: 8px; }
.cursor.is-active .l { opacity: 0; }
.cursor.is-active .c-tl { border-right-color: transparent; border-bottom-color: transparent; }
.cursor.is-active .c-tr { border-left-color: transparent; border-bottom-color: transparent; }
.cursor.is-active .c-bl { border-right-color: transparent; border-top-color: transparent; }
.cursor.is-active .c-br { border-left-color: transparent; border-top-color: transparent; }
.cursor.is-down .cursor__frame { width: 44px; height: 28px; transition-duration: 0.18s; }
.cursor__text { position: absolute; left: 34px; top: -14px; color: #fff; font-size: 12px; line-height: 1.2; letter-spacing: 0.02em; text-transform: uppercase; white-space: pre; }
.cursor__text span { display: inline-block; overflow: hidden; vertical-align: top; }
.cursor__text span i { display: block; font-style: normal; transform: translateY(110%); transition: transform 0.65s var(--ease); }
.cursor__text span:nth-child(odd) i { transform: translateY(-110%); }
.cursor__text.is-on span i { transform: none; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor .card, html.has-cursor [data-cursor] { cursor: none; }
html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto; }
/* the custom cursor is not inside a full-screen element, so the native one comes back there */
html.has-cursor :fullscreen, html.has-cursor :fullscreen * { cursor: auto; }
html.has-cursor :fullscreen button, html.has-cursor :fullscreen .player__track { cursor: pointer; }
@media (hover: none), (pointer: coarse) { .cursor { display: none !important; } }

/* --- scroll indicator ------------------------------------------------ */
.scrollbar { position: fixed; top: 0; right: 3px; bottom: 0; z-index: 60; width: 6px; pointer-events: none; mix-blend-mode: difference; }
.scrollbar__track { position: absolute; top: 96px; bottom: 20px; left: 50%; width: 1px; background: rgba(255, 255, 255, 0.28); }
.scrollbar__head { position: absolute; top: 96px; left: 0; width: 6px; height: 6px; background: #fff; transform: translateY(calc(var(--p, 0) * (100vh - 122px))); transform: translateY(calc(var(--p, 0) * (100dvh - 122px))); }
.scrollbar__label {
  position: absolute; top: 96px; right: 12px; color: #fff; font-size: 12px; white-space: nowrap; text-transform: uppercase;
  transform: translateY(calc(var(--p, 0) * (100vh - 122px) - 3px)); transform: translateY(calc(var(--p, 0) * (100dvh - 122px) - 3px)); opacity: 0; transition: opacity 0.3s;
}
.scrollbar.is-moving .scrollbar__label { opacity: 1; }
@media (max-width: 991px) { .scrollbar { right: 2px; } .scrollbar__label { display: none; } .scrollbar__track { top: 65px; } .scrollbar__head { top: 65px; transform: translateY(calc(var(--p, 0) * (100vh - 91px))); transform: translateY(calc(var(--p, 0) * (100dvh - 91px))); } }

/* --- player ----------------------------------------------------------- */
.player { position: relative; display: flex; justify-content: center; background: #000; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; }
.player__stage { position: relative; height: min(78svh, 56.25vw); aspect-ratio: var(--ar, 16 / 9); max-width: 100%; }
.player[data-ratio='9:16'] .player__stage { height: 82svh; }
.player[data-ratio='1:1'] .player__stage { height: auto; width: min(100%, 82svh); }
/* a playlist with both landscape and portrait films keeps one box, so the page does not jump between films */
.player.is-mixed[data-ratio] .player__stage { width: 100%; height: 82svh; aspect-ratio: auto; }
.player.is-mixed .player__poster { object-fit: contain; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.6s ease; }
.player.is-started .player__poster { opacity: 0; pointer-events: none; }
.player__hit { position: absolute; inset: 0 0 44px 0; z-index: 2; }
/* gradient under the controls: the film can be any colour */
.player__stage::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 96px; z-index: 3; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0.6) 46px, rgba(0, 0, 0, 0) 100%);
  transition: opacity 0.4s var(--ease);
}
.player.is-idle.is-playing .player__stage::after { opacity: 0; }
.player__big {
  position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%);
  padding: 10px 14px 9px; background: var(--ink); white-space: nowrap;
  font-size: var(--fs-h3); text-transform: uppercase; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.6s var(--ease-expo);
}
.player.is-playing .player__big { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
.player__ui {
  position: absolute; inset: auto 0 0 0; z-index: 4; display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 0 var(--g) var(--g); font-size: 12px; text-transform: uppercase;
  transition: opacity 0.4s var(--ease);
}
.player.is-idle.is-playing .player__ui { opacity: 0; }
.player__ui button { padding: 8px 0; white-space: nowrap; }
.player__time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.player__time::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 4px 1px 0; background: var(--brand); }
.player__track { position: relative; height: 24px; cursor: pointer; touch-action: none; }
.player__track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255, 255, 255, 0.5); }
.player__buf { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; width: 0; background: rgba(255, 255, 255, 0.35); }
.player__fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; width: 0; background: #fff; }
.player__fill::after { content: ''; position: absolute; right: -3px; top: -1.5px; width: 6px; height: 6px; background: #fff; }
.player__sound b { font-weight: 700; }
/* buffering and failure are visible states, not a frozen poster */
.player.is-loading .player__big { opacity: 1; transform: translate(-50%, -50%); font-size: 0; }
.player.is-loading .player__big::after { content: '[ … ]'; font-size: var(--fs-h3); animation: player-wait 1s steps(2, end) infinite; }
@keyframes player-wait { 50% { opacity: 0.35; } }
.player.is-error .player__big { opacity: 1; transform: translate(-50%, -50%); }
.player.is-error .player__hit { pointer-events: none; }

.player:fullscreen { align-items: center; }
.player.player:fullscreen .player__stage.player__stage.player__stage { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
.player:fullscreen .player__poster { object-fit: contain; }

.playlist { display: flex; gap: var(--g); padding: var(--g); overflow-x: auto; scrollbar-width: none; background: #000; color: #fff; scroll-snap-type: x proximity; }
.playlist::-webkit-scrollbar { display: none; }
.playlist__item { flex: none; width: clamp(120px, 12vw, 200px); text-align: left; scroll-snap-align: start; }
.playlist__item .playlist__thumb img { opacity: 0.5; transition: opacity 0.22s ease; }
.playlist__item.is-active .playlist__thumb img { opacity: 1; }
@media (hover: hover) { .playlist__item:hover .playlist__thumb img { opacity: 1; } }
.playlist__thumb { position: relative; aspect-ratio: 3 / 2; margin-bottom: 6px; background: var(--media); border: 2px solid transparent; overflow: hidden; }
.playlist__item.is-active .playlist__thumb { border-color: rgba(255, 255, 255, 0.5); }
.playlist__thumb img { width: 100%; height: 100%; object-fit: cover; }
.playlist__item span { display: block; line-height: 1.1; text-transform: uppercase; }
.playlist__item span + span { margin-top: 3px; color: var(--muted-inv); font-variant-numeric: tabular-nums; }

/* --- compare ----------------------------------------------------------- */
.compare { display: flex; flex-direction: column; gap: 12px; }
.compare__tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.compare__tab { color: var(--muted); text-transform: uppercase; transition: color 0.1s; }
.compare__tab.is-active { color: var(--ink); }
@media (hover: hover) { .compare__tab:hover { color: var(--ink); } }
.compare__tab.is-active::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: var(--brand); vertical-align: 1px; }
.compare__arrow { color: var(--muted); }
.compare__box { position: relative; aspect-ratio: var(--ar, 16 / 9); max-height: 86svh; margin-inline: auto; width: 100%; background: var(--media); overflow: hidden; cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare[data-ratio='9:16'] .compare__box { width: min(100%, calc(86svh * 9 / 16)); }
.compare[data-ratio='4:5'] .compare__box { width: min(100%, calc(86svh * 4 / 5)); }
.compare__box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.compare__before { clip-path: inset(0 calc(100% - var(--x, 50%)) 0 0); transition: opacity 0.4s var(--ease); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 1px; margin-left: -0.5px; background: #fff; mix-blend-mode: difference; pointer-events: none; }
.compare__handle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff; }
.compare__handle::after { content: '< >'; position: absolute; top: calc(50% + 12px); left: 50%; transform: translateX(-50%); color: #fff; font-size: 12px; white-space: nowrap; letter-spacing: 0.1em; }
.compare__lbl { position: absolute; bottom: 10px; z-index: 2; padding: 5px 6px 4px; background: var(--ink); color: #fff; text-transform: uppercase; pointer-events: none; }
.compare__lbl--a { left: 10px; } .compare__lbl--b { right: 10px; }
.compare__cap { color: var(--muted); line-height: 1.2; }
.compare__box:focus-visible { outline-offset: -1px; }

/* --- case view ----------------------------------------------------------- */
.case { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: var(--bg); clip-path: inset(100% 0 0 0); transition: clip-path 0.85s var(--ease-wipe); }
.case[hidden] { visibility: hidden; pointer-events: none; }
.case.is-open { clip-path: inset(0); }
/* a solid bar above the scroller: it never sits on the film or on the copy */
.case__bar { position: relative; z-index: 5; flex: none; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: var(--g); background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.case__bar button, .case__bar a { padding: 4px 0; }
.case__nav { display: inline-flex; align-items: center; gap: 14px; }
.case__pos { font-variant-numeric: tabular-nums; }
.case__scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; outline: 0; }
.case__scroll::-webkit-scrollbar { display: none; }

.case__head { display: grid; grid-template-columns: 55fr 45fr; gap: var(--g); padding: 46px var(--g) 0; align-items: end; }
.case__title { grid-column: 1 / -1; margin-bottom: 26px; }
.case__title .ln > span { transition-delay: 0.35s; }
.case__one { max-width: 26ch; }
.case__meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.case__meta dt { margin-bottom: 6px; color: var(--muted); text-transform: uppercase; }
.case__meta dd { line-height: 1.12; }
.case__spec { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }

.case__body { display: grid; grid-template-columns: 45fr 55fr; gap: 0 var(--g); margin-top: 46px; padding: 0 var(--g); }
.case__nofilm { height: 30px; }
.block { display: contents; }
.block__label { padding: 14px 0 60px; border-top: 1px solid var(--ink); color: var(--muted); text-transform: uppercase; }
.block__label b { color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 8px; }
.block__main { padding: 14px 0 60px; border-top: 1px solid var(--ink); }
.block--full .block__main { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
.block--full .block__label { grid-column: 1 / -1; padding-bottom: 14px; }
.block__lead { max-width: 30ch; margin-bottom: 20px; }
.block__main .text { max-width: 62ch; }

.bullets { margin-top: 26px; border-top: 1px solid var(--line); }
.bullets li { display: grid; grid-template-columns: 26px 1fr; padding: 11px 0 12px; border-bottom: 1px solid var(--line); }
.bullets li::before { content: ''; width: 6px; height: 6px; margin-top: 0.5em; background: var(--ink); }

.pipe { counter-reset: pipe; }
.pipe li { counter-increment: pipe; display: grid; grid-template-columns: 60px 1fr; gap: 6px 0; padding: 12px 0 18px; border-bottom: 1px solid var(--line); }
.pipe li:first-child { padding-top: 0; }
.pipe li::before { content: counter(pipe, decimal-leading-zero); color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 0.5em; font-variant-numeric: tabular-nums; }
.pipe h4 { font-size: var(--fs-sub); line-height: 1; margin-bottom: 8px; }
.pipe .text { grid-column: 2; }

.metrics { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); border-top: 1px solid var(--ink); }
.metric { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: clamp(150px, 15vw, 260px); padding: 14px 14px 16px 0; border-bottom: 1px solid var(--line); }
.metric:not(:first-child) { padding-left: 14px; border-left: 1px solid var(--line); }
.metric__value { font-size: clamp(32px, 4.6vw, 88px); line-height: 0.85; letter-spacing: -0.04em; text-transform: uppercase; white-space: nowrap; }
.metric__label { max-width: 26ch; font-size: 15px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }

.stills { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g); }
.stills figure { background: var(--media); overflow: hidden; }
.stills img { width: 100%; height: auto; aspect-ratio: auto 1 / 1; transition: transform 0.75s var(--ease-expo); }
@media (hover: hover) { .stills figure:hover img { transform: scale(1.04); } }
.stills figcaption { padding: 8px 0 0; background: var(--bg); color: var(--muted); text-transform: uppercase; }

.case__nextcase { display: block; position: relative; margin: 60px var(--g) var(--g); height: 60svh; overflow: hidden; color: #fff; }
.case__nextcase::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0.6) 44px, rgba(0, 0, 0, 0) 96px),
    linear-gradient(to top, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0) 80%);
}
.case__nextcase .h1, .case__nextcase .body { position: absolute; left: 20px; z-index: 2; }
.case__nextcase .body { top: 20px; text-transform: uppercase; }
.case__nextcase .h1 { bottom: 20px; right: 20px; }
.case__nextcase img { transition: transform 0.9s var(--ease-expo); }
@media (hover: hover) { .case__nextcase:hover img { transform: scale(1.05); } }
.case__cta { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 var(--g) 30px; }

@media (max-width: 991px) {
  /* a landscape film never grows taller than the screen when the phone is turned */
  .player__stage { height: auto; width: min(100%, calc((100svh - 60px) * 16 / 9)); }
  .player[data-ratio='9:16'] .player__stage { height: 74svh; width: auto; }
  .player[data-ratio='1:1'] .player__stage { height: auto; width: min(100%, 74svh); }
  .player.is-mixed[data-ratio] .player__stage { height: 74svh; width: 100%; }
  /* two rows: the track on top, buttons under it, full screen included */
  .player__ui { grid-template-columns: auto auto 1fr auto auto; gap: 0 10px; }
  .player__track { grid-column: 1 / -1; grid-row: 1; }
  .player__sound { grid-column: 4; }
  .player__full { grid-column: 5; }
  .player__ui button { padding: 14px 0; }
  .player__hit { bottom: 76px; }
  .player__stage::after { height: 130px; background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0.6) 76px, rgba(0, 0, 0, 0) 100%); }
  .playlist__item { width: 110px; }
  .case__bar button, .case__bar a { padding: 14px 0; margin: -10px 0; }
  .compare__tab { padding: 14px 0; margin: -8px 0; }

  .case__head { grid-template-columns: 1fr; padding-top: 26px; gap: 22px; }
  .case__title { margin-bottom: 0; }
  .case__meta { grid-template-columns: repeat(2, 1fr); }
  .case__body { grid-template-columns: 1fr; margin-top: 30px; }
  .block__label { padding-bottom: 12px; }
  .block__main { border-top: 0; padding: 0 0 46px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 0; gap: 26px; }
  .metric:not(:first-child) { padding-left: 0; border-left: 0; }
  .metric:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
  .stills { grid-template-columns: repeat(2, 1fr); }
  .pipe li { grid-template-columns: 34px 1fr; }
  .case__nextcase { height: 56vw; min-height: 240px; margin-top: 30px; }
  .case__nextcase .h1, .case__nextcase .body { left: 10px; }
  .case__nextcase .body { top: 10px; } .case__nextcase .h1 { bottom: 10px; }
  .case__cta { flex-direction: column; align-items: flex-start; }
}
