/* ==========================================================================
   KartCenter Hildesheim – Kartbahn Page Styles
   Seamless scroll-linked video animation with cinematic overlays
   ========================================================================== */

/* Shared video section ------------------------------------------------------- */
.kb-video-wrap {
  position: relative;
  width: 100%;
  background: #131313;
}

.kb-video-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height on mobile to exclude browser UI */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-video-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Cinematic section (dark) ------------------------------------------------- */
.kb-cinematic-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(19,19,19,0.4) 70%, rgba(19,19,19,0.85) 100%),
    /* Cover KlingAI watermark bottom-right */
    radial-gradient(ellipse at 95% 95%, rgba(19,19,19,1) 0%, rgba(19,19,19,0.9) 8%, transparent 25%);
}


.kb-explode-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(255,255,255,0.35) 60%, rgba(255,255,255,0.85) 100%),
    radial-gradient(ellipse at 90% 90%, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 12%, transparent 35%);
}

/* Hero overlay (cinematic start) ------------------------------------------- */
.kb-hero-overlay {
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.22,1,0.36,1), transform 400ms cubic-bezier(0.22,1,0.36,1);
}
@media (min-width: 768px) { .kb-hero-overlay { left: 80px; } }
@media (min-width: 1024px) { .kb-hero-overlay { left: 120px; } }

.kb-hero-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.kb-hero-label-line {
  width: 40px;
  height: 1px;
  background: #E30613;
}
.kb-hero-label span {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.kb-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2.5rem, 8vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.kb-hero-accent {
  color: #E30613;
}

.kb-hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
}

/* Scroll hint ------------------------------------------------------------- */
.kb-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}
.kb-scroll-hint span {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.kb-hint-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  animation: kb-pulse 1.8s ease-in-out infinite;
}
@keyframes kb-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Card badge (bottom-left) ------------------------------------------------ */
.kb-card-badge {
  position: absolute;
  bottom: 40px;
  left: 40px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms cubic-bezier(0.22,1,0.36,1), transform 500ms cubic-bezier(0.22,1,0.36,1);
}
@media (min-width: 768px) { .kb-card-badge { left: 60px; bottom: 50px; } }

.kb-card-badge.kb-visible {
  opacity: 1;
  transform: translateY(0);
}

