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

/* ============ NAVBAR ============ */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(253, 252, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 20px rgba(45, 90, 61, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #2D5A3D;
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

/* ============ FLOATING CARDS ============ */
.floating-card {
  z-index: 10;
}

.card-1 {
  animation: float1 4s ease-in-out infinite;
}

.card-2 {
  animation: float2 5s ease-in-out infinite;
}

.card-3 {
  animation: float3 4.5s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-1deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(0.5deg); }
}

/* ============ SCROLL REVEAL (progressive enhancement) ============ */
/* Default: all content visible — no JS required */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* When JS is ready and user prefers motion, apply scroll-reveal */
.js-ready @media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }

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

/* Fallback for browsers without @supports: JS adds .revealed class */
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============ MOBILE MENU ============ */
.mobile-menu-link {
  display: block;
}

/* ============ BACK TO TOP ============ */
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============ FORM STYLES ============ */
input:focus,
textarea:focus {
  outline: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .font-serif {
    font-size: 2rem;
    line-height: 1.1;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .floating-card {
    display: none;
  }
}

/* ============ SELECTION ============ */
::selection {
  background: #b8d1b6;
  color: #1e3f29;
}
