:root {
  --cs-height: min(78vh, 760px);
  --cs-radius: 20px;
  --cs-speed: 700ms;
  --cs-ease: cubic-bezier(.22,.61,.36,1);
}

.cinematic-slider,
.canvas-slider {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: var(--cs-aspect, 16 / 9);
  max-height: var(--cs-height);
  border-radius: var(--cs-radius);
  overflow: hidden;
  background: #0f1115;
  isolation: isolate;
}

.cinematic-slider::before,
.canvas-slider::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--bg-image, none);
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.55) saturate(1.1);
  transform: scale(1.08);
  transition: background-image var(--cs-speed) var(--cs-ease);
  z-index: 0;
}

.cinematic-slider::after,
.canvas-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 45%),
    linear-gradient(to top, rgba(0,0,0,.5), rgba(0,0,0,.12));
  z-index: 1;
}

.cs-slide,
.canvas-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  filter: blur(10px);
  transition:
    opacity var(--cs-speed) var(--cs-ease),
    transform var(--cs-speed) var(--cs-ease),
    filter var(--cs-speed) var(--cs-ease);
  pointer-events: none;
}

.cs-slide::before,
.canvas-slide::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--slide-bg);
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(.58) saturate(1.05);
  transform: scale(1.04);
  opacity: 0;
  transition:
    opacity var(--cs-speed) var(--cs-ease),
    transform var(--cs-speed) var(--cs-ease);
  z-index: 0;
}

.cs-slide img,
.canvas-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.82);
  position: relative;
  z-index: 1;
}

.cs-slide.is-active,
.canvas-slide.is-active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0px);
  pointer-events: auto;
}

.cs-slide.is-active::before,
.canvas-slide.is-active::before {
  opacity: 1;
  transform: scale(1);
}

.cs-caption {
  position: absolute;
  left: clamp(16px, 4vw, 56px);
  bottom: clamp(20px, 5vh, 64px);
  color: #fff;
  max-width: min(680px, 90%);
  transform: translateY(24px);
  opacity: 0;
  transition: all var(--cs-speed) var(--cs-ease);
}

.cs-slide.is-active .cs-caption,
.canvas-slide.is-active .cs-caption {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 130ms;
}

.cs-caption h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.05;
}

.cs-caption p {
  margin: 0;
  font-size: clamp(14px, 1.8vw, 20px);
  opacity: .92;
}

.cs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .2s ease, transform .2s ease;
}

.cs-btn:hover {
  background: rgba(255,255,255,.24);
  transform: translateY(-1px);
}

.cs-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255,255,255,.16);
  color: #fff;
  backdrop-filter: blur(5px);
  transition: background .2s ease, transform .2s ease;
}

.cs-nav:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-50%) scale(1.06);
}

.cs-prev { left: 14px; }
.cs-next { right: 14px; }

.cs-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.cs-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255,255,255,.45);
  transition: transform .2s ease, background .2s ease;
}

.cs-dot.is-active {
  background: #fff;
  transform: scale(1.35);
}

.cinematic-slider canvas.cs-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.cinematic-slider.is-webgl .cs-slide img,
.cinematic-slider.is-webgl .cs-slide::before,
.canvas-slider.is-webgl .canvas-slide img,
.canvas-slider.is-webgl .canvas-slide::before {
  opacity: 0;
}

.canvas-slider .canvas-slide img {
  opacity: 0;
  width: 1px;
  height: 1px;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.canvas-slider .canvas-slide {
  z-index: 3;
}

@media (max-width: 768px) {
  .cinematic-slider { --cs-height: 62vh; border-radius: 14px; }
  .cs-nav { width: 40px; height: 40px; }
}
