/* ==========================================================================
   DAVID AGBAYEWA — PORTFOLIO
   case-study.css  (loaded after style.css and senior.css)

   Case studies and the motion reel, rebuilt 2026-10-03. Pages are generated
   by build/pages.py; edit content there, styles here. Same tokens as the
   homepage (senior.css): paper, ink, one green. Work sits on paper; dark
   bands only where the work itself is dark.
   ========================================================================== */

body.cs2-page {
  background-color: var(--sr-paper);
  color: var(--sr-ink);
}

body.cs2-page .site-header.is-scrolled {
  background-color: var(--sr-paper);
  border-bottom-color: var(--sr-rule);
}

.cs2 a:focus-visible,
.cs2 video:focus-visible {
  outline: 2px solid var(--sr-green);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */

.cs2-hero {
  padding-block: clamp(40px, 7vw, 96px) clamp(40px, 6vw, 72px);
}

.cs2-back {
  display: inline-block;
  margin-bottom: clamp(32px, 5vw, 56px);
  font-size: 0.9375rem;
  color: var(--sr-graphite);
  text-decoration: none;
}

.cs2-back:hover {
  color: var(--sr-green);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.cs2-org {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--sr-green);
  margin: 0 0 16px;
}

.cs2-tag {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sr-graphite);
  border: 1px solid var(--sr-rule);
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: 2px;
}

.cs2-title {
  font-size: clamp(2.4rem, 6.2vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
  max-width: 16ch;
  margin: 0 0 clamp(24px, 3vw, 36px);
}

.cs2-lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.55;
  color: var(--sr-graphite);
  max-width: 62ch;
  margin: 0;
}

.cs2-facts {
  display: grid;
  gap: 20px 32px;
  margin: clamp(36px, 5vw, 56px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--sr-rule);
}

@media (min-width: 768px) {
  .cs2-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .cs2-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.cs2-facts dt {
  font-size: 0.875rem;
  color: var(--sr-mute);
  margin-bottom: 6px;
  font-weight: 500;
}

.cs2-facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- Bands ---------- */

.cs2-band {
  padding-block: clamp(56px, 8vw, 112px);
}

.cs2-band--rule {
  border-top: 1px solid var(--sr-rule);
}

.cs2-band--flush {
  padding-top: 0;
}

.cs2-band--dark {
  background: var(--sr-ink);
  color: var(--sr-paper);
}

.cs2-band--dark + .cs2-band--dark {
  padding-top: 0;
}

/* ---------- Two-column text ---------- */

.cs2-text {
  display: grid;
  gap: 20px clamp(32px, 6vw, 96px);
}

@media (min-width: 992px) {
  .cs2-text {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

.cs2-h2 {
  font-size: clamp(1.625rem, 2.8vw, 2.375rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
  max-width: 18ch;
}

.cs2-text__body p {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--sr-graphite);
  max-width: 64ch;
  margin: 0 0 18px;
}

.cs2-text__body p:last-child {
  margin-bottom: 0;
}

.cs2-band--dark .cs2-text__body p,
.cs2-band--dark .cs2-gallery__caption {
  color: #b9bcc2;
}

/* ---------- Decisions ---------- */

.cs2-decisions {
  list-style: none;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 0;
}

.cs2-decision {
  display: grid;
  gap: 8px clamp(32px, 6vw, 96px);
  padding: 28px 0;
  border-top: 1px solid var(--sr-rule);
}

.cs2-decision:last-child {
  border-bottom: 1px solid var(--sr-rule);
}

@media (min-width: 992px) {
  .cs2-decision {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

.cs2-decision h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

.cs2-decision p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--sr-graphite);
  max-width: 64ch;
}

/* ---------- Galleries ---------- */

.cs2-gallery__head {
  display: grid;
  gap: 12px clamp(32px, 6vw, 96px);
  margin-bottom: clamp(24px, 3vw, 40px);
}

@media (min-width: 992px) {
  .cs2-gallery__head {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    align-items: end;
  }
}

.cs2-gallery__caption {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--sr-graphite);
  max-width: 64ch;
}

.cs2-grid {
  display: grid;
  gap: clamp(8px, 1.2vw, 16px);
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs2-grid--full { grid-template-columns: 1fr; }
.cs2-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs2-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs2-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs2-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 767px) {
  .cs2-grid--three,
  .cs2-grid--four,
  .cs2-grid--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cs2-grid figure {
  margin: 0;
}

.cs2-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #e4e5e0;
}

.cs2-band--dark .cs2-grid img {
  background: #22252a;
}

.cs2-grid figcaption {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--sr-graphite);
}

.cs2-band--dark .cs2-grid figcaption {
  color: #9ea2a9;
}

.cs2-grid figcaption strong {
  display: block;
  color: var(--sr-ink);
  font-weight: 700;
}

.cs2-band--dark .cs2-grid figcaption strong {
  color: var(--sr-paper);
}

/* ---------- Group (sister brands) ---------- */

.cs2-brand + .cs2-brand {
  margin-top: clamp(40px, 5vw, 64px);
}

.cs2-brand__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 700;
}

