@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&family=Unbounded:wght@600;700;800&display=swap");

:root {
  --primary: #3E5BA5;
  --accent: #8486aa;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #5b6474;
  --line: rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  --radius: 1.125rem;
  --radius-lg: 1.5rem;
  --header-height: clamp(4.5rem, 5vw, 5.5rem);
  --site-gutter: clamp(1rem, 4vw, 4.5rem);
  --section-space: clamp(4rem, 8vw, 7.5rem);
  --section-space-tight: clamp(2rem, 4vw, 3.5rem);
  --content-max: min(100% - (var(--site-gutter) * 2), 90rem);
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body, #smooth-wrapper, #smooth-content, .page {
  scrollbar-width: thin;
  scrollbar-color: #3e5ba5 rgba(62, 91, 165, 0.08);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#smooth-wrapper::-webkit-scrollbar,
#smooth-content::-webkit-scrollbar,
.page::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
#smooth-wrapper::-webkit-scrollbar-track,
#smooth-content::-webkit-scrollbar-track,
.page::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: rgba(62, 91, 165, 0.08);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
#smooth-wrapper::-webkit-scrollbar-thumb,
#smooth-content::-webkit-scrollbar-thumb,
.page::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background-color: #3e5ba5;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
#smooth-wrapper::-webkit-scrollbar-thumb:hover,
#smooth-content::-webkit-scrollbar-thumb:hover,
.page::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background-color: #2c4b92;
}

body.menu-open {
  overflow: hidden;
}

main {
  padding-top: max(var(--header-height), 5.5rem);
}

section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

:where(img, svg, video, canvas, iframe) {
  max-width: 100%;
}

img,
video,
canvas,
iframe {
  display: block;
}

.px-site {
  padding-left: var(--site-gutter);
  padding-right: var(--site-gutter);
}

.grid-site {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.875rem, 1.8vw, 1.5rem);
}

.section-title {
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-title::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -0.5rem;
  height: 2px;
  background: var(--accent);
  opacity: 0.45;
}

body .site-header {
  --logo-r: 255;
  --logo-g: 255;
  --logo-b: 255;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.875rem, 2vw, 1.75rem);
  min-height: var(--header-height);
  padding: clamp(0.875rem, 1.5vw, 1.125rem) var(--site-gutter);
  color: rgb(var(--logo-r), var(--logo-g), var(--logo-b));
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0));
  backdrop-filter: blur(8px);
  transition: transform 0.35s ease, opacity 0.35s ease, padding 0.3s ease, gap 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

body .site-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

body .site-header.is-logo-only {
  gap: 0;
  background: transparent;
  backdrop-filter: none;
}

body .site-header.is-logo-only .site-nav {
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
}

body .logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition: none;
}

body .brand-logo {
  width: clamp(2.75rem, 3vw, 3.625rem);
  height: clamp(2.75rem, 3vw, 3.625rem);
  display: block;
  color: inherit;
  transition: none;
}

body .brand-path {
  fill: currentColor;
  fill-rule: evenodd;
  transition: none;
}

body .site-header.is-scroll-down .logo-link {
  transition: color 1.05s cubic-bezier(0.22, 1, 0.36, 1), transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

body .site-header.is-scroll-down .brand-logo {
  transition: color 1.05s cubic-bezier(0.22, 1, 0.36, 1), transform 1.05s cubic-bezier(0.22, 1, 0.36, 1), filter 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

body .site-header.is-scroll-down .brand-path {
  transition: fill 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

body .site-header.is-logo-only .logo-link {
  transform: translateY(1px);
}

body .site-header.is-logo-only .brand-logo {
  filter: drop-shadow(0 8px 18px rgba(62, 91, 165, 0.18));
}

body .site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 2.5rem);
  width: min(100%, 1680px);
  justify-content: space-between;
  margin-left: 0.375rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

body .site-nav a {
  position: relative;
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

body .site-nav a::before {
  content: "+";
  font-weight: 400;
  opacity: 0.72;
}

body .site-nav a::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 0;
  bottom: -0.375rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

body .site-nav a:hover::after,
body .site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

body .menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

body .menu-toggle span {
  width: 18px;
  height: 2px;
  background: #ffffff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

html body.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
  opacity: 1;
}

html body.menu-open .menu-toggle span:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
  opacity: 1;
}

body.menu-open .site-header {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* حل جذري لمشكلة الوميض الأبيض قبل تحميل السكربت */
html {
  background-color: var(--bg);
}

.global-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #3E5BA5;
  z-index: 999999;
  pointer-events: none;
  /* By default on hard load, it covers the screen (yPercent equivalent to 0) */
  transform: translateY(0%);
}

#smooth-wrapper {
  overflow: hidden;
}

#smooth-content {
  overflow: visible;
}

