.case-studies {
  position: relative;
  overflow: clip;
  padding-block: clamp(92px, 10vw, 156px);
  color: #f7f9fb;
  background:
    linear-gradient(180deg, rgb(3 23 42 / 18%), rgb(2 18 34 / 76%)),
    #041a30;
}

.case-studies::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(125 167 207 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(125 167 207 / 5%) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  pointer-events: none;
}

.case-studies__glow {
  position: absolute;
  top: -22%;
  right: -12%;
  width: min(760px, 66vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(39 117 185 / 24%), transparent 66%);
  pointer-events: none;
}

.case-studies .section-shell {
  position: relative;
  z-index: 1;
}

.case-studies__heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.72fr);
  gap: clamp(48px, 8vw, 128px);
  align-items: end;
  margin-bottom: clamp(42px, 5.5vw, 82px);
}

.case-studies__heading h2 {
  max-width: 760px;
  margin: 22px 0 0;
  font-size: clamp(2.4rem, 5.2vw, 5.25rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.18;
  text-wrap: balance;
}

.case-studies__intro {
  padding: 28px 0 4px clamp(26px, 3vw, 52px);
  border-left: 1px solid rgb(174 199 224 / 25%);
}

.case-studies__intro p {
  margin: 0;
  color: #b8c8d8;
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 2;
}

.case-studies__intro small {
  display: block;
  margin-top: 20px;
  color: #7892aa;
  font-size: 11px;
  line-height: 1.7;
}

.case-browser {
  border: 1px solid rgb(156 185 214 / 24%);
  background: #061b31;
  box-shadow: 0 54px 120px rgb(0 0 0 / 32%);
}

.case-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid rgb(156 185 214 / 22%);
}

.case-tabs button {
  position: relative;
  display: grid;
  min-height: 112px;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 18px;
  align-content: center;
  padding: 24px clamp(18px, 2vw, 30px);
  border: 0;
  border-right: 1px solid rgb(156 185 214 / 18%);
  color: #7f99b1;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.case-tabs button:last-child {
  border-right: 0;
}

.case-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #a77d37, #dfc17e);
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.case-tabs button:hover {
  color: #dce6ef;
  background: rgb(255 255 255 / 2%);
}

.case-tabs button[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(180deg, rgb(32 91 142 / 28%), rgb(255 255 255 / 2%));
}

.case-tabs button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.case-tabs button:focus-visible {
  z-index: 2;
  outline: 2px solid #d8b66f;
  outline-offset: -4px;
}

.case-tabs span {
  grid-row: 1 / 3;
  color: #b49356;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.case-tabs strong {
  color: inherit;
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.case-tabs small {
  color: #668199;
  font-size: 10px;
}

.case-panel:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1.64fr) minmax(370px, 0.86fr);
  min-height: 760px;
  background: #f5f2eb;
}

.case-panel__visual {
  position: relative;
  overflow: hidden;
  align-self: stretch;
  padding: clamp(24px, 3vw, 48px);
  background:
    radial-gradient(circle at 22% 12%, rgb(43 117 181 / 26%), transparent 34%),
    linear-gradient(145deg, #0c3557, #051a30 62%, #020f1d);
}

.case-panel__visual::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(141 179 214 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(141 179 214 / 7%) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  pointer-events: none;
}

.case-panel__visual img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  margin-top: clamp(38px, 6vw, 88px);
  border: 1px solid rgb(194 213 231 / 30%);
  background: #fff;
  box-shadow: 0 36px 80px rgb(0 0 0 / 36%);
}

