body { background: radial-gradient(circle at 15% 10%, rgba(255,43,214,.22), transparent 35%), radial-gradient(circle at 85% 20%, rgba(0,240,255,.12), transparent 30%), #05070f; }
.hero-bg { background: linear-gradient(180deg, rgba(255,43,214,.14), transparent 45%); }
.hero-noise::before { content:""; position:absolute; inset:0; pointer-events:none; opacity:.08; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 3px 3px; }
.glass { background: rgba(15,23,42,.55); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.glass-ultra { background: rgba(15,23,42,.42); border: 1px solid rgba(255,255,255,.15); }
.btn-primary { background: linear-gradient(90deg,#ff2bd6,#00d9ff); color: #fff; padding: .6rem 1rem; border-radius: .75rem; font-weight: 700; transition: all 0.3s ease; }
.btn-primary:hover { 
  filter: brightness(1.08); 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(255,43,214,.4);
  background: linear-gradient(90deg,#ff5fe0,#ff2bd6);
}
.btn-ghost { 
  background: rgba(255,255,255,.06); 
  border: 1px solid rgba(255,255,255,.14); 
  color: #fff; 
  padding: .6rem 1rem; 
  border-radius: .75rem; 
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-ghost:hover { 
  background: rgba(255,255,255,.12); 
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,255,255,.15);
  border-color: rgba(255,43,214,.5);
}
.text-gradient-anim {
  /* Fallback color so heading stays visible when background-clip text is unsupported */
  color: #f8fafc;
  background: linear-gradient(90deg,#fff,#ff9eea,#00e5ff,#fff);
  background-size: 220% 100%;
  animation: shine 5s ease infinite;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .text-gradient-anim {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
@keyframes shine { 0% { background-position: 0 0; } 100% { background-position: 220% 0; } }
.tilt { transition: transform .25s ease, box-shadow .25s ease; }
.tilt:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(255,43,214,.25); }
.ring-gradient { box-shadow: 0 0 0 1px rgba(255,43,214,.4), 0 20px 40px rgba(17,24,39,.45); }
.nav-link { position: relative; }
.nav-link::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: #ff2bd6; transition: width .2s ease; }
.nav-link:hover::after { width: 100%; }
.back-to-top-btn { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; width: 2.2rem; height: 2.2rem; border-radius: 999px; background: #ff2bd6; color: #fff; border: 0; cursor: pointer; }

/* Fade-in animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered fade-in animations */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  opacity: 0;
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
  animation: fadeInRight 0.8s ease-out forwards;
}

.fade-in-scale {
  opacity: 0;
  animation: fadeInScale 0.6s ease-out forwards;
}

/* Delay classes for staggered effect */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Enhanced button hover effects */
.btn-enhanced {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-enhanced::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-enhanced:hover::before {
  left: 100%;
}

.btn-enhanced:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255,43,214,0.3);
}

/* Keep hero CTA buttons visible even if reveal animation or IntersectionObserver fails */
.hero-cta-row {
  opacity: 1 !important;
  animation: none;
}

/* Magnetic button effect */
.magnetic {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic:hover {
  transform: scale(1.05);
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:hover::after {
  width: 300px;
  height: 300px;
}

/* Enhanced navigation hover */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #ff2bd6;
  text-shadow: 0 0 10px rgba(255,43,214,0.5);
}

/* GitHub Stars Badge */
.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.github-stars:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 43, 214, 0.5);
  transform: scale(1.05);
}

.github-stars svg {
  width: 1rem;
  height: 1rem;
  fill: #fbbf24;
}

/* Advanced animations and effects */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 43, 214, 0.3); }
  50% { box-shadow: 0 0 30px rgba(255, 43, 214, 0.6); }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

[data-reveal] {
  animation: slideInUp 0.8s ease-out;
}

.glass {
  transition: box-shadow 0.4s ease;
}
.glass:hover {
  /* 改用 box-shadow 而非 animation：避免 animation shorthand 取代掉 .fade-in-up / .feature-card 的進場 animation 導致 opacity 回到 0 讓卡片消失 */
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.55), 0 12px 30px rgba(0,0,0,.28);
}

.feature-card {
  animation: fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }
.feature-card:nth-child(7) { animation-delay: 0.7s; }
.feature-card:nth-child(8) { animation-delay: 0.8s; }

.magnetic {
  transition: transform 0.3s ease;
}

.magnetic:hover {
  transform: scale(1.05);
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

.gradient-bg {
  background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
  background-size: 400% 400%;
  animation: rainbow 15s ease infinite;
}

.pulse-glow {
  animation: glow 3s ease-in-out infinite;
}

.float-animation {
  animation: float 6s ease-in-out infinite;
}

/* Interactive elements */
.interactive-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.interactive-card:hover {
  transform: translateY(-8px) rotateX(5deg);
  box-shadow: 0 20px 40px rgba(255, 43, 214, 0.3);
}

@keyframes demoFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.0);
  }
  35% {
    box-shadow: 0 0 0 10px rgba(0, 240, 255, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.0);
  }
}

