  *, *::before, *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
  }

  body {
    overflow-x: hidden;
  }

  ::selection {
    background: rgba(75, 191, 135, 0.3);
    color: #f0f3f9;
  }

  /* Scroll reveal base — content always visible, animation applied via JS */
  .reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

    .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; }
  }

  /* Navbar scroll state */
  #navbar.scrolled {
    background: rgba(7, 18, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

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

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

  /* Subtle grain overlay */
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    z-index: 9999;
  }

  /* Smooth focus outlines */
  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #4bbf87;
    outline-offset: 2px;
  }

  /* Custom scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #071222;
  }
  ::-webkit-scrollbar-thumb {
    background: #1e4570;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #2d5a8e;
  }
