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

/* Scroll reveal — progressive enhancement, only applies when JS runs */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal {
  transform: translateY(20px);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transform: none;
    opacity: 1;
  }
}

/* Navbar scroll state */
nav.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

nav.scrolled .nav-text-color {
  color: #1e293b;
}

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

.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body.menu-open .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

body.menu-open .menu-line:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
  opacity: 0;
}

/* Selection color */
::selection {
  background: #0d9488;
  color: #fff;
}

/* Subtle focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

/* Smooth image loading */
img {
  image-rendering: auto;
}

img[loading="lazy"] {
  transition: opacity 0.3s ease;
}
