  *, *::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(91, 184, 156, 0.2);
    color: #f0f3f8;
  }

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

  input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
  }

  /* Scroll reveal — progressive enhancement, only applies when JS runs */
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 0;
      transform: translateY(24px);
      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.revealed {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Reduced motion — disable all transitions */
  @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;
    }
  }

  /* Vertical text for scroll indicator */
  .writing-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }

  /* Custom scrollbar */
  ::-webkit-scrollbar {
    width: 6px;
  }
  ::-webkit-scrollbar-track {
    background: #060d14;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Focus styles */
  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 1px solid rgba(91, 184, 156, 0.5);
    outline-offset: 2px;
  }

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

  /* Navbar background transition */
  #navbar.scrolled {
    background: rgba(6, 13, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* Form focus states */
  input:focus, textarea:focus {
    border-color: rgba(91, 184, 156, 0.6) !important;
  }
