/* CueClass site — home theme carousel (autoplay, drag / swipe / keys; behaviour in carousel.js).
   This file holds the geometry and a neutral look; css/themes*.css (loaded near the viewport) dress
   the whole section in the look of the centred theme. */

.themes {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--section);
  padding-bottom: var(--section);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.showcase {
  position: relative;
  --slide-w: min(64vw, 1000px);
  --slide-gap: clamp(20px, 2.6vw, 44px);
}

.showcase-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
}

.showcase-head h2 {
  margin: 0 0 12px;
}

.showcase-head p {
  max-width: 34em;
  margin: 0;
  color: var(--muted);
}

.themes .themes-label {
  display: flex;
  width: max-content;
}

.tc-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 56px 0 36px;
  cursor: grab;
}

.tc-viewport::-webkit-scrollbar {
  display: none;
}

.tc-viewport:focus-visible {
  outline-offset: -6px;
}

.tc-viewport.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.tc-track {
  display: flex;
  gap: var(--slide-gap);
  width: max-content;
  margin: 0;
  padding: 0 calc(50vw - var(--slide-w) / 2);
  list-style: none;
}

.tc-slide {
  position: relative;
  flex: 0 0 var(--slide-w);
  scroll-snap-align: center;
  transform: scale(var(--s, 0.86));
  transform-origin: 50% 60%;
  will-change: transform;
}

.tc-slide img,
.tc-slide video {
  -webkit-user-drag: none;
  user-select: none;
}

.tc-slide .screen {
  margin: 0;
}

.tc-slide .screen-bezel {
  overflow: hidden;
  background: #1b1f27;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.tc-slide .screen-glass {
  position: relative;
  overflow: hidden;
}

.tc-slide .screen-glass img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tc-slide:not(.is-active) .screen-glass {
  filter: grayscale(1);
}

/* poster underneath; the clip fades in once it plays */
.tc-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 260ms linear;
}

.screen-glass.is-playing .tc-video {
  opacity: 1;
}

.tc-caption {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 18px;
  font-size: 1.05rem;
  font-weight: 650;
}

.tc-caption .tc-no {
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tc-caption .en {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}

.tc-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.tc-btn:hover {
  border-color: var(--ink);
}

.tc-btn svg {
  width: 18px;
  height: 18px;
}

.tc-dots {
  display: flex;
  gap: 2px;
  margin: 0 4px;
  padding: 0;
  list-style: none;
}

.tc-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.tc-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}

.tc-dot:hover::before {
  transform: scale(1.3);
}

.tc-dot[aria-current="true"]::before {
  width: 22px;
  border-radius: 4px;
  background: var(--ink);
}

/* this slide's playback: a thin bar that fills while the clip plays, then the carousel moves on */
.tc-progress {
  flex: 0 0 100%;
  width: min(240px, 60vw);
  height: 2px;
  max-width: 240px;
  margin: 2px auto 0;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}

.tc-progress i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(var(--tc-progress, 0));
}

html.js .tc-noscript {
  display: none;
}

@media (max-width: 760px) {
  .showcase {
    --slide-w: calc(100vw - 36px);
    --slide-gap: 14px;
  }
  .tc-viewport {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tc-progress {
    display: none;
  }
}

/* decoration layers stay out of the flow even before themes-decor.css arrives */
.theme-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.tb {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.tb > * {
  position: absolute;
  width: 120px;
}
