/* ==========================================================================
   GLOBAL VARIABLES & CUSTOM PROPERTIES (WHITE & LOGO-BLUE THEME)
   ========================================================================== */
:root {
  /* White & Logo-Blue Palette */
  --color-bg: #FFFFFF;
  /* Pure White Background */
  --color-primary: #08182E;
  /* Deep Navy Blue from Logo */
  --color-accent: #08182E;
  /* Branding Accent Color */
  --color-accent-hover: #122C4D;
  --color-white: #FFFFFF;
  --color-text-muted: rgba(8, 24, 46, 0.6);

  /* Preloader Curtain Theme (White and Logo Blue) */
  --color-curtain-bg: #FFFFFF;
  --color-curtain-text: #08182E;

  /* Glassmorphism Styles */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(8, 24, 46, 0.08);
  --glass-shadow: rgba(8, 24, 46, 0.04);

  /* Typography */
  --font-headings: 'Cormorant Garamond', serif;
  --font-body: 'Manrope', sans-serif;

  /* Transitions */
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  /* iOS-style premium ease-out */
  --transition-fluid: cubic-bezier(0.85, 0, 0.15, 1);
  /* Custom split curtain curve */
  --duration-medium: 0.6s;
  --duration-slow: 1.2s;
}

/* ==========================================================================
   RESET & SYSTEM STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto;
  background-color: var(--color-bg);
}

/* Android & Mobile Native Touch & Form Input Optimization */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent; /* Removes harsh blue/gray Android tap highlights */
}

/* Prevent Android WebKit synthetic font bolding and harsh capitalization on form inputs and placeholders */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  font-family: var(--font-body) !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input::placeholder,
textarea::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder,
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  font-family: var(--font-body) !important;
  font-weight: 300 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: rgba(255, 255, 255, 0.42) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.42) !important;
}

/* Prevent Android Chrome auto-zoom on input focus */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Lenis Smooth Scroll Recommended CSS Helpers */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* GPU Hardware Acceleration & Smooth 60fps/120fps Transitions for Windows & Low-End Devices */
a,
button,
input,
textarea,
.social-icon-btn,
.btn-sweep,
.interest-pill,
.revenue-pill,
.service-tab-btn {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Explicit GPU Layer Promotion for heavy scroll/tilt-animated elements */
.glow-card,
.team-card,
.why-us-card,
#hero-bg-img,
#about-gsap-main-wrap,
#about-gsap-overlap-wrap,
.panel-parallax-img,
.testimonial-card-stacked,
.header-minimal,
.preloader-panel,
.menu-trigger,
.split-text .char,
.mask-reveal,
.fade-up,
.fade-down {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, opacity;
}

a,
button {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-primary);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(8, 24, 46, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Noise overlay for texture */
.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  opacity: 0.012;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   UTILITIES & ACCESSIBILITY (WCAG 2.1 AA)
   ========================================================================== */
a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Screen Reader Only Utility for Accessible Form Control Labels */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Production Focus-Visible Keyboard Outlines (Gold/Primary Contrast Ring) */
:focus-visible {
  outline: 2px solid #D4AF37 !important;
  outline-offset: 4px !important;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #D4AF37 !important;
  outline-offset: 3px !important;
}

/* WCAG AA Motion Reduction Overrides */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .preloader-gate {
    display: none !important;
  }

  #three-ribbon-canvas-container {
    opacity: 0.15 !important;
  }
}

/* Core Web Vitals Render Skip (content-visibility) for deep page sections */
.team-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}
.testimonials-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}
.faq-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.footer-contact-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 1000px;
}
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}

/* Responsive mobile override for stacked testimonials stack */
@media (max-width: 1024px) {
  .testimonials-stack {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    position: relative !important;
  }
  .testimonial-card-stacked {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    height: auto !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Forced GPU Layering for Heavy Components */
.header-minimal,
.hero,
.fixed.bottom-6.right-6,
.fs-menu,
.about-section,
.services-section,
.why-us-section,
.team-section,
.testimonials-section,
.faq-section,
.footer-contact-section {
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Strict CSS Containment to Prevent Global Layout Recalculations */
.hero,
.about-section,
.services-section,
.why-us-section,
.team-section,
.faq-section,
.footer-contact-section,
.footer {
  contain: layout style;
}

/* Testimonials Desktop Stack Initial States to Prevent Overlap FOUC Glitch on Load */
@media (min-width: 1025px) {
  .testimonial-card-stacked:nth-child(2) {
    transform: translate3d(0, 120%, 0) rotate(2deg);
  }
  .testimonial-card-stacked:nth-child(3) {
    transform: translate3d(0, 120%, 0) rotate(-2deg);
  }
}