/* "Creative Vision & Content Deliverables" explorer: category -> client -> asset carousel.
   Uses only theme tokens from main.css :root. Native scroll-snap does the swiping; explorer.js adds
   arrows, dots, mouse-drag and panel switching. */

.cx {
  margin-top: 8px;
  min-width: 0;
}
.cx ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cx button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cx button:focus-visible,
.cx a:focus-visible,
.cx-viewport:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 3px;
}
.cx [hidden] {
  display: none !important;
}

/* ---------- Level 1: categories ---------- */
.cx-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.cx-cats[data-count="3"],
.cx-cats[data-count="6"],
.cx-cats[data-count="9"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cx-cat {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: var(--border);
  border-radius: 16px;
  background: var(--bg);
  text-align: left;
  transition: border-color 0.35s ease, transform 0.35s ease;
}
.cx-cat-media,
.cx-cat-media img,
.cx-cat-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cx-cat-media img,
.cx-cat-media video {
  object-fit: cover;
  opacity: 0.55;
  filter: grayscale(0.4);
  transition: transform 0.6s ease, opacity 0.35s ease, filter 0.35s ease;
}
.cx-cat-body {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  padding: 44px 18px 16px;
  background: linear-gradient(to top, rgba(6, 6, 6, 0.92) 25%, rgba(6, 6, 6, 0));
}
.cx-cat-index {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--theme);
}
.cx-cat-name {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--white);
}
.cx-cat-count {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
}
.cx-cat:hover,
.cx-cat:focus-visible {
  border-color: rgba(191, 247, 71, 0.5);
}
.cx-cat:hover img,
.cx-cat:hover video {
  transform: scale(1.04);
  opacity: 0.8;
  filter: grayscale(0);
}
.cx-cat[aria-pressed="true"] {
  border-color: var(--theme);
}
.cx-cat[aria-pressed="true"] img,
.cx-cat[aria-pressed="true"] video {
  opacity: 0.9;
  filter: none;
}
.cx-cat[aria-pressed="true"] .cx-cat-name {
  color: var(--theme);
}

/* ---------- Level 2: clients ---------- */
.cx-panel {
  margin-top: 48px;
  min-width: 0;
}
.cx-panel:not([hidden]) {
  animation: cx-in 0.4s ease both;
}
.cx-clients-head,
.cx-stage-head,
.cx-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cx-clients-head h3,
.cx-stage-head h3 {
  margin: 0;
}
.cx-clients-head h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}
.cx-clients-head h3 span {
  color: var(--text);
}
.cx-arrows {
  display: inline-flex;
  gap: 8px;
}
.cx-arrow {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  transition: border-color 0.25s, color 0.25s, opacity 0.25s;
}
.cx-arrow:hover:not(:disabled) {
  border-color: var(--theme);
  color: var(--theme);
}
.cx-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
.cx-track,
.cx-viewport {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cx-track::-webkit-scrollbar,
.cx-viewport::-webkit-scrollbar {
  display: none;
}
.cx-track {
  margin-top: 16px;
  padding-bottom: 4px;
}
.cx-track > li,
.cx-viewport > li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.cx-client {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-areas: "media name" "media count";
  align-items: center;
  column-gap: 14px;
  width: 260px;
  padding: 10px 16px 10px 10px;
  border: var(--border);
  border-radius: 14px;
  background: transparent;
  text-align: left;
  transition: border-color 0.25s, background-color 0.25s;
}
.cx-client-media {
  grid-area: media;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
}
.cx-client-media img,
.cx-client-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cx-client-name {
  grid-area: name;
  align-self: end;
  font-weight: 600;
  line-height: 1.25;
  color: var(--white);
}
.cx-client-count {
  grid-area: count;
  align-self: start;
  font-size: 13px;
  color: var(--text);
}
.cx-client:hover {
  border-color: rgba(191, 247, 71, 0.5);
}
.cx-client[aria-pressed="true"] {
  border-color: var(--theme);
  background: var(--bg);
}
.cx-client[aria-pressed="true"] .cx-client-name {
  color: var(--theme);
}

/* ---------- Level 3: selected client's assets ---------- */
.cx-stage {
  margin-top: 36px;
}
.cx-stage:not([hidden]) {
  animation: cx-in 0.4s ease both;
}
.cx-stage-head {
  align-items: flex-end;
  margin-bottom: 20px;
}
.cx-stage-head h3 {
  font-size: 32px;
  line-height: 1.15;
  color: var(--white);
}
.cx-stage-head p {
  margin: 6px 0 0;
  color: var(--text);
}
.cx-stage-head .arrow-link {
  flex: 0 0 auto;
  white-space: nowrap;
}
.cx-viewport {
  --cx-h: clamp(320px, 46vw, 560px);
  gap: 20px;
  cursor: grab;
}
.cx-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
.cx-slide {
  height: var(--cx-h);
  aspect-ratio: 4 / 5;
  max-width: 100%;
  border: var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
}
.cx-slide.is-reel {
  aspect-ratio: 9 / 16;
}
.cx-slide.is-video:not(.is-reel) {
  aspect-ratio: 16 / 9;
}
.cx-slide > a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.cx-slide img,
.cx-slide video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  -webkit-user-drag: none;
}
.cx-slide.is-video img,
.cx-slide.is-video video {
  object-fit: cover;
  background: #000;
}
.cx-slide .work-play {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -32px 0 0 -32px;
}
.cx-slide:hover .work-play {
  background: var(--theme);
  color: var(--bg-2);
}
.cx-controls {
  margin-top: 20px;
}
.cx-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}
.cx-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(193, 193, 193, 0.28);
  transition: background-color 0.25s, transform 0.25s;
}
.cx-dots i.is-on {
  background: var(--theme);
  transform: scale(1.25);
}
.cx-pos {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text);
}
.cx-featured {
  margin-top: 80px;
}

@keyframes cx-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .cx-cats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  /* categories become a swipeable row so the page never grows a wall of cards */
  .cx-cats {
    display: flex;
    gap: 14px;
    margin-right: -12px;
    padding-right: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .cx-cats::-webkit-scrollbar {
    display: none;
  }
  .cx-cats > li {
    flex: 0 0 62%;
    scroll-snap-align: start;
  }
  .cx-panel {
    margin-top: 32px;
  }
  .cx-client {
    width: 230px;
  }
  .cx-stage-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .cx-stage-head h3 {
    font-size: 26px;
  }
  .cx-viewport {
    --cx-h: min(440px, 112vw);
    gap: 14px;
  }
  .cx-slide {
    max-width: 86vw;
  }
  /* swiping is the control on touch screens */
  .cx-arrows {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-panel:not([hidden]),
  .cx-stage:not([hidden]) {
    animation: none;
  }
  .cx *,
  .cx *::before,
  .cx *::after {
    transition: none !important;
  }
  .cx-cat:hover img,
  .cx-cat:hover video {
    transform: none;
  }
}
