.hero-carousel {
  --hero-carousel-cut: 13px;
  --hero-carousel-control-size: 1.5rem;
  --hero-carousel-aspect: 16 / 9;
  position: relative;
  width: 100%;
  color: var(--d4-bone-100, #ddd5c6);
  isolation: isolate;
}

.hero-carousel::before,
.hero-carousel::after {
  position: absolute;
  z-index: 5;
  width: 2.8rem;
  height: 1px;
  background: var(--d4-bronze-300, #b79669);
  content: "";
  pointer-events: none;
  opacity: 0.72;
  display: none;
}

.hero-carousel::before {
  top: 0;
  left: var(--hero-carousel-cut);
}

.hero-carousel::after {
  right: var(--hero-carousel-cut);
  bottom: 0;
}

.hero-carousel__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--hero-carousel-aspect);
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  touch-action: pan-y pinch-zoom;
}

.hero-carousel__viewport::before,
.hero-carousel__viewport::after {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  content: "";
}

.hero-carousel__viewport::before {
  inset: 0;
  z-index: 8;
  background: url("../images/gilded-frame.webp") center/100% 100% no-repeat;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.48));
}

.hero-carousel__viewport::after {
  inset: 9.375% 9.44% 11.621% 7.552%;
  z-index: 4;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent 46%, rgba(151, 72, 42, 0.06));
  box-shadow: inset 0 0 2.8rem rgba(0,0,0,.6);
}

.hero-carousel__track {
  position: absolute;
  inset: 9.375% 9.44% 11.621% 7.552%;
  overflow: hidden;
  -webkit-mask: url("../images/gilded-frame-mask.png") center/100% 100% no-repeat;
  mask: url("../images/gilded-frame-mask.png") center/100% 100% no-repeat;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: stretch;
  overflow: hidden;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
}

.hero-carousel__slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.hero-carousel__media {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  color: inherit;
  background:
    radial-gradient(circle at 50% 55%, rgba(128, 97, 61, 0.12), transparent 58%),
    var(--d4-ink-950, #080909);
  text-decoration: none;
}

.hero-carousel__media[href] {
  cursor: pointer;
}

.hero-carousel__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  filter: saturate(0.92) contrast(1.03);
  transition: opacity 260ms ease;
}

.hero-carousel__slide.is-loaded .hero-carousel__image {
  opacity: 1;
}

.hero-carousel__fallback {
  display: none;
  max-width: min(78%, 36rem);
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--d4-border, rgba(183, 150, 105, 0.34));
  border-bottom: 1px solid var(--d4-border, rgba(183, 150, 105, 0.34));
  color: var(--d4-bone-300, #b9b0a2);
  background: rgba(8, 9, 9, 0.84);
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: center;
  text-wrap: pretty;
}

.hero-carousel__slide.is-error .hero-carousel__image {
  display: none;
}

.hero-carousel__slide.is-error .hero-carousel__fallback {
  display: block;
}

.hero-carousel__loader {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(52%, 260px);
  padding: 0.5rem 0.72rem 0.65rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 4px;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid rgba(183, 150, 105, 0.18);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity var(--d4-transition, 160ms ease), visibility 0s linear var(--d4-transition, 160ms ease);
}

