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

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

  body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  a {
    text-decoration: none;
  }

  ::selection {
    background: rgba(0, 212, 170, 0.25);
    color: #f1f5f9;
  }

  /* Nav scroll state */
  #nav.scrolled {
    background: rgba(5, 21, 37, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Mobile menu transitions */
  #mobile-menu.show {
    animation: slideDown 0.25s ease forwards;
  }

  #mobile-menu.hide {
    animation: slideUp 0.2s ease forwards;
  }

  @keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 400px; }
  }

  @keyframes slideUp {
    from { opacity: 1; max-height: 400px; }
    to { opacity: 0; max-height: 0; }
  }

  /* Hamburger animation */
  #menu-btn.active .line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }
  #menu-btn.active .line:nth-child(2) {
    opacity: 0;
  }
  #menu-btn.active .line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.125rem;
  }

  /* Scroll-triggered fade-in */
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

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

  /* Stagger children */
  .stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
  .stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
  .stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
  .stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
  .stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }

  .stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
  }
