/* ============================================
   Tim's Woodworking — Custom Styles
   ============================================ */

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f5f0e6;
}
::-webkit-scrollbar-thumb {
  background: #a7c4a4;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6b9e6e;
}

/* --- Service Card Hover Glow --- */
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* --- Gallery Item --- */
.gallery-item {
  position: relative;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 44, 34, 0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* --- Process Step Connector (desktop) --- */
@media (min-width: 1024px) {
  .process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.5rem;
    right: -1.5rem;
    width: 3rem;
    height: 2px;
    background: linear-gradient(to right, rgba(167, 196, 164, 0.4), transparent);
    z-index: 0;
  }
}

/* --- Navbar scroll state --- */
.nav-scrolled {
  background: rgba(253, 251, 247, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

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

.menu-line:nth-child(1) {
  transform-origin: center;
}
.menu-line:nth-child(2) {
  transform-origin: center;
}
.menu-line:nth-child(3) {
  transform-origin: center;
}

/* Hamburger to X animation */
.menu-active .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.menu-active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-active .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.5rem;
}

/* --- Mobile link animation --- */
.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

.mobile-menu-open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* --- Scroll reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    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-delay-1 { transition-delay: 0.1s; }
  .reveal-delay-2 { transition-delay: 0.2s; }
  .reveal-delay-3 { transition-delay: 0.3s; }
  .reveal-delay-4 { transition-delay: 0.4s; }
}

/* --- Form select arrow --- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23065f46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Selection color --- */
::selection {
  background: rgba(6, 78, 59, 0.15);
  color: #064e3b;
}
