/* ============================================
   MachineTrader — Dark Theme (Orange + Black)
   ============================================ */

/* ---- Smooth scroll & base ---- */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(255, 107, 0, 0.3);
  color: #fff;
}

/* ---- Custom scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ---- Text gradient ---- */
.text-gradient {
  background: linear-gradient(135deg, #ff6b00 0%, #489fd9 50%, #4dbd90 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Primary button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e05e00 0%, #ff6b00 100%);
  color: #fff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 107, 0, 0.25);
}

.btn-primary::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-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255, 107, 0, 0.4), 0 8px 32px rgba(255, 107, 0, 0.25);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

/* ---- Secondary button (dark theme) ---- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #489fd9;
  border-color: #489fd9;
  color: #fff;
  transform: translateY(-2px);
}

/* ---- Light-theme secondary button (used on dark hero) ---- */
.btn-secondary-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.btn-secondary-light:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* ---- Navbar (dark) ---- */
#navbar {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

#navbar.scrolled {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---- Hero background ---- */
.hero-bg {
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 107, 0, 0.08) 0%, transparent 60%);
}

.hero-grid {
  background-image: 
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
}

/* ---- Animations ---- */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.animate-fade-in {
  animation: fade-in 0.8s ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
  opacity: 0;
}

.animate-pulse-slow {
  animation: pulse-slow 6s ease-in-out infinite;
}

.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-600 { animation-delay: 0.6s; }
.animation-delay-2000 { animation-delay: 2s; }

/* ---- Scroll-triggered animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Node glow effects (hero SVG) ---- */
.node-glow-blue { filter: drop-shadow(0 0 8px rgba(72, 159, 217, 0.3)); }
.node-glow-purple { filter: drop-shadow(0 0 8px rgba(134, 104, 171, 0.3)); }
.node-glow-green { filter: drop-shadow(0 0 8px rgba(77, 189, 144, 0.3)); }
.node-glow-yellow { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3)); }
.node-glow-red { filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.3)); }

/* ---- Feature node hover ---- */
.feature-node {
  transition: all 0.3s ease;
}

.feature-node:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---- FAQ accordion (dark) ---- */
.faq-item {
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-item.active {
  border-color: rgba(255, 107, 0, 0.4);
  background: rgba(255, 107, 0, 0.05);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-content.show {
  max-height: 300px;
}

/* ---- Stats counter animation ---- */
.stat-item {
  position: relative;
}

.stat-item::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
}

.stat-item:last-child::after {
  display: none;
}

/* ---- Hamburger animation ---- */
.hamburger-line {
  transition: all 0.3s ease;
}

.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ---- Feature card stagger ---- */
.feature-card {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive adjustments ---- */
@media (max-width: 640px) {
  .stat-item::after {
    display: none;
  }
}

/* ---- Subtle floating animation for hero nodes ---- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-float {
  animation: float 4s ease-in-out infinite;
}

/* ---- Loading shimmer for hero mockup ---- */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer {
  background: linear-gradient(
    90deg, 
    transparent 25%, 
    rgba(255,255,255,0.03) 50%, 
    transparent 75%
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}
