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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Smooth scroll offset for fixed nav */
section[id] {
  scroll-margin-top: 80px;
}

/* Navbar transition */
#navbar {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 20px rgba(16, 42, 67, 0.08);
  backdrop-filter: blur(12px);
}

#navbar.scrolled .nav-link {
  color: #102a43;
}

#navbar.scrolled .nav-text {
  color: #102a43;
}

/* Mobile menu */
#mobile-menu {
  backdrop-filter: blur(20px);
}

#mobile-menu.active {
  transform: translateX(0);
}

/* Menu animation */
.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

#mobile-menu-btn.active .menu-line:nth-child(2) {
  opacity: 0;
}

#mobile-menu-btn.active .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.5rem;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }

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

  .reveal-delay-1 { transition-delay: 0.1s; }
  .reveal-delay-2 { transition-delay: 0.2s; }
  .reveal-delay-3 { transition-delay: 0.3s; }
  .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f4f8;
}

::-webkit-scrollbar-thumb {
  background: #627d98;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334e68;
}

/* Selection color */
::selection {
  background-color: #d49a2a;
  color: #102a43;
}

/* Form select arrow */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
}

/* Image loading placeholder */
img {
  background-color: #f0f4f8;
}

/* Print styles */
@media print {
  #navbar, #mobile-menu-btn, .reveal {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }
}
