/* Composite the grain as one layer so scrolling does not repaint its backdrop. */
.grain {
  display: block;
  z-index: 26;
  opacity: .17;
  background: none;
  animation: none;
  overflow: hidden;
  contain: paint;
}
.grain::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: url("/assets/review/grain.png") 0 0/104px 104px repeat;
  animation: grain-phase .72s steps(1,end) infinite;
  will-change: transform;
}
body.review-media-active .grain { opacity: .10; }
@keyframes grain-phase {
  0% { transform: translate(0,0); }
  16% { transform: translate(-8px,11px); }
  32% { transform: translate(6px,-13px); }
  48% { transform: translate(-14px,-7px); }
  64% { transform: translate(12px,7px); }
  80% { transform: translate(-4px,14px); }
}

/* One video fills the current preview without changing the artwork’s proportions. */
.archive-card[data-archive-preview] .archive-image img,
.review-frame-surface img, .review-gallery-media img { filter: grayscale(1); transition: filter .23s linear; }
.archive-card[data-archive-preview]:is(:hover,:focus-visible) .archive-image img,
.review-frame-surface:hover img, .review-gallery-slide.is-current img { filter: none; }
.archive-card[data-archive-preview]:hover .archive-image img { transform: none; }
.archive-image, .review-frame-surface { touch-action: pan-y; background: #0a0a0a; }
.motion-preview-video {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  background: #0a0a0a;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s linear;
}
.has-preview-video > .motion-preview-video { opacity: 1; }
/* The red timeline is attached only while the shared player is active. */
.motion-preview-timeline {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 10px;
  height: 2px;
  z-index: 4;
  background: #ff4438;
  box-shadow: 0 1px 3px #0009;
  pointer-events: none;
  visibility: hidden;
}
.has-preview-video > .motion-preview-timeline { visibility: visible; }
.motion-preview-timeline i {
  position: absolute;
  left: var(--preview-position, 0%);
  bottom: -2px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  background: #ff4438;
  clip-path: polygon(0 0, 100% 0, 64% 53%, 64% 100%, 36% 100%, 36% 53%);
}
.review-index-thumb .motion-preview-timeline { bottom: 4px; }
.review-index-thumb .motion-preview-timeline i { height: 9px; width: 9px; }

.review-archive-gallery { margin: 16px 0 clamp(32px,6vw,72px); min-width: 0; }
.review-gallery-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  padding-inline: 15%;
  gap: clamp(6px,1vw,15px);
  scrollbar-width: none;
}
.review-gallery-track::-webkit-scrollbar { display: none; }
.review-gallery-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; }
.review-gallery-media {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #110e0e;
}
.review-gallery-media img { width: 100%; height: 100%; object-fit: contain; opacity: .6; transition: opacity .25s, filter .25s; }
.review-gallery-slide.is-current img, .review-gallery-slide:hover img { opacity: 1; }
.review-gallery-caption { display: block; padding-block: 8px; font-size: clamp(.96rem,1.9vw,1.55rem); font-weight: 600; }
.review-gallery-nav { display: flex; gap: 15px; align-items: center; justify-content: center; margin-block: 3px; }
.review-gallery-nav button {
  width: 44px; height: 44px; border: 1px solid var(--ink);
  color: var(--paper); background: var(--ink); border-radius: 50%; cursor: pointer;
}
.review-gallery-nav button:disabled { color: var(--ink); background: transparent; border-color: var(--line); cursor: default; }
.review-gallery-nav output { min-width: 7ch; text-align: center; font: .78rem/1 var(--mono); }
.archive-row--reel-pair { grid-template-columns: repeat(2, minmax(0,1fr)); }
.archive-grid .archive-row--reel-pair .archive-image { height: auto; aspect-ratio: 16/9; }
.archive-grid .archive-row--reel-pair .archive-image img { object-fit: contain; }
.review-frame-layout { direction: ltr; }
[dir=rtl] .review-frame-layout > * { direction: rtl; }
@media (max-width: 760px) {
  .review-gallery-track { padding-inline: 7.5%; }
  .archive-row--reel-pair { grid-template-columns: minmax(0,1fr); }
}

/* Catalogue arrangement and row highlight. */
.review-index-head,
.review-index-row {
  position: relative;
  grid-template-columns: 3.3ch minmax(72px, .24fr) minmax(10rem,1fr) minmax(10rem,.7fr) 7ch;
  gap: 18px;
  align-items: center;
  padding-inline: min(2vw,20px);
}
.review-index-head > span:nth-child(2) { grid-column: 3; }
.review-index-row strong {
  font-size: clamp(1.12rem,2.4vw,2.3rem);
  line-height: 1.13;
  font-weight: 600;
}
.review-index-row span { font-size: .92rem; line-height: 1.4; }
.review-index-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  touch-action: pan-y;
  background: var(--ink);
  overflow: hidden;
}
.review-index-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(.78);
  transition: filter .22s ease, transform .28s ease;
}
.review-index-row:hover .review-index-thumb img,
.review-index-row:focus-visible .review-index-thumb img { filter: none; transform: scale(1.07); }
/* One background moves between the rows, independent of the selected film. */
.review-frame-choices, .review-archive-index { position: relative; isolation: isolate; }
.review-row-highlight {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  height: var(--highlight-height, 42px);
  background: var(--ink);
  pointer-events: none;
  opacity: 0;
  transform: translateY(var(--highlight-top, 0px));
  transition: opacity .18s ease-out;
}
.review-row-highlight.is-visible {
  opacity: 1;
  transition: transform .24s cubic-bezier(.21,.8,.29,1), height .24s cubic-bezier(.21,.8,.29,1), opacity .16s ease-out;
}
.highlight-row { position: relative; transition: color .17s ease; }
.highlight-row.is-highlighted { color: var(--paper); }
.review-index-row:hover strong { text-decoration: none; }
.archive-card:focus-visible, .review-index-row:focus-visible, .review-frame-choices button:focus-visible { outline-offset: -3px; }
.archive-card[data-catalogue-id] { content-visibility: visible; }