.global-footer {
  position: relative;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(4rem, 7vw, 6rem) var(--site-gutter) clamp(1.35rem, 3vw, 2rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 38%, #eef3ff 100%);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
  isolation: isolate;
}

.global-footer::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -15rem;
  width: min(78rem, 96vw);
  height: 24rem;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(62, 91, 165, 0.34) 0%, rgba(62, 91, 165, 0.22) 26%, rgba(62, 91, 165, 0.09) 50%, rgba(62, 91, 165, 0) 74%);
  filter: blur(36px);
  pointer-events: none;
  z-index: -1;
}

.global-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(62, 91, 165, 0.12);
  pointer-events: none;
}

.editorial-footer-shell {
  position: relative;
  width: min(100%, 96rem);
  margin: 0 auto;
  display: grid;
  gap: clamp(1.5rem, 2.5vw, 2.5rem);
}

.editorial-footer-lead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(18rem, 0.72fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  padding: clamp(1.35rem, 3vw, 2.2rem);
  border-radius: clamp(1.25rem, 2vw, 2rem);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.editorial-footer-lead--text-only {
  grid-template-columns: minmax(0, 1fr);
}

.editorial-footer-copy {
  display: grid;
  gap: clamp(0.9rem, 1.8vw, 1.3rem);
}

.editorial-footer-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.editorial-footer-kicker,
.editorial-footer-count,
.editorial-footer-label,
.editorial-footer-preview-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.editorial-footer-kicker,
.editorial-footer-label {
  color: rgba(15, 23, 42, 0.56);
}

.editorial-footer-count {
  color: rgba(62, 91, 165, 0.88);
}

.editorial-footer-title-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.editorial-footer-title {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  max-width: 8ch;
}

.editorial-footer-arrow {
  flex: 0 0 auto;
  width: clamp(3.1rem, 4vw, 4rem);
  height: clamp(3.1rem, 4vw, 4rem);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
  transition: transform 0.35s ease;
}

.editorial-footer-arrow svg {
  width: 1.35rem;
  height: 1.35rem;
}

.editorial-footer-lead:hover .editorial-footer-arrow {
  transform: translate(0.2rem, -0.2rem) scale(1.03);
}

.editorial-footer-summary {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.65;
}

.editorial-footer-preview {
  position: relative;
  width: min(100%, 20rem);
  justify-self: end;
  aspect-ratio: 5 / 4;
  border-radius: clamp(1rem, 1.5vw, 1.5rem);
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.editorial-footer-preview img {
  width: 100%;
  height: 100%;
  padding: clamp(0.55rem, 0.9vw, 0.8rem);
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  transition: transform 0.8s ease;
}

.editorial-footer-lead:hover .editorial-footer-preview img {
  transform: scale(1.02);
}

.editorial-footer-preview-card {
  height: 100%;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  color: var(--ink);
  background: #ffffff;
}

.editorial-footer-preview-badge {
  justify-self: start;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  color: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.editorial-footer-preview-copy {
  display: grid;
  gap: 0.55rem;
}

.editorial-footer-preview-copy strong {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.05;
}

.editorial-footer-preview-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.editorial-footer-preview-items {
  display: grid;
  gap: 0.55rem;
}

.editorial-footer-preview-items span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.editorial-footer-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
  align-items: start;
}

.editorial-footer-stack {
  display: grid;
  gap: 0.8rem;
}

.global-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--primary);
}

.global-footer-logo .brand-logo {
  width: 52px;
  height: 52px;
}