#demo.demo-focus {
  animation: demoFocusPulse 1.2s ease-out 1;
}

.parallax-bg {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.parallax-bg > * {
  transform: translateZ(0);
}

/* Loading states */
.loading-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Advanced hover effects */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Particle effect */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(0, 240, 255, 0.6);
  border-radius: 50%;
  animation: particle-float 10s linear infinite;
}

@keyframes particle-float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ── Mouse-follow glow button system ─────────────────────── */

/* Radial spotlight that tracks cursor inside the button */
.btn-glow-spot {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255,255,255,0.22) 0%,
    rgba(0,240,255,0.16) 35%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.28s ease, width 0.28s ease, height 0.28s ease;
  z-index: 2;
  will-change: left, top;
}

/* Shimmer streak — fires once each time the mouse enters */
.btn-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    105deg,
    transparent 25%,
    rgba(255,255,255,0.24) 50%,
    transparent 75%
  );
  opacity: 0;
  transform: translateX(-130%) skewX(-18deg);
}

@keyframes glow-btn-shimmer {
  0%   { transform: translateX(-130%) skewX(-18deg); opacity: 0.95; }
  80%  { opacity: 1; }
  100% { transform: translateX(390%) skewX(-18deg); opacity: 0; }
}

/* Outer pulsing glow — starts when mouse enters */
@keyframes glow-btn-pulse {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(255,43,214,0.50),
      0 0 22px rgba(255,43,214,0.28),
      0 4px 18px rgba(0,0,0,0.32);
  }
  50% {
    box-shadow:
      0 0 26px rgba(255,43,214,0.92),
      0 0 50px rgba(255,43,214,0.58),
      0 0 80px rgba(0,240,255,0.32),
      0 6px 24px rgba(0,0,0,0.40);
  }
}

@keyframes glow-btn-ghost-pulse {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(255,255,255,0.22),
      0 0 18px rgba(255,43,214,0.18),
      inset 0 0 8px rgba(255,255,255,0.04);
  }
  50% {
    box-shadow:
      0 0 20px rgba(255,255,255,0.40),
      0 0 42px rgba(255,43,214,0.38),
      0 0 65px rgba(0,240,255,0.22),
      inset 0 0 12px rgba(255,255,255,0.08);
  }
}

/* Active state — toggled by JS on mouseenter/mouseleave */
.btn-glow-active .btn-glow-spot {
  opacity: 1;
  width: 250px;
  height: 250px;
}

.btn-glow-active .btn-shimmer {
  animation: glow-btn-shimmer 0.72s ease-out forwards;
}

.btn-glow-active.btn-primary {
  animation: glow-btn-pulse 1.5s ease-in-out infinite;
}

.btn-glow-active.btn-ghost {
  animation: glow-btn-ghost-pulse 1.5s ease-in-out infinite;
}

.btn-glow-active.glass-ultra {
  animation: glow-btn-pulse 1.5s ease-in-out infinite;
}

/* ── Global cursor aura ───────────────────────────────────── */
#cursor-aura {
  position: fixed;
  top: 0;
  left: 0;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(255,43,214,0.10) 0%,
    rgba(0,240,255,0.05) 40%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  filter: blur(50px);
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: left, top;
}

/* ── Card 3D-tilt spotlight ───────────────────────────────── */
.card-glow-spot {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255,43,214,0.20) 0%,
    rgba(0,240,255,0.08) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.card-glow-active .card-glow-spot {
  opacity: 1;
}

@keyframes card-border-glow {
  0%, 100% {
    box-shadow:
      0 12px 30px rgba(0,0,0,0.30),
      0 0 0 1px rgba(255,43,214,0.22);
  }
  50% {
    box-shadow:
      0 20px 44px rgba(0,0,0,0.38),
      0 0 0 1px rgba(255,43,214,0.55),
      0 0 32px rgba(255,43,214,0.18);
  }
}

