.case-reel {
  --case-reel-height: min(320px, calc((100vw - 64px) * 9 / 16));
  --case-reel-gap: 20px;
  min-width: 0;
  max-width: 100%;
}
.case-reel__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.case-reel__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.case-reel__controls[hidden] { display: none; }
.case-reel__button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 44px;
  border: 1px solid var(--line, #444);
  border-radius: 50%;
  background: transparent;
  color: var(--white, #fff);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.case-reel__button:hover {
  border-color: var(--lime, #c6ff33);
  color: var(--lime, #c6ff33);
}
.case-reel__button:disabled { opacity: .4; cursor: default; }
.case-reel__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--case-reel-gap);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--lime, #c6ff33) transparent;
  touch-action: auto;
  cursor: grab;
}
.case-reel__track::after {
  content: '';
  flex: 0 0 var(--case-reel-tail, 0px);
  margin-inline-start: calc(-1 * var(--case-reel-gap));
}
.case-reel__track.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
  user-select: none;
}
.case-reel__item {
  --case-reel-ratio: 1.7777777778;
  width: calc(var(--case-reel-height) * var(--case-reel-ratio));
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  scroll-snap-align: start;
}
.case-reel__item--portrait { --case-reel-ratio: .5625; }
.case-reel__frame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--case-reel-ratio);
  background: transparent;
  border-radius: 6px;
}
.case-reel.background-reel .case-reel__frame {
  height: auto;
  aspect-ratio: var(--background-ratio);
}
.case-reel__frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
  user-select: none;
}
.case-reel__item--display-crop .case-reel__frame { overflow: hidden; }
.case-reel__item--display-crop .case-reel__frame img { height: auto; }
.case-reel__item figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 11px 0 4px;
  color: var(--muted, #aaa);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.case-reel__item figcaption > span { min-width: 0; }
.case-reel__project {
  display: inline-flex;
  gap: 5px;
  color: var(--white, #fff);
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.case-reel__button:focus-visible,
.case-reel__track:focus-visible,
.case-reel__project:focus-visible {
  outline: 2px solid var(--lime, #c6ff33);
  outline-offset: 3px;
}
.case-reel__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .case-reel { --case-reel-gap: 14px; }
  .case-reel__toolbar { margin-bottom: 12px; gap: 8px 12px; }
  .case-reel__controls { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-reel__track { scroll-behavior: auto; }
}
