/* =========================================================
   HUSSAIN AHMAD — WHITE HERO + MOBILE SCROLL REPAIR V13
   Loaded after all legacy styles so the homepage hero remains
   white and touch scrolling cannot be trapped by the parallax.
   ========================================================= */

body.home-page {
  --xf-paper: #ffffff;
  --xf-ink: #0b0b0b;
  --xf-muted: #666a70;
  --xf-line: #e8e8e3;
  --xf-red: #f20d18;
  --xf-green: #08b98d;
  color: var(--xf-ink) !important;
  background: var(--xf-paper) !important;
}

body.home-page main {
  background: var(--xf-paper) !important;
}

/* White integrated navigation */
body.home-page .site-header.site-header--hero,
body.home-page .site-header.site-header--hero.scrolled {
  color: var(--xf-ink) !important;
  background: rgba(255,255,255,.97) !important;
  border-bottom: 1px solid var(--xf-line) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
}
body.home-page .site-header.site-header--hero.scrolled {
  box-shadow: 0 12px 35px rgba(15,15,15,.06) !important;
}
body.home-page .site-header--hero .site-brand-name,
body.home-page .site-header--hero .site-nav-link {
  color: var(--xf-ink) !important;
}
body.home-page .site-header--hero .site-nav-link.active {
  color: var(--xf-red) !important;
}
body.home-page .site-header--hero .nav-dropdown-toggle,
body.home-page .site-header--hero .menu-toggle {
  color: var(--xf-ink) !important;
  background: #fff !important;
  border-color: #d9d9d4 !important;
}
body.home-page .site-header--hero .menu-toggle span {
  background: var(--xf-ink) !important;
}
body.home-page .site-header--hero .site-services-menu {
  color: var(--xf-ink) !important;
  background: #fff !important;
  border-color: var(--xf-line) !important;
  box-shadow: 0 24px 70px rgba(15,15,15,.12) !important;
}
body.home-page .site-header--hero .site-service-menu-item:hover {
  background: #f7f7f3 !important;
}
body.home-page .site-header--hero .site-service-menu-copy small {
  color: #717171 !important;
}

/* White hero canvas */
body.home-page .hero.hero-xfolio {
  color: var(--xf-ink) !important;
  background: var(--xf-paper) !important;
}
body.home-page .hero-xfolio .hero-kicker {
  color: var(--xf-green) !important;
}
body.home-page .hero-xfolio .hero-title,
body.home-page .hero-xfolio .mini-title,
body.home-page .hero-xfolio .metric strong {
  color: var(--xf-ink) !important;
}
body.home-page .hero-xfolio .hero-title span {
  color: var(--xf-red) !important;
}
body.home-page .hero-xfolio-intro p,
body.home-page .hero-xfolio .metric > span {
  color: var(--xf-muted) !important;
}
body.home-page .hero-xfolio .metric-accent strong {
  color: var(--xf-green) !important;
}
body.home-page .hero-xfolio .hero-circle-link {
  color: var(--xf-ink) !important;
  background: rgba(255,255,255,.9) !important;
  border-color: var(--xf-red) !important;
}
body.home-page .hero-xfolio .hero-circle-link:hover {
  color: #fff !important;
  background: var(--xf-red) !important;
}
body.home-page .hero-xfolio-actions .btn-primary {
  color: #fff !important;
  background: var(--xf-red) !important;
  border-color: var(--xf-red) !important;
}
body.home-page .hero-xfolio-actions .btn-primary:hover {
  color: #fff !important;
  background: var(--xf-ink) !important;
  border-color: var(--xf-ink) !important;
}
body.home-page .hero-xfolio-actions .btn-outline {
  color: var(--xf-ink) !important;
  background: #fff !important;
  border-color: var(--xf-green) !important;
}
body.home-page .hero-xfolio-actions .btn-outline:hover {
  color: #fff !important;
  background: var(--xf-green) !important;
}
body.home-page .hero-xfolio-portrait img {
  filter: drop-shadow(0 24px 30px rgba(0,0,0,.16)) !important;
}
body.home-page .hero-xfolio-portrait-placeholder {
  color: rgba(10,10,10,.5) !important;
  border-color: #deded8 !important;
  background: linear-gradient(155deg,#f7f7f4,#e9e9e4) !important;
}

/* Remove black exit-darkening from the previous parallax version. */
body.home-page .hero.hero-xfolio::after {
  background: linear-gradient(to bottom, transparent 58%, rgba(255,255,255,.72) 100%) !important;
  opacity: calc(var(--hero-scroll-progress, 0) * .28) !important;
}
body.home-page .hero-xfolio-bottom-strip {
  background: var(--xf-red) !important;
  box-shadow: none !important;
}

/* =========================================================
   PHONE SCROLL REPAIR
   1. Do not trap scroll chaining on the hero.
   2. Restore normal document overflow whenever the menu is closed.
   3. Keep the off-canvas menu non-interactive while hidden.
   ========================================================= */
@media (max-width: 900px) {
  html {
    min-height: 100% !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }
  body.home-page {
    position: static !important;
    min-height: 100% !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: auto !important;
    touch-action: pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body.home-page:not(.menu-open) {
    overflow-y: auto !important;
  }
  body.home-page.menu-open {
    overflow: hidden !important;
  }
  body.home-page main {
    position: relative !important;
    min-height: 1px !important;
    overflow: visible !important;
    touch-action: pan-y pinch-zoom !important;
  }
  body.home-page .hero.hero-xfolio {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: clip !important;
    overscroll-behavior: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }
  body.home-page .hero-xfolio-shell,
  body.home-page .hero-xfolio-layout,
  body.home-page .hero-xfolio-heading,
  body.home-page .hero-xfolio-intro,
  body.home-page .hero-xfolio-visual,
  body.home-page .hero-xfolio-metrics {
    touch-action: pan-y pinch-zoom !important;
  }

  /* Closed fixed drawer must never sit over the page or capture swipes. */
  body.home-page .site-primary-nav:not(.open) {
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.home-page .site-primary-nav.open {
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* White mobile drawer */
  body.home-page .site-header--hero .site-primary-nav {
    color: var(--xf-ink) !important;
    background: #fff !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  body.home-page .site-header--hero .site-primary-nav > .site-nav-link,
  body.home-page .site-header--hero .site-services-trigger {
    color: var(--xf-ink) !important;
    border-bottom-color: var(--xf-line) !important;
  }
  body.home-page .site-header--hero .site-services-menu {
    color: var(--xf-ink) !important;
    background: #f8f8f5 !important;
  }

  /* Too many continuously composited layers can freeze low-memory phones. */
  body.home-page .hero-xfolio-heading,
  body.home-page .hero-xfolio-intro,
  body.home-page .hero-xfolio-shape,
  body.home-page .hero-xfolio-portrait,
  body.home-page .hero-xfolio-metrics,
  body.home-page .hero-xfolio-actions,
  body.home-page .hero-xfolio .hero-circle-link,
  body.home-page .hero-xfolio-float {
    will-change: auto !important;
  }
}

@media (max-width: 600px) {
  body.home-page .hero.hero-xfolio {
    padding-top: 28px !important;
  }
  body.home-page .hero-xfolio-shell {
    padding-bottom: 78px !important;
  }
}