.kb-card-badge-inner {
  background: rgba(19,19,19,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-card-badge-dark .kb-card-badge-inner {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.06);
}

.kb-card-badge-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.kb-card-badge-dark .kb-card-badge-label { color: rgba(0,0,0,0.3); }

.kb-card-badge-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}
.kb-card-badge-dark .kb-card-badge-name { color: #131313; }

.kb-card-badge-accent { color: #E30613; }

.kb-card-badge-detail {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}
.kb-card-badge-dark .kb-card-badge-detail { color: rgba(0,0,0,0.35); }

/* Part info overlays (exploded view) -------------------------------------- */
.kb-part-info {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 260px;
}
.kb-part-info.kb-visible {
  opacity: 1;
  transform: translateY(0);
}

.kb-part-icon {
  font-size: 20px;
  color: #E30613;
  flex-shrink: 0;
  margin-top: 2px;
}

.kb-part-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 0.85rem;
  color: #131313;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.kb-part-info p {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(0,0,0,0.4);
  line-height: 1.4;
}

/* Part positions */
.kb-part-info-1 { top: 20%; right: 8%; }
.kb-part-info-2 { top: 55%; left: 6%; }
.kb-part-info-3 { bottom: 25%; right: 10%; }
.kb-part-info-4 { bottom: 15%; left: 8%; }

/* Mobile-only parts: hidden on desktop */
.kb-part-info-5,
.kb-part-info-6,
.kb-part-info-7 { display: none; }

/* Explode title overlay --------------------------------------------------- */
.kb-explode-title {
  position: absolute;
  bottom: 100px;
  left: 40px;
  z-index: 5;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}
@media (min-width: 768px) { .kb-explode-title { left: 60px; bottom: 120px; } }

.kb-explode-title-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.3);
  margin-bottom: 8px;
}
.kb-explode-title-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 2.5rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #131313;
  text-transform: uppercase;
}
@media (min-width: 768px) { .kb-explode-title-heading { font-size: 3.5rem; } }
.kb-explode-title-accent { color: #E30613; }

/* Progress bar ------------------------------------------------------------ */
.kb-progress {
  position: absolute;
  bottom: 40px;
  right: 40px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
@media (min-width: 768px) { .kb-progress { right: 60px; } }

.kb-progress-bar {
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
  transition: background 400ms ease;
}
.kb-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: #E30613;
  border-radius: 1px;
  transition: width 60ms linear;
}

.kb-progress-dark .kb-progress-bar {
  background: rgba(0,0,0,0.08);
}



/* Loader ------------------------------------------------------------------ */
.kb-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: #131313;
  transition: opacity 600ms cubic-bezier(0.22,1,0.36,1);
}
.kb-loader.kb-loaded {
  opacity: 0;
  pointer-events: none;
}
.kb-loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: #E30613;
  border-radius: 50%;
  animation: kb-spin 800ms linear infinite;
}
@keyframes kb-spin { to { transform: rotate(360deg); } }
.kb-loader-text {
  margin-top: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* Transition blend between cinematic (dark) and explode (white) ----------- */
.kb-blend-to-white {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  z-index: 3;
  pointer-events: none;
}

/* ==========================================================================
   MOBILE OPTIMIZATION – richtig krass gut
   Everything below ONLY applies to mobile (<768px).
   Desktop remains completely unchanged.
   ========================================================================== */
@media (max-width: 767px) {

  /* ---- Hero overlay: centered top on mobile, below header ---- */
  .kb-hero-overlay {
    left: 50% !important;
    top: 140px !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    text-align: center;
    align-items: center;
    width: calc(100% - 48px);
  }

  .kb-hero-label {
    margin-bottom: 12px;
    gap: 8px;
    justify-content: center;
  }
  .kb-hero-label-line {
    width: 24px;
  }
  .kb-hero-label span {
    font-size: 0.55rem;
    letter-spacing: 0.25em;
  }

  .kb-hero-title {
    font-size: clamp(2rem, 12vw, 3.5rem);
    margin-bottom: 14px;
    line-height: 0.9;
  }

  .kb-hero-sub {
    font-size: 0.75rem;
    max-width: 260px;
    line-height: 1.5;
    margin: 0 auto;
  }

  /* ---- Scroll hint: above safe area / browser UI ---- */
  .kb-scroll-hint {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  }
  .kb-scroll-hint span {
    font-size: 0.5rem;
  }
  .kb-hint-line {
    height: 20px;
  }

  /* ---- Card badge: compact on mobile, bottom-left, a bit higher ---- */
  .kb-card-badge {
    left: 20px;
    bottom: 110px;
  }

  .kb-card-badge-inner {
    padding: 12px 16px;
    gap: 2px;
    border-radius: 6px;
  }

  .kb-card-badge-label {
    font-size: 0.5rem;
  }

  .kb-card-badge-name {
    font-size: 1.15rem;
  }

  .kb-card-badge-detail {
    font-size: 0.6rem;
  }

  /* ---- Part info overlays: EXACTLY like desktop – no background ---- */
  /* On mobile: plain icon + text, no pill, no card. Positioned OUTSIDE the 16:9 kart zone. */
  .kb-part-info {
    max-width: 180px;
  }

  /* Show mobile-only parts */
  .kb-part-info-5,
  .kb-part-info-6,
  .kb-part-info-7 { display: flex; }

  /* Sporadically positioned outside the 16:9 center band, pulled inward */
  /* Top zone (above kart) */
  .kb-part-info-1 { top: 12% !important; right: 50px !important; left: auto !important; bottom: auto !important; }
  .kb-part-info-3 { top: 14% !important; left: 40px !important; right: auto !important; bottom: auto !important; }
  .kb-part-info-5 { top: 26% !important; right: 60px !important; left: auto !important; bottom: auto !important; }
  /* Bottom zone (below kart) */
  .kb-part-info-2 { bottom: 20% !important; left: 40px !important; right: auto !important; top: auto !important; }
  .kb-part-info-4 { bottom: 12% !important; right: 50px !important; left: auto !important; top: auto !important; }
  .kb-part-info-6 { bottom: 24% !important; right: 60px !important; left: auto !important; top: auto !important; }
  .kb-part-info-7 { bottom: 12% !important; left: 40px !important; right: auto !important; top: auto !important; }

  .kb-part-info h3 {
    font-size: 0.75rem;
    margin-bottom: 1px;
  }
  .kb-part-info p {
    font-size: 0.6rem;
    line-height: 1.35;
  }
  .kb-part-icon {
    font-size: 18px;
  }

  /* ---- Explode title: mobile positioning ---- */
  .kb-explode-title {
    left: 20px;
    bottom: 100px;
  }

  .kb-explode-title-label {
    font-size: 0.5rem;
  }
  .kb-explode-title-heading {
    font-size: 2rem;
  }

  /* ---- Progress bar: centered, above safe area / browser UI ---- */
  .kb-progress {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    align-items: center;
  }

  .kb-progress-bar {
    width: 100px;
    height: 3px;
    border-radius: 2px;
  }
  .kb-progress-bar::after {
    border-radius: 2px;
  }

  /* ---- Vignette on mobile ---- */
  /* Dark cinematic: removed as requested */
  .kb-cinematic-vignette {
    background: none !important;
  }

  /* White explode: very subtle edge softening */
  .kb-explode-vignette {
    background:
      radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(255,255,255,0.1) 75%, rgba(255,255,255,0.35) 100%);
  }

  /* ---- Loader ---- */
  .kb-loader-ring {
    width: 32px;
    height: 32px;
  }
  .kb-loader-text {
    font-size: 0.55rem;
    margin-top: 10px;
  }
}

