/* ============================================
   GL Cabinets — Custom Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: rgba(48, 79, 48, 0.15);
  color: #1a1a1a;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #FAF8F4;
}
::-webkit-scrollbar-thumb {
  background: #c5d8c5;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9bbf9b;
}

/* --- Header --- */
#site-header {
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

#site-header.scrolled {
  border-bottom-color: rgba(197, 216, 197, 0.4);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #304f30;
  transition: width 0.3s ease;
}

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

/* --- Mobile Menu --- */
#mobile-menu {
  pointer-events: all;
}

#mobile-menu.open {
  pointer-events: all;
  opacity: 1;
}

#mobile-menu.closed {
  pointer-events: none;
  opacity: 0;
}

.mobile-link {
  position: relative;
}

.mobile-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: #304f30;
  transition: width 0.3s ease;
}

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

/* --- Hero Image Grid --- */
.hero-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 100%;
  min-height: 500px;
  position: relative;
}

.hero-img {
  overflow: hidden;
  position: relative;
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.hero-img--1 {
  grid-row: 1 / 3;
  grid-column: 1 / 2;
}

.hero-img--2 {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
}

.hero-img--3 {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
}

/* --- Buttons --- */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  position: relative;
}

/* --- Service Cards --- */
.service-card {
  position: relative;
  overflow: hidden;
  transition: background-color 0.5s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: #74a174;
  transition: height 0.4s ease;
}

.service-card:hover::before {
  height: 100%;
}

/* --- Work Items --- */
.work-item {
  position: relative;
  cursor: pointer;
}

.work-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #304f30;
  transition: width 0.4s ease;
}

.work-item:hover::after {
  width: 100%;
}

/* --- Process Cards --- */
.process-card {
  position: relative;
  transition: background-color 0.5s ease;
}

/* --- About --- */
.about-img-wrapper {
  position: relative;
  overflow: hidden;
}

.about-img-wrapper::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border: 1px solid #c5d8c5;
  z-index: -1;
  border-radius: 2px;
}

/* --- Contact Form --- */
#contact-form 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='%236B6B6B' stroke-width='1.5' 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;
}

#contact-form input:focus,
#contact-form textarea:focus,
#contact-form select:focus {
  border-color: #9bbf9b;
  box-shadow: 0 0 0 3px rgba(155, 191, 155, 0.15);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #304f30;
  color: #FAF8F4;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 40;
  border-radius: 2px;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #1e321e;
  transform: translateY(-2px);
}

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .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; }
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  .hero-image-grid {
    min-height: 400px;
  }
}

@media (max-width: 767px) {
  .hero-image-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: auto;
  }

  .hero-img--1 {
    grid-row: auto;
    grid-column: auto;
    min-height: 300px;
  }

  .hero-img--2,
  .hero-img--3 {
    grid-row: auto;
    grid-column: auto;
    min-height: 200px;
  }

  .hero-img--4 {
    display: none;
  }

  .about-img-wrapper::after {
    display: none;
  }
}

/* --- Print --- */
@media print {
  #site-header,
  .back-to-top,
  #mobile-menu {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }
}
