/* Case-study hero inspired by the supplied reference artwork. */
.case-study-reference-hero {
  position: relative;
  display: grid;
  min-height: max(760px, 100svh);
  align-items: center;
  overflow: hidden;
  padding: 140px 0 76px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 18%, rgba(173, 196, 112, 0.56), transparent 35%),
    linear-gradient(90deg, #174a46 0%, #285c4e 54%, #789963 100%);
}

.case-study-reference-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(191, 181, 80, 0.2) 2px, transparent 2px),
    linear-gradient(90deg, rgba(191, 181, 80, 0.2) 2px, transparent 2px),
    radial-gradient(circle at 25% 44%, transparent 0 235px, rgba(191, 181, 80, 0.21) 237px 239px, transparent 241px 410px, rgba(191, 181, 80, 0.17) 412px 414px, transparent 416px),
    radial-gradient(circle at 81% 57%, transparent 0 220px, rgba(191, 181, 80, 0.18) 222px 224px, transparent 226px);
  background-size: 320px 320px, 320px 320px, 100% 100%, 100% 100%;
  opacity: 0.82;
}

.case-study-reference-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 45, 43, 0.24), transparent 38%, rgba(214, 210, 122, 0.06));
}

.case-study-reference-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1480px, calc(100% - 64px));
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  gap: clamp(54px, 7vw, 112px);
  align-items: center;
}

.case-study-reference-copy {
  display: grid;
  min-width: 0;
  gap: 1.8rem;
  text-align: right;
}

.case-study-reference-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #fbbb3f;
  font-family: var(--font-display, "IBM Plex Sans Arabic", sans-serif);
  font-size: clamp(4.2rem, 8vw, 8.1rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-shadow: 0 10px 28px rgba(19, 64, 58, 0.16);
}

.case-study-reference-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 3rem);
  max-width: 790px;
  margin: 0;
}

.case-study-reference-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 500;
  line-height: 2;
  text-wrap: pretty;
}

.case-study-reference-copy .hero-related-actions {
  margin-top: 0.4rem;
}

.case-study-reference-copy .hero-related-link {
  color: #174a46;
  background: #fbbb3f;
  border-color: #fbbb3f;
}

.case-study-reference-copy .hero-related-link:hover {
  color: #fff;
  background: #ef7358;
  border-color: #ef7358;
}

.case-study-reference-mark {
  display: grid;
  width: min(100%, 590px);
  aspect-ratio: 1 / 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 22px);
  justify-self: center;
  direction: ltr;
  filter: drop-shadow(0 30px 48px rgba(15, 58, 54, 0.14));
}

.case-study-reference-piece {
  display: block;
  min-width: 0;
  min-height: 0;
  background: #fbbb3f;
}

.case-study-reference-piece-1 {
  border-radius: 0 0 100% 0;
}

.case-study-reference-piece-2 {
  border-radius: 0 100% 0 0;
}

.case-study-reference-piece-3 {
  border-radius: 0 0 0 100%;
}

.case-study-reference-piece-4 {
  border-radius: 100% 0 0 0;
}

body.dark-theme .case-study-reference-hero,
[data-theme="dark"] .case-study-reference-hero {
  background:
    radial-gradient(circle at 86% 18%, rgba(145, 170, 91, 0.38), transparent 35%),
    linear-gradient(90deg, #0d3331 0%, #17463e 54%, #536e4d 100%);
}

@media (max-width: 980px) {
  .case-study-reference-hero {
    min-height: 0;
    padding: 128px 0 72px;
  }

  .case-study-reference-grid {
    width: min(100% - 40px, 760px);
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .case-study-reference-copy h1 {
    font-size: clamp(4rem, 13vw, 7rem);
  }

  .case-study-reference-mark {
    width: min(82vw, 520px);
  }
}

@media (max-width: 620px) {
  .case-study-reference-hero {
    padding: 112px 0 54px;
  }

  .case-study-reference-grid {
    width: min(100% - 28px, 520px);
    gap: 2.4rem;
  }

  .case-study-reference-copy {
    gap: 1.35rem;
  }

  .case-study-reference-copy h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
    line-height: 1.05;
  }

  .case-study-reference-intro {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .case-study-reference-intro p {
    font-size: 1rem;
    line-height: 1.85;
  }

  .case-study-reference-mark {
    width: min(88vw, 410px);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-study-reference-copy .hero-related-link {
    transition: none;
  }
}
