/* UFL is the case-study benchmark. Its opening, disclosure and grid primitives
   are reused directly; this layer adapts the other renderers to the same rails.
   Long project names may take more space than UFL's three-letter masthead. */
.project-page {
  --case-fit-height: max(240px, calc(100svh - 160px));
}
.benchmark-case {
  --case-section-space: 64px;
  --case-media-space: 32px;
  --case-grid-gap: 24px;
  --case-copy-gap: 64px;
  --case-media-max: 1680px;
}
.benchmark-case .case-content {
  width: auto;
  max-width: none;
  margin: 0 var(--gutter);
}
.benchmark-case .project-top {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 24px 48px;
}
.benchmark-case .project-top h1 {
  font-size: clamp(48px, 5.6vw, 80px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}
.project-title-season { white-space: nowrap; }
.project-top-with-subtitle {
  grid-template-areas: "title facts" "subtitle facts";
}
.project-top-with-subtitle h1 { grid-area: title; }
.project-top-with-subtitle .project-subtitle { grid-area: subtitle; }
.project-top-with-subtitle .project-facts { grid-area: facts; }
.benchmark-case .project-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.benchmark-case .project-facts:has(> div:last-child:nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.benchmark-case .project-facts > div + div {
  border-left: 1px solid var(--line);
  padding-left: 32px;
}
.benchmark-case .project-facts dt { font-size: 12px; line-height: 18px; }
.benchmark-case .project-facts dd { font-size: 16px; line-height: 24px; }
.benchmark-case .ufl-intro p + p { margin-top: 20px; }
.benchmark-case .ufl-role-copy { gap: var(--case-copy-gap); }
.benchmark-case .case-copy-heading {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  text-transform: none;
  color: var(--paper);
}
.benchmark-case .case-copy-heading + p { margin-top: 0; }
.benchmark-case .project-body {
  width: 100%;
  max-width: var(--case-media-max);
  margin: var(--case-media-space) auto 0;
  gap: var(--case-grid-gap);
}
/* Wide galleries retain UFL's rails; each image and film fits the viewport. */
.benchmark-case.full-width-case .project-body { max-width: none; }
.benchmark-case.full-width-case .project-film {
  width: min(100%, calc(var(--case-fit-height) * 16 / 9));
}
/* Explicit media order supports full, half and third-width artwork rows. */
.benchmark-case .project-body[data-ordered-media] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.benchmark-case [data-ordered-media] > .artwork-figure { grid-column: span 3; }
.benchmark-case [data-ordered-media] > .project-media-third { grid-column: span 2; }
.benchmark-case [data-ordered-media] > .project-media-wide { grid-column: 1 / -1; }
.benchmark-case .project-film {
  width: min(100%, var(--case-media-max), calc(var(--case-fit-height) * 16 / 9));
  min-width: 0;
  min-height: 0;
  justify-self: center;
  aspect-ratio: auto;
  background: transparent;
}
.benchmark-case .project-film > video,
.benchmark-case .project-film > iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #090a09;
}
.benchmark-case.project-story figcaption,
.benchmark-case.atomic-case figcaption {
  margin: 12px 0 0;
  padding: 0;
  font-size: 14px;
  line-height: 21px;
}
.benchmark-case .project-artwork-fit > .artwork {
  width: min(100%, calc(var(--case-fit-height) * var(--artwork-ratio)));
  margin-inline: auto;
}
.benchmark-case .artwork img { transition: filter .2s; }
.benchmark-case .artwork:hover img { filter: brightness(.88); }
.benchmark-case .artwork:active img { filter: brightness(.75); }
.benchmark-case .project-ending {
  width: auto;
  max-width: none;
  margin: 80px var(--gutter);
}
.benchmark-case .project-neighbor small { display: flex; align-items: center; gap: 8px; }
.benchmark-case .next-project small { justify-content: flex-end; }
.benchmark-case .project-direction-hint { font-size: 16px; line-height: 1; }
.project-neighbor strong { font-size: clamp(24px, 2.5vw, 36px); line-height: 1.3; }
.project-media-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  text-decoration: underline;
}
.project-media-link:hover { color: var(--paper); }
.benchmark-case .project-media-link { padding: 8px 0; }