.cs2-brand__name span {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--sr-mute);
}

/* ---------- Outcome ---------- */

.cs2-outcome {
  list-style: none;
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

@media (min-width: 992px) {
  .cs2-outcome {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cs2-outcome li {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.4;
  font-weight: 600;
  padding-top: 20px;
  border-top: 2px solid var(--sr-green);
}

.cs2-note {
  margin: clamp(28px, 4vw, 40px) 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--sr-mute);
  max-width: 72ch;
}

/* ---------- Next project ---------- */

.cs2-next {
  display: block;
  padding-block: clamp(64px, 9vw, 120px);
  background: var(--sr-ink);
  color: var(--sr-paper);
  text-decoration: none;
}

.cs2-next:hover {
  color: var(--sr-paper);
}

.cs2-next__label {
  display: block;
  font-size: 1rem;
  color: #9ea2a9;
  margin-bottom: 12px;
}

.cs2-next__title {
  display: block;
  font-size: clamp(2rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  max-width: 18ch;
  transition: color 180ms ease;
}

.cs2-next:hover .cs2-next__title,
.cs2-next:focus-visible .cs2-next__title {
  color: #a8cdb9;
}

.cs2-next:focus-visible {
  outline: 2px solid #a8cdb9;
  outline-offset: -6px;
}

/* ---------- Reel ---------- */

.cs2-reel-feature {
  margin: 0;
}

.cs2-reel-feature video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #000;
}

.cs2-reel-feature figcaption {
  display: grid;
  gap: 6px 32px;
  margin-top: 16px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--sr-graphite);
}

@media (min-width: 992px) {
  .cs2-reel-feature figcaption {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

.cs2-reel-feature figcaption strong {
  color: var(--sr-ink);
  font-size: 1.1875rem;
}

.cs2-reel-grid {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .cs2-reel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cs2-reel-grid figure {
  margin: 0;
}

/* Phones: each film at its own shape. Wider screens: equal 9:16 frames,
   the film shown whole (letterboxed on black), timecode top right. */
.cs2-reel-frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.cs2-reel-frame video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

@media (min-width: 768px) {
  .cs2-reel-frame {
    aspect-ratio: 9 / 16;
  }

  .cs2-reel-frame video {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: contain;
  }
}

.cs2-reel-time {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 10px;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.cs2-reel-frame.is-playing .cs2-reel-time {
  opacity: 0;
}

.cs2-reel-grid figcaption {
  margin-top: 12px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--sr-graphite);
}

.cs2-reel-grid figcaption strong {
  display: block;
  font-size: 1.0625rem;
  color: var(--sr-ink);
}

@media (prefers-reduced-motion: reduce) {
  .cs2-next__title {
    transition: none;
  }
}
