/* ==========================================================================
   CARDLY - THREE.JS HERO CANVAS STYLES (MOBILE-RESPONSIVE SYSTEM)
   3D Viewport, Card Preview Switcher, Ambient Glow & Mobile Controls
   ========================================================================== */

.hero-section {
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 1.25rem);
  padding-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}

@media (min-width: 768px) {
  .hero-section {
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 5rem;
  }
}

.hero-center-box {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 2rem;
  z-index: 2;
  position: relative;
  width: 100%;
}

@media (min-width: 768px) {
  .hero-center-box {
    margin-bottom: 3.5rem;
  }
}

/* Hero Badge - Perfected Mobile Alignment & Wrapping */
.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.01em;
  max-width: calc(100% - 1rem);
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 359.98px) {
  .hero-badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    gap: 0.35rem;
  }
  
  .hero-title {
    font-size: 1.7rem !important;
    line-height: 1.15;
  }
  
  .hero-description {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0;
  }
  
  .hero-cta-group {
    max-width: 260px;
    gap: 0.65rem;
  }
}

@media (min-width: 480px) {
  .hero-badge {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    gap: 0.6rem;
  }
}

@media (min-width: 768px) {
  .hero-badge {
    padding: 0.55rem 1.35rem;
    font-size: 0.9rem;
    margin-bottom: 2.2rem;
  }
}

[data-theme="light"] .hero-badge {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284c7;
}

.badge-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
  animation: pulse-glow 2s infinite;
}

[data-theme="light"] .badge-dot {
  background: #0284c7;
  box-shadow: 0 0 10px #0284c7;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.55; }
}

.hero-title {
  margin-bottom: 1.1rem;
}

.hero-description {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.85rem;
  padding: 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 640px;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.15rem;
    line-height: 1.65;
    margin-bottom: 3rem;
  }
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  gap: 0.85rem;
}

.hero-cta-group .btn {
  width: 100%;
}

@media (min-width: 580px) {
  .hero-cta-group {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    max-width: none;
    gap: 1.25rem;
  }
  
  .hero-cta-group .btn {
    width: auto;
  }
}

/* Hero Centered 3D Canvas Viewport Box (Full Screen Width & Visible Tooltips) */
.hero-canvas-wrapper-centered {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
  overflow: visible;
}

.hero-canvas-container {
  position: relative;
  width: 100%;
  height: 330px;
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, rgba(20, 25, 38, 0.82) 0%, rgba(5, 7, 12, 0.98) 100%);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(32px);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(56, 189, 248, 0.15);
  touch-action: pan-y;
}

@media (min-width: 480px) {
  .hero-canvas-container {
    height: 400px;
    margin-top: 2.5rem;
  }
}

@media (min-width: 768px) {
  .hero-canvas-container {
    height: 560px;
    margin-top: 3.5rem;
  }
}

[data-theme="light"] .hero-canvas-container {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.96) 100%);
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

#three-canvas:active {
  cursor: grabbing;
}

/* 3D Card Switcher Overlay Controls - Mobile Touch Scroll & Zero Overflow */
.card-switcher-overlay {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  width: calc(100% - 1.25rem);
  max-width: 360px;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.card-switcher-overlay::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

@media (min-width: 640px) {
  .card-switcher-overlay {
    bottom: 1.5rem;
    width: auto;
    max-width: none;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.5rem;
    overflow-x: visible;
  }
}

[data-theme="light"] .card-switcher-overlay {
  background: rgba(255, 255, 255, 0.96);
}

.switcher-btn {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .switcher-btn {
    flex: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }
}

.switcher-btn:hover {
  color: var(--text-primary);
}

.switcher-btn.active {
  background: var(--gradient-primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-glow-cyan);
}

[data-theme="light"] .switcher-btn {
  color: #475569;
}

[data-theme="light"] .switcher-btn:hover {
  color: #0f172a;
}

[data-theme="light"] .switcher-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

/* Floating Feature Pills (Desktop only) */
.hero-floating-pill {
  position: absolute;
  z-index: 12;
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(15, 21, 33, 0.85);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: float-slow 4s ease-in-out infinite;
}

@media (min-width: 1024px) {
  .hero-floating-pill {
    display: flex;
  }
}

[data-theme="light"] .hero-floating-pill {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.floating-pill-left {
  top: 15%;
  left: -2.5rem;
  animation-delay: 0s;
}

.floating-pill-right {
  bottom: 22%;
  right: -2.5rem;
  animation-delay: 2s;
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Canvas Glow Effects Clamped */
.canvas-glow-1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  background: var(--accent-cyan);
  filter: blur(100px);
  opacity: 0.22;
  pointer-events: none;
}

.canvas-glow-2 {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 280px;
  height: 280px;
  background: var(--accent-rose);
  filter: blur(100px);
  opacity: 0.22;
  pointer-events: none;
}