.case-panel__signals {
  position: absolute;
  z-index: 3;
  top: clamp(22px, 3vw, 42px);
  left: clamp(24px, 3vw, 48px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dce8f2;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.case-panel__signals i {
  width: clamp(18px, 2.2vw, 42px);
  height: 1px;
  background: linear-gradient(90deg, #bf9a57, #377fbd);
}

.case-panel__demo {
  position: absolute;
  z-index: 3;
  right: clamp(24px, 3vw, 48px);
  bottom: clamp(20px, 2.5vw, 36px);
  color: rgb(187 207 225 / 70%);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.case-panel__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(38px, 4.4vw, 68px) clamp(30px, 4vw, 62px);
  color: #0a2741;
}

.case-panel__eyebrow {
  margin: 0 0 22px;
  color: #9a773f;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.case-panel__content h3 {
  margin: 0;
  font-size: clamp(1.8rem, 2.65vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.33;
  text-wrap: balance;
}

.case-panel__lead {
  margin: 24px 0 0;
  color: #536779;
  font-size: 14px;
  line-height: 1.9;
}

.case-match {
  margin-top: 30px;
  padding: 24px 0 24px 24px;
  border-top: 1px solid #d7d6d1;
  border-bottom: 1px solid #d7d6d1;
  border-left: 3px solid #b08a49;
}

.case-match small,
.case-customize > small {
  display: block;
  margin-bottom: 9px;
  color: #9a773f;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.case-match strong {
  display: block;
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.65;
}

.case-match p {
  margin: 11px 0 0;
  color: #627283;
  font-size: 12px;
  line-height: 1.75;
}

.case-customize {
  margin-top: 28px;
}

.case-customize ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-customize li {
  padding: 7px 10px;
  border: 1px solid #cfd5da;
  color: #334d63;
  background: rgb(255 255 255 / 54%);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.case-panel__scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 26px;
  color: #486077;
  font-size: 10px;
  font-weight: 750;
}

.case-panel__scope i {
  color: #b08a49;
  font-style: normal;
}

.case-panel__cta {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 15px 20px;
  color: #fff;
  background: #082844;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.case-panel__cta:hover {
  background: #0d3b63;
  transform: translateY(-2px);
}

.case-panel__cta:focus-visible {
  outline: 3px solid #d3b36d;
  outline-offset: 3px;
}

.case-studies__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(28px, 3vw, 42px) clamp(26px, 3.6vw, 54px);
  border: 1px solid rgb(156 185 214 / 20%);
  border-top: 0;
  background: rgb(255 255 255 / 2.5%);
}

.case-studies__footer p {
  margin: 0;
  color: #879eb3;
  font-size: 12px;
  line-height: 1.8;
}

.case-studies__footer strong {
  display: block;
  margin-bottom: 3px;
  color: #dce7f0;
  font-size: 14px;
}

.case-studies__footer a {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 32px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #b18b4d;
  color: #f2f6f9;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1120px) {
  .case-panel:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .case-panel__visual img {
    margin-top: 54px;
  }

  .case-panel__content {
    min-height: 660px;
  }
}

@media (max-width: 900px) {
  .case-studies__heading {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .case-studies__intro {
    max-width: 680px;
  }

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

  .case-tabs button:nth-child(2) {
    border-right: 0;
  }

  .case-tabs button:nth-child(-n + 2) {
    border-bottom: 1px solid rgb(156 185 214 / 18%);
  }
}

@media (max-width: 620px) {
  .case-studies {
    padding-block: 80px;
  }

  .case-studies__heading h2 {
    font-size: clamp(2.1rem, 10vw, 3rem);
    line-height: 1.26;
  }

  .case-studies__intro {
    padding: 20px 0 0 20px;
  }

  .case-browser {
    margin-inline: -16px;
  }

  .case-tabs button {
    min-height: 96px;
    gap: 2px 10px;
    padding: 18px 14px;
  }

  .case-tabs strong {
    font-size: 13px;
  }

  .case-tabs small {
    font-size: 9px;
  }

  .case-panel__visual {
    padding: 18px 12px 50px;
  }

  .case-panel__visual img {
    margin-top: 48px;
  }

  .case-panel__signals {
    top: 20px;
    left: 14px;
    gap: 7px;
    font-size: 8px;
  }

  .case-panel__signals i {
    width: 12px;
  }

  .case-panel__demo {
    right: 14px;
    bottom: 20px;
    font-size: 7px;
  }

  .case-panel__content {
    min-height: 0;
    padding: 38px 24px 28px;
  }

  .case-panel__content h3 {
    font-size: 1.78rem;
    line-height: 1.42;
  }

  .case-match {
    padding-left: 16px;
  }

  .case-panel__scope {
    gap: 7px;
  }

  .case-panel__cta {
    margin-top: 28px;
  }

  .case-studies__footer {
    align-items: stretch;
    flex-direction: column;
    margin-inline: -16px;
  }

  .case-studies__footer a {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-tabs button,
  .case-tabs button::after,
  .case-panel__cta {
    transition: none;
  }
}

@media (forced-colors: active) {
  .case-browser,
  .case-tabs button,
  .case-panel__cta,
  .case-customize li {
    border: 1px solid CanvasText;
  }
}
