/* Case page. SPEC "Case page template". Footer stays the existing cream footer. */

.case-page { background: var(--cream); color: var(--olive); }
.case-page .case { max-width: none; margin: 0; }
.case-page .case > section,
.case-page .case > header,
.case-page .case > .case-next { margin-top: 0; }
/* Film, cutdowns, brand world and images keep their gap (the reset above was zeroing it). */
.case-page .case > .case-block { margin-top: 4.5rem; }
.case-page .case-hero { border-radius: 0; }
.case-page .case-hero__media { aspect-ratio: auto; animation: none; background: transparent; }
.case-page.theme-olive {
  background: var(--olive);
  color: var(--cream);
  --rule: color-mix(in srgb, var(--cream) 20%, transparent);
  --film: #2c2f1a;
}
.case-page.theme-olive .wordmark,
.case-page.theme-olive .case-nav a,
.case-page.theme-olive .menu-toggle { color: var(--cream); }
.case-page.theme-cream {
  --rule: color-mix(in srgb, var(--olive) 22%, transparent);
  --film: color-mix(in srgb, var(--olive) 8%, transparent);
}
.case-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 18px 0;
}
.case-nav { display: none; }
.case-nav a {
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}
.case-nav__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  transform: scale(0);
}
.case-nav__dot.is-on { transform: scale(1); }
.menu-toggle, .menu__close {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: inherit;
  opacity: 0.75;
}
.menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--cream);
  color: var(--olive);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.menu.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.menu__close { position: absolute; top: 22px; right: 18px; }
.menu a {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 12vw, 3rem);
  line-height: 1.1;
  color: var(--olive);
  text-decoration: none;
  text-wrap: balance;
}

.case {
  padding: 2.5rem 18px 4rem;
}
.case-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin: 0 0 1.75rem;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.case-title {
  margin: 0 auto 1.75rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(44px, 7.4vw, 108px);
  line-height: 1;
  text-align: center;
  text-wrap: balance;
}
.case-hero {
  position: relative;
  aspect-ratio: 1.7;
  overflow: hidden;
  background: var(--olive);
}
.case-hero__media,
.case-hero__empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-hero__empty {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--olive);
  color: var(--cream);
}
.case-hero__empty p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.case-hero__dot { display: none; }
.case-hero__dot--legacy {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
}
.case-hero__dot.is-in { transform: translate(-50%, -50%) scale(1); }
.case-hero__dot.is-pop { animation: case-dot-pop 0.3s ease both; }
@keyframes case-dot-pop {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}

.case-lead { margin: 1.75rem 0 0; max-width: 36rem; }
.kicker {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.case-lead__mark {
  margin: 0.45rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.25;
  text-wrap: balance;
}
.case-info {
  display: block;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.case-info > * + * { margin-top: 1.75rem; }
.case-info p { margin: 0.55rem 0 0; font-size: 15px; line-height: 1.45; }
.case-highlights, .case-del {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.4;
}
.case-highlights li + li, .case-del li + li { margin-top: 0.35rem; }
.case-del li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.case-block { margin-top: 3.5rem; }
.case-block .kicker { margin-bottom: 1rem; }
.case-film {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--film, #2c2f1a);
}
.case-film__facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; display: block; }
.case-film__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.case-film__name { position: absolute; left: 24px; bottom: 20px; font-family: var(--font-serif); font-style: italic; font-size: 26px; color: var(--cream); }
.case-film__play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; border-radius: 50%; background: var(--cream); transform: translate(-50%, -50%); transition: transform .2s ease; }
.case-film__play::after { content: ""; position: absolute; left: 26px; top: 21px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--olive); }
.case-film__facade:hover .case-film__play { transform: translate(-50%, -50%) scale(1.08); }
.case-film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.case-cuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
}
.case-cuts__line {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  text-wrap: balance;
}
.cut {
  margin: 0;
}
.cut__frame {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--film, #2c2f1a);
}
.cut__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cut__play {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cut__play span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream);
  transform: translate(-50%, -50%);
}
.cut__play span::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 14px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent var(--olive);
}
.cut figcaption {
  margin-top: 0.55rem;
  font-size: 13px;
}
.case-world__row, .case-images__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.case-world__row img, .case-images__row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.case-images__row img:last-child:nth-child(3),
.case-world__row img:last-child:nth-child(3) { grid-column: 1 / -1; }
.case-world__caption {
  margin: 0.75rem 0 0;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.85;
}
.case-film__caption {
  margin: 0.75rem 0 0;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.85;
  max-width: 60ch;
}
.cut__frame--loop { aspect-ratio: auto; background: transparent; max-width: 360px; }
.cut--loop { display: flex; flex-direction: column; align-items: center; }
.cut--loop .cut__frame--loop { width: 100%; }
.cut--loop figcaption { width: 100%; max-width: 360px; text-align: center; }
.cut__media { display: block; width: 100%; height: auto; }
.cut__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.case-world__row--4 { grid-template-columns: 1fr 1fr; }
.case-world__row--portrait img { aspect-ratio: 4 / 5; }
.case-world__row--4 img:last-child:nth-child(3) { grid-column: auto; }

