.kc-cases {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 8px 0 14px;
}

.kc-cases-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.kc-cases-kicker {
  color: var(--pxs-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.kc-cases-header h2 {
  margin: 5px 0 4px;
  color: var(--pxs-fg-primary);
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.kc-cases-header p {
  max-width: 820px;
  margin: 0;
  color: var(--pxs-fg-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.kc-cases-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  background: var(--pxs-accent-dim);
  padding: 8px 12px;
  color: var(--pxs-accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.kc-cases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kc-case-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--pxs-border-default);
  border-radius: 20px;
  background: var(--pxs-bg-surface);
  color: inherit;
  text-align: left;
  box-shadow: 0 5px 18px rgba(63, 39, 30, 0.05);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.kc-case-card:hover {
  border-color: var(--pxs-accent);
  box-shadow: 0 14px 32px rgba(128, 47, 37, 0.11);
  transform: translateY(-2px);
}

.kc-case-cover {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 0;
  border-bottom: 1px solid var(--pxs-border-default);
  background: #f5ecdc;
  padding: 8px;
  cursor: zoom-in;
}

.kc-case-cover img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 7px 12px rgba(54, 37, 29, 0.08));
  transition: transform 360ms cubic-bezier(0.22, 0.7, 0.22, 1);
}

.kc-case-card:hover .kc-case-cover img {
  transform: scale(1.035);
}

.kc-case-cover:focus-visible,
.kc-case-use:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pxs-accent) 32%, transparent);
  outline-offset: -3px;
}

.kc-case-cover-caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(to top, rgba(24, 18, 16, 0.86), rgba(24, 18, 16, 0));
  padding: 34px 14px 11px;
  color: #fff;
  pointer-events: none;
}

.kc-case-cover-caption > span:first-child {
  font-size: 12px;
  font-weight: 900;
}

.kc-case-cover-caption > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.86;
}

.kc-case-cover-caption i {
  font-size: 13px;
  font-style: normal;
}

.kc-case-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 16px;
}

.kc-case-eyebrow {
  color: var(--pxs-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.kc-case-copy h3 {
  margin: 0;
  color: var(--pxs-fg-primary);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.kc-case-copy > p {
  min-height: 3.2em;
  margin: 0;
  color: var(--pxs-fg-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.kc-case-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.kc-case-tags span {
  border-radius: 999px;
  background: var(--pxs-bg-elevated);
  padding: 5px 8px;
  color: var(--pxs-fg-secondary);
  font-size: 10px;
  font-weight: 800;
}

.kc-case-use {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  background: var(--pxs-accent);
  padding: 10px 12px;
  color: var(--pxs-accent-contrast, #fff);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease;
}

.kc-case-use:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.kc-case-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
}

.kc-case-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(24, 18, 16, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.kc-case-modal-panel {
  position: relative;
  display: flex;
  width: min(1040px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: var(--pxs-bg-surface);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.3);
  animation: kc-case-modal-in 260ms cubic-bezier(0.22, 0.72, 0.22, 1) both;
}

.kc-case-modal-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--pxs-border-default);
  padding: 15px 18px 14px 22px;
}

.kc-case-modal-panel > header h2 {
  margin: 3px 0 0;
  color: var(--pxs-fg-primary);
  font-size: 22px;
  font-weight: 900;
}

.kc-case-modal-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--pxs-border-default);
  border-radius: 13px;
  background: var(--pxs-bg-elevated);
  color: var(--pxs-fg-secondary);
  cursor: pointer;
}

.kc-case-modal-close:hover,
.kc-case-modal-close:focus-visible {
  border-color: var(--pxs-accent);
  outline: none;
  color: var(--pxs-accent);
}

.kc-case-modal-body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px;
  overflow: hidden;
}

.kc-case-full-image {
  display: grid;
  min-height: 0;
  overflow: auto;
  place-items: start center;
  background: #ede5db;
  padding: 18px;
}

.kc-case-full-image img {
  display: block;
  width: min(620px, 100%);
  height: auto;
  border-radius: 14px;
  background: #f8f2e6;
  box-shadow: 0 16px 40px rgba(50, 32, 24, 0.14);
}

.kc-case-modal-body > aside {
  display: flex;
  overflow: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  border-left: 1px solid var(--pxs-border-default);
  padding: 24px;
}

.kc-case-modal-body > aside > span {
  color: var(--pxs-accent);
  font-size: 12px;
  font-weight: 900;
}

.kc-case-modal-body > aside h3 {
  margin: 0;
  color: var(--pxs-fg-primary);
  font-size: 22px;
  font-weight: 900;
}

.kc-case-modal-body > aside p,
.kc-case-modal-body > aside li {
  color: var(--pxs-fg-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.kc-case-modal-body > aside > strong {
  color: var(--pxs-fg-primary);
  font-size: 13px;
}

.kc-case-modal-body > aside ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.kc-case-modal-body > aside .pxs-btn {
  width: 100%;
  margin-top: auto;
}

@keyframes kc-case-modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .kc-cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .kc-cases {
    padding: 6px 0 10px;
  }

  .kc-cases-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .kc-cases-grid {
    display: flex;
    overflow-x: auto;
    margin-right: -12px;
    padding: 0 12px 8px 0;
    scroll-snap-type: x mandatory;
  }

  .kc-case-card {
    width: min(78vw, 300px);
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .kc-case-modal {
    align-items: end;
    padding: 0;
  }

  .kc-case-modal-panel {
    width: 100%;
    max-height: 94vh;
    border-radius: 22px 22px 0 0;
  }

  .kc-case-modal-body {
    display: flex;
    overflow: auto;
    flex-direction: column;
  }

  .kc-case-full-image {
    overflow: visible;
    padding: 12px;
  }

  .kc-case-modal-body > aside {
    overflow: visible;
    border-top: 1px solid var(--pxs-border-default);
    border-left: 0;
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-case-card,
  .kc-case-cover img,
  .kc-case-use,
  .kc-case-modal-panel {
    animation: none;
    transition: none;
  }
}
