/* ============================================
   David Peguero Home Improvement — Custom Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* Selection */
::selection {
  background-color: #7B2D3B;
  color: #fff;
}

/* Typography Utilities */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7B2D3B;
  background: linear-gradient(135deg, rgba(123, 45, 59, 0.08) 0%, rgba(123, 45, 59, 0.04) 100%);
  border: 1px solid rgba(123, 45, 59, 0.15);
  padding: 0.4em 1em;
  border-radius: 100px;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: #111827;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #6b7280;
  max-width: 560px;
}

/* Header scroll state */
#site-header.scrolled {
  background: rgba(253, 248, 247, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.04);
}

#site-header.scrolled .font-display {
  color: #111827;
}

/* Nav link underline animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #7B2D3B;
  transition: width 0.25s ease;
}

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

/* Mobile menu animation */
#mobile-menu {
  animation: slideDown 0.25s ease forwards;
}

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

/* Scroll Reveal Animations (progressive enhancement) */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Default state for reduced motion or no-JS */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
  }

  .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; }
  .reveal-delay-5 { transition-delay: 0.5s; }
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #7B2D3B;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #fdf8f7;
}

::-webkit-scrollbar-thumb {
  background: #e9d5d7;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7B2D3B;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .section-desc {
    font-size: 1rem;
  }
}

/* Print styles */
@media print {
  #site-header,
  #mobile-menu,
  .reveal {
    display: block !important;
    opacity: 1 !important;
  }

  body {
    background: white;
    color: black;
  }
}
