/* Custom Tailwind Config */
:root {
  --color-forest-green: #2d5a27;
  --color-cream: #f5f1e8;
  --color-rust: #a85a3a;
  --color-charcoal: #2a2a2a;
  --color-warm-gray: #8b8680;
}

/* Typography */
html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bitter', serif;
}

/* Tailwind Custom Colors */
@layer components {
  .bg-forest-green { @apply bg-[#2d5a27]; }
  .bg-cream { @apply bg-[#f5f1e8]; }
  .bg-rust { @apply bg-[#a85a3a]; }
  .bg-charcoal { @apply bg-[#2a2a2a]; }
  .bg-warm-gray { @apply bg-[#8b8680]; }
  
  .text-forest-green { @apply text-[#2d5a27]; }
  .text-cream { @apply text-[#f5f1e8]; }
  .text-rust { @apply text-[#a85a3a]; }
  .text-charcoal { @apply text-[#2a2a2a]; }
  .text-warm-gray { @apply text-[#8b8680]; }
  
  .border-forest-green { @apply border-[#2d5a27]; }
  .border-rust { @apply border-[#a85a3a]; }
}

/* Navigation */
#navbar {
  background: transparent;
  transition: all 0.3s ease;
}

#navbar.scrolled {
  background: rgba(245, 241, 232, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-text {
  color: #f5f1e8;
  transition: color 0.3s ease;
}

#navbar.scrolled .navbar-text {
  color: var(--color-charcoal);
}

#navbar.scrolled a:hover {
  color: var(--color-rust) !important;
}

/* Hero Section */
.hero-section {
  background-image: url('https://buildonyourlandllc.com/wp-content/uploads/2022/03/custom-home-construction.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.hero-content {
  opacity: 0;
  transform: translateX(-60px);
  position: relative;
  z-index: 10;
}

.hero-content h1 {
  color: #f5f1e8;
}

.hero-content p {
  color: #f5f1e8;
}

.hero-content button {
  background-color: var(--color-rust);
}

.hero-content button:hover {
  background-color: var(--color-forest-green);
}

/* Why Us Section */
#why-us-section {
  overflow-x: hidden;
}

.why-us-card {
  opacity: 1;
  transform: translateY(0);
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border-left: 4px solid var(--color-rust);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.why-us-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Service Items */
#services {
  overflow-x: hidden;
}

.service-item {
  opacity: 1;
}

.service-content {
  opacity: 1;
  transform: translateX(0);
}

.service-image {
  opacity: 1;
  transform: translateX(0);
}

.service-image img {
  transition: transform 0.6s ease;
}

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

/* Gallery Grid - Masonry */
#gallery {
  overflow-x: hidden;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  grid-auto-rows: 250px;
  overflow-x: hidden;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
}

.gallery-item:nth-child(1) { grid-column: span 1; grid-row: span 1; }
.gallery-item:nth-child(2) { grid-column: span 1; grid-row: span 1; }
.gallery-item:nth-child(3) { grid-column: span 1; grid-row: span 1; }
.gallery-item:nth-child(4) { grid-column: span 1; grid-row: span 1; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Contact Cards */
#contact {
  overflow-x: hidden;
}

.contact-card {
  opacity: 1;
  transform: translateY(0);
}

/* Map */
#map {
  opacity: 1;
  transform: translateY(0);
}

.leaflet-container {
  border-radius: 12px;
  overflow: hidden;
}

/* Buttons */
button {
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

/* Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-content,
  .hero-image,
  .why-us-card,
  .service-item,
  .gallery-item,
  .contact-card,
  #map {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
  }

  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-content button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #navbar {
    padding: 0.75rem 0;
  }

  .text-2xl {
    font-size: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  .hero-content button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }

  .why-us-card {
    padding: 1.5rem;
  }

  .why-us-card .text-6xl {
    font-size: 3rem;
  }

  .service-content .text-6xl {
    font-size: 3rem;
  }

  .service-content h3 {
    font-size: 1.5rem;
  }

  .service-content p {
    font-size: 0.95rem;
  }

  .service-image {
    height: 250px;
  }

  .gallery-grid {
    gap: 1rem;
    grid-auto-rows: 180px;
  }

  .contact-card {
    padding: 1.5rem;
  }

  .contact-card h3 {
    font-size: 1.1rem;
  }

  .contact-card p {
    font-size: 0.9rem;
  }

  #map {
    height: 300px;
  }
}

@media (max-width: 350px) {
  .max-w-7xl {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #navbar {
    padding: 0.5rem 0;
  }

  .text-2xl {
    font-size: 1.25rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1rem;
  }

  .hero-content h1 {
    font-size: 1.25rem;
  }

  .hero-content p {
    font-size: 0.85rem;
  }

  .hero-content button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .why-us-card {
    padding: 1rem;
  }

  .why-us-card .text-6xl {
    font-size: 2rem;
  }

  .service-content .text-6xl {
    font-size: 2rem;
  }

  .service-content h3 {
    font-size: 1.1rem;
  }

  .service-content p {
    font-size: 0.85rem;
  }

  .service-image {
    height: 200px;
  }

  .gallery-grid {
    gap: 0.75rem;
    grid-auto-rows: 150px;
  }

  .contact-card {
    padding: 1rem;
  }

  .contact-card h3 {
    font-size: 1rem;
  }

  .contact-card p {
    font-size: 0.8rem;
    word-break: break-all;
  }

  #map {
    height: 250px;
  }
}