.editorial-footer-brandline {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 26ch;
}

.editorial-footer-nav,
.global-footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.editorial-footer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.editorial-footer-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(62, 91, 165, 0.4);
  background: rgba(62, 91, 165, 0.08);
  color: var(--primary);
}

.editorial-footer-pill.is-current {
  border-color: rgba(62, 91, 165, 0.46);
  background: rgba(62, 91, 165, 0.1);
  color: var(--primary);
}

.editorial-footer-pill--social {
  font-size: 0.92rem;
}

.global-footer-bottom {
  position: relative;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  padding-top: 1rem;
  padding-left: clamp(6rem, 10vw, 10rem);
  padding-right: clamp(6rem, 10vw, 10rem);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.global-footer-signature {
  position: absolute;
  right: 0.25rem;
  bottom: -0.7rem;
  display: block;
  width: clamp(7rem, 11vw, 10rem);
  max-width: 26vw;
  color: rgba(62, 91, 165, 0.74);
  pointer-events: none;
  user-select: none;
}

.global-footer-signature svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.global-footer-signature-path {
  fill: rgba(62, 91, 165, 0.16);
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-opacity: 0.82;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  will-change: stroke-dashoffset, fill-opacity, stroke-opacity;
  transition: stroke-dashoffset 1.45s cubic-bezier(0.65, 0, 0.35, 1) var(--signature-delay, 0s), fill-opacity 0.45s ease calc(var(--signature-delay, 0s) + 0.9s), stroke-opacity 0.45s ease calc(var(--signature-delay, 0s) + 0.9s);
}

.global-footer-signature.is-drawn .global-footer-signature-path {
  stroke-dashoffset: 0;
  fill-opacity: 1;
  stroke-opacity: 0.28;
}

@media (prefers-reduced-motion: reduce) {
  .global-footer-signature-path {
    transition: none;
  }
}

@media (max-width: 960px) {
  .editorial-footer-lead {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .editorial-footer-preview {
    width: 100%;
    justify-self: stretch;
    aspect-ratio: 16 / 10;
  }

  .editorial-footer-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .editorial-footer-title {
    font-size: clamp(2rem, 13vw, 3.6rem);
  }

  .editorial-footer-title-row {
    align-items: center;
  }

  .editorial-footer-preview {
    aspect-ratio: 4 / 3;
  }

  .global-footer-bottom {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 2.8rem;
  }

  .global-footer-signature {
    left: 50%;
    right: auto;
    bottom: -0.7rem;
    width: min(8.5rem, 42vw);
    max-width: none;
    transform: translateX(-50%);
  }
}

.back-to-top {
  position: fixed;
  right: clamp(1rem, 2vw, 1.5rem);
  bottom: clamp(1rem, 2vw, 1.5rem);
  z-index: 9999;
}

@media (max-width: 768px) {
  body .site-header {
    justify-content: space-between;
    gap: 0.75rem;
    backdrop-filter: none;
    background: rgba(15, 23, 42, 0.98);
  }

  body .site-header.is-logo-only .site-nav {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }

  body .site-nav {
    position: fixed;
    top: calc(var(--header-height) + 0.25rem);
    left: var(--site-gutter);
    right: var(--site-gutter);
    display: grid;
    width: auto;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    margin-left: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    font-family: "Barlow Condensed", "Unbounded", "Inter", sans-serif;
    text-transform: none;
    letter-spacing: 0.02em;
  }

  body .site-nav a {
    padding: 0.625rem 0.5rem;
    font-family: inherit;
  }

  body .site-nav a::before {
    content: "+";
  }

  body .menu-toggle {
    display: inline-flex;
  }

  body.menu-open .site-header .site-nav,
  body.menu-open .site-header.is-logo-only .site-nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .editorial-footer {
    padding-left: var(--site-gutter);
    padding-right: var(--site-gutter);
  }
}

/* Transitions optimization */
.animate-heavy {
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease !important;
    will-change: transform, opacity;
}


/* LQIP Blur-Up Effect */
.lqip-blur {
    filter: blur(10px);
    transition: filter 0.6s ease-out, opacity 0.6s ease-out;
    will-change: filter, opacity;
}
.lqip-blur.loaded {
    filter: blur(0);
}

/* Animation Optimizations */
[data-reveal], .horizontal-track-panel {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

body:not([data-page="products"]) .circular-card,
body:not([data-page="products"]) .showcase-card {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* --- Mobile Scroll Jumps & Layout Shift Fixes --- */
@media (max-width: 768px) {
    /* 1. Address Bar Fix: Convert common full-height elements to JS fixed viewport height */
    .min-h-screen, 
    [class*="h-[100vh]"], 
    [class*="min-h-[100vh]"],
    .tw-min-h-\[100vh\],
    .tw-h-\[100vh\] {
        height: calc(var(--vh, 1vh) * 100) !important;
        min-height: calc(var(--vh, 1vh) * 100) !important;
    }
    
    /* 2. GPU Acceleration for Fixed Elements and Heros to stop jitter */
    .site-header, .docked-header, .site-nav, 
    .menu-toggle, .logo-float, 
    .parallax-container, .hero-bg, .hero-content,
    .docked-footer {
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    /* 3. Disable heavy painting operations like fixed background on mobile */
    .hero, section, div {
        background-attachment: scroll !important;
    }
}

/* --- SCROLL KILL-SWITCH (STABILITY OVER ANIMATION) --- */
@media (max-width: 768px) {
    /* 1. إظهار جملة واحدة فقط من Marquee في المنتصف للموبايل */
    .landing-built-marquee, .landing-built-wrapper {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    .landing-built-marquee__track, .landing-built-marquee__group {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: auto !important;
        animation: none !important; /* إيقاف الأنميشن */
        transform: none !important;
    }
    .landing-built-marquee__group:not(:first-child) {
        display: none !important; /* إخفاء التكرار */
    }
    .landing-built-marquee__item {
        display: none !important; /* إخفاء الكلمات */
    }
    .landing-built-marquee__item:first-child {
        display: block !important; /* إظهار أول كلمة فقط */
        text-align: center !important;
        font-size: clamp(3rem, 10vw, 4rem) !important;
        white-space: nowrap !important;
    }

    /* 2. تقليل المساحات حول From issue detection to site delivery */
    .scene-1, .scene-2, .scene-3, .construction-scroll-showcase {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    .scene-1 {
      min-height: 0 !important;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
    }
    .expanding-box-slot {
        height: auto !important;
        min-height: auto !important;
      margin-bottom: 0.75rem !important;
      width: calc(100vw - 36px) !important;
        position: relative !important;
    }
    .expanding-box {
      height: auto !important;
      min-height: 0 !important;
      padding: 18px 18px 16px !important;
    }
    .expanding-box-copy {
      gap: 6px !important;
    }
    .expanding-box-copy strong {
      line-height: 1 !important;
      margin: 0 !important;
    }

    /* 3. Kill absolute heights / pinning / spacing to destroy scroll-jackers */
    main, section, 
    .smooth-content, .smooth-wrapper,
    .pin-spacer, .horizontal-track-panel,
    .parallax-container, .hero {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        position: static !important;
    }

    /* 4. إصلاح قفزة الهاتف في الصور (تحويل الـ horizontal إلى عمودي طبيعي) */
    .horizontal-panels {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        transform: none !important;
    }
    .panel {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 2rem 1rem !important;
        margin-bottom: 1rem !important;
        position: static !important;
        transform: none !important;
    }
    .panel-visual {
        position: static !important;
        transform: none !important;
    }
    .panel-visual img {
        height: auto !important;
        max-height: 60vh !important; /* كي لا تملأ الشاشة وتسبب scroll jump */
        width: 100% !important;
        object-fit: cover !important;
    }

    /* 5. Forcibly restore native scrolling & nullify GSAP inline transforms */
    * {
        scroll-behavior: auto !important;
        touch-action: pan-y !important; /* حرية لمس كاملة للتمرير العمودي */
    }
    
    [style*="transform"]:not(.global-transition-overlay):not(.hero-activation-card):not(.hero-card-inner):not(.hero-hover-glow):not(.hero-card-sheen):not(.hero-card-flash):not(.hero-back-logo):not(.hero-logo-fill):not(.hero-logo-core):not(.hero-logo-stroke path),
    .pin-spacer, .showcase-card, [data-reveal]:not(.hero-activation-scene) {
        transform: translate3d(0, 0, 0) !important; /* GPU ONLY */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Hide specific scroll-blocking canvases that might freeze mobile */
    canvas.webgl {
        display: none !important;
    }
}

/* --- HEADER STABILITY (NO JUMPING/LAG) --- */
@media (max-width: 768px) {
  .global-transition-overlay {
    transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
  }

    /* 1. Force strict sticky flow & strip transitions */
    .site-header, .docked-header {
        position: sticky !important;
        top: 0 !important;
        height: 70px !important;
        transform: translate3d(0, 0, 0) !important; /* GPU Lock */
        transition: none !important; /* Kill laggy ease-in-out */
        margin-top: 0 !important;
        background: #ffffff !important; 
        z-index: 9999 !important;
        width: 100% !important;
        /* Ensure it behaves like a solid nav bar instead of absolute absolute */
    }

    body {
        padding-top: 0 !important; /* Adjust if content dives under header */
    }
}

/* --- HEADER V2: FULL-SCREEN OVERLAY MENU --- */
body[data-nav="overlay-v2"] {
  --overlay-menu-bg: #3e5ba5;
  --overlay-menu-line: rgba(255, 255, 255, 0.22);
  --overlay-menu-text: #ffffff;
}

body[data-nav="overlay-v2"].menu-open {
  overflow: hidden;
}

body[data-nav="overlay-v2"] .site-header {
  justify-content: space-between !important;
  gap: clamp(0.875rem, 2vw, 1.5rem) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  mix-blend-mode: normal !important;
}

body[data-nav="overlay-v2"] .site-header.is-logo-only {
  gap: clamp(0.875rem, 2vw, 1.5rem) !important;
}

body[data-nav="overlay-v2"] .site-header.is-logo-only .logo-link {
  transform: none !important;
}

body[data-nav="overlay-v2"] .site-header.is-logo-only .brand-logo {
  filter: none !important;
}

body[data-nav="overlay-v2"] .logo-link {
  position: relative;
  z-index: 10031;
}

body[data-nav="overlay-v2"] .menu-toggle::before {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(62, 91, 165, 0.38), rgba(17, 24, 39, 0.2));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(16px) saturate(1.16);
  -webkit-backdrop-filter: blur(16px) saturate(1.16);
  z-index: -1;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), background 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease;
  pointer-events: none;
}

body[data-nav="overlay-v2"] .menu-toggle {
  display: inline-flex !important;
  position: relative;
  z-index: 10031;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  width: clamp(3rem, 4vw, 3.6rem);
  height: clamp(3rem, 4vw, 3.6rem);
  margin-left: auto;
  padding: 0;
  gap: 0.38rem;
  border: 0 !important;
  border-radius: 999px;
  background: transparent !important;
  color: inherit;
  transition: transform 0.35s ease, color 0.35s ease, opacity 0.35s ease;
}

body[data-nav="overlay-v2"] .menu-toggle::before {
  inset: 0;
  border-radius: 999px;
}

body[data-nav="overlay-v2"] .menu-toggle:hover {
  transform: translateY(-1px);
}

body[data-nav="overlay-v2"] .menu-toggle span {
  position: absolute;
  left: 50%;
  width: clamp(1.35rem, 2vw, 1.95rem);
  height: 2px;
  border-radius: 999px;
  background: currentColor !important;
  opacity: 1;
  transform-origin: center;
  transition: top 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, background 0.35s ease;
}

body[data-nav="overlay-v2"] .menu-toggle span:nth-child(1) {
  top: calc(50% - 0.44rem);
  transform: translate(-50%, -50%);
}

body[data-nav="overlay-v2"] .menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}

body[data-nav="overlay-v2"] .menu-toggle span:nth-child(3) {
  top: calc(50% + 0.44rem);
  transform: translate(-50%, -50%);
}

body[data-nav="overlay-v2"].menu-open .menu-toggle span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

body[data-nav="overlay-v2"].menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0.16);
}

body[data-nav="overlay-v2"].menu-open .menu-toggle span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

body[data-nav="overlay-v2"] .site-header.is-scroll-down .menu-toggle::before,
body[data-nav="overlay-v2"] .site-header.is-logo-only .menu-toggle::before {
  opacity: 0;
  transform: scale(0.9);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

body[data-nav="overlay-v2"] .site-header.is-scroll-down,
body[data-nav="overlay-v2"] .site-header.is-logo-only {
  color: var(--primary) !important;
}

body[data-nav="overlay-v2"] .site-nav {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10020 !important;
  display: grid !important;
  align-content: center !important;
  gap: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: clamp(5.5rem, 10vh, 7rem) clamp(1rem, 4vw, 2rem) clamp(1.25rem, 4vh, 2rem) !important;
  margin: 0 !important;
  justify-content: stretch !important;
  background: var(--overlay-menu-bg) !important;
  color: var(--overlay-menu-text) !important;
  border: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate3d(0, -100%, 0) !important;
  transition: transform 0.62s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.42s ease, visibility 0s linear 0.62s !important;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: "Barlow Condensed", "Unbounded", "Inter", sans-serif;
}

body[data-nav="overlay-v2"] .site-nav::-webkit-scrollbar {
  display: none;
}

body[data-nav="overlay-v2"].menu-open .site-nav,
body[data-nav="overlay-v2"].menu-open .site-header.is-logo-only .site-nav {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
  transition-delay: 0s !important;
}

body[data-nav="overlay-v2"] .site-nav a {
  position: relative;
  display: block !important;
  width: 100%;
  padding: clamp(0.8rem, 1.2vw, 0.95rem) 0 clamp(0.95rem, 1.6vw, 1.15rem) !important;
  border-top: 1px solid var(--overlay-menu-line);
  color: inherit !important;
  font-family: "Barlow Condensed", "Unbounded", "Inter", sans-serif;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.86;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(1.25rem);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, color 0.25s ease;
}

body[data-nav="overlay-v2"] .site-nav a:last-child {
  border-bottom: 1px solid var(--overlay-menu-line);
}

body[data-nav="overlay-v2"] .site-nav a::before {
  content: none !important;
}

body[data-nav="overlay-v2"] .site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: clamp(0.35rem, 0.8vw, 0.5rem);
  width: clamp(6rem, 16vw, 11rem);
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-nav="overlay-v2"].menu-open .site-nav a {
  opacity: 1;
  transform: translateY(0);
}

body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(1) { transition-delay: 0.1s; }
body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(2) { transition-delay: 0.14s; }
body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(3) { transition-delay: 0.18s; }
body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(4) { transition-delay: 0.22s; }
body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(5) { transition-delay: 0.26s; }
body[data-nav="overlay-v2"].menu-open .site-nav a:nth-child(6) { transition-delay: 0.3s; }

body[data-nav="overlay-v2"] .site-nav a:hover::after,
body[data-nav="overlay-v2"] .site-nav a:focus-visible::after,
body[data-nav="overlay-v2"] .site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

body[data-nav="overlay-v2"] .site-nav a:focus-visible {
  outline: none;
}

body[data-nav="overlay-v2"] .site-nav a[aria-current="page"] {
  color: rgba(255, 255, 255, 0.8) !important;
}

body[data-nav="overlay-v2"].menu-open .site-header,
body[data-nav="overlay-v2"].menu-open .site-header.is-logo-only,
body[data-nav="overlay-v2"].menu-open .site-header.is-past-hero {
  color: #ffffff !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

body[data-nav="overlay-v2"].menu-open .menu-toggle::before {
  opacity: 0;
  transform: scale(0.92);
}

@media (hover: none) {
  body[data-nav="overlay-v2"] .site-nav a:active::after {
    transform: scaleX(1);
  }
}

@media (max-width: 640px) {
  body[data-nav="overlay-v2"] .site-nav {
    padding-top: 5rem !important;
  }

  body[data-nav="overlay-v2"] .site-nav a {
    font-size: clamp(2.85rem, 17vw, 5rem);
  }
}

