/**
 * ====================================================================
 * AMIR CONSTRUCTION GROUP (ACG) — MODULAR STYLESHEET
 * ====================================================================
 * Contains custom architectural utilities, 3D card tilt transformations,
 * glassmorphism, responsive scrollbars, preloader animations, and
 * bilingual LTR/RTL font rendering optimizations.
 * ====================================================================
 */

:root {
  --navy: #10243A;
  --navy-light: #183454;
  --navy-dark: #0A1726;
  --gold: #D6A64F;
  --gold-light: #E3BC73;
  --gold-dark: #B88934;
  --charcoal: #20262D;
  --concrete: #F3F5F7;
  --steel: #778391;
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  background-color: #FFFFFF;
  color: #20262D;
  scroll-behavior: smooth;
}

/* ====================================================================
   1. BILINGUAL TYPOGRAPHY & RTL SUPPORT (LOGICAL PROPERTIES)
   ==================================================================== */
html[dir="ltr"] body {
  font-family: 'Inter', 'Poppins', sans-serif;
}
html[dir="ltr"] h1, 
html[dir="ltr"] h2, 
html[dir="ltr"] h3, 
html[dir="ltr"] .font-display {
  font-family: 'Montserrat', 'Poppins', sans-serif;
}

html[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Noto Nastaliq Urdu', sans-serif;
  line-height: 1.85;
}
html[dir="rtl"] h1, 
html[dir="rtl"] h2, 
html[dir="rtl"] h3, 
html[dir="rtl"] .font-display {
  font-family: 'Noto Sans Arabic', 'Noto Nastaliq Urdu', sans-serif;
  line-height: 1.55;
}
html[dir="rtl"] .urdu-nastaliq-accent {
  font-family: 'Noto Nastaliq Urdu', 'Noto Sans Arabic', serif;
  line-height: 2.15;
}

/* ====================================================================
   2. PRELOADER ANIMATIONS
   ==================================================================== */
#acg-preloader {
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.65s ease;
}
#acg-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes drawStroke {
  0% { stroke-dashoffset: 320; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulseGold {
  0%, 100% { opacity: 0.75; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

.preloader-stroke {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: drawStroke 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.preloader-emblem {
  animation: pulseGold 2s ease-in-out infinite;
}

/* ====================================================================
   3. ARCHITECTURAL BLUEPRINT GRID PATTERNS
   ==================================================================== */
.blueprint-grid {
  background-image: 
    linear-gradient(to right, rgba(16, 36, 58, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 36, 58, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.blueprint-grid-dark {
  background-image: 
    linear-gradient(to right, rgba(214, 166, 79, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(214, 166, 79, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ====================================================================
   4. FLOATING GEOMETRIC ELEMENTS
   ==================================================================== */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}
@keyframes floatReverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-3deg); }
}

.animate-float-slow {
  animation: floatSlow 7s ease-in-out infinite;
}
.animate-float-reverse {
  animation: floatReverse 8.5s ease-in-out infinite;
}

/* ====================================================================
   5. SECTION SCROLL REVEAL ANIMATIONS
   ==================================================================== */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================================
   6. 3D SERVICE CARD PERSPECTIVE & TILT
   ==================================================================== */
.service-card-wrapper {
  perspective: 1100px;
}
.service-card-3d {
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}
.service-card-3d:hover {
  box-shadow: 0 24px 48px -12px rgba(16, 36, 58, 0.18);
  border-color: rgba(214, 166, 79, 0.65);
}
.service-card-inner-pop {
  transform: translateZ(20px);
}

/* ====================================================================
   7. CUSTOM SCROLLBAR
   ==================================================================== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #10243A;
}
::-webkit-scrollbar-thumb {
  background: #D6A64F;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #B88934;
}

/* ====================================================================
   8. GLASSMORHPISM UTILITIES
   ==================================================================== */
.glass-navy {
  background: rgba(16, 36, 58, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 166, 79, 0.5);
}

/* ====================================================================
   9. MODALS & LIGHTBOX TRANSITIONS
   ==================================================================== */
.modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal-panel {
  transform: scale(0.95) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-backdrop.open .modal-panel {
  transform: scale(1) translateY(0);
}
