/* ── Customize Agent Teaser — 3D Tunnel ─────────────────────────────────── */

/* Scroll driver — tall section gives scroll range for the tunnel */
.cz-teaser-section {
  position: relative;
  height: 550vh;
  z-index: 12;
}

/* Sticky container — stays pinned while parent is scrolled through */
.cz-teaser-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

/* ── HUD overlay (non-interactive) ──────────────────────────────────────── */
.cz-hud {
  position: absolute;
  inset: 2rem;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.cz-hud-top,
.cz-hud-bottom {
  display: flex;
  align-items: center;
  gap: 0;
}

.cz-hud-label {
  white-space: nowrap;
}

.cz-hud-label strong {
  color: var(--color-blue);
  font-variant-numeric: tabular-nums;
}

.cz-hud-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 1.2rem;
  position: relative;
}

.cz-hud-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 4px;
  height: 4px;
  background: var(--color-violet);
}

.cz-hud-side {
  align-self: flex-start;
  margin-top: auto;
  margin-bottom: auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.2em;
  animation: hudSidePulse 2s ease-in-out infinite;
}

@keyframes hudSidePulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

/* ── 3D Tunnel — JS-driven perspective projection ────────────────────────── */
.cz-tunnel-viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.cz-tunnel-world {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* Velocity vignette — edges darken when scrolling fast */
.cz-tunnel-vignette {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(10, 15, 28, 0.8) 100%
  );
  opacity: 0.4;
  transition: opacity 0.15s ease-out;
}

/* ── Tunnel items — shared positioning ───────────────────────────────────── */
.cz-tunnel-bigtext,
.cz-tunnel-card,
.cz-tunnel-star {
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
}

/* ── Big text strips ─────────────────────────────────────────────────────── */
.cz-tunnel-bigtext {
  font-size: clamp(5rem, 14vw, 13rem);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  line-height: 1;
  mix-blend-mode: screen;
}

/* ── Tunnel class cards ──────────────────────────────────────────────────── */
.cz-tunnel-card {
  width: 210px;
  background: rgba(20, 27, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Corner brackets — reuse card hover pattern */
.cz-tunnel-card::before,
.cz-tunnel-card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 2;
  transition:
    width 0.3s,
    height 0.3s;
}
.cz-tunnel-card::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid rgba(168, 85, 247, 0.5);
  border-left: 1px solid rgba(168, 85, 247, 0.5);
}
.cz-tunnel-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.5);
  border-right: 1px solid rgba(168, 85, 247, 0.5);
}

.cz-tc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cz-tc-role {
  font-size: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cz-tc-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.3;
  pointer-events: none;
}

.cz-tc-char {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 12px auto 6px;
  z-index: 1;
}

.cz-tc-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cz-tc-name {
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text);
  text-align: center;
  padding: 0 12px 10px;
}

.cz-tc-stats {
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cz-tc-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cz-tc-stat-name {
  font-size: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  width: 28px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.cz-tc-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
}

.cz-tc-fill {
  height: 100%;
  border-radius: 1px;
  opacity: 0.8;
}

/* ── Stars ───────────────────────────────────────────────────────────────── */
.cz-tunnel-star {
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

/* ── End CTA overlay ─────────────────────────────────────────────────────── */
.cz-teaser-cta {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(76, 29, 149, 0.35) 0%,
    rgba(10, 15, 28, 0.86) 65%
  );
  transition: opacity 0.1s;
}

.cz-teaser-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  max-width: 560px;
  padding: 0 24px;
}

.cz-teaser-cta-inner .status-badge {
  margin-bottom: 28px;
}

.cz-teaser-cta-inner h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 16px;
}

.cz-teaser-cta-inner h2 .accent {
  background: linear-gradient(135deg, var(--color-blue), var(--color-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cz-teaser-cta-inner .description {
  text-align: center;
  margin-bottom: 36px;
}

.cz-teaser-cta-inner .glass-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Customize Teaser — Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .cz-tunnel-card {
    width: 160px;
  }
  .cz-hud-side {
    display: none;
  }
  .cz-teaser-section {
    height: 400vh;
  }
  .cz-tunnel-bigtext {
    font-size: clamp(3rem, 12vw, 8rem);
  }
  .cz-teaser-cta-inner h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
  }
  .cz-teaser-cta-inner .description {
    font-size: 0.88rem;
    margin-bottom: 28px;
  }
}

@media (max-width: 480px) {
  .cz-tunnel-card {
    width: 120px;
  }

  .cz-teaser-section {
    height: 350vh;
  }

  .cz-hud {
    inset: 0.75rem;
    font-size: 0.45rem;
  }

  .cz-tunnel-bigtext {
    font-size: clamp(2rem, 10vw, 5rem);
  }

  .cz-tc-header {
    padding: 7px 10px;
  }

  .cz-tc-role {
    font-size: 0.5rem;
  }

  .cz-tc-char {
    width: 65px;
    height: 65px;
    margin: 8px auto 4px;
  }

  .cz-tc-name {
    font-size: 0.85rem;
    padding: 0 8px 6px;
  }

  .cz-tc-stats {
    padding: 6px 10px 10px;
    gap: 4px;
  }

  .cz-tc-stat-name {
    font-size: 0.4rem;
    width: 24px;
  }

  .cz-teaser-cta-inner {
    padding: 0 16px;
  }

  .cz-teaser-cta-inner h2 {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }

  .cz-teaser-cta-inner .description {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .cz-teaser-cta-inner .glass-button {
    width: 100%;
    justify-content: center;
  }
}
