
/* =========================================================
   Case Study Detail
========================================================= */
body:not(.is-case-study-open) .case-study-detail {
  display: none !important;
}

.case-study-detail {
  background: var(--white);
  color: var(--black);
}

.case-study-detail[hidden] {
  display: none;
}

.case-study {
  background: var(--white);
  color: var(--black);
}

.case-layout {
  display: grid;
  gap: clamp(28px, 4vw, 54px);
}

/* =========================================================
   Hero
========================================================= */
.case-hero {
  position: relative;
  min-height: 100vh;
  color: var(--white);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #0e100f;
  --case-hero-scale: 1;
}

.case-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.74)),
    var(--case-hero-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(var(--case-hero-scale));
  transform-origin: center;
  will-change: transform;
}

.case-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(0, 0, 0, 0.05) 0%,
      rgba(0, 0, 0, 0.42) 55%,
      rgba(0, 0, 0, 0.78) 100%
    );
  pointer-events: none;
}

.case-hero__top {
  position: absolute;
  top: calc(var(--nav-height) + 26px);
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
}

.case-hero__back {
  display: inline-flex;
  width: fit-content;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1;
}

.case-hero__back:hover {
  color: var(--white);
}

.case-hero__content {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
  padding-top: calc(var(--nav-height) + 70px);
  padding-bottom: 70px;
}

.case-hero__eyebrow {
  margin: 0;
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.78);
}

