/* ============================================
   PROTECH V2 — Custom Styles
   Only what Tailwind CDN cannot handle:
   - Keyframe animations
   - Scroll reveal states
   - Grain texture overlay
   - Smooth scroll behavior
   ============================================ */

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

body.menu-open {
  overflow: hidden;
}

/* --- Hero Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.hero-animate {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-animate-delay-1 {
  animation-delay: 0.2s;
}

.hero-animate-delay-2 {
  animation-delay: 0.4s;
}

.hero-animate-delay-3 {
  animation-delay: 0.6s;
}

/* --- Scroll Indicator Bounce --- */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.scroll-indicator {
  animation: gentleBounce 2s ease-in-out infinite;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.active {
  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; }

/* --- Grain Texture Overlay --- */
.grain-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* --- Navbar Global Structure --- */
.navbar {
  position: sticky !important;
  top: 0;
  z-index: 999 !important;
  background-color: #F8F6F2 !important;
  transition: box-shadow 0.3s ease;
  opacity: 0.98;
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* --- Mobile Sidebar --- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* --- Sidebar Backdrop --- */
.sidebar-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* --- FAQ Accordion --- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-answer.open {
  max-height: 500px;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.faq-open .faq-icon {
  transform: rotate(45deg);
}

/* --- Floating Quick Nav --- */
.quick-nav {
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.quick-nav.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* --- Service Card Hover Border --- */
.service-card {
  border-top: 3px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  border-top-color: #FFBE0B;
}

/* --- Testimonial Quote Decoration --- */
.quote-mark {
  font-size: 6rem;
  line-height: 1;
  color: rgba(255, 190, 11, 0.15);
  font-family: 'Georgia', serif;
  position: absolute;
  top: -0.5rem;
  left: -0.25rem;
  pointer-events: none;
  user-select: none;
}

/* --- Portfolio Image Hover --- */
.portfolio-img {
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-img {
  transform: scale(1.03);
}

/* --- Button Hover Enhancements --- */
.btn-primary {
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 190, 11, 0.3);
}

.btn-secondary {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* --- Form Focus States --- */
.form-input:focus {
  outline: none;
  border-color: #FFBE0B;
  box-shadow: 0 0 0 3px rgba(255, 190, 11, 0.15);
}

/* --- Selection Color --- */
::selection {
  background-color: rgba(255, 190, 11, 0.25);
  color: #1A1A1A;
}
