/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0F1117;
}
::-webkit-scrollbar-thumb {
  background: #3A3D4A;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #E8634A;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
  transform-origin: top;
}

/* Reveal on scroll — progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fallback: always visible if JS is disabled */
.no-js .reveal-section,
.js .reveal-section {
  /* JS will add .revealed class */
}

/* Navbar transitions */
.nav-scrolled #navbar {
  background: rgba(15, 17, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.nav-scrolled .nav-logo-text,
.nav-scrolled .nav-link,
.nav-scrolled .nav-menu-btn {
  color: #fff;
}

/* Mobile menu transitions */
#mobile-menu.menu-open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.menu-closed {
  opacity: 0;
  pointer-events: none;
}

/* Card hover effects */
.group:hover .group-hover\\:scale-105 {
  transform: scale(1.05);
}

/* Selection color */
::selection {
  background: #E8634A;
  color: #fff;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid #E8634A;
  outline-offset: 2px;
}

/* Mobile menu link hover */
.mobile-nav-link {
  transition: color 0.3s ease;
}

/* Smooth image loading */
img {
  background-color: #EBE9E3;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal-section {
    opacity: 1;
    transform: none;
  }
}