/* Ordered story blocks keep their content and credit lines, on UFL's rhythm. */
.benchmark-case .case-opening + .story-lead { margin-top: var(--case-media-space); }
.benchmark-case .story-block {
  margin-top: var(--case-section-space);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.benchmark-case .story-block > h2 {
  margin: 0 0 var(--case-media-space);
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0;
  text-transform: none;
  text-wrap: initial;
}
.benchmark-case .story-columns { gap: var(--case-copy-gap); }
.benchmark-case .story-columns.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1200px;
}
.benchmark-case .story-copy p { margin: 0 0 20px; font-size: 16px; line-height: 26px; }
.benchmark-case .story-copy p:last-child { margin-bottom: 0; }
.benchmark-case .story-copy-lead p:first-of-type { font-size: 20px; line-height: 30px; }
.benchmark-case .story-media-grid { gap: var(--case-grid-gap); max-width: var(--case-media-max); margin-inline: auto; }
.benchmark-case .story-media-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.benchmark-case .story-lead,
.benchmark-case .story-media-grid.one-column > .story-artwork {
  width: min(100%, var(--case-media-max), calc(var(--case-fit-height) * var(--artwork-ratio)));
  margin-inline: auto;
}
.benchmark-case .story-film-frame {
  width: min(100%, var(--case-media-max), calc(var(--case-fit-height) * 16 / 9));
  margin-inline: auto;
}

/* Atomic keeps its authored sequence and shared section rhythm. */
.benchmark-case.atomic-case .project-top { row-gap: 4px; }
.benchmark-case.atomic-case .atomic-copy { max-width: 1000px; font-size: 20px; line-height: 30px; }
.benchmark-case.atomic-case .atomic-copy p + p { margin-top: 20px; }
.benchmark-case.atomic-case .atomic-section { margin-top: var(--case-section-space); }
.benchmark-case.trailer-project .project-top { row-gap: 12px; }
.benchmark-case.trailer-project .project-subtitle { font-size: 20px; line-height: 30px; }
.benchmark-case.trailer-project .trailer-source {
  width: min(100%, var(--case-media-max), calc(var(--case-fit-height) * 16 / 9));
  margin-inline: auto;
}

@media (min-width: 601px) {
  body:has(.benchmark-case) .header { height: 64px; }
  .benchmark-case { padding-top: 72px; }
}
@media (max-width: 1200px) {
  .benchmark-case .project-top { grid-template-columns: 1fr; }
  .project-top-with-subtitle { grid-template-areas: "title" "subtitle" "facts"; }
}
@media (max-width: 900px) {
  .benchmark-case { --case-grid-gap: 16px; --case-copy-gap: 32px; }
  .benchmark-case .project-facts { gap: 16px; }
  .benchmark-case .project-facts > div + div { padding-left: 16px; }
}
@media (max-width: 600px) {
  .benchmark-case .project-body[data-ordered-media] { grid-template-columns: minmax(0, 1fr); }
  .benchmark-case [data-ordered-media] > .artwork-figure { grid-column: 1 / -1; }
  .benchmark-case { --case-media-space: 24px; --case-grid-gap: 24px; --case-copy-gap: 20px; }
  .benchmark-case .project-top { padding: 0; gap: 16px; }
  .benchmark-case .project-top h1 { font-size: 56px; line-height: 64px; }
  .benchmark-case .project-top h1.project-title-long { font-size: clamp(34px, 10vw, 48px); line-height: 1.14; }
  .project-top .project-title-long .project-title-main,
  .project-top .project-title-long .project-title-season { display: block; }
  .project-top .project-title-long .project-title-separator { display: none; }
  .benchmark-case .project-facts { gap: 12px; }
  .benchmark-case .project-facts > div + div { padding-left: 12px; }
  .benchmark-case .project-facts dt { font-size: 11px; margin-bottom: 4px; }
  .benchmark-case .project-facts dd { font-size: 13px; line-height: 20px; }
  .benchmark-case .story-block > h2 { font-size: 26px; line-height: 34px; }
  .benchmark-case .story-columns.two-column,
  .benchmark-case .story-media-grid.two-column { grid-template-columns: minmax(0, 1fr); }
  .benchmark-case .story-copy-lead p:first-of-type,
  .benchmark-case.atomic-case .atomic-copy { font-size: 18px; line-height: 28px; }
  .benchmark-case .project-ending { margin-block: 64px; }
  .project-page .project-neighbor small {
    gap: 4px;
    margin-bottom: 8px;
    font-size: clamp(11px, 3vw, 13px);
    letter-spacing: 0;
    line-height: 1.4;
  }
  .project-neighbor strong { font-size: clamp(18px, 5vw, 24px); line-height: 1.2; }
  .benchmark-case.trailer-project .project-subtitle { font-size: 16px; line-height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .benchmark-case .artwork img { transition: none; }
}
