/* ==========================================================================
   RKGG PRECIOUS METALS - LUXURY MOTION DESIGN SYSTEM (CSS)
   Subtle, Cinematic, Premium Animations & Micro-Interactions
   ========================================================================== */

:root {
  --ease-lux-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-lux-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring-subtle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-gold-glow: rgba(212, 175, 55, 0.25);
  --motion-gold-bright: #d4af37;
  --motion-tertiary: #735c00;
}

/* --------------------------------------------------------------------------
   1. VIEWPORT SCROLL REVEAL BASE STYLES
   -------------------------------------------------------------------------- */

/* Base hidden state for animated elements */
.reveal-fade-up,
.reveal-fade-down,
.reveal-fade-left,
.reveal-fade-right,
.reveal-blur-clear,
.reveal-scale-in,
.reveal-mask,
.stagger-child {
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  transition-property: transform, opacity, filter, clip-path;
  transition-duration: 0.85s;
  transition-timing-function: var(--ease-lux-out);
}

/* Fade Up */
.reveal-fade-up {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
}
.reveal-fade-up.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Fade Down */
.reveal-fade-down {
  opacity: 0;
  transform: translate3d(0, -24px, 0);
}
.reveal-fade-down.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Fade Left */
.reveal-fade-left {
  opacity: 0;
  transform: translate3d(-36px, 0, 0);
}
.reveal-fade-left.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Fade Right */
.reveal-fade-right {
  opacity: 0;
  transform: translate3d(36px, 0, 0);
}
.reveal-fade-right.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Blur to Clear (Hero & Important Headings) */
.reveal-blur-clear {
  opacity: 0;
  filter: blur(14px);
  transform: translate3d(0, 18px, 0) scale(0.98);
}
.reveal-blur-clear.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

/* Scale In (Cards & Badges) */
.reveal-scale-in {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.92);
}
.reveal-scale-in.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Mask Reveal (Curtain style reveal for banners) */
.reveal-mask {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transform: translate3d(0, 10px, 0);
}
.reveal-mask.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transform: translate3d(0, 0, 0);
}

/* --------------------------------------------------------------------------
   2. STAGGER DELAYS & SEQUENCING
   -------------------------------------------------------------------------- */

[data-stagger="1"] { transition-delay: 80ms; }
[data-stagger="2"] { transition-delay: 160ms; }
[data-stagger="3"] { transition-delay: 240ms; }
[data-stagger="4"] { transition-delay: 320ms; }
[data-stagger="5"] { transition-delay: 400ms; }
[data-stagger="6"] { transition-delay: 480ms; }
[data-stagger="7"] { transition-delay: 560ms; }
[data-stagger="8"] { transition-delay: 640ms; }

/* Word by Word / Letter Split Reveal */
.motion-word-wrapper {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  margin-right: 0.22em;
}

.motion-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 100%, 0) rotate(2deg);
  transition: transform 0.75s var(--ease-lux-out), opacity 0.75s var(--ease-lux-out);
  will-change: transform, opacity;
}

.is-visible .motion-word {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

/* --------------------------------------------------------------------------
   3. HIGHLIGHT SWEEP & SHIMMER EFFECTS
   -------------------------------------------------------------------------- */

.highlight-sweep {
  position: relative;
  display: inline-block;
  background: linear-gradient(120deg, currentColor 0%, currentColor 40%, rgba(212, 175, 55, 0.9) 50%, currentColor 60%, currentColor 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-position 1.2s var(--ease-lux-out);
}

.highlight-sweep.is-visible {
  animation: sweepGlory 2.8s var(--ease-lux-out) infinite alternate;
}

@keyframes sweepGlory {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Ambient Gold Border Shimmer for Luxury Cards */
.gold-border-shimmer {
  position: relative;
}

.gold-border-shimmer::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), transparent 40%, rgba(212, 175, 55, 0.6) 70%, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

.gold-border-shimmer:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. MICRO-INTERACTIONS & HOVER STATES
   -------------------------------------------------------------------------- */

/* Premium Card Hover Lift */
.motion-card,
.luxury-shadow,
.gold-border-thin {
  transition: transform 0.4s var(--ease-lux-out), 
              box-shadow 0.4s var(--ease-lux-out), 
              border-color 0.4s ease, 
              background-color 0.4s ease;
  will-change: transform, box-shadow;
}

.motion-card:hover,
.luxury-shadow:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 20px 40px -10px rgba(7, 23, 71, 0.09), 
              0 0 24px -4px rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.45) !important;
}

