/* ============================================================
   裕益行 — 動畫增強樣式 (animations.css)
   純動畫效果，不影響原有佈局與排版
   ============================================================ */

/* ── Particle Canvas Background ── */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Scroll Progress Bar ── */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #FCA311, #FFD700, #FCA311);
  background-size: 200% 100%;
  animation: shimmerBar 2s linear infinite;
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(252,163,17,0.35);
}
@keyframes shimmerBar {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Hero Text Character Reveal ── */
.hero-text-reveal .char-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) rotateX(-30deg);
  animation: charRevealIn 0.6s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
@keyframes charRevealIn {
  to { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

/* ── Decorative Floating SVGs ── */
.deco-svg {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  transition: transform 0.3s ease-out;
}
.deco-hex {
  width: 120px; height: 120px;
  top: 10%; left: 5%;
  animation: decoSpin 25s linear infinite;
}
.deco-circle {
  width: 100px; height: 100px;
  top: 15%; right: 8%;
  animation: decoFloat 6s ease-in-out infinite;
}
.deco-diamond {
  width: 80px; height: 80px;
  bottom: 20%; left: 10%;
  animation: decoPulse 4s ease-in-out infinite;
}
.deco-cross {
  width: 60px; height: 60px;
  bottom: 25%; right: 12%;
  animation: decoFloat 8s ease-in-out infinite reverse;
}
.deco-tri {
  width: 90px; height: 90px;
  top: 50%; right: 3%;
  animation: decoSpin 30s linear infinite reverse;
}
@keyframes decoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes decoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
}
@keyframes decoPulse {
  0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.6; }
  50% { transform: rotate(45deg) scale(1.15); opacity: 1; }
}

/* ── Section SVG Wave Dividers ── */
.section-svg-divider {
  text-align: center;
  margin: 1rem 0;
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.section-svg-divider.visible {
  opacity: 1;
  transform: scaleX(1);
}
.section-svg-divider svg {
  width: 100%;
  max-width: 400px;
  height: 20px;
}

/* ── Card Mouse Glow (cursor follow) ── */
.has-glow {
  position: relative;
}
.has-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(
    300px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(252,163,17,0.08) 0%, transparent 70%
  );
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
  transition: opacity 0.3s;
}

/* ── Click Ripple ── */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(252,163,17,0.3);
  transform: scale(0);
  animation: rippleExpand 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes rippleExpand {
  to { transform: scale(1); opacity: 0; }
}

/* ── Stat Number Bounce In ── */
.stat-animate-in {
  animation: statBounceIn 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes statBounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Hero Title Gradient Shimmer ── */
header h1 {
  background: linear-gradient(90deg, #fff 0%, #fff 40%, #FCA311 50%, #fff 60%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4s ease-in-out infinite;
}
@keyframes textShimmer {
  0%, 100% { background-position: 200% center; }
  50% { background-position: 0% center; }
}

/* ── CTA Section Floating Orb ── */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-section::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252,163,17,0.15) 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(-30px,20px) scale(1.1); }
  66% { transform: translate(20px,-10px) scale(0.9); }
}

/* ── SVG Draw Animation (for injected SVGs) ── */
.svg-draw path, .svg-draw line, .svg-draw polyline, .svg-draw circle, .svg-draw rect {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.5s ease;
}
.svg-draw.drawn path, .svg-draw.drawn line, .svg-draw.drawn polyline,
.svg-draw.drawn circle, .svg-draw.drawn rect {
  stroke-dashoffset: 0;
}

/* ── Scroll Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ── Breadcrumb Arrow Bounce ── */
.breadcrumb span {
  display: inline-block;
}

/* ── Icon Circle Spin Ring ── */
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* ── Emergency Box Pulse ── */
@keyframes emergencyPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ── Responsive: disable heavy effects on mobile ── */
@media (max-width: 768px) {
  .deco-svg { display: none; }
  .scroll-progress-bar { height: 2px; }
  .cta-section::after { display: none; }
  header h1 {
    -webkit-text-fill-color: #fff;
    background: none !important;
    animation: none !important;
  }
}
