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

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

body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Navigation ===== */
.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-scrolled {
  background: rgba(254, 253, 248, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(4, 120, 87, 0.08), 0 4px 30px rgba(4, 120, 87, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.3s ease;
}

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

/* Mobile Menu */
.mobile-menu {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-link {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(4, 120, 87, 0.08);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-link:hover {
  color: #059669;
  padding-left: 0.5rem;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #fefdf8 0%, #ecfdf5 50%, #d1fae5 100%);
  position: relative;
}

.hero-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.hero-blob-1 {
  width: 500px;
  height: 500px;
  background: #a7f3d0;
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.hero-blob-2 {
  width: 300px;
  height: 300px;
  background: #6ee7b7;
  bottom: 10%;
  left: -50px;
  animation: float 6s ease-in-out infinite reverse;
}

.hero-blob-3 {
  width: 200px;
  height: 200px;
  background: #34d399;
  top: 40%;
  right: 30%;
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.95); }
}

.hero-grid {
  position: relative;
  z-index: 1;
}

.hero-content {
  animation: heroFadeIn 1s ease forwards;
}

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

.hero-image {
  animation: heroImageIn 1s 0.2s ease forwards;
  opacity: 0;
}

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

.hero-float-card {
  animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  position: relative;
}

/* ===== Section Labels ===== */
.section-label {
  letter-spacing: 0.15em;
}

/* ===== Service Cards ===== */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #047857, #34d399);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  grid-template-rows: repeat(2, 200px);
}

.gallery-item {
  overflow: hidden;
  cursor: pointer;
}

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

.gallery-img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== About ===== */
.about-bg-pattern {
  background-image: radial-gradient(circle at 2px 2px, #047857 1px, transparent 0);
  background-size: 32px 32px;
}

/* ===== CTA ===== */
.cta-bg {
  position: absolute;
  inset: 0;
}

.cta-overlay {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.88) 0%, rgba(4, 120, 87, 0.82) 50%, rgba(6, 95, 70, 0.85) 100%);
}

/* ===== Contact ===== */
.contact-icon {
  transition: transform 0.3s ease, background 0.3s ease;
}

.contact-info-item:hover .contact-icon {
  transform: scale(1.1);
  background: #a7f3d0;
}

.form-label {
  font-weight: 500;
}

.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
  color: #a7f3d0;
}

.btn-submit {
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-submit:hover::after {
  opacity: 1;
}

/* ===== Footer ===== */
.footer-link {
  display: inline-block;
  transition: padding-left 0.2s ease;
}

.footer-link:hover {
  padding-left: 0.3rem;
}

/* ===== Reveal Animations ===== */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { min-height: auto; padding: 8rem 0 4rem; }
  .hero-headline { font-size: 2.5rem !important; }
  .hero-image { margin-bottom: 2rem; }
  .hero-float-card { position: relative; bottom: auto; left: auto; margin-top: 1rem; }
  .hero-img-wrapper { max-width: 100% !important; }
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .gallery-item:nth-child(1) { grid-column: 1; grid-row: auto; }
  .gallery-item:nth-child(2) { grid-column: 2; grid-row: auto; }
  .gallery-item:nth-child(3) { grid-column: 1; grid-row: auto; }
  .gallery-item:nth-child(4) { grid-column: 2; grid-row: auto; }
  .gallery-item:nth-child(5) { grid-column: 1 / 3; grid-row: auto; }
  .gallery-img { min-height: 180px; }
  .about-img-secondary { display: none !important; }
}

@media (max-width: 640px) {
  .hero-headline { font-size: 2rem !important; }
  .hero-subtitle { font-size: 1rem !important; }
  .section-header h2 { font-size: 2rem !important; }
  .service-card { padding: 1.5rem !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 220px;
  }
  .gallery-item:nth-child(1) { grid-column: 1; grid-row: 1; }
  .gallery-item:nth-child(2) { grid-column: 2; grid-row: 1 / 3; }
  .gallery-item:nth-child(3) { grid-column: 1; grid-row: 2; }
  .gallery-item:nth-child(4) { display: none; }
  .gallery-item:nth-child(5) { grid-column: 1 / 3; grid-row: auto; }
}
