/* Custom Styling for REI Construction LLC - Zero-Maintenance Pure Static Web Architecture */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,700&display=swap');

:root {
  --color-primary: #062A60;
  --color-primary-dark: #041B3E;
  --color-secondary: #EB7100;
  --color-secondary-dark: #C96100;
  --color-light-shade: #F4F7FF;
  --color-dark: #0D0C0A;
  --color-text: #4A5568;
  --shadow-card: 0 10px 30px -5px rgba(6, 42, 96, 0.08);
  --shadow-glow-orange: 0 12px 28px -5px rgba(235, 113, 0, 0.38);
  --shadow-glow-primary: 0 12px 28px -5px rgba(6, 42, 96, 0.38);
}

body {
  background-color: #FFFFFF;
  color: var(--color-text);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Smooth Transitions & GPU Acceleration */
.transition-all-custom {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hero Overlay & Backgrounds */
.hero-bg {
  background-attachment: fixed;
  background-image: linear-gradient(135deg, rgba(6, 42, 96, 0.88) 0%, rgba(13, 12, 10, 0.78) 100%), url('assets/hero-banner.jpg');
  background-position: center;
  background-size: cover;
}

.cta-bg {
  background-image: linear-gradient(135deg, rgba(6, 42, 96, 0.94) 0%, rgba(4, 27, 62, 0.90) 100%), url('assets/cta-bg.jpg');
  background-position: center;
  background-size: cover;
}

.newsletter-bg {
  background-image: linear-gradient(180deg, rgba(6, 42, 96, 0.94) 0%, rgba(13, 12, 10, 0.98) 100%), url('assets/newsletter-bg.jpg');
  background-position: center;
  background-size: cover;
}

/* Modern Service & Feature Cards */
.service-card {
  border: 1px solid rgba(229, 231, 235, 0.8);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid transparent;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow, border-color;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 35px -10px rgba(6, 42, 96, 0.12), 0 10px 15px -5px rgba(6, 42, 96, 0.04);
  border-color: rgba(235, 113, 0, 0.4);
  border-bottom-color: var(--color-secondary);
}

/* Modern Project & Gallery Cards with Accessible Focus Indicator */
.project-card, .gallery-item, .lightbox-trigger {
  overflow: hidden;
  border-radius: 1.25rem;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  touch-action: manipulation;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  z-index: 15 !important;
}
.project-card:focus-visible, .gallery-item:focus-visible, .lightbox-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(235, 113, 0, 0.8), 0 0 0 2px #ffffff;
}
.project-card img, .gallery-item img, .lightbox-trigger img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
.project-card:hover img, .gallery-item:hover img, .lightbox-trigger:hover img {
  transform: scale(1.1);
  filter: contrast(1.05);
}
.project-card:hover, .gallery-item:hover, .lightbox-trigger:hover {
  box-shadow: 0 25px 40px -12px rgba(6, 42, 96, 0.3);
  transform: translateY(-6px);
}
.project-overlay {
  background: linear-gradient(180deg, rgba(6, 42, 96, 0) 0%, rgba(6, 42, 96, 0.45) 50%, rgba(6, 42, 96, 0.95) 100%);
  transition: background 0.4s ease;
}
.project-card:hover .project-overlay {
  background: linear-gradient(180deg, rgba(6, 42, 96, 0.2) 0%, rgba(6, 42, 96, 0.65) 45%, rgba(6, 42, 96, 0.98) 100%);
}

/* Team Card Modernization */
.team-card {
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(229, 231, 235, 0.8);
  background: var(--color-light-shade);
  box-shadow: var(--shadow-card);
}
.team-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 35px -10px rgba(6, 42, 96, 0.15);
}

/* Testimonial Quote Box */
.testimonial-card {
  position: relative;
  border-radius: 1.5rem;
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-bottom: 4px solid var(--color-secondary);
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -8px rgba(6, 42, 96, 0.12);
}
.quote-mark {
  font-size: 5.5rem;
  line-height: 1;
  color: rgba(235, 113, 0, 0.12);
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  font-family: serif;
  pointer-events: none;
}

/* Modernized Button System & Touch Target Optimization */
/* Global Interactivity, Stacking Context & Button Responsiveness Guarantee */
a, button, [role="button"], input[type="submit"], input[type="button"], .btn-primary, .btn-secondary, .btn-white, .btn-glass-white {
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  touch-action: manipulation;
  z-index: 20;
}
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}
button:disabled, input:disabled, button[disabled] {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.75;
}

