/* ===================================================================
 * Kitsune Promotional Site – Custom Styles
 * Glassmorphic dark theme matching the Kitsune app design system
 * =================================================================== */

/* ---------- CSS Custom Properties (from app tokens) ---------- */
:root {
  --primary: #6C3CE1;
  --primary-hover: #5A2DC7;
  --primary-light: #8B6CE8;
  --primary-subtle: rgba(108, 60, 225, 0.12);
  --accent: #F5A623;
  --accent-hover: #E09510;
  --accent-light: #F7BC56;
  --teal: #00D4AA;
  --teal-hover: #00B894;
  --bg-primary: #0d0d1a66;
  --bg-secondary: rgba(20, 20, 40, 0.7);
  --bg-elevated: rgba(26, 26, 53, 0.65);
  --bg-surface: rgba(34, 34, 68, 0.6);
  --bg-overlay: rgba(13, 13, 26, 0.85);
  --text-primary: #F0F0F5;
  --text-secondary: #B0B0C8;
  --text-muted: #6E6E8A;
  --border-thin: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --glass-bg: rgba(20, 20, 40, 0.55);
  --glass-bg-hover: rgba(26, 26, 53, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 12px;
  --shadow-glow-primary: 0 0 20px rgba(108, 60, 225, 0.3);
  --shadow-glow-accent: 0 0 16px rgba(245, 166, 35, 0.25);
  --shadow-glow-teal: 0 0 16px rgba(0, 212, 170, 0.2);
  --text-glow: 0 0 12px rgba(108, 60, 225, 0.4);
  --text-glow-accent: 0 0 10px rgba(245, 166, 35, 0.35);
  --success: #27AE60;
  --error: #E74C3C;
  --info: #3498DB;
}

/* ---------- Global ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

::selection {
  background: rgba(108, 60, 225, 0.4);
  color: #fff;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: rgba(108, 60, 225, 0.4);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------- Firefly Background ---------- */
.firefly-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Ensure all page content stacks above the firefly canvas */
nav, main, section, header, footer, .section-divider, #toast-container {
  position: relative;
  z-index: 2;
}

/* ---------- Glassmorphic Card ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-thin);
}

/* ---------- Navbar ---------- */
.nav-glass {
  background: rgba(13, 13, 26, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-thin);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-glass.scrolled {
  background: rgba(13, 13, 26, 0.92);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Hero ---------- */
.hero-bg {
  background: transparent;
}
.hero-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(108, 60, 225, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(245, 166, 35, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 20% 80%, rgba(0, 212, 170, 0.06) 0%, transparent 50%),
              var(--bg-primary);
}

/* ---------- Hero Scene Background ---------- */
.hero-scene-bg {
  position: absolute;
  inset: -20% 0 0 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 2;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  will-change: transform;
}
.hero-scene-bg.loaded { opacity: 0.25; }

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 60, 225, 0.12) 0%, transparent 70%);
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  animation: pulseGlow 6s ease-in-out infinite;
}

/* ---------- Hero Character Sprites ---------- */
.hero-sprite {
  position: absolute;
  bottom: 0;
  height: 70%;
  max-height: 480px;
  width: auto;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.8s ease;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 18%);
  mask-image: linear-gradient(to top, transparent 0%, black 18%);
}
.hero-sprite.loaded { opacity: 1; }
.hero-sprite-left  { left: 5%; }
.hero-sprite-right { right: 5%; transform: scaleX(-1); }

@media (max-width: 768px) {
  .hero-sprite { display: none; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ---------- Glow effects ---------- */
.glow-primary { box-shadow: var(--shadow-glow-primary); }
.glow-accent { box-shadow: var(--shadow-glow-accent); }
.glow-teal { box-shadow: var(--shadow-glow-teal); }

.text-glow { text-shadow: var(--text-glow); }
.text-glow-accent { text-shadow: var(--text-glow-accent); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(108, 60, 225, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 24px rgba(108, 60, 225, 0.45);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0D0D1A;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.3);
}
.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: 0 6px 24px rgba(245, 166, 35, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  transition: all 0.2s ease;
}
.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary-light);
}

/* ---------- Feature Cards ---------- */
.feature-card {
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(108, 60, 225, 0.15);
  border-color: rgba(108, 60, 225, 0.3);
}

.feature-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 22px;
}

/* ---------- Pricing Cards ---------- */
.pricing-card {
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}
.pricing-card:hover {
  transform: translateY(-4px);
}
.pricing-card.featured {
  border-color: rgba(108, 60, 225, 0.5);
  box-shadow: 0 0 30px rgba(108, 60, 225, 0.2);
}
.pricing-card.coming-soon .card-body {
  opacity: 0.5;
  pointer-events: none;
}