.card-glow-active.glass {
  animation: card-border-glow 2s ease-in-out infinite;
}

/* Override the flat CSS tilt:hover — 3D tilt is now JS-driven */
.tilt {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}
.tilt:hover {
  /* box-shadow only; transform is set by JS for 3D effect */
  box-shadow: 0 22px 48px rgba(255,43,214,0.22);
}

/* ── Scroll-reveal ────────────────────────────────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.16,1,0.3,1),
              transform 0.75s cubic-bezier(0.16,1,0.3,1);
}

.scroll-reveal.animate-in {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}

[data-reveal].animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Nav scroll glass effect ──────────────────────────────── */
header.nav-scrolled {
  background: rgba(5,7,15,0.85) !important;
  backdrop-filter: blur(28px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.6) !important;
  border-bottom-color: rgba(255,43,214,0.28) !important;
  box-shadow: 0 1px 0 rgba(255,43,214,0.18), 0 4px 24px rgba(0,0,0,0.35);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* ── Aurora background orbs ───────────────────────────────── */
@keyframes aurora-drift-1 {
  0%,100% { transform: translate(0px,   0px)  scale(1.00); }
  33%      { transform: translate(60px, -45px) scale(1.12); }
  66%      { transform: translate(-35px, 30px) scale(0.92); }
}
@keyframes aurora-drift-2 {
  0%,100% { transform: translate(0px,   0px)  scale(1.00); }
  40%      { transform: translate(-65px, 55px) scale(1.14); }
  75%      { transform: translate(45px, -28px) scale(0.94); }
}
@keyframes aurora-drift-3 {
  0%,100% { transform: translate(0px,   0px)  scale(1.00); }
  30%      { transform: translate(40px,  40px) scale(1.08); }
  70%      { transform: translate(-50px,-20px) scale(0.96); }
}

/* ── Click ripple wave ────────────────────────────────────── */
@keyframes click-ripple-expand {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 0.55; }
  100% { transform: translate(-50%,-50%) scale(5.5); opacity: 0; }
}

.click-ripple-wave {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.30);
  pointer-events: none;
  animation: click-ripple-expand 0.65s ease-out forwards;
  z-index: 10;
}

/* ── Counter flash on finish ──────────────────────────────── */
@keyframes counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); color: #ff5fe0; }
  100% { transform: scale(1); }
}

.counter-done {
  animation: counter-pop 0.4s ease-out forwards;
}

/* ── Page load progress bar ───────────────────────────────── */
#page-loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #ff2bd6, #00d9ff, #00f0ff, #ff2bd6);
  background-size: 200% 100%;
  animation: loader-bar-shine 1.2s linear infinite;
  z-index: 9999;
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1), opacity 0.4s ease;
  box-shadow: 0 0 8px rgba(255,43,214,0.7), 0 0 18px rgba(255,43,214,0.35);
}

@keyframes loader-bar-shine {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Scrollspy nav active ─────────────────────────────────── */
nav a.nav-active {
  color: #ff5fe0 !important;
  text-shadow: 0 0 12px rgba(255,95,224,0.55);
}

nav a.nav-active::after {
  width: 100% !important;
  background: #ff5fe0 !important;
}

/* ── FAQ smooth accordion ─────────────────────────────────── */
#faq details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#faq details summary::-webkit-details-marker { display: none; }

#faq details summary::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: #ff5fe0;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

#faq details[open] summary::after {
  transform: rotate(45deg);
}

/* ── Plan recommended glow ────────────────────────────────── */
@keyframes plan-recommend-pulse {
  0%, 100% {
    box-shadow:
      0 0 14px rgba(251,191,36,0.22),
      0 0 30px rgba(251,191,36,0.10),
      0 12px 30px rgba(0,0,0,0.28);
  }
  50% {
    box-shadow:
      0 0 28px rgba(251,191,36,0.50),
      0 0 55px rgba(251,191,36,0.25),
      0 18px 40px rgba(0,0,0,0.38);
  }
}

.plan-recommended {
  animation: plan-recommend-pulse 2.8s ease-in-out infinite;
  position: relative;
}

.plan-recommended::before {
  content: '🔥 最推薦';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 2px 10px rgba(251,191,36,0.5);
}