/* Interactive Image Scale inside cards */
.motion-card img,
.group:hover img,
.luxury-shadow img {
  transition: transform 0.6s var(--ease-lux-out), filter 0.6s var(--ease-lux-out);
}

.motion-card:hover img,
.group:hover img {
  transform: scale(1.04);
}

/* Buttons & Pill Micro-Interactions */
a, button, input[type="submit"] {
  transition: transform 0.3s var(--ease-lux-out), 
              box-shadow 0.3s var(--ease-lux-out), 
              background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease;
}

.btn-primary-luxury,
.gold-gradient-bg {
  position: relative;
  overflow: hidden;
}

.btn-primary-luxury::before,
.gold-gradient-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.btn-primary-luxury:hover::before,
.gold-gradient-bg:hover::before {
  left: 140%;
  transition: left 0.75s var(--ease-lux-out);
}

.btn-primary-luxury:hover,
.gold-gradient-bg:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.45);
}

.btn-primary-luxury:active,
.gold-gradient-bg:active {
  transform: translate3d(0, 0, 0) scale(0.98);
}

/* Navigation Links Animated Underline */
header nav a {
  position: relative;
  transition: color 0.3s ease;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--motion-gold-bright);
  transition: width 0.35s var(--ease-lux-out), left 0.35s var(--ease-lux-out);
  border-radius: 2px;
}

header nav a:hover::after,
header nav a.text-tertiary::after {
  width: 100%;
  left: 0;
}

/* Icon Micro Movement */
.material-symbols-outlined,
.material-icons {
  transition: transform 0.35s var(--ease-lux-out), color 0.35s ease;
}

.group:hover .material-symbols-outlined,
.group:hover .material-icons,
a:hover .material-symbols-outlined,
button:hover .material-symbols-outlined {
  transform: translate3d(3px, 0, 0);
}

.group:hover .material-symbols-outlined[style*="trending_up"],
.group:hover .material-symbols-outlined[style*="arrow_upward"] {
  transform: translate3d(2px, -3px, 0);
}

/* --------------------------------------------------------------------------
   5. CONTINUOUS ELEGANT MOTION
   -------------------------------------------------------------------------- */

/* Slow Breathing Float */
.float-slow {
  animation: floatSlow 7s ease-in-out infinite alternate;
}

@keyframes floatSlow {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -8px, 0); }
}

/* Live Rates Pulse Dot */
.pulse-live {
  position: relative;
}

.pulse-live::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.4;
  animation: pulseLiveGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseLiveGlow {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.45); opacity: 0; }
}

/* Slow Ambient Shimmer */
.shimmer-ambient {
  background-size: 200% 200%;
  animation: ambientGradient 8s ease infinite;
}

@keyframes ambientGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --------------------------------------------------------------------------
   6. RESPONSIVENESS & ACCESSIBILITY (REDUCED MOTION)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .reveal-fade-up { transform: translate3d(0, 20px, 0); }
  .reveal-fade-left { transform: translate3d(-20px, 0, 0); }
  .reveal-fade-right { transform: translate3d(20px, 0, 0); }
  .reveal-fade-down { transform: translate3d(0, -15px, 0); }
  
  .motion-card:hover,
  .luxury-shadow:hover {
    transform: translate3d(0, -3px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal-fade-up,
  .reveal-fade-down,
  .reveal-fade-left,
  .reveal-fade-right,
  .reveal-blur-clear,
  .reveal-scale-in,
  .reveal-mask {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
}
