.case-benchmark {
  padding-top: 92px;
  padding-bottom: 108px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.96) 58%, rgba(239, 243, 248, 0.94) 100%);
}

.case-benchmark .section-heading {
  margin-bottom: 42px;
}

.case-benchmark-stage {
  position: relative;
  min-height: 420px;
}

.case-benchmark-panel {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.12fr);
  border: 1px solid rgba(224, 229, 236, 0.94);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(20, 28, 40, 0.08);
}

.case-benchmark-panel:not(.is-active) {
  display: none;
}

.case-benchmark-media {
  position: relative;
  display: block;
  min-height: 344px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #0f1116;
  cursor: pointer;
}

.case-benchmark-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.08), rgba(10, 12, 18, 0.44));
  content: "";
}

.case-benchmark-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.36s ease;
}

.case-benchmark-media:hover img {
  transform: scale(1.04);
}

.case-benchmark-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  transform: translate(-50%, -50%);
}

.case-benchmark-play-icon {
  position: relative;
  width: 86px;
  height: 86px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(10, 12, 18, 0.22);
  backdrop-filter: blur(6px);
}

.case-benchmark-play-icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid #ffffff;
  transform: translate(-34%, -50%);
  content: "";
}

.case-benchmark-play span:last-child {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.case-benchmark-copy {
  display: flex;
  min-height: 344px;
  padding: 52px 52px 48px;
  flex-direction: column;
  justify-content: center;
}

.case-benchmark-accent {
  width: 58px;
  height: 6px;
  margin-bottom: 34px;
  border-radius: 999px;
  background: var(--color-brand);
}

.case-benchmark-copy h3 {
  margin: 0;
  color: var(--color-brand);
  font-size: clamp(28px, 2.1vw, 32px);
  line-height: 1.32;
  font-weight: 800;
}

.case-benchmark-copy p {
  margin: 26px 0 0;
  color: #2c3849;
  font-size: 16px;
  line-height: 1.95;
}

.case-benchmark-tabs {
  display: grid;
  margin-top: 0;
  border-top: 1px solid rgba(224, 229, 236, 0.94);
  border-left: 1px solid rgba(224, 229, 236, 0.94);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.case-benchmark-tab {
  position: relative;
  display: flex;
  min-height: 98px;
  padding: 20px 18px;
  border: 0;
  border-right: 1px solid rgba(224, 229, 236, 0.94);
  border-bottom: 1px solid rgba(224, 229, 236, 0.94);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #4a5563;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.case-benchmark-tab span {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  pointer-events: none;
}

.case-benchmark-tab::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
  content: "";
}

.case-benchmark-tab:hover,
.case-benchmark-tab.is-active {
  color: var(--color-brand);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.98));
}

.case-benchmark-tab.is-active::after {
  transform: scaleX(1);
}

.case-benchmark-tab:focus-visible {
  outline: 2px solid rgba(216, 12, 24, 0.28);
  outline-offset: -2px;
}

.case-video-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.case-video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.case-video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.74);
  backdrop-filter: blur(6px);
}

.case-video-dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  aspect-ratio: 16 / 9;
  background: #0b111d;
  box-shadow: 0 28px 80px rgba(10, 12, 18, 0.42);
}

.case-video-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #0b111d;
  object-fit: contain;
}

.case-video-close {
  position: absolute;
  z-index: 2;
  top: -16px;
  right: -16px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(10, 12, 18, 0.24);
  cursor: pointer;
}

.case-video-close::before,
.case-video-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #1b2430;
  content: "";
}

.case-video-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.case-video-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.case-library {
  padding-top: 92px;
  padding-bottom: 112px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.96) 58%, rgba(239, 243, 248, 0.94) 100%);
}

.case-library .section-heading {
  margin-bottom: 42px;
}

.case-library-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-library-shell {
  position: relative;
  min-height: 420px;
}

.case-library-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #687385;
  background: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 600;
}

.case-library-loading[hidden] {
  display: none;
}

.case-library-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(216, 12, 24, 0.18);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: caseLibraryLoadingSpin 0.8s linear infinite;
}