/* ==========================================================================
   Mobile content sections – below the animation
   ========================================================================== */
@media (max-width: 767px) {

  /* ---- Mobile section headline sizing ---- */
  .kb-mobile-headline {
    font-size: 2rem !important;
    line-height: 0.92;
    margin-bottom: 2rem !important;
  }

  /* ---- Kart spec cards: full-bleed on mobile ---- */
  .kb-kart-card {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .kb-kart-card .kb-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .kb-kart-card .kb-stat-item {
    padding-left: 12px;
  }

  /* ---- Track feature cards: horizontal scroll on mobile ---- */
  .kb-track-features-mobile {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .kb-track-features-mobile > * {
    scroll-snap-align: start;
    flex: 0 0 280px;
    min-width: 280px;
  }

  /* Hide scrollbar but allow scroll */
  .kb-track-features-mobile::-webkit-scrollbar {
    height: 0;
    display: none;
  }
  .kb-track-features-mobile {
    scrollbar-width: none;
  }

  /* ---- Track image ---- */
  .kb-track-image-mobile {
    height: 220px !important;
    border-radius: 12px;
  }

  /* ---- Safety section: stack vertically ---- */
  .kb-safety-list li .kb-safety-icon {
    width: 44px;
    height: 44px;
  }

  /* ---- Equipment table ---- */
  .kb-equipment-card {
    border-radius: 12px;
    padding: 20px !important;
  }

  /* ---- CTA section ---- */
  .kb-cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .kb-cta-buttons a {
    text-align: center;
    padding: 16px 24px !important;
    font-size: 1rem !important;
  }
}

/* Swipe indicator for mobile horizontally scrollable cards */
.kb-swipe-indicator {
  display: none;
}
@media (max-width: 767px) {
  .kb-swipe-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 0;
    color: rgba(255,255,255,0.25);
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }
  .kb-swipe-indicator .material-symbols-outlined {
    font-size: 14px;
    animation: kb-swipe-nudge 2s ease-in-out infinite;
  }
  @keyframes kb-swipe-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
  }
}
