.qcm,
.qcm * {
  box-sizing: border-box;
}

.qcm {
  --qcm-stage-rows: 640;
  --qcm-gap: 22px;
  --qcm-large-width: 370px;
  --qcm-large-row: 128 / span 387;
  --qcm-small-width: 206px;
  --qcm-small-row-top: 27 / span 284;
  --qcm-small-row-bottom: 331 / span 284;
  --qcm-medium-width: 250px;
  --qcm-medium-row-top: 1 / span 310;
  --qcm-medium-row-bottom: 331 / span 310;
  --qcm-radius: 20px;
  --qcm-edge-peek: 100px;

  position: relative;
  width: 100%;
  min-width: 0;
}

.qcm__viewport {
  width: 100%;
  overflow: hidden;
  padding: 46px 0 53px;
}

.qcm__track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  margin-inline-start: calc(var(--qcm-edge-peek) * -1);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.qcm__group {
  flex: 0 0 auto;
  display: grid;
  grid-template-rows: repeat(var(--qcm-stage-rows), minmax(0, 1px));
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  column-gap: var(--qcm-gap);
  row-gap: 0;
  width: max-content;
  padding-inline-end: var(--qcm-gap);
}

.qcm__item {
  position: relative;
  min-width: 0;
  overflow: visible;
  z-index: 1;
}

.qcm__item--large {
  width: var(--qcm-large-width);
  height: 100%;
}

.qcm__item--small {
  width: var(--qcm-small-width);
  height: 100%;
}

.qcm__item--medium {
  width: var(--qcm-medium-width);
  height: 100%;
}

.qcm__item:nth-child(5n + 1) {
  grid-row: var(--qcm-large-row);
}

.qcm__item:nth-child(5n + 2) {
  grid-row: var(--qcm-small-row-top);
}

.qcm__item:nth-child(5n + 3) {
  grid-row: var(--qcm-small-row-bottom);
}

.qcm__item:nth-child(5n + 4) {
  grid-row: var(--qcm-medium-row-top);
}

.qcm__item:nth-child(5n + 5) {
  grid-row: var(--qcm-medium-row-bottom);
}

.qcm-card {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--qcm-radius);
  background: #17131f;
  color: #fff;
  text-decoration: none;
  transform: translateZ(0) scale(1);
  transform-origin: center;
  transition:
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qcm-card__image,
.qcm-card__placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.qcm-card__image {
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  transform: scale(1.001);
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qcm-card__placeholder {
  background:
    radial-gradient(
      circle at 25% 20%,
      rgba(113, 37, 255, 0.55),
      transparent 38%
    ),
    linear-gradient(135deg, #2b2143, #121019);
}

.qcm-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(9, 7, 15, 0.02) 42%,
    rgba(9, 7, 15, 0.18) 66%,
    rgba(9, 7, 15, 0.78) 100%
  );
}

.qcm-card__content {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: #fff;
}

.qcm-card__location {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-family: Inter, sans-serif;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.qcm-card__title {
  display: block;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.qcm-card:focus-visible {
  outline: 3px solid #6c2cff;
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .qcm__item:hover {
    z-index: 30;
  }

  .qcm__item:hover .qcm-card {
    transform: scale(1.065);
    box-shadow: 0 24px 58px rgba(24, 14, 58, 0.28);
  }

  .qcm__item:hover .qcm-card__image {
    transform: scale(1.075);
  }
}

.qcm-admin-notice {
  padding: 12px 16px;
  border-left: 4px solid #d63638;
  background: #fff1f1;
  color: #3c434a;
  font: 14px/1.5 sans-serif;
}

@media (max-width: 1024px) {
  .qcm {
    --qcm-stage-rows: 462;
    --qcm-gap: 16px;
    --qcm-large-width: 266px;
    --qcm-large-row: 92 / span 279;
    --qcm-small-width: 148px;
    --qcm-small-row-top: 20 / span 204;
    --qcm-small-row-bottom: 240 / span 204;
    --qcm-medium-width: 180px;
    --qcm-medium-row-top: 1 / span 223;
    --qcm-medium-row-bottom: 240 / span 223;
    --qcm-radius: 17px;
    --qcm-edge-peek: 56px;
  }

  .qcm__viewport {
    padding: 34px 0 42px;
  }

  .qcm-card__content {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .qcm-card__title {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .qcm {
    --qcm-stage-rows: 296;
    --qcm-gap: 10px;
    --qcm-large-width: 170px;
    --qcm-large-row: 60 / span 178;
    --qcm-small-width: 95px;
    --qcm-small-row-top: 13 / span 131;
    --qcm-small-row-bottom: 154 / span 131;
    --qcm-medium-width: 115px;
    --qcm-medium-row-top: 1 / span 143;
    --qcm-medium-row-bottom: 154 / span 143;
    --qcm-radius: 13px;
    --qcm-edge-peek: 24px;
  }

  .qcm__viewport {
    padding: 22px 0 24px;
  }

  .qcm-card__content {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 3px;
  }

  .qcm-card__location {
    font-size: 7px;
  }

  .qcm-card__title {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qcm__viewport {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .qcm__track {
    transform: none !important;
    will-change: auto;
  }

  .qcm__item {
    scroll-snap-align: start;
  }

  .qcm-card,
  .qcm-card__image {
    transition: none;
  }
}
