/* ==========================================================
   Custom Mobile & Interactive Styling for Marblism Landing
   ========================================================== */

/* Prevent horizontal overflow on mobile viewports */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

/* Ensure sticky header functions properly */
header[data-hidden="false"] {
  transform: translateY(0) !important;
}

header[data-hidden="true"]:not(:has(details[open])) {
  transform: translateY(-100%) !important;
}

/* AI Team Carousel (Swiper horizontal scroll & snap) */
.swiper {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  scroll-snap-type: x mandatory;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  outline: none;
}

.swiper.is-dragging {
  cursor: grabbing !important;
  scroll-behavior: auto !important;
  scroll-snap-type: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.swiper::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.swiper-wrapper {
  display: flex !important;
  width: max-content !important;
  transform: none !important;
}

.swiper-slide {
  scroll-snap-align: start !important;
  flex-shrink: 0 !important;
  user-select: none;
  -webkit-user-select: none;
}

.swiper-slide a {
  -webkit-user-drag: none;
  user-select: none;
}

/* Next / Prev button interactive effects */
button[aria-label="Next"],
button[aria-label="Previous"],
button[aria-label="Prev"] {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

button[aria-label="Next"]:hover {
  transform: translateY(-50%) scale(1.08) translateX(2px);
}

button[aria-label="Next"]:active {
  transform: translateY(-50%) scale(0.95);
}

button[aria-label="Previous"]:hover,
button[aria-label="Prev"]:hover {
  transform: translateY(-50%) scale(1.08) translateX(-2px);
}

button[aria-label="Previous"]:active,
button[aria-label="Prev"]:active {
  transform: translateY(-50%) scale(0.95);
}

/* Marquee infinite animation */
@keyframes v2-marquee-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.animate-v2-marquee {
  display: flex !important;
  animation: v2-marquee-scroll 45s linear infinite !important;
  will-change: transform;
}

.animate-v2-marquee:hover {
  animation-play-state: paused;
}

/* Ensure all reveal elements are visible and crisp */
.v2-reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* Interactive Demo Modal */
.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.demo-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.demo-modal-container {
  position: relative;
  width: 100%;
  max-width: 1080px;
  aspect-ratio: 16 / 9;
  background: #0E0E10;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-modal-backdrop.is-open .demo-modal-container {
  transform: scale(1);
}

.demo-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.demo-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Mobile responsive refinements */
@media (max-width: 640px) {
  /* Ensure hero buttons fit on narrow screens */
  form[class*="max-w-[580px]"] {
    flex-direction: column !important;
  }
  
  form[class*="max-w-[580px]"] input {
    width: 100% !important;
  }
  
  form[class*="max-w-[580px]"] button {
    width: 100% !important;
  }

  /* Padding adjustments for mobile readability */
  section {
    padding-top: clamp(60px, 12vw, 100px) !important;
    padding-bottom: clamp(60px, 12vw, 100px) !important;
  }

  /* Heatmap scroll hint on mobile */
  .relative[style*="--p:"] {
    padding: 16px 12px !important;
  }
}

/* Improve summary clickable touch target and marker removal */
summary::-webkit-details-marker {
  display: none;
}

summary {
  list-style: none;
}

/* Heatmap Interactive Styling & Hover Glow */
#growth-heatmap {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#growth-heatmap span[style*="--c"] {
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
  will-change: opacity, transform;
}

#growth-heatmap span[style*="--c"]:hover {
  transform: scale(1.22);
  filter: brightness(1.25) drop-shadow(0 4px 8px rgba(255, 222, 0, 0.35));
  z-index: 10;
  cursor: pointer;
}
