.cases-page {
  --case-ink: #111820;
  --case-muted: #5c6672;
  --case-line: #dfe4e8;
  --case-panel: #ffffff;
  --case-soft: #f4f7f6;
  --case-accent: #0f766e;
  --case-warm: #9f5b13;
  min-height: 100dvh;
  color: var(--case-ink);
  background: #eef2f1;
}

.case-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--case-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.case-brand img {
  display: block;
  width: 156px;
  height: auto;
}

.case-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--case-line);
  border-radius: 999px;
  background: #f9fbfb;
}

.case-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #26313a;
  font-weight: 700;
  font-size: 0.92rem;
}

.case-nav a:hover,
.case-nav a.active {
  color: #fff;
  text-decoration: none;
  background: var(--case-accent);
}

.case-page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.case-page-heading {
  padding: 28px;
  border: 1px solid var(--case-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.13), rgba(255, 255, 255, 0) 46%),
    #fff;
  box-shadow: 0 16px 34px rgba(16, 20, 25, 0.08);
}

.case-kicker {
  margin: 0 0 8px;
  color: #0b4f4a;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.case-page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.case-page-heading p:last-child {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--case-muted);
  font-size: 1.04rem;
}

.case-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.case-explainer div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--case-line);
  border-radius: 8px;
  background: #fff;
}

.case-explainer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--case-accent);
}

.case-explainer span {
  color: var(--case-muted);
}

.case-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.case-overview-card {
  display: grid;
  gap: 7px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--case-line);
  border-radius: 8px;
  background: #fff;
  color: var(--case-ink);
}

.case-overview-card:hover {
  border-color: #b9d6d2;
  text-decoration: none;
  transform: translateY(-1px);
}

.case-overview-card span {
  color: var(--case-accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.case-overview-card strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.case-overview-card small {
  color: var(--case-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.case-list {
  display: grid;
  gap: 22px;
}

.case-study {
  scroll-margin-top: 86px;
  border: 1px solid var(--case-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 20, 25, 0.06);
}

.case-study-header {
  padding: 22px;
  border-bottom: 1px solid var(--case-line);
}

.case-study-header h2 {
  max-width: 1040px;
  margin: 6px 0 10px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.case-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #6f410b;
  background: #fff2dd;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.case-instruction {
  margin: 8px 0 0;
  color: var(--case-muted);
}

.case-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--case-line);
}

.case-video-card {
  margin: 0;
  min-width: 0;
  background: #fff;
}

.case-video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111820;
}

.case-video-card figcaption {
  padding: 14px;
}

.case-video-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.case-video-title strong {
  color: var(--case-ink);
}

.case-score {
  min-width: 68px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0b4f4a;
  background: #e7f4f1;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.case-video-card p {
  margin: 0;
  color: var(--case-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.case-skill-row {
  padding: 16px 22px 20px;
  color: var(--case-muted);
  font-size: 0.9rem;
}

.case-skill-row code {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--case-soft);
  color: #26313a;
  font-size: 0.82rem;
}

.case-error {
  padding: 24px;
  border: 1px solid var(--case-line);
  border-radius: 8px;
  background: #fff;
  color: var(--case-muted);
}

@media (max-width: 980px) {
  .case-explainer,
  .case-overview,
  .case-video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .case-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .case-nav {
    width: 100%;
    overflow-x: auto;
  }

  .case-page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 14px;
  }

  .case-page-heading,
  .case-study-header {
    padding: 18px;
  }
}
