/* Campaign case studies (layout on top of refine.css) */
.cmp-hero .hero-header { margin-bottom: 48px; }

.cmp-hero-figure {
  margin: 0 auto;
  max-width: 1040px;
}

.cmp-hero-figure img,
.cmp-tile img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.cmp-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.cmp-pair .cs-page img {
  aspect-ratio: 3 / 4.4;
  object-fit: cover;
}

.cmp-street {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 40%;
}

.cmp-lockup img {
  background: #0b0b0c;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 0 8%;
}

.cmp-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.cmp-head .section-desc { margin: 0; }

.cmp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 24px;
}

.cmp-tile { margin: 0; }

.cmp-tile figcaption {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cmp-tile figcaption span {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}


@media (max-width: 720px) {
  .cmp-grid { grid-template-columns: 1fr; gap: 32px; }
  .cmp-pair { gap: 16px; }
}

.cs-overview:has(+ .cs-overview) { margin-bottom: 16px; }

/* Year-by-year galleries */
.cmp-year + .cmp-year { border-top: 1px solid var(--border); }

.cmp-year-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px 64px;
  align-items: baseline;
  margin-bottom: 40px;
}

.cmp-year-head .section-title { margin: 0; }

.cmp-year-meta {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.cmp-year-head .section-desc { margin: 0; }

.cmp-wide { margin: 0 0 24px; }

.cmp-wide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.cmp-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.cmp-panel { margin: 0; }

.cmp-panel-mat {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 8px;
  background: var(--surface-subtle);
}

.cmp-panel-mat img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cmp-panel-mat--dark { background: #160a0c; }

.cmp-wide figcaption,
.cmp-panel figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .cmp-year-head { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .cmp-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .cmp-panel-mat { padding: 16px; }
}

.cmp-lockup-mat { aspect-ratio: 16 / 9; padding: 32px 48px; }

.cs-page .cmp-panel-mat img { background: none; border: 0; border-radius: 0; }

/* Extra groups inside a year */
.cmp-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cmp-row--4 .cmp-panel-mat { padding: 16px; }

.cmp-sub {
  margin: 56px 0 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.cmp-spreads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.cmp-spreads figure { margin: 0; }

.cmp-spreads img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
}

.cmp-spreads figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cs-page figcaption a { color: inherit; text-underline-offset: 3px; }

/* Films */
/* Column widths keep the 16:9 film and the two 9:16 reels the same height */
.cmp-film-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.3164fr) minmax(0, 0.3164fr);
  gap: 24px;
  align-items: start;
}

.cmp-film { margin: 0; }

.cmp-film video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.cmp-film--wide video { aspect-ratio: 16 / 9; }
.cmp-film--tall video { aspect-ratio: 9 / 16; }

.cmp-film figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.cmp-film figcaption strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.cmp-film-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 40px;
}

.cmp-sub-desc {
  max-width: 640px;
  margin: -8px 0 24px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Large pair of portrait pieces in place of a wide image */
.cmp-feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.cmp-feature figure { margin: 0; }

.cmp-feature img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
}

.cmp-feature figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Brochure page viewer */
.cmp-book {
  --page: min(86cqi, 880px);
  container-type: inline-size;
  border-radius: 12px;
  background: var(--surface-subtle);
  padding: 24px 0 16px;
}

.cmp-book-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 calc((100cqi - var(--page)) / 2);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.cmp-book-track::-webkit-scrollbar { display: none; }

.cmp-book-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.cmp-book-page {
  flex: 0 0 var(--page);
  margin: 0;
  scroll-snap-align: center;
}

.cmp-book-page img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  user-select: none;
  -webkit-user-drag: none;
}

