/* ═══════════════════════════════════════════════════════════════════════════
   TUI Scene Carousel — CSS-only animated demo
   ═══════════════════════════════════════════════════════════════════════════ */

/* Carousel section container */
.carousel-section {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 8px;
}

/* ── Terminal wrapper ── */
.terminal-wrapper {
  width: 100%;
}

/* Scaling container — height is set by JS on mobile */
.terminal-aspect {
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* The window is always 900px wide; JS scales it down on small screens */
.terminal-aspect .macos-window {
  width: 900px;
  transform-origin: top left;
}

/* ── Carousel container ── */
.carousel {
  position: relative;
  min-height: 460px;
}

/* ── Scene ── */
.scene {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Carousel controls ── */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.carousel-btn {
  background: rgba(150,200,255,0.06);
  border: 1px solid rgba(150,200,255,0.12);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.carousel-btn:hover {
  background: rgba(150,200,255,0.15);
  border-color: rgba(150,200,255,0.3);
  color: var(--brand);
}

.carousel-btn:active { transform: scale(0.95); }

.carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(150,200,255,0.2);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.carousel-dot:hover { background: rgba(150,200,255,0.4); }

.carousel-dot.active {
  background: var(--brand);
  width: 22px;
  border-radius: 4px;
}

.carousel-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  min-height: 1.2rem;
  padding: 0 1rem;
}

/* ── Staggered reveal ── */
.scene.active .rv { opacity: 0; animation: rv-in 0.3s ease forwards; }
.scene.active .rv1 { animation-delay: 0.3s; }
.scene.active .rv2 { animation-delay: 0.6s; }
.scene.active .rv3 { animation-delay: 0.9s; }
.scene.active .rv4 { animation-delay: 1.2s; }
.scene.active .rv5 { animation-delay: 1.5s; }
.scene.active .rv6 { animation-delay: 1.8s; }
.scene.active .rv7 { animation-delay: 2.1s; }
.scene.active .rv8 { animation-delay: 2.4s; }
.scene:not(.active) .rv { opacity: 0; }

@keyframes rv-in { to { opacity: 1; } }

/* Typewriter effect */
.scene.active .tw {
  overflow: hidden; white-space: nowrap;
  display: inline-block; width: 0;
  animation: tw-type 1.5s steps(40) 0.3s forwards;
}
.scene:not(.active) .tw { width: 0; }
@keyframes tw-type { to { width: 100%; } }
