/* ==========================================================
   CASE STUDY SHELL
========================================================== */

.case-header,
.case-hero,
.story,
.sticky-section,
.results,
.next-project {
  width: min(100%, 1500px);
  margin-inline: auto;
}

.case-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;

  display: flex;
  align-items: center;

  width: 100%;
  max-width: none;
  padding: 20px clamp(24px, 4vw, 64px);

  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(18px);
}

.case-header a {
  position: relative;

  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-header a::after,
.next-project a::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;

  height: 1px;
  background: currentColor;
  content: "";

  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.case-header a:hover::after,
.next-project a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==========================================================
   HERO
========================================================== */

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.7fr);
  gap: clamp(48px, 7vw, 110px);
  align-items: end;

  min-height: auto;
  padding: 130px clamp(24px, 6vw, 96px) 72px;
  border-bottom: 1px solid var(--border);
}

.case-hero h1 {
  margin: 10px 0 18px;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(5rem, 10vw, 9rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.case-hero p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.35;
}

.project-meta {
  display: grid;
  gap: 20px;
  padding-bottom: 4px;
}

.project-meta div {
  display: grid;
  gap: 5px;

  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.project-meta span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

/* ==========================================================
   STORY
========================================================== */

.story {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);

  padding: 78px clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--border);
}

.story h2,
.results h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 500;
  line-height: 0.95;
}

.story-right {
  max-width: 760px;
}

.story p,
.sticky-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65;
}

.story p:last-child,
.sticky-copy p:last-child {
  margin-bottom: 0;
}

/* ==========================================================
   STICKY SECTIONS
========================================================== */

.sticky-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.45fr);
  gap: clamp(48px, 7vw, 100px);
  align-items: start;

  padding: 88px clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--border);
}

.sticky-copy {
  position: sticky;
  top: 92px;
  height: max-content;
}

.sticky-copy h2 {
  margin: 14px 0 22px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.5rem, 4.5vw, 4.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.sticky-images {
  display: grid;
  gap: 28px;
}

.sticky-images img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-secondary);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

/* ==========================================================
   RESULTS
========================================================== */

.results {
  padding: 88px clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--border);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 38px;
}

.metrics div {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-secondary);

  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.metrics span {
  display: block;
  margin-bottom: 8px;

  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: none;
}

.next-project {
  padding: 72px clamp(24px, 6vw, 96px) 84px;
  text-align: center;
}

.next-project a {
  position: relative;
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 500;
}

/* ==========================================================
   DARK THEME
========================================================== */

html[data-theme="dark"] .case-header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

html[data-theme="dark"] .sticky-images img {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 900px) {
  .case-hero,
  .story,
  .sticky-section {
    grid-template-columns: 1fr;
  }

  .case-hero {
    gap: 38px;
    padding-top: 118px;
  }

  .project-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sticky-copy {
    position: static;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .case-header {
    padding: 17px 20px;
  }

  .case-hero,
  .story,
  .sticky-section,
  .results,
  .next-project {
    padding-right: 20px;
    padding-left: 20px;
  }

  .case-hero {
    padding-top: 100px;
    padding-bottom: 52px;
  }

  .story,
  .sticky-section,
  .results {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .project-meta,
  .metrics {
    grid-template-columns: 1fr;
  }

  .project-meta {
    gap: 16px;
  }

  .metrics {
    gap: 10px;
  }

  .next-project {
    padding-top: 52px;
    padding-bottom: 60px;
  }
}


/* ==========================================================
   LONG-FORM CASE STUDY CONTENT
========================================================== */

.case-section,
.case-media,
.case-takeaways {
  width: min(100%, 1500px);
  margin-inline: auto;
  padding: 78px clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--border);
}

.case-section {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);
}

.case-section__heading h2,
.case-media h2,
.case-takeaways h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 500;
  line-height: 0.95;
}

.case-section__body {
  max-width: 860px;
}

.case-section__body > p,
.case-media__copy,
.case-takeaways li {
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65;
}

.case-section__body > p {
  margin: 0 0 18px;
}

.case-section__body > p:last-child {
  margin-bottom: 0;
}

.case-list {
  display: grid;
  gap: 18px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.case-list li {
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.case-list strong {
  color: var(--text);
}

.methods-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.methods-grid div {
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
}

.case-media {
  display: grid;
  gap: 34px;
}

.case-media__intro {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);
}

.case-media__copy {
  max-width: 860px;
  margin: 0;
}

.case-media__figure {
  margin: 0;
}

.case-media__figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-secondary);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

@media (min-width: 901px) {
  .case-media__figure--compact img {
    max-width: 50%;
  }
}

.case-media__figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-takeaways {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 100px);
}

.case-takeaways ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-takeaways li {
  position: relative;
  padding-left: 24px;
}

.case-takeaways li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  content: "✓";
  font-weight: 700;
}

html[data-theme="dark"] .case-media__figure img {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

@media (max-width: 900px) {
  .case-section,
  .case-media__intro,
  .case-takeaways {
    grid-template-columns: 1fr;
  }

  .methods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .case-section,
  .case-media,
  .case-takeaways {
    padding: 58px 20px;
  }

  .methods-grid {
    grid-template-columns: 1fr;
  }

  .case-list li {
    padding: 18px;
  }
}
