/* ===== BASE & RESET ===== */
*, *::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;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===== SCROLL REVEAL (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .reveal:nth-child(2) { transition-delay: 0.1s; }
  .reveal:nth-child(3) { transition-delay: 0.2s; }
  .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* ===== HEADER SCROLL STATE ===== */
#site-header.scrolled {
  background: rgba(6, 25, 43, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(112, 144, 176, 0.1);
}

#site-header.scrolled .font-display {
  color: #fff;
}

/* ===== MOBILE MENU ===== */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-link {
  position: relative;
}

.mobile-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #6FD7B4;
  transition: width 0.3s ease;
}

.mobile-link:hover::after {
  width: 100%;
}

/* ===== NAV LINK HOVER (desktop) ===== */
nav a:not(.inline-flex) {
  position: relative;
}

nav a:not(.inline-flex)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #6FD7B4;
  transition: width 0.3s ease;
}

nav a:not(.inline-flex):hover::after {
  width: 100%;
}

/* ===== IMAGE HOVER ZOOM ===== */
img.hover-zoom {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

img.hover-zoom:hover {
  transform: scale(1.05);
}

/* ===== CUSTOM SELECTION ===== */
::selection {
  background: rgba(61, 193, 154, 0.3);
  color: #fff;
}

/* ===== FOCUS STYLES ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid #6FD7B4;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 640px) {
  .font-display {
    word-spacing: -0.02em;
  }
}

/* ===== SMOOTH SCROLL OFFSET FOR FIXED NAV ===== */
section[id] {
  scroll-margin-top: 80px;
}