/* Optional blocks (Nov 20). */
.case-b__wide { display: block; width: 100%; height: auto; }
.case-b__loop { display: grid; gap: 1.25rem; }
.case-b__media { display: block; width: 100%; height: auto; }
.case-b__line { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: 22px; line-height: 1.3; text-wrap: balance; }
.case-b__row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.case-b__row img, .case-b__row video { display: block; width: 100%; object-fit: cover; object-position: top; aspect-ratio: 1; }
.case-b__row--tall img, .case-b__row--tall video { aspect-ratio: 1 / 2; }
.case-b__row--portrait img, .case-b__row--portrait video { aspect-ratio: 4 / 5; }
.case-b__row--wide img, .case-b__row--wide video { aspect-ratio: 16 / 9; }
.case-b__row--widegrid img { aspect-ratio: 16 / 9; }
.case-b__row.case-b__row--widegrid { grid-template-columns: 1fr; }
@media (min-width: 768px) { .case-b__row.case-b__row--widegrid { grid-template-columns: repeat(3, 1fr); } }
.case-b__row--strip img, .case-b__row--strip video { aspect-ratio: 4 / 5; transform: scale(1.015); }
.case-b__row.case-b__row--strip { overflow: hidden; }
.case-b__row.case-b__row--strip { grid-template-columns: repeat(2, 1fr); gap: 0; }
@media (min-width: 768px) { .case-b__row.case-b__row--strip { grid-template-columns: repeat(var(--n, 5), 1fr); gap: 0; } }
.case-b__row.case-b__row--grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .case-b__row.case-b__row--grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) {
  .case-b__loop { grid-template-columns: repeat(12, 1fr); gap: 0 20px; align-items: center; }
  .case-b__loop .case-b__media { grid-column: 1 / 8; }
  .case-b__loop .case-b__line { grid-column: 9 / 13; }
  .case-b__row { grid-template-columns: repeat(var(--n, 3), 1fr); gap: 20px; }
}
/* Spotlights (Nov 23): vertical clips, 6 across desktop, 2 on phone; play full screen with sound. */
.case-spots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .case-spots { grid-template-columns: repeat(6, 1fr); gap: 20px; } }
.case-spot { position: relative; display: block; padding: 0; border: 0; background: var(--film, #2c2f1a); cursor: pointer; aspect-ratio: 9 / 16; overflow: hidden; }
.case-spot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.case-spot:hover img { transform: scale(1.03); }
.case-spot .case-film__play { width: 44px; height: 44px; }
.case-spot .case-film__play::after { left: 18px; top: 14px; border-width: 8px 0 8px 13px; }
.spot-modal { position: fixed; inset: 0; z-index: 6000; background: rgba(20,20,17,.94); display: flex; align-items: center; justify-content: center; }
.spot-modal__video { height: min(92vh, 177.7vw); width: auto; max-width: 100vw; aspect-ratio: 9 / 16; background: #000; }
.spot-modal__close { position: absolute; top: 18px; right: 22px; background: none; border: 0; color: var(--cream); font: inherit; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
/* Rollout row (Nov 23): mixed 9:16 and 4:5 pieces at one shared height on desktop. */
.case-roll { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; align-items: end; }
.case-roll__item { margin: 0; }
.case-roll__media { position: relative; display: block; width: 100%; aspect-ratio: var(--ar, 9 / 16); overflow: hidden; background: var(--film, #2c2f1a); padding: 0; border: 0; }
.case-roll__media img, .case-roll__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.case-roll figcaption { margin-top: .55rem; font-size: 13px; }
.case-roll__line { grid-column: 1 / -1; margin: 0.5rem 0 0; font-family: var(--font-serif); font-style: italic; font-size: 20px; line-height: 1.3; }
@media (min-width: 768px) {
  /* On the 12-column grid: each piece takes 3 columns, bottoms aligned; the summary line sits in 10 to 12. */
  .case-roll { grid-template-columns: repeat(12, 1fr); gap: 0 20px; align-items: end; }
  .case-roll__item { grid-column: span 3; }
  .case-roll__line { grid-column: 10 / 13; align-self: center; margin: 0; font-family: var(--font-serif); font-style: italic; font-size: 22px; line-height: 1.3; text-wrap: balance; }
}
/* Pull quote and chapter spacing (Nov 23, eBay). */
.case-page .case > .case-quote { margin-top: 6.5rem; margin-bottom: 0; max-width: none; width: auto; padding: 0; border: 0; }
.case-quote__text { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: clamp(32px, 4.4vw, 64px); line-height: 1.08; max-width: 20ch; text-wrap: balance; }
@media (min-width: 768px) {
  .case-quote { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; }
  .case-quote__text, .case-quote__by { grid-column: 4 / 11; max-width: none; }
}
.case-quote__by { margin: 1.25rem 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.case-page .case > .case-block.case-chapter { margin-top: 8.5rem; }
.case-page .case > .case-block.case-in { margin-top: 2.5rem; }
.case-credits {
  margin: 3rem 0 0;
  font-size: 11px;
  line-height: 1.45;
  opacity: 0.7;
}
.case-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.case-pager a { color: inherit; text-decoration: none; }
.case-pager__next { text-align: right; }
.case-pager__kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.case-pager__title {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.15;
  text-wrap: balance;
}
.case-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.case-reveal.is-in { opacity: 1; transform: none; }

@media (min-width: 768px) {
  .case-bar {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    padding: 26px 32px 0;
  }
  .case-bar .wordmark { grid-column: 1 / 4; }
  .case-nav {
    display: flex;
    grid-column: 10 / 13;
    justify-self: end;
    gap: 1.35rem;
  }
  .menu-toggle { display: none; }
  .case { padding: 3.5rem 32px 5rem; }
  .case-lead { width: calc((100% - 220px) / 12 * 5 + 80px); max-width: none; }
  .case-info {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.25rem;
    align-items: start;
  }
  .case-info > * + * { margin-top: 0; }
  .case-info__about { grid-column: 1 / 4; }
  .case-info__idea { grid-column: 4 / 7; }
  .case-info__role { grid-column: 7 / 10; }
  .case-info__del { grid-column: 10 / 13; text-align: right; }
  .case-cuts { grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: center; }
  .case-cuts__line { grid-column: 3; grid-row: 1; margin: 0; }
  .case-world__row, .case-images__row { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .case-images__row img:last-child:nth-child(3),
  .case-world__row img:last-child:nth-child(3) { grid-column: auto; }
  .case-world__row--4 { grid-template-columns: repeat(4, 1fr); }
  .case-pager__title { font-size: 26px; }
}

/* Glosslab: hero pair, one day, standouts. Absent on every other case. */
.case-hero--pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  aspect-ratio: auto;
  overflow: visible;
  background: transparent;
}
.case-hero__shot { position: relative; aspect-ratio: 4 / 5; }
.case-page .case-hero--pair .case-hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  animation: none;
}
.case-hero--pair .case-hero__pair {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.case-day__row {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  overflow-x: auto;
}
.case-day figure {
  flex: 0 0 calc((100% - 13px) / 2.3);
  margin: 0;
}
.case-day img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.case-day figcaption {
  margin-top: 0.45rem;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.35;
}
.case-day__time,
.case-day__label { display: block; }
.case-day__time { opacity: 0.7; }
.case-standouts {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.case-page .case > .case-standouts { margin-top: 3rem; }
.case-standouts__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

@media (min-width: 768px) {
  .case-hero--pair { grid-template-columns: 1fr 1fr; gap: 20px; }
  .case-day__row { overflow: visible; }
  .case-day figure { flex: 1 1 0; min-width: 0; }
  .case-standouts {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 20px;
    row-gap: 120px;
    align-items: start;
  }
  .case-page .case > .case-standouts { margin-top: 140px; }
  .case-standouts__img { width: 100%; margin: 0; }
  .case-standouts__img--1 { grid-column: 2 / 7; grid-row: 1; }
  .case-standouts__img--2 { grid-column: 8 / 12; grid-row: 1; margin-top: 180px; }
  .case-standouts__img--3 { grid-column: 1 / 5; grid-row: 2; }
  .case-standouts__img--4 { grid-column: 6 / 9; grid-row: 2; margin-top: 120px; }
  .case-standouts__img--5 { grid-column: 10 / 13; grid-row: 2; margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-reveal { opacity: 1; transform: none; transition: none; }
  .menu { transition: none; }
  .case-hero__dot.is-pop { animation: none; }
}

/* Grid lock (Nov 23): every case section sits on the same 12-column, 20px-gutter grid. */
@media (min-width: 768px) {
  .case-page .case > .case-credits { width: calc((100% - 220px) / 12 * 8 + 140px); max-width: none; }
}

/* Row item labels (Nov 24, Applebee's merch). */
.case-b__fig { margin: 0; }
.case-b__fig figcaption { margin-top: 0.75rem; font-size: 11px; line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
/* Portrait loop at 5 columns, line in 7 to 11 (Nov 24, Applebee's). */
@media (min-width: 768px) {
  .case-b--narrow .case-b__loop .case-b__media { grid-column: 1 / 6; }
  .case-b--narrow .case-b__loop .case-b__line { grid-column: 7 / 12; }
}
/* Phone row: 4 across on desktop, 2 on phone. */
.case-b__row.case-b__row--phone { grid-template-columns: repeat(2, 1fr); }
.case-b__row--phone video, .case-b__row--phone img { aspect-ratio: 584 / 1220; object-fit: cover; border-radius: 14% / 6.7%; }
@media (min-width: 768px) { .case-b__row.case-b__row--phone { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
/* Rows of 4 or more: 2 across on phone. */
.case-b__row.case-b__row--many { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .case-b__row.case-b__row--many { grid-template-columns: repeat(var(--n, 4), 1fr); } }
/* Phone loops cropped to the phone edge; corners rounded here so no baked-in background shows (Nov 24, LBP). */
.cut__frame--loop .cut__media { border-radius: 13.3% / 6.2%; }