.review-storyboard { padding: clamp(44px,7vw,94px) max(22px,4vw); background: #e5dfd5; }
.review-storyboard h2 {
  font-size: clamp(2rem,7vw,5.6rem);
  line-height: 1.05;
  margin: 4px 0 22px;
  letter-spacing: -.045em;
}
[dir=rtl] .review-storyboard h2 { letter-spacing: 0; line-height: 1.2; }
.review-storyboard ol {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 32%);
  gap: 12px;
  margin: 20px 0;
  padding: 0 0 12px;
  overflow-x: auto;
  scroll-snap-type: inline mandatory;
  list-style: none;
}
.review-storyboard li { scroll-snap-align: start; }
.review-storyboard img { display: block; aspect-ratio: 16/9; object-fit: contain; width: 100%; background: #d7d1c7; }
.review-storyboard figure { margin: 0; }
.review-storyboard figcaption { font: .82rem/1.6 var(--mono); margin-block-start: 5px; }
.review-storyboard ol:focus-visible { outline-offset: 3px; }

.resistance-sequence-list { --chapter-progress: 0%; position: relative; }
.resistance-sequence-list::before {
  position: absolute;
  content: "";
  inset-inline-start: 0;
  inset-block-start: 0;
  width: 3px;
  height: var(--chapter-progress);
  background: var(--review-red);
  transition: height .3s ease;
}
.resistance-sequence-list > .review-chapter-row { padding-inline-start: 15px; }
.review-chapter-row:has(button[aria-current=true]) { color: #94251a; background-color: #f6eee2; }

[lang=ar] .ar-full-case :is(.client-hero__title p,.film-card__caption,.client-statement,.process-section p,.case-strategy article p,.case-outcome p,.resistance-section-copy,.identity-film-copy) {
  line-height: 1.72;
  font-size: clamp(1rem,1.55vw,1.25rem);
  letter-spacing: 0;
}
[lang=ar] .ar-full-case :is(.client-section-head h2,.case-strategy h2,.agency-signoff h2,.made-making-head h2,.storyboard-section__copy h2,.resistance-style-board__copy h2,.resistance-director-note) {
  font-family: "IBM Plex Sans Arabic",Tahoma,sans-serif;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
[lang=ar] .ar-full-case :is(.resistance-case,.resistance-credits,.client-case) { text-align: start; }
[lang=ar] .ar-full-case .video-trigger span { direction: rtl; }
[lang=ar] .ar-full-case .process-list { font-family: var(--sans); font-size: clamp(1.1rem,2.8vw,2.6rem); letter-spacing: 0; line-height: 1.45; }
[lang=ar] .ar-full-case .client-index__list span { line-height: 1.42; }
[lang=ar] .ar-full-case :is(figcaption,.film-card h3,.film-card p,.film-archive-item h3) { line-height: 1.55; text-transform: none; letter-spacing: 0; }
[lang=ar] .ar-full-case .client-hero__media { direction: ltr; }
[lang=ar] .ar-full-case .client-facts > div { min-width: 0; overflow-wrap: anywhere; }
[lang=ar] .ar-full-case .client-facts span, [lang=ar] .ar-full-case .kicker { font-family: var(--sans); letter-spacing: 0; font-size: .85rem; }
[lang=ar] .ar-full-case .client-facts strong { font-size: clamp(1rem,1.5vw,1.2rem); }
@media (max-width:760px) {
  .review-index-head,.review-index-row { grid-template-columns: 2.5ch 86px minmax(0,1fr) 5.5ch; gap: 8px; padding-inline: 7px; }
  .review-index-head > span:nth-child(3) { display: none; }
  .review-index-row strong { font-size: clamp(1rem,4vw,1.4rem); }
  .review-index-row > span:not(.review-index-thumb) { grid-column: 3 / -1; grid-row: 2; font-size: .78rem; }
  .review-index-row > bdi:last-child { grid-column: 4; grid-row: 1; }
  .review-storyboard ol { grid-auto-columns: 74%; }
  [lang=ar] .ar-full-case .client-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [lang=ar] .ar-full-case .client-hero__title { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion:reduce) {
  .grain::before { animation: none; }
  .motion-preview-video,.highlight-row,.review-row-highlight.is-visible,.review-gallery-media img { transition: none; }
}
