/* ── Case study page ──────────────────────────────────────────────── */

.case-back {
  padding: 110px 8vw 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-3);
  transition: color var(--transition-base),
              transform var(--dur-press) var(--ease-out);
}

.back-link-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .back-link:hover {
    color: var(--white);
  }
  /* Mirrors the read-more nudge, pointing the other way — same gesture,
     reversed, so forward and back feel like one system. */
  .back-link:hover .back-link-arrow {
    transform: translateX(-4px);
  }
}

.back-link:active {
  transform: scale(0.98);
  transition-duration: 100ms;
}

/* ── Case hero ────────────────────────────────────────────────────── */

#case-hero {
  padding: 44px 8vw 88px;
  background: var(--black);
  border-bottom: 1px solid var(--grey-2);
}

.case-id {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.case-id img {
  height: 72px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.case-name {
  font-family: var(--font-display);
  font-size: clamp(44px, 6.4vw, 84px);
  color: var(--white);
  letter-spacing: 0.04em;
  line-height: 1;
}

.case-lede {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--grey-4);
  line-height: 1.8;
  max-width: 680px;
  margin-top: 28px;
}

.case-tags {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey-3);
  letter-spacing: 0.1em;
  line-height: 1.9;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--grey-2);
  max-width: 680px;
}

/* ── Story ────────────────────────────────────────────────────────── */

#case-story {
  padding: 88px 8vw;
  background: var(--grey-1);
}

.case-story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.case-story-cell {
  background: var(--black);
  padding: 40px 32px;
}

.case-story-cell p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.8;
}

.case-story-cell p + p {
  margin-top: 14px;
}

/* ── Features ─────────────────────────────────────────────────────── */

.case-part {
  padding: 96px 8vw;
}

/* Sections alternate black / grey down the page. These are assigned by
   where the section sits, not by which client surface it describes —
   swap them if the two parts are ever reordered again. */
.case-part-web     { background: var(--black); }   /* first  */
.case-part-desktop { background: var(--grey-1); }  /* second */

.case-part-head {
  max-width: 720px;
  margin-bottom: 64px;
}

.case-part-head .section-heading {
  margin-top: 10px;
}

.case-part-head p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.8;
  margin-top: 18px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 56px;
  align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--grey-2);
}

/* Alternating sides keeps a long list of features from reading as a
   single column of identical rows. Counted inside .feature-list so the
   section header doesn't shift the rhythm by one. */
.feature-list .feature:nth-child(even) .feature-copy { order: 2; }
.feature-list .feature:nth-child(even) .feature-media { order: 1; }

.feature-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--grey-3);
}

.feature-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  color: var(--white);
  letter-spacing: 0.04em;
  margin-top: 12px;
  line-height: 1.1;
}

.feature-copy p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.8;
  margin-top: 14px;
}

.feature-points {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.feature-points li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey-3);
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}

.feature-points li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--grey-3);
}

.feature-media {
  display: grid;
  gap: 14px;
}

.feature-media.is-pair {
  grid-template-columns: 1fr 1fr;
}

/* ── Architecture ─────────────────────────────────────────────────── */

#case-arch {
  padding: 96px 8vw;
  background: var(--black);
  border-top: 1px solid var(--grey-2);
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 48px;
}

.arch-cell {
  background: var(--grey-1);
  padding: 32px 26px;
  border-top: 2px solid var(--grey-2);
}

.arch-cell dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-3);
}

.arch-cell dd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.7;
  margin-top: 12px;
}

/* ── Closing ──────────────────────────────────────────────────────── */

#case-next {
  padding: 96px 8vw;
  background: var(--grey-1);
  text-align: center;
}

.case-next-inner {
  max-width: 640px;
  margin: 0 auto;
}

.case-next-heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 56px);
  color: var(--white);
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.case-next-inner p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.8;
  margin-top: 18px;
}

.case-next-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .case-story-grid {
    grid-template-columns: 1fr;
  }
  .arch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  /* Copy always leads once the columns stack — alternating order only
     makes sense while they sit side by side. */
  .feature-list .feature:nth-child(even) .feature-copy { order: 0; }
  .feature-list .feature:nth-child(even) .feature-media { order: 0; }
}

@media (max-width: 768px) {
  .case-back {
    padding-top: 96px;
  }
  #case-hero  { padding: 36px 8vw 64px; }
  #case-story,
  .case-part,
  #case-arch,
  #case-next  { padding: 64px 8vw; }
  .case-part-head {
    margin-bottom: 44px;
  }
  .arch-grid {
    grid-template-columns: 1fr;
  }
  .feature-media.is-pair {
    grid-template-columns: 1fr;
  }
}

/* The screenshots are the subject here, not a supporting strip, so they
   sit closer to full strength than they do in a gallery. */
.feature-media .shot-btn img {
  opacity: 0.94;
}

@media (hover: hover) and (pointer: fine) {
  .feature-media .shot-btn:hover img {
    opacity: 1;
  }
}
