/* RUF Strategic Group - shared styles (perf + UX optimized) */

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

/* Section snap — proximity = snap kalau dekat, free-scroll kalau gak */
main > section,
main > div > div > section[id] {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  scroll-margin-top: 80px;
}

/* Marquee jangan ikut snap (terlalu pendek, aneh kalau di-snap) */
.marquee-wrapper {
  scroll-snap-align: none !important;
}

/* Theme transition - applied ONLY during toggle via .theme-transitioning class */
html.theme-transitioning,
html.theme-transitioning body,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease,
              fill 400ms ease, stroke 400ms ease, box-shadow 400ms ease !important;
}

/* Background orbs - static for scroll perf */
.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 640px) {
  .orb { filter: blur(35px); }
}

.orb-float-slow,
.orb-float-medium {
  animation: none !important;
}

/* Subtle pulse glow for hero ambient accent */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: translate3d(0, 0, 0) scale(1); }
  50% { opacity: 0.85; transform: translate3d(0, 0, 0) scale(1.05); }
}

.pulse-glow {
  animation: pulse-glow 5s ease-in-out infinite;
}

/* Disable backdrop-filter on cards (perf), keep only on sticky nav */
.backdrop-blur,
[class*="backdrop-blur"] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.nav-sticky {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  z-index: 100;
  pointer-events: none;
  border-bottom-right-radius: 999px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  transition: width 80ms linear;
}

/* Marquee */
@keyframes marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.marquee-track {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  width: max-content;
  will-change: transform;
}

.marquee-wrapper {
  contain: layout paint;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

/* Card hover */
.card-hover {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms ease, box-shadow 250ms ease;
  contain: layout paint;
}

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

/* CTA arrow micro */
.cta-arrow {
  display: inline-block;
  transition: transform 200ms ease;
}

.group:hover .cta-arrow,
button:hover .cta-arrow,
a:hover .cta-arrow {
  transform: translateX(4px);
}

/* Lucide icons */
[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 2;
}

/* Reveal with stagger support */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Counter target — small visual cue while animating */
.counter-active {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.55); }

::selection { background: #3b82f6; color: #fff; }

/* Form */
.form-input {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0a0e18;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  width: 100%;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.dark .form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder { color: #94a3b8; }

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.mobile-menu.open { max-height: 600px; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
