/* ===== 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;
}

::selection {
  background: #B8613C;
  color: #FDF9F3;
}

/* ===== Clip Paths ===== */
.clip-diagonal {
  clip-path: polygon(30% 0%, 100% 0, 100% 100%, 0% 100%);
}

/* ===== Scroll Line Animation ===== */
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== Hero Animations ===== */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-line {
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { animation-delay: 0.25s; }
.hero-line:nth-child(3) { animation-delay: 0.4s; }

.hero-subtitle {
  animation: fadeIn 0.8s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

/* ===== Reveal on Scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ===== Service Cards ===== */
.service-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease, border-color 0.5s ease;
}

.service-card:hover {
  transform: translateY(-6px);
}

/* ===== Gallery Items ===== */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 32, 0);
  transition: background 0.4s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  background: rgba(44, 36, 32, 0.15);
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
}

/* ===== Navbar Scroll State ===== */
.nav-scrolled {
  background: rgba(253, 249, 243, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.nav-scrolled #nav-logo-text {
  color: #2C2420;
}

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

.menu-line {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.menu-btn-active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-btn-active .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-btn-active .menu-line:nth-child(3) {
  width: 24px;
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ===== Mobile Links ===== */
.mobile-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

/* ===== Custom 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='%238A7E74' 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;
}

/* ===== Smooth Focus ===== */
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(184, 97, 60, 0.1);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .clip-diagonal {
    clip-path: none;
  }
}
