.cases,
.cases-empty {
  --cases-accent: var(--accent);
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--frame-gap) clamp(2.5rem, 6vw, 4.5rem);
  background: transparent;
  color: var(--text);
}

.cases-empty {
  color: var(--text-muted);
}

.cases__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  max-width: 96rem;
  margin: 0 auto clamp(2.25rem, 5vw, 4rem);
}

.cases__head-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.cases__tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cases__tag-line {
  width: 1.75rem;
  height: 2px;
  background: var(--cases-accent);
}

.cases__heading {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.052em;
  line-height: 0.98;
  text-wrap: balance;
}

.cases__sub {
  max-width: 32rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.cases__all {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.9rem;
  padding: 0.3rem 0.3rem 0.3rem 1.25rem;
  background: var(--text);
  border-radius: 999px;
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.cases__all-icon {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
  color: var(--text);
  transition: transform 0.45s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.cases__all-icon .icon {
  width: 1rem;
  height: 1rem;
}

.cases__all:hover .cases__all-icon,
.cases__all:focus-visible .cases__all-icon {
  background: var(--cases-accent);
  color: #fff;
  transform: rotate(-45deg);
}

.cases__all:focus-visible,
.case:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.cases__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 3.25rem) clamp(1.25rem, 2.5vw, 2.5rem);
  align-items: start;
  max-width: 96rem;
  margin-inline: auto;
}

.case {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.cases--stagger .case:nth-child(2) {
  margin-top: 1.35rem;
}

.cases--stagger .case:nth-child(4),
.cases--stagger .case:nth-child(6) {
  margin-top: 0.7rem;
}

.cases--stagger .case:nth-child(3n + 1) .case__stage {
  aspect-ratio: 4 / 5.15;
}

.cases--stagger .case:nth-child(3n + 2) .case__stage {
  aspect-ratio: 4 / 4.75;
}

.cases--stagger .case:nth-child(3n) .case__stage {
  aspect-ratio: 4 / 5.35;
}

.case__stage {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
}

.case__glass {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.case__glass :is(rect, line) {
  fill: none;
  stroke: #c4c4c4;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.case__frame,
.case__shelf line {
  transition: stroke 0.35s var(--ease-out);
}

.case__frame {
  stroke: #8f8f8f;
}

.case__shelf line {
  stroke: #6f6f6f;
}

.case:hover .case__frame,
.case:focus-visible .case__frame,
.case.is-open .case__frame,
.case:hover .case__shelf line,
.case:focus-visible .case__shelf line,
.case.is-open .case__shelf line {
  stroke: #161616;
}

.case__reflections line {
  stroke: rgba(18, 18, 18, 0.16);
}

.case__pane {
  stroke: rgba(18, 18, 18, 0.28);
}

.case__accent {
  stroke: var(--cases-accent);
  stroke-width: 2;
  stroke-linecap: round;
}

.case__cars {
  position: absolute;
  inset: 20% 5% 16%;
  pointer-events: none;
}

.case__car {
  position: absolute;
  bottom: 0;
  width: 42%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
}

.case__car--back {
  left: 0;
  z-index: 1;
  width: 36%;
}

.case__car--mid {
  right: 0;
  z-index: 1;
  width: 36%;
}

.case__car--front,
.case__car--solo {
  left: 29%;
  z-index: 2;
  width: 42%;
}

.case__car--solo {
  left: 16%;
  width: 68%;
  max-height: 70%;
}

.case__car--far {
  left: 18%;
  z-index: 1;
  width: 30%;
  bottom: 20%;
}

.case__silhouette {
  color: var(--text-muted);
  mix-blend-mode: normal;
}

.case__silhouette path,
.case__silhouette circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.case__shadow {
  position: absolute;
  bottom: 0;
  left: 22%;
  z-index: 0;
  width: 56%;
  height: 0.7rem;
  background: radial-gradient(ellipse at center, rgba(16, 24, 40, 0.22), transparent 70%);
  transform-origin: center;
}

.case__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: hidden;
}

.case__copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.case__name {
  position: relative;
  display: inline-block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.case__rule {
  position: absolute;
  right: 0;
  bottom: -0.12rem;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}

.case__count {
  color: #3f3f3f;
  font-size: 0.875rem;
  font-weight: 500;
}

.case__arrow {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform 0.45s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.case__arrow .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.case:hover .case__rule,
.case:focus-visible .case__rule,
.case.is-open .case__rule {
  transform: scaleX(1);
}

.case:hover .case__arrow,
.case:focus-visible .case__arrow,
.case.is-open .case__arrow {
  background: var(--cases-accent);
  border-color: var(--cases-accent);
  color: #fff;
  transform: rotate(-45deg);
}

.js:not(.is-reduced-motion) .cases:not(.is-ready) .case__car,
.js:not(.is-reduced-motion) .cases:not(.is-ready) .case__shadow,
.js:not(.is-reduced-motion) .cases:not(.is-ready) .case__copy {
  opacity: 0;
}

@media (max-width: 800px) {
  .cases__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cases__row {
    display: flex;
    gap: 0.9rem;
    max-width: none;
    margin-inline: calc(var(--frame-gap) * -1);
    padding-inline: var(--frame-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--frame-gap);
    scrollbar-width: none;
  }

  .cases__row::-webkit-scrollbar {
    display: none;
  }

  .case,
  .cases--stagger .case {
    flex: 0 0 78vw;
    margin-top: 0;
    scroll-snap-align: center;
  }

  .cases--stagger .case .case__stage {
    aspect-ratio: 4 / 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cases__all-icon,
  .case__rule,
  .case__arrow {
    transition: none;
  }
}
