  *, *::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;
  }

  ::selection {
    background: rgba(54, 191, 141, 0.2);
    color: #f0f4f8;
  }

  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 6px;
  }
  ::-webkit-scrollbar-track {
    background: #031221;
  }
  ::-webkit-scrollbar-thumb {
    background: #334e68;
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #627d98;
  }

  /* Scroll reveal — progressive enhancement, only active when JS is present */
  .reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

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

  /* Hero animations */
  .hero-anim {
    opacity: 1;
    transform: translateY(0);
    animation: heroFadeUp 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  }

  .hero-anim:nth-child(2) { animation-delay: 0.15s; }
  .hero-anim:nth-child(3) { animation-delay: 0.3s; }
  .hero-anim:nth-child(4) { animation-delay: 0.45s; }
  .hero-anim:nth-child(5) { animation-delay: 0.6s; }

  @keyframes heroFadeUp {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Scroll line animation */
  .animate-scroll-line {
    animation: scrollLine 1.8s ease-in-out infinite;
  }

  @keyframes scrollLine {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
  }

  /* Navbar glass effect */
  #navbar.scrolled {
    background: rgba(3, 18, 33, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(51, 78, 104, 0.3);
  }

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

  /* Input autofill override for dark theme */
  input:-webkit-autofill,
  textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0a2540 inset !important;
    -webkit-text-fill-color: #f0f4f8 !important;
    caret-color: #f0f4f8;
  }

  /* Reduced motion */
  @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 {
      opacity: 1;
      transform: none;
    }
  }

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

  /* Button focus for no-outline buttons */
  button:focus-visible,
  a:focus-visible {
    outline: 2px solid #36bf8d;
    outline-offset: 2px;
  }