@keyframes caseLibraryLoadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.case-library-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(227, 232, 239, 0.96);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 54px rgba(18, 28, 40, 0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.case-library-card[data-case-href] {
  cursor: pointer;
}

.case-library-card:hover {
  transform: translateY(-6px);
  border-color: rgba(216, 12, 24, 0.18);
  box-shadow: 0 28px 64px rgba(18, 28, 40, 0.12);
}

.case-library-card[data-case-href]:focus-visible {
  outline: 2px solid rgba(216, 12, 24, 0.28);
  outline-offset: 4px;
}

.case-library-media {
  height: 182px;
  overflow: hidden;
  background: #eef3f9;
}

.case-library-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.case-library-card:hover .case-library-media img {
  transform: scale(1.04);
}

.case-library-logo {
  position: absolute;
  top: 138px;
  left: 26px;
  z-index: 1;
  display: flex;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--color-brand);
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(18, 28, 40, 0.12);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.case-library-logo span {
  display: -webkit-box;
  overflow: hidden;
  max-width: calc(100% - 18px);
  color: inherit;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.case-library-body {
  padding: 84px 26px 24px;
}

.case-library-body h3 {
  min-height: 0;
  margin: 0;
  padding-bottom: 14px;
  color: #253142;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 500;
}

.case-library-body p {
  margin: 0;
  color: #5f6875;
  font-size: 14px;
  line-height: 1.75;
}

.case-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 42px;
  flex-wrap: wrap;
}

.case-page-btn,
.case-page-arrow {
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #8a94a3;
  background: transparent;
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.case-page-btn:hover,
.case-page-arrow:hover {
  color: #1d2530;
}

.case-page-btn.is-active {
  color: #ffffff;
  background: var(--color-brand);
  box-shadow: 0 14px 30px rgba(216, 12, 24, 0.22);
}

.case-page-arrow {
  min-width: 32px;
  font-size: 30px;
  line-height: 1;
}

.case-page-arrow.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.case-library-error,
.case-library-empty {
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  grid-column: 1 / -1;
  color: #687385;
  font-size: 16px;
  text-align: center;
}

.case-library-error p,
.case-library-empty p {
  margin: 0;
}

.case-library-retry {
  min-width: 112px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  background: var(--color-brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.case-library-retry:hover {
  background: #b30712;
}

@media (max-width: 1080px) {
  .case-benchmark-panel {
    grid-template-columns: 1fr;
  }

  .case-benchmark-copy,
  .case-benchmark-media {
    min-height: 320px;
  }

  .case-benchmark-copy {
    padding: 40px 34px 36px;
  }

  .case-benchmark-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .case-library-shell,
  .case-library-loading,
  .case-library-error,
  .case-library-empty {
    min-height: 320px;
  }

  .case-benchmark {
    padding-top: 68px;
    padding-bottom: 76px;
  }

  .case-benchmark .section-heading {
    margin-bottom: 30px;
  }

  .case-benchmark-media,
  .case-benchmark-copy {
    min-height: auto;
  }

  .case-benchmark-media {
    aspect-ratio: 16 / 10;
  }

  .case-benchmark-play {
    gap: 12px;
  }

  .case-benchmark-play-icon {
    width: 68px;
    height: 68px;
  }

  .case-benchmark-play-icon::before {
    border-top-width: 11px;
    border-bottom-width: 11px;
    border-left-width: 18px;
  }

  .case-benchmark-copy {
    padding: 28px 18px 24px;
  }

  .case-benchmark-accent {
    margin-bottom: 22px;
  }

  .case-benchmark-copy h3 {
    font-size: 24px;
  }

  .case-benchmark-copy p {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.85;
  }

  .case-benchmark-tabs {
    margin-top: 22px;
    grid-template-columns: 1fr 1fr;
  }

  .case-benchmark-tab {
    min-height: 76px;
    padding: 16px 12px;
    font-size: 16px;
  }

  .case-video-modal {
    padding: 0;
  }

  .case-video-dialog {
    width: 100vw;
    height: 100dvh;
    padding: 0;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .case-video-player {
    object-fit: contain;
  }

  .case-video-close {
    top: calc(env(safe-area-inset-top) + 12px);
    right: calc(env(safe-area-inset-right) + 12px);
  }

  .case-library {
    padding-bottom: 78px;
  }

  .case-library .section-heading {
    margin-bottom: 28px;
  }

  .case-library-grid {
    gap: 20px;
    grid-template-columns: 1fr;
  }

  .case-library-media {
    height: 196px;
  }

  .case-library-logo {
    top: 152px;
    left: 18px;
    width: 84px;
    height: 84px;
    font-size: 13px;
  }

  .case-library-body {
    padding: 74px 18px 20px;
  }

  .case-library-body h3 {
    min-height: 0;
    padding-bottom: 12px;
    font-size: 17px;
    line-height: 1.6;
  }

  .case-library-body p {
    font-size: 13px;
  }

  .case-pagination {
    gap: 12px;
    padding-top: 30px;
  }

  .case-page-btn,
  .case-page-arrow {
    min-width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .case-page-arrow {
    min-width: 28px;
    font-size: 24px;
  }
}
