/* ==========================================================
   MOTION TEST — linked from the three pages of this test copy only.
   Lenis rules + everything the GSAP effects in js/motion.js need.
   Most moving parts use CSS variables on the separate translate /
   scale / opacity properties, so the site's own hover effects
   (which use transform) keep working untouched.
   ========================================================== */

/* ---------- Lenis (smooth scroll) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis, .lenis.lenis-smooth { scroll-behavior: auto !important; }   /* Lenis already smooths: the site's CSS smooth-scroll must not do it a second time */
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- first-visit intro: logo, gold line, curtain lifts ---------- */
/* set in <head> before first paint; js/motion.js swaps it for the real curtain (the 5s animation is only a safety net) */
html.lux-pre::before {
  content: ""; position: fixed; inset: 0; z-index: 100001; background: #1c1304;
  animation: luxSafe .01s 5s forwards;
}
@keyframes luxSafe { to { visibility: hidden; } }
.lux-intro { position: fixed; inset: 0; z-index: 100001; display: grid; place-items: center; background: #1c1304; }
.lux-intro-in { display: grid; justify-items: center; gap: 26px; }
.lux-intro img { width: clamp(92px, 11vw, 132px); height: auto; border-radius: 50%; box-shadow: 0 0 0 1px rgba(217, 190, 116, .35), 0 30px 80px -20px rgba(194, 154, 58, .45); }
.lux-intro-line { display: block; width: clamp(120px, 16vw, 220px); height: 1px; background: linear-gradient(90deg, transparent, #d9be74, transparent); }

/* ---------- background: one long blurred photo, fixed far behind the page (built by js/motion.js) ----------
   It slides at a fifth of the scroll speed; the photo is blurred ahead of time, so nothing is blurred live. */
.bgx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bgx-photo { position: absolute; top: 0; left: 50%; background: center / 100% 100% no-repeat; will-change: transform; }

/* ---------- no boxes: the sections have no background of their own ----------
   Everything sits straight on the blurred photos. Readability comes from the background itself:
   js/motion.js paints a soft tone layer (.bgx-tone) that is lighter behind light sections and darker
   behind dark ones, blending between them with no edges. */
html.motion-on body:not(.page-gw) { background: #6b4a20; position: relative; }   /* warm colour under the photos; the gateway has none */
html.motion-on main > section.section, html.motion-on .i-hero, html.motion-on .i-cta { background: transparent; }
html.motion-on .i-cta::before { display: none; }
.bgx-tone { position: absolute; top: 0; left: 0; right: 0; z-index: -1; pointer-events: none; }   /* moves with the content */
html.motion-on .saw-top::before, html.motion-on .saw-bottom::after { display: none; }

/* ---------- header slides away while reading down, comes back on the way up ---------- */
html.motion-on .site-header { transition: background .3s, box-shadow .3s, translate .55s cubic-bezier(.2, .7, .2, 1); }
html.motion-on .site-header.hdr-hide { translate: 0 -110%; }

/* ---------- word-by-word reveal (words only: Arabic letters keep joining) ---------- */
.mw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .16em; margin: 0 -.04em -.16em; }
.mw-i { display: inline-block; transform-origin: 0 100%; }
/* the little gold line before each section label draws itself */
html.motion-on .section-head .eyebrow::before { transform: scaleX(var(--el, 1)); transform-origin: 0 50%; }
[dir="rtl"] .section-head .eyebrow::before { transform-origin: 100% 50%; }

/* ---------- scroll-in blocks ----------
   Never put .mo on an element GSAP also moves with x / y / scale: GSAP then writes
   "translate: none; scale: none" inline and these variables stop working. */
.mo {
  opacity: var(--ro, 1);
  translate: calc(var(--rx, 0px) + var(--mgx, 0) * 1px) calc(var(--ry, 0px) + var(--mgy, 0) * 1px);
  scale: var(--rs, 1);
}

/* ---------- pictures ---------- */
html.motion-on .hero-bg { animation: none; inset: -12% 0; will-change: transform; }
html.motion-on .p-media img, html.motion-on .svc-img img { height: 118%; translate: 0 var(--py, -7%); }
html.motion-on .f-item img, html.motion-on .svc-img img, html.motion-on .mz img { scale: var(--is, 1); }

/* ---------- gateway ---------- */
html.motion-on .gw-bg { scale: var(--gs, 1); translate: calc(var(--mx, 0) * 1px) calc(var(--my, 0) * 1px); }
html.motion-on .gw-body { translate: calc(var(--bx, 0) * 1px) calc(var(--by, 0) * 1px); }
html.motion-on .gw-seam { rotate: var(--sr, 0deg); scale: var(--ss, 1); }

/* ---------- scroll progress bar ---------- */
.motion-progress {
  position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 2000; pointer-events: none;
  background: linear-gradient(90deg, #8f6000, #d9be74, #8f6000);
  transform: scaleX(0); transform-origin: 0 50%;
}
[dir="rtl"] .motion-progress { transform-origin: 100% 50%; }

/* ---------- magnetic buttons ---------- */
html.motion-on .magnet { will-change: transform; }
html.motion-on .magnet:hover { transform: none; }


/* ---------- bigger content, less empty space ----------
   With no boxes around the sections, the old roomy spacing read as gaps and the content as small. */
html.motion-on { font-size: clamp(16px, 11px + .55vw, 19px); }            /* everything sized in rem grows a little on wider screens */
html.motion-on body { font-size: 1.04rem; }
html.motion-on .container { width: min(1560px, 100% - 56px); }
html.motion-on .container.narrow { width: min(960px, 100% - 40px); }
html.motion-on .section { padding: clamp(36px, 4.2vw, 66px) 0; }
html.motion-on .i-hero { padding-bottom: clamp(36px, 4vw, 64px); }
html.motion-on .section-head { max-width: 880px; margin-bottom: clamp(24px, 3vw, 42px); }
html.motion-on .section-head h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
html.motion-on .section-head p { font-size: 1.15rem; }
html.motion-on .products-grid, html.motion-on .why-grid { gap: 26px; }
html.motion-on .p-body h3 { font-size: 1.4rem; }
html.motion-on .p-body p, html.motion-on .why-card p { font-size: 1rem; }
html.motion-on .why-card h3 { font-size: 1.35rem; }
html.motion-on .factory-grid { grid-auto-rows: clamp(120px, 11vw, 170px); }
html.motion-on .svc + .svc { margin-top: clamp(44px, 6vw, 84px); }
html.motion-on .logos-block + .logos-block { margin-top: 44px; }
@media (min-width: 721px) {
  html.motion-on .gallery { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
  html.motion-on .dev-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}


/* ==========================================================
   DARK GLASS THEME (companies + individuals; the gateway is untouched)
   The page sits on the dark-washed photo: text turns light, and the content
   lives in frosted "glass" boxes (a translucent tint + a fine light edge; no
   live blur, the photo behind is already blurred). The tokens are redefined
   once here, so every rule in style.css that uses them follows.
   ========================================================== */
html.motion-on body:not(.page-gw) {
  --text: #efe5cf; --muted: rgba(239, 229, 207, .76); --line: rgba(255, 245, 225, .16); --bg-alt: rgba(255, 250, 240, .07);
  --glass: rgba(255, 250, 240, .07); --glass-hi: rgba(255, 250, 240, .11); --glass-line: rgba(255, 245, 225, .17);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 22px 46px -26px rgba(0, 0, 0, .7);
  color: var(--text);
}

/* text */
html.motion-on main h1, html.motion-on main h2, html.motion-on main h3, html.motion-on main h4,
html.motion-on .logos-title { color: #fbf3e2; }
html.motion-on .section-head .eyebrow, html.motion-on .tl-year, html.motion-on .about-text p strong { color: var(--g300); }
html.motion-on .section-head p, html.motion-on .section.dark .section-head p { color: var(--muted); opacity: 1; }
html.motion-on .p-body h3 svg, html.motion-on .p-link { color: var(--g300); }
html.motion-on .p-link:hover { color: var(--g200); }

/* the glass boxes */
html.motion-on .p-card, html.motion-on .why-card, html.motion-on .mv-card, html.motion-on .mv-card.vision,
html.motion-on .faq-item, html.motion-on .form-card, html.motion-on .about-text, html.motion-on .factory-intro,
html.motion-on .logos-block, html.motion-on .svc-text, html.motion-on .contact-grid > div:first-child {
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); color: var(--text);
}
html.motion-on .mv-card.vision { background: rgba(10, 6, 1, .32); }
html.motion-on .about-text, html.motion-on .factory-intro, html.motion-on .logos-block,
html.motion-on .svc-text, html.motion-on .contact-grid > div:first-child {
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 40px);
}
html.motion-on .why-card:hover, html.motion-on .p-card:hover { border-color: rgba(217, 190, 116, .45); box-shadow: var(--glass-shadow); }
html.motion-on .faq-item[open] { border-color: rgba(217, 190, 116, .45); }

/* small pieces inside the glass */
html.motion-on .tags span, html.motion-on .i-tag {
  background: var(--glass-hi); color: var(--g200); border: 1px solid var(--glass-line); box-shadow: none;
}
html.motion-on .i-tag svg { color: var(--g300); }
html.motion-on .why-card .ico, html.motion-on .faq-item summary::after { background: rgba(217, 190, 116, .14); color: var(--g300); border-color: var(--glass-line); }
html.motion-on .faq-item[open] summary::after { background: var(--g600); color: #fff; }
html.motion-on .faq-item summary { color: #fbf3e2; }
html.motion-on .filter { background: var(--glass); color: var(--g200); border-color: var(--glass-line); }
html.motion-on .filter.active { background: var(--g600); border-color: var(--g600); color: #fff; }
html.motion-on .btn-outline { background: transparent; border-color: var(--g300); color: var(--g100); }   /* a <button> keeps the browser's light-grey fill otherwise: cream text on it was unreadable ("Show more") */
html.motion-on .btn-outline:hover { background: var(--g600); border-color: var(--g600); color: #fff; }
html.motion-on .logo-cell { background: #fff; border-color: transparent; }   /* the logos need a light card; pure white so logos with their own white box blend in */

/* form */
html.motion-on .section .form-card h3 { color: #fbf3e2; }   /* style.css colours it via ".section.dark .form-card h3" */
html.motion-on .field label { color: var(--g200); }
html.motion-on .field input, html.motion-on .field textarea, html.motion-on .form-card select {
  background: rgba(255, 250, 240, .08); border-color: var(--glass-line); color: #fbf3e2;
}
html.motion-on .field input::placeholder, html.motion-on .field textarea::placeholder { color: rgba(239, 229, 207, .45); }
html.motion-on .form-card select option { color: #2b1d08; background: #fff; }

/* individuals hero */
html.motion-on .i-hero h1 em { color: var(--g300); background: linear-gradient(transparent 86%, rgba(217, 190, 116, .45) 86%); }   /* a thin gold underline instead of the light-page highlight band */
html.motion-on .i-hero .lead { color: var(--muted); }
html.motion-on .i-trust li { color: var(--g200); }
html.motion-on .i-trust svg { color: var(--g300); }

/* individuals header: dark, like the companies page */
html.motion-on .page-ind .site-header { background: rgba(28, 19, 4, .82); border-bottom-color: rgba(217, 190, 116, .22); }
html.motion-on .page-ind .site-header.scrolled { background: rgba(28, 19, 4, .95); }
html.motion-on .page-ind .brand { color: #fff; }
html.motion-on .page-ind .brand-text small { color: var(--g300); }
html.motion-on .page-ind .nav a { color: var(--g200); }
html.motion-on .page-ind .nav a:hover, html.motion-on .page-ind .nav a.active { color: #fff; }
html.motion-on .page-ind .lang-toggle { border-color: var(--g400); color: var(--g200); }
html.motion-on .page-ind .menu-btn { color: var(--g100); }
html.motion-on .page-ind .nav a.aud-link { background: var(--g100); color: var(--g900); }
@media (max-width: 1100px) {
  html.motion-on .page-ind .nav { background: rgba(28, 19, 4, .98); border-bottom-color: rgba(217, 190, 116, .25); }
  html.motion-on .page-ind .nav a { border-bottom-color: rgba(217, 190, 116, .12); }
}

/* client / partner logos in their own colours (the original greys them out until hovered) */
html.motion-on .logo-cell img { filter: none; }