/* Stacking Context Enforcement for Fixed Header and Floating Buttons */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100 !important;
}
#scroll-top-btn {
  cursor: pointer !important;
  z-index: 200 !important;
}
#scroll-top-btn.opacity-0, #scroll-top-btn.invisible {
  pointer-events: none !important;
  visibility: hidden !important;
}
#scroll-top-btn.opacity-100 {
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Global Utility Classes for Pointer Interactivity */
.pointer-events-none, [class*="pointer-events-none"] {
  pointer-events: none !important;
}
.pointer-events-auto, [class*="pointer-events-auto"] {
  pointer-events: auto !important;
}

.btn-primary {
  align-items: center;
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  background-color: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 15px -3px rgba(6, 42, 96, 0.25);
  color: #FFFFFF;
  cursor: pointer !important;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.025em;
  min-height: 48px;
  pointer-events: auto !important;
  position: relative !important;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  z-index: 20;
}
.btn-primary:hover {
  background-image: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  background-color: var(--color-secondary);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-glow-orange);
  color: #FFFFFF;
  transform: translateY(-2.5px);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 10px -2px rgba(235, 113, 0, 0.25);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(235, 113, 0, 0.4), 0 0 0 2px #ffffff;
}

.btn-secondary {
  align-items: center;
  background-image: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  background-color: var(--color-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 15px -3px rgba(235, 113, 0, 0.3);
  color: #FFFFFF;
  cursor: pointer !important;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.035em;
  min-height: 48px;
  pointer-events: auto !important;
  position: relative !important;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  z-index: 20;
}
.btn-secondary:hover {
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  background-color: var(--color-primary);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glow-primary);
  color: #FFFFFF;
  transform: translateY(-2.5px);
}
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 10px -2px rgba(6, 42, 96, 0.25);
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(6, 42, 96, 0.4), 0 0 0 2px #ffffff;
}

.btn-white, .btn-glass-white {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  color: var(--color-primary);
  cursor: pointer !important;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.025em;
  min-height: 48px;
  pointer-events: auto !important;
  position: relative !important;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow, background-color, color;
  z-index: 20;
}
.btn-white:hover, .btn-glass-white:hover {
  background-color: #FFFFFF;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
  color: var(--color-secondary);
  transform: translateY(-2.5px);
}
.btn-white:active, .btn-glass-white:active {
  transform: translateY(0) scale(0.98);
}
.btn-white:focus-visible, .btn-glass-white:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}

/* Button Group Spacing Utilities */
.btn-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}
@media (min-width: 640px) {
  .btn-group {
    gap: 1.5rem;
  }
}

/* Sticky Header Shadow on Scroll */
.header-scrolled {
  box-shadow: 0 10px 30px -5px rgba(6, 42, 96, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Scroll Reveal Animation Classes (Supporting all patterns) */
.reveal, .reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.active, .reveal-up.is-revealed, .reveal-up.active, .reveal-scale.is-revealed, .reveal-scale.active {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}
.reveal-delay-100 { transition-delay: 100ms; }
.reveal-delay-200 { transition-delay: 200ms; }
.reveal-delay-300 { transition-delay: 300ms; }

/* Lightbox Gallery Trigger Overlays */
.lightbox-hover-overlay {
  align-items: center;
  background: linear-gradient(180deg, rgba(6, 42, 96, 0.2) 0%, rgba(6, 42, 96, 0.85) 100%);
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  left: 0;
  opacity: 0;
  padding: 1.5rem;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 0.35s ease;
}
.project-card:hover .lightbox-hover-overlay,
.gallery-item:hover .lightbox-hover-overlay,
.lightbox-trigger:hover .lightbox-hover-overlay {
  opacity: 1;
}

/* Lightbox Modal Structure, Animations & Complete Event Isolation */
#lightbox-modal {
  backdrop-filter: blur(16px);
  background-color: rgba(6, 18, 40, 0.94);
  display: flex;
  inset: 0;
  opacity: 0;
  pointer-events: none !important;
  position: fixed;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  visibility: hidden !important;
  z-index: 9999 !important;
}
/* CRITICAL: Guarantee zero click interception by closed modal or any of its children */
#lightbox-modal:not(.open), #lightbox-modal:not(.open) * {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
#lightbox-modal.open {
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: opacity 0.3s ease, visibility 0s;
  visibility: visible !important;
}
#lightbox-modal.open .pointer-events-none {
  pointer-events: none !important;
}
#lightbox-img-container {
  max-height: 75vh;
  max-width: 90vw;
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#lightbox-modal.open #lightbox-img-container {
  transform: scale(1);
}
body.lightbox-open {
  overflow: hidden !important;
  /* Dynamic padding-right is calculated via JavaScript (script.js) to match exact browser scrollbar width without layout shifting */
}