.coming-soon-badge {
  position: absolute;
  top: 30px;
  right: -35px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0D0D1A;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 36px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- VN Sample Cards ---------- */
.vn-card {
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.35s ease;
  cursor: pointer;
}
.vn-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.vn-card .vn-overlay {
  background: linear-gradient(to top, rgba(13, 13, 26, 0.95) 0%, transparent 60%);
}

/* ---------- Language Badges ---------- */
.lang-badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.lang-badge:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  transform: translateY(-2px);
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 360px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  background: rgba(39, 174, 96, 0.9);
  border: 1px solid rgba(39, 174, 96, 0.4);
  color: #fff;
  backdrop-filter: blur(12px);
}
.toast.info {
  background: rgba(108, 60, 225, 0.9);
  border: 1px solid rgba(108, 60, 225, 0.4);
  color: #fff;
  backdrop-filter: blur(12px);
}
.toast.error {
  background: rgba(231, 76, 60, 0.9);
  border: 1px solid rgba(231, 76, 60, 0.4);
  color: #fff;
  backdrop-filter: blur(12px);
}

/* ---------- Scroll Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .reveal:nth-child(2) { transition-delay: 80ms; }
.stagger-children > .reveal:nth-child(3) { transition-delay: 160ms; }
.stagger-children > .reveal:nth-child(4) { transition-delay: 240ms; }
.stagger-children > .reveal:nth-child(5) { transition-delay: 320ms; }
.stagger-children > .reveal:nth-child(6) { transition-delay: 400ms; }

/* ---------- Section Dividers ---------- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ---------- Gradient Text ---------- */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-teal {
  background: linear-gradient(135deg, var(--teal), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Media frames ---------- */
.img-placeholder,
.media-frame {
  background: linear-gradient(135deg, rgba(34, 34, 68, 0.8), rgba(20, 20, 40, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--border-thin);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.media-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 35%, rgba(13, 13, 26, 0.18));
  pointer-events: none;
}

.media-frame-hero::after {
  background: linear-gradient(180deg, rgba(108, 60, 225, 0.14), transparent 30%, rgba(13, 13, 26, 0.28));
}

.media-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: auto;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
}

/* ---------- VN Demo Overlay ---------- */
.vn-demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vn-demo-overlay[hidden] {
  display: none;
}

.vn-demo-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.vn-demo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 26, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.vn-demo-shell {
  position: relative;
  width: 90%;
  max-width: 1600px;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 40, 0.58);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.vn-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.vn-demo-kicker {
  color: var(--accent-light);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}

.vn-demo-close {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.vn-demo-close:hover {
  background: rgba(108, 60, 225, 0.2);
  border-color: rgba(108, 60, 225, 0.5);
  transform: translateY(-1px);
}

.vn-demo-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(7, 8, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vn-demo-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Mobile Nav Overlay ---------- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: blur(8px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-thin);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-nav-panel.open {
  transform: translateX(0);
}

/* ---------- Pricing Table Check / Cross ---------- */
.check { color: var(--teal); }
.cross { color: var(--text-muted); }

/* ---------- Email Input ---------- */
.email-input {
  background: var(--glass-bg);
  border: 1px solid var(--border-thin);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.email-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.2);
}
.email-input::placeholder {
  color: var(--text-muted);
}

/* ---------- Responsive Helpers ---------- */
@media (max-width: 767px) {
  .pricing-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
  }
  .pricing-scroll > * {
    scroll-snap-align: center;
    min-width: 280px;
  }

  .vn-demo-overlay {
    padding: 0;
  }

  .vn-demo-shell {
    padding: 0.75rem;
    border-radius: 20px;
  }

  .vn-demo-header {
    align-items: flex-start;
  }
}

.hero-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  z-index: 10;
}

#hero-trailer {
  position: relative;
  z-index: 1;
}

.hero-play-btn i {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-play-btn:hover i {
  color: #fff;
  transform: scale(1.08);
}

.hero-play-btn.playing {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Feature Screenshot Gallery Thumbnails ---------- */
.feat-gallery {
  position: relative;
  cursor: pointer;
}

.feat-gallery-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(13, 13, 26, 0.72);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-thin);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 2;
}

.feat-gallery-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.2s ease;
  z-index: 1;
  pointer-events: none;
}

.feat-gallery:hover .feat-gallery-hint {
  background: rgba(13, 13, 26, 0.32);
}

.feat-gallery-hint i {
  font-size: 1.75rem;
  color: transparent;
  transition: color 0.2s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.feat-gallery:hover .feat-gallery-hint i {
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Feature Screenshot Lightbox ---------- */
.feat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.feat-lightbox[hidden] { display: none; }

.feat-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.feat-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 26, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
}

.feat-lb-shell {
  position: relative;
  width: 90%;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.feat-lb-content {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.feat-lb-img-wrap {
  flex: 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 56px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-thin);
}

.feat-lb-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  image-rendering: auto;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
}

.feat-lb-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--border-thin);
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

.feat-lb-close:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.feat-lb-arrow {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--border-thin);
  color: var(--text-secondary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5;
  margin: 0 0.5rem;
}

.feat-lb-arrow:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.feat-lb-dots {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  min-height: 0.75rem;
}

.feat-lb-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.feat-lb-dot.active {
  background: var(--primary-light);
  transform: scale(1.4);
}

@media (max-width: 767px) {
  .feat-lb-arrow {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
    margin: 0 0.25rem;
  }
}