.cmp-book-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.cmp-book-count {
  min-width: 64px;
  text-align: center;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.cmp-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.cmp-book-btn:hover:not(:disabled) { border-color: var(--text-muted); }
.cmp-book-btn:disabled { opacity: 0.35; cursor: default; }

.cmp-book-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Closing */
.cmp-close { text-align: center; }

.cmp-close-line {
  margin: 0 auto;
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: balance;
}

.cmp-close-source {
  margin: 24px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cmp-close-lockup {
  margin: 0 auto;
  max-width: 880px;
}

.cmp-close-lockup img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.cmp-next-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.cmp-next-card:hover { border-color: var(--border-strong); }

.cmp-next-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.cmp-next-label {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cmp-next-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.cmp-next-desc {
  margin: 16px 0 24px;
  color: var(--text-secondary);
}

.cmp-next-go {
  font-weight: 600;
  color: var(--text);
}

.cmp-next-go span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.cmp-next-card:hover .cmp-next-go span { transform: translateX(4px); }

.cmp-next-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.cmp-end-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  margin-top: 40px;
  font-size: 0.9375rem;
}

.cmp-end-links a {
  color: var(--text-secondary);
  text-underline-offset: 3px;
}

.cmp-end-links a:hover { color: var(--text); }

@media (max-width: 900px) {
  .cmp-film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-film--wide { grid-column: 1 / -1; }
  .cmp-film-grid--4 { margin-top: 32px; }
  .cmp-next-card { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .cmp-next-card img { order: -1; }
}

@media (max-width: 720px) {
  .cmp-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-spreads { grid-template-columns: 1fr; gap: 16px; }
  .cmp-sub { margin-top: 40px; }
  .cmp-film-grid { gap: 16px; }
  .cmp-feature { gap: 16px; }
  .cmp-book { padding-top: 16px; }
  .cmp-book { --page: 90cqi; }
  .cmp-book-track { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cmp-next-card,
  .cmp-next-go span { transition: none; }
  .cmp-next-card:hover .cmp-next-go span { transform: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Films play muted in place; the overlay restarts one with sound */
.cmp-film-frame { position: relative; }

.cmp-film-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.cmp-film-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.cmp-film-play:hover .cmp-film-chip { background: rgba(0, 0, 0, 0.82); }

.cmp-film-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cmp-film-frame.is-active .cmp-film-play { display: none; }

@media (max-width: 720px) {
  .cmp-film-play { padding: 8px; }
  .cmp-film-chip { padding: 6px 8px; font-size: 0.75rem; gap: 6px; }
}

/* Portrait booklets show roughly two pages at once, like an open spread */
.cmp-book.cmp-book--portrait { --page: min(42cqi, 420px); }

@media (max-width: 720px) {
  .cmp-book.cmp-book--portrait { --page: 70cqi; }
}

/* Outcome block before the closing line */
.cmp-outcome {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px 64px;
  align-items: center;
}

.cmp-outcome .section-title { margin: 0 0 16px; }

.cmp-outcome-line {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.cmp-outcome .section-desc { margin: 0; }

.cmp-outcome-figure { margin: 0; }

.cmp-outcome-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.cmp-outcome-figure figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .cmp-outcome { grid-template-columns: 1fr; gap: 32px; }
  .cmp-outcome-figure { max-width: 420px; }
}

/* Two-up row and plain looping video */
.cmp-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cmp-loop-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
}

/* A 16:9 film beside one 9:16 cut, both the same height */
.cmp-film-grid--pair {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.3164fr);
}

/* Emails shown in scrollable frames */
.cmp-emails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 24px;
}

.cmp-email { margin: 0; }

.cmp-email-frame {
  height: 560px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #f3f1e9;
  scrollbar-width: thin;
}

.cmp-email-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cmp-email-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.cmp-email figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.cmp-email figcaption strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.cmp-note {
  max-width: 640px;
  margin: 32px 0 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .cmp-emails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-film-grid--pair { grid-template-columns: minmax(0, 1fr) minmax(0, 0.42fr); }
}

@media (max-width: 600px) {
  .cmp-emails { grid-template-columns: 1fr; }
  .cmp-email-frame { height: 480px; }
  .cmp-film-grid--pair { grid-template-columns: 1fr; }
  .cmp-film-grid--pair .cmp-film--tall { max-width: 260px; }
}

.cmp-emails--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }

@media (max-width: 600px) {
  .cmp-emails--2 { grid-template-columns: 1fr; }
}

/* Data tables */
.cmp-table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cmp-table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cmp-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.cmp-table th,
.cmp-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.cmp-table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
}

.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td { border-bottom: 0; }

.cmp-table tbody th {
  font-weight: 600;
  color: var(--text);
}

.cmp-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cmp-table-note {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}

.cmp-bar-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.cmp-bar-cell .num { min-width: 48px; }

.cmp-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--w), var(--surface-subtle) var(--w));
}

.cmp-table--tests { min-width: 820px; }
.cmp-table--tests td { width: 34%; }
.cmp-table--tests td.num { width: auto; }

.cmp-table .is-winner {
  font-weight: 600;
  color: var(--text);
}

.cmp-film-single { margin-bottom: 24px; }

/* Project section with text on the left and highlights on the right */
.cmp-cs-side { padding-top: 72px; }

@media (max-width: 900px) {
  .cmp-cs-side { padding-top: 0; }
}

/* More campaigns: a sideways-scrolling row at the end of each case study */
.cmp-more-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.cmp-more-head .section-title { margin: 0; }

.cmp-more-btns { display: flex; gap: 8px; }

.cmp-more-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80%, 440px);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.cmp-more-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.cmp-more-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
  color: inherit;
  text-decoration: none;
  scroll-snap-align: start;
  transition: border-color 0.2s ease;
}

.cmp-more-card:hover { border-color: var(--border-strong); }

.cmp-more-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cmp-more-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #000;
}

.cmp-more-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cmp-more-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cmp-more-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cmp-more-card .cmp-next-go { margin-top: auto; }
.cmp-more-card:hover .cmp-next-go span { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .cmp-more-card { transition: none; }
  .cmp-more-card:hover .cmp-next-go span { transform: none; }
}

/* Three 9:16 pieces side by side, and a strip of four film stills */
.cmp-vert { align-items: start; }
.cmp-vert > figure, .cmp-strip > figure { margin: 0; }
.cmp-vert > figure > img,
.cmp-strip img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
}
.cmp-vert figcaption,
.cmp-strip figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.cmp-vert figcaption strong { display: block; color: var(--text); font-weight: 600; }
.cmp-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 720px) {
  .cmp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 600px) {
  .cmp-vert { grid-template-columns: 1fr 1fr; }
  .cmp-vert > .cmp-film { grid-column: 1 / -1; max-width: 320px; }
}
.cmp-mat-43 { aspect-ratio: 4 / 3; }
.cmp-row--2 + .cmp-spreads { margin-top: 24px; }
.cmp-feature--narrow { max-width: 760px; }

/* Captions under viewer slides */
.cmp-book-page figcaption {
  max-width: 680px;
  margin-top: 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.cmp-book-page figcaption strong { display: block; color: var(--text); font-weight: 600; }
.cmp-book-page figcaption { transition: opacity 0.2s ease; }
.cmp-book-page:not(.is-current) figcaption { opacity: 0; }
.cmp-book-step {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Four emails per row */
.cmp-emails--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cmp-emails--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cmp-emails--4 { grid-template-columns: 1fr; } }