.hero-carousel[data-loading="true"] .hero-carousel__loader {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.hero-carousel__progress-track {
  position: relative;
  overflow: hidden;
  grid-row: 2;
  height: 4px;
  border: 1px solid rgba(183, 150, 105, 0.28);
  background: rgba(8, 9, 9, 0.82);
}

.hero-carousel__progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--hero-carousel-progress, 0%);
  background: linear-gradient(90deg, var(--d4-blood-800, #3a0c0a), var(--d4-blood-400, #a92e25));
  box-shadow: 0 0 0.7rem rgba(169, 46, 37, 0.34);
  transform-origin: left center;
  transition: width 110ms linear;
}

.hero-carousel[data-progress-indeterminate="true"] .hero-carousel__progress-bar {
  width: 38%;
  animation: hero-carousel-progress 1.25s ease-in-out infinite;
}

.hero-carousel__progress-value {
  grid-row: 1;
  color: var(--d4-bronze-300, #b79669);
  font: 0.72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hero-carousel[data-progress-indeterminate="true"] .hero-carousel__progress-value {
  visibility: hidden;
}

.hero-carousel__control {
  appearance: none;
  position: absolute;
  z-index: 6;
  top: 50%;
  display: grid;
  width: var(--hero-carousel-control-size);
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--d4-bronze-300, #b79669);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color var(--d4-transition, 160ms ease), border-color var(--d4-transition, 160ms ease), background-color var(--d4-transition, 160ms ease);
}

.hero-carousel__control--previous {
  left: calc(7.552% + .1rem);
  clip-path: none;
}

.hero-carousel__control--next {
  right: calc(9.44% + .1rem);
  clip-path: none;
}

.hero-carousel__control-icon {
  width: 0.36rem;
  height: 0.36rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.hero-carousel__control--previous .hero-carousel__control-icon {
  transform: rotate(-135deg);
}

.hero-carousel__control--next .hero-carousel__control-icon {
  transform: rotate(45deg);
}

.hero-carousel__control:hover,
.hero-carousel__control:focus-visible {
  color: #fff8e9;
  background: transparent;
  filter: drop-shadow(0 0 4px rgba(183, 150, 105, .75));
}

.hero-carousel__control:focus-visible,
.hero-carousel__dot:focus-visible,
.hero-carousel__media:focus-visible {
  outline: 2px solid var(--d4-bronze-300, #b79669);
  outline-offset: 3px;
}

.hero-carousel__control:disabled {
  opacity: 0.35;
  cursor: default;
}

.hero-carousel__dots {
  position: absolute;
  z-index: 7;
  bottom: calc(11.621% + .25rem);
  left: 50%;
  display: flex;
  min-height: 2.15rem;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  margin: 0;
  padding: 0.35rem 1rem;
  border: 1px solid var(--d4-border, rgba(183, 150, 105, 0.34));
  border-bottom: 0;
  background: rgba(8, 9, 9, 0.9);
  list-style: none;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
}

.hero-carousel__dot {
  appearance: none;
  display: block;
  width: 1.6rem;
  height: 0.28rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--d4-bronze-700, #493723);
  cursor: pointer;
  transition: background-color var(--d4-transition, 160ms ease), transform var(--d4-transition, 160ms ease);
}

.hero-carousel__dot[aria-current="true"] {
  background: var(--d4-blood-400, #a92e25);
  box-shadow: 0 0 0 1px rgba(169, 46, 37, 0.25);
  transform: scaleY(1.5);
}

.hero-carousel__dot:hover {
  background: var(--d4-bronze-300, #b79669);
}

.hero-carousel__live {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hero-carousel[data-count="0"] .hero-carousel__viewport,
.hero-carousel[data-count="0"] .hero-carousel__control,
.hero-carousel[data-count="0"] .hero-carousel__dots,
.hero-carousel[data-count="1"] .hero-carousel__control,
.hero-carousel[data-count="1"] .hero-carousel__dots {
  display: none;
}

@keyframes hero-carousel-progress {
  0% {
    transform: translateX(-115%);
  }

  50% {
    transform: translateX(85%);
  }

  100% {
    transform: translateX(265%);
  }
}

@media (max-width: 640px) {
  .hero-carousel {
    --hero-carousel-cut: 8px;
    --hero-carousel-control-size: 1.4rem;
  }

  .hero-carousel__control {
    top: auto;
    bottom: 8.5%;
    height: var(--hero-carousel-control-size);
    transform: none;
  }

  .hero-carousel__loader {
    right: 3.5rem;
    bottom: 18%;
    left: 3.5rem;
    grid-template-columns: minmax(0, 1fr) 2.8rem;
  }

  .hero-carousel__dots {
    gap: 0.42rem;
  }

  .hero-carousel__dot {
    width: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__slide,
  .hero-carousel__image,
  .hero-carousel__control,
  .hero-carousel__dot,
  .hero-carousel__loader,
  .hero-carousel__progress-bar {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compact pagination dots keep the frame visually dominant without removing
   keyboard-sized hit targets from the actual buttons. */
.hero-carousel__dots {
  min-height: 1.45rem;
  gap: .5rem;
  padding: .28rem .65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .36);
  backdrop-filter: blur(2px);
  clip-path: none;
}

.hero-carousel__dot {
  width: .72rem;
  height: .72rem;
  border: 1px solid rgba(183, 150, 105, .78);
  border-radius: 50%;
  background: rgba(4, 4, 4, .94);
  box-shadow: none;
}

.hero-carousel__dot[aria-current="true"] {
  width: .93rem;
  height: .93rem;
  border: 1px solid rgba(211, 180, 134, .92);
  background: var(--d4-blood-400, #a92e25);
  box-shadow: none;
  transform: none;
}

.hero-carousel__dot:hover {
  border-color: rgba(224, 194, 150, .96);
  background: rgba(10, 9, 8, .98);
}

.hero-carousel__dot[aria-current="true"]:hover {
  background: var(--d4-blood-400, #a92e25);
}

.hero-download-button:focus-visible,
.hero-help-button:focus-visible {
  outline: none !important;
  border: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .52));
}

.hero-download-button:focus,
.hero-download-button:active,
.hero-help-button:focus,
.hero-help-button:active {
  outline: none !important;
  border: 0 !important;
  border-color: transparent !important;
}

@media (max-width: 640px) {
  .hero-carousel__dots { gap: .36rem; padding-inline: .3rem; }
  .hero-carousel__dot { width: .63rem; height: .63rem; }
  .hero-carousel__dot[aria-current="true"] { width: .81rem; height: .81rem; }
}

@media (forced-colors: active) {
  .hero-carousel__viewport,
  .hero-carousel__control,
  .hero-carousel__dots,
  .hero-carousel__progress-track {
    border-color: CanvasText;
  }

  .hero-carousel__progress-bar,
  .hero-carousel__dot[aria-current="true"] {
    background: Highlight;
  }
}
