/* Navigation persistence */
.nav-buttons.auth-loading {
  opacity: 0;
  pointer-events: none;
}

.auth-cached-logged-in .nav-buttons>a[href*="login"] {
  display: none !important;
}

.auth-cached-logged-out .nav-buttons.auth-loading {
  opacity: 1;
  pointer-events: auto;
}

/* Body background initialization */
body {
  background: linear-gradient(180deg,
      var(--bg) 0%,
      var(--bg-warm) 10%,
      var(--bg) 25%,
      var(--bg-warm) 40%,
      var(--bg) 55%,
      var(--bg-warm) 70%,
      var(--bg) 85%);
  background-attachment: fixed;
}

.hero {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(217, 119, 6, 0.06) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: 20%;
  right: -10%;
  width: 50%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(217, 119, 6, 0.04) 0%, transparent 50%);
  animation: heroGlow 10s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

@keyframes heroGlow {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.badge-dot {
  animation: pulseDot 2s ease-in-out infinite !important;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #ea580c 50%, #f59e0b 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.how-it-works {
  background: transparent;
  position: relative;
}

.step-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.04);
  border-color: rgba(217, 119, 6, 0.2);
}

.step-number {
  background: linear-gradient(135deg, var(--accent) 0%, #ea580c 100%);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.use-cases {
  background: transparent;
}

.use-case-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.use-case-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

.use-case-card.use-case-featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent), #f59e0b, #ea580c, var(--accent)) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: gradientBorder 6s ease infinite;
}

@keyframes gradientBorder {

  0%,
  100% {
    background-position: 0% 50%, 0% 50%;
  }

  50% {
    background-position: 0% 50%, 100% 50%;
  }
}

.use-case-card.use-case-featured:hover {
  box-shadow: 0 32px 64px rgba(217, 119, 6, 0.18), 0 16px 32px rgba(217, 119, 6, 0.1);
}

.feature-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}

.diagram-showcase {
  background: transparent;
}

.diagram-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.diagram-item:hover,
.diagram-item.active {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.15);
}

.diagram-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.8), rgba(254, 243, 199, 0.6));
}

.cta {
  background: transparent;
}

.cta-content:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(217, 119, 6, 0.12);
}

.platform-stats {
  background: transparent;
  padding-top: 95px;
}

.platform-stats.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.platform-stats.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.stats-banner {
  position: relative;
  overflow: hidden;
}

.stats-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.03) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

.stat-block {
  transition: all 0.3s ease;
}

.stat-block:hover {
  transform: translateY(-4px);
}

.testimonials {
  background: transparent;
  position: relative;
  overflow: hidden;
}

.testimonials::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.2), transparent);
}

.testimonial-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
}

.testimonial-stars {
  color: var(--accent);
}

.footer {
  background: transparent;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 5%,
      var(--border) 20%,
      rgba(217, 119, 6, 0.3) 50%,
      var(--border) 80%,
      transparent 95%);
}

.footer-brand .logo {
  transition: all 0.3s ease;
}

.footer-brand .logo:hover {
  transform: translateY(-2px);
}

@media (max-width: 768px) {

  .hero::before,
  .hero::after {
    opacity: 0.5;
  }

  .cta::before {
    opacity: 0.5;
  }

  .hero {
    min-height: auto !important;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .platform-stats {
    padding-top: 20px;
    padding-bottom: 40px;
  }
}