/* ============================================
   Lin's Garden — Custom Styles
   ============================================ */

/* Base */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-display {
  font-family: 'Playfair Display', Georgia, serif;
}

/* Navbar */
#navbar {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

#navbar.scrolled {
  background: rgba(253, 252, 248, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
}

.nav-link {
  position: relative;
}

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

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

#navbar.scrolled .nav-link {
  color: #064e3b;
}

#navbar:not(.scrolled) .nav-link {
  color: #d1fae5;
}

/* Mobile menu */
#mobile-menu.open {
  max-h: 500px;
}

#bar1.open {
  transform: rotate(45deg) translate(5px, 5px);
}

#bar2.open {
  opacity: 0;
}

#bar3.open {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.25rem;
}

#menu-icon-open.hidden {
  display: flex;
}

#menu-icon-open:not(.hidden) {
  display: none;
}

#menu-icon-close:not(.hidden) {
  display: flex;
}

#menu-icon-close.hidden {
  display: none;
}

.mobile-nav-link {
  display: block;
}

/* Reveal animations — 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);
  }
}

/* Fallback: always visible if JS disabled or reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

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

/* Hero pattern overlay */
#top::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(254, 249, 238, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Card hover lift */
.reveal > * {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Smooth image loading */
img {
  loading: lazy;
}

/* Selection color */
::selection {
  background: #a7f3d0;
  color: #064e3b;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #ecfdf5;
}

::-webkit-scrollbar-thumb {
  background: #6ee7b7;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #34d399;
}