.case-hero__title {
  margin: 0;
  max-width: 17ch;
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: clamp(48px, 5.8vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.case-hero__intro {
  margin: 0;
  max-width: 72ch;
  font-size: 17px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.84);
}

.case-hero__stats {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: clamp(60px, 12vh, 140px);
}

.case-hero__stat {
  display: grid;
  gap: 10px;
  text-align: left;
}

.case-hero__stat strong {
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: clamp(28px, 2.5vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.case-hero__stat span {
  max-width: 16ch;
  font-size: 14px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.78);
}

/* =========================================================
   Shared Sections
========================================================= */
.case-section {
  background: var(--white);
  color: var(--black);
  padding: clamp(72px, 10vh, 120px) 0;
}

.case-section--overview {
  padding-top: clamp(84px, 12vh, 140px);
}

.case-section--systems {
  padding-top: clamp(28px, 5vh, 70px);
}

.case-section--videos {
  padding-top: clamp(36px, 6vh, 80px);
  padding-bottom: clamp(100px, 14vh, 170px);
  overflow: hidden;
}

.case-section__header {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.case-pill {
  margin: 0;
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f3f3;
  padding: 0 13px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-section__title {
  margin: 0;
  max-width: 22ch;
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: 4rem;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.case-section__meta {
  margin: 0;
  font-size: 13px;
  line-height: 1;
  color: rgba(17, 17, 17, 0.7);
}

.case-section__text {
  margin: 0;
  max-width: 48ch;
  font-size: 17px;
  line-height: 1.45;
  color: rgba(17, 17, 17, 0.72);
}

/* =========================================================
   Overview
========================================================= */
.case-overview-card {
  background: #f7f7f7;
  border-radius: 28px;
  padding: clamp(28px, 4vw, 46px);
  display: grid;
  gap: clamp(44px, 6vw, 78px);
}

.case-copy {
  display: grid;
  gap: 28px;
}

.case-copy-block {
  display: grid;
  gap: 4px;
}

.case-copy-block__heading {
  margin: 0;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
}

.case-copy-block__text {
  margin: 0;
  max-width: 102ch;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(17, 17, 17, 0.84);
}

.split-text {
  opacity: 1;
  will-change: transform;
}

.split-text * {
  will-change: transform;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.case-gallery__item {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #d9d9d9;
  aspect-ratio: 16 / 9;
}

.case-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   Systems
========================================================= */
.case-system-stack {
  display: grid;
  gap: 24px;
}

.case-system-panel {
  background: #f7f7f7;
  border-radius: 28px;
  padding: clamp(26px, 3.2vw, 42px);
  display: grid;
  gap: 30px;
}

.case-system-panel--dark {
  background: #111111;
  color: var(--white);
}

.case-system-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.case-system-panel--dark .case-system-panel__header {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.case-system-panel__header span {
  color: var(--purple);
  font-size: 13px;
  line-height: 1;
}

.case-system-panel__header h3 {
  margin: 0;
  max-width: 16ch;
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: 3rem;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-align: right;
}

.case-system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.case-system-card {
  min-height: 190px;
  border-radius: 20px;
  background: var(--white);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-system-card--dark {
  background: rgba(255, 255, 255, 0.08);
}

.case-system-card__number {
  color: var(--purple);
  font-size: 13px;
  line-height: 1;
}

.case-system-card--dark .case-system-card__number {
  color: rgba(255, 255, 255, 0.62);
}

.case-system-card__text {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: rgba(17, 17, 17, 0.86);
}

.case-system-card--dark .case-system-card__text {
  color: rgba(255, 255, 255, 0.9);
}

/* =========================================================
   Videos
========================================================= */
.case-video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 26px;
  align-items: center;
}

.case-video-card {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: #d9d9d9;
  cursor: pointer;
  transform: scale(1);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    filter 220ms ease;
}

.case-video-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

.case-video-card__label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  color: var(--white);
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-video-card__play {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.62);
  color: var(--white);
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.case-video-grid.is-hovering .case-video-card.is-dimmed {
  transform: scale(0.94);
  opacity: 0.52;
  filter: grayscale(1);
}

.case-video-card.is-hovered {
  transform: scale(1.055);
  z-index: 2;
}

/* =========================================================
   Video Modal
========================================================= */
.case-video-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.case-video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.case-video-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.case-video-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(420px, 92vw);
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  transform: scale(0.96);
  transition: transform 220ms ease;
}

.case-video-modal.is-open .case-video-modal__dialog {
  transform: scale(1);
}

.case-video-modal__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-video-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* =========================================================
   Campaign Performance / Metrics Panel
========================================================= */
.case-system-panel--metrics {
  background: #f7f7f7;
  color: #111111;
}

.case-system-panel--metrics .case-system-panel__header {
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.case-system-panel--metrics .case-system-panel__header span {
  color: var(--purple);
}

.case-system-panel--metrics .case-system-panel__header h3 {
  color: #111111;
}

.case-metrics {
  display: grid;
  gap: 28px;
}

.case-metrics__top {
  display: grid;
}

.case-metrics__block {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-metrics__kicker {
  margin: 0;
  color: var(--purple);
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-metrics__value {
  margin: 0;
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: clamp(44px, 6vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  color: #111111;
}

.case-metrics__section {
  display: grid;
  gap: 16px;
}

.case-metrics__section h4 {
  margin: 0;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: rgba(17, 17, 17, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.case-metrics__grid--socials {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-metrics__item {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-metrics__label {
  margin: 0;
  color: var(--purple);
  font-size: 13px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-metrics__number {
  margin: 0;
  font-family: "Haas Grot Disp Trial";
  font-weight: 400;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: #111111;
}

@media (max-width: 1100px) {
  .case-metrics__grid,
  .case-metrics__grid--socials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .case-metrics {
    gap: 22px;
  }

  .case-metrics__grid,
  .case-metrics__grid--socials {
    grid-template-columns: 1fr;
  }

  .case-metrics__block,
  .case-metrics__item {
    min-height: 140px;
    padding: 20px;
    border-radius: 18px;
  }

  .case-metrics__value {
    font-size: clamp(38px, 13vw, 58px);
  }

  .case-metrics__number {
    font-size: clamp(30px, 10vw, 42px);
  }
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1100px) {
  .case-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-system-card {
    min-height: 170px;
  }
}

@media (max-width: 1000px) {
  .case-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .case-video-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .case-system-panel__header {
    display: grid;
    justify-content: start;
  }

  .case-system-panel__header h3 {
    text-align: left;
  }

  .case-system-grid {
    grid-template-columns: 1fr;
  }

  .case-system-card {
    min-height: 140px;
  }
}

@media (max-width: 620px) {
  .case-hero {
    min-height: 860px;
  }

  .case-hero__content {
    padding-top: calc(var(--nav-height) + 100px);
  }

  .case-hero__title {
    max-width: 12ch;
    font-size: clamp(46px, 14vw, 68px);
  }

  .case-hero__stats {
    grid-template-columns: 1fr;
    margin-top: 54px;
  }

  .case-hero__stat {
    text-align: center;
    justify-items: center;
  }

  .case-section__title {
    max-width: 12ch;
  }

  .case-video-grid {
    grid-template-columns: 1fr;
  }

  .case-video-card.is-hovered,
  .case-video-grid.is-hovering .case-video-card.is-dimmed {
    transform: scale(1);
    opacity: 1;
    filter: none;
  }
}

.case-video-card__media {
  pointer-events: none;
}

.case-video-card__media::-webkit-media-controls {
  display: none !important;
}

.case-video-card__media::-webkit-media-controls-panel {
  display: none !important;
}

.case-video-card__media::-webkit-media-controls-overlay-play-button {
  display: none !important;
}

.case-video-card__media::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.case-video-card__media::-webkit-media-controls-enclosure {
  display: none !important;
}


@media (min-width: 2200px) {
  .case-hero__title {
    font-size: clamp(82px, 5.2vw, 108px);
  }

  .case-hero__intro {
    font-size: 20px;
  }

  .case-hero__eyebrow,
  .case-hero__back {
    font-size: 15.5px;
  }

  .case-hero__stats {
    width: min(1100px, 100%);
  }

  .case-hero__stat strong {
    font-size: clamp(42px, 2.7vw, 56px);
  }

  .case-hero__stat span {
    font-size: 15.5px;
  }

  .case-section__title {
    font-size: 4.9rem;
  }

  .case-section__text,
  .case-copy-block__text {
    font-size: 18.5px;
  }

  .case-copy-block__heading {
    font-size: 19.5px;
  }

  .case-system-panel__header h3 {
    font-size: 3.5rem;
  }

  .case-system-card {
    min-height: 230px;
    padding: 28px;
  }
}