/* ============================================================================
 * Mashhor Hub — Immersive Homepage Experience (PREVIEW)  · /experience
 * Vanilla, no libraries. Theme-aware brand palette, RTL-aware, reduced-motion
 * complete. Scoped under .xp so it never touches the injected header/footer.
 * ==========================================================================*/

.xp {
  /* Brand-derived cinematic palette (deep navy + gold + cyan + mint) */
  --xp-bg: #041121;
  --xp-bg-2: #071a33;
  --xp-bg-3: #0a2444;
  --xp-ink: #f6f2e8;
  --xp-muted: #b9c7dc;
  --xp-gold: #f4cd55;
  --xp-gold-soft: #f8e59d;
  --xp-cyan: #36daf5;
  --xp-mint: #5de6b1;
  --xp-line: rgba(182, 205, 235, 0.14);
  --xp-panel: rgba(255, 255, 255, 0.035);
  --xp-panel-brd: rgba(255, 255, 255, 0.09);
  --xp-max: 1200px;
  --xp-ease: cubic-bezier(0.22, 1, 0.36, 1);

  color: var(--xp-ink);
  background: var(--xp-bg);
  font-family: 'Outfit', 'Tajawal', system-ui, -apple-system, sans-serif;
  position: relative;
  overflow: clip;
}
.xp *,
.xp *::before,
.xp *::after { box-sizing: border-box; }

/* Arabic display face when the page is RTL */
.xp[dir="rtl"], html[lang^="ar"] .xp { font-family: 'Tajawal', 'Cairo', 'Outfit', system-ui, sans-serif; }

/* ---- Scroll progress (chapter) rail ------------------------------------- */
.xp-progress {
  position: fixed; inset-block-start: 0; inset-inline-start: 0;
  height: 3px; width: 100%; z-index: 40; pointer-events: none;
  background: transparent;
}
.xp-progress__bar {
  height: 100%; width: var(--xp-scroll, 0%);
  background: linear-gradient(90deg, var(--xp-gold), var(--xp-cyan), var(--xp-mint));
  box-shadow: 0 0 18px rgba(54, 218, 245, 0.5);
  transition: width 0.1s linear;
}
.xp[dir="rtl"] .xp-progress__bar { margin-inline-start: auto; }

.xp-chapters {
  position: fixed; inset-inline-end: 22px; inset-block-start: 50%;
  transform: translateY(-50%); z-index: 39;
  display: flex; flex-direction: column; gap: 12px; pointer-events: none;
}
.xp-chapters button {
  width: 9px; height: 9px; border-radius: 50%; padding: 0; border: 0;
  background: rgba(255,255,255,0.22); cursor: pointer; pointer-events: auto;
  transition: transform 0.3s var(--xp-ease), background 0.3s;
}
.xp-chapters button[aria-current="true"] { background: var(--xp-gold); transform: scale(1.7); box-shadow: 0 0 10px var(--xp-gold); }
@media (max-width: 860px) { .xp-chapters { display: none; } }

/* ---- Generic scene scaffold --------------------------------------------- */
.xp-scene { position: relative; z-index: 2; }
.xp-wrap { width: min(100% - 44px, var(--xp-max)); margin-inline: auto; }
.xp-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--xp-cyan); font-weight: 600; margin: 0 0 14px;
}
.xp[dir="rtl"] .xp-eyebrow { letter-spacing: 0.04em; }
.xp h2.xp-title { font-family: 'Syne','Tajawal',sans-serif; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 18px; font-size: clamp(2rem, 5vw, 3.6rem); text-wrap: balance; }
.xp .xp-lead { color: var(--xp-muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.8; max-width: 60ch; }
.xp .grad { background: linear-gradient(105deg, var(--xp-gold), var(--xp-cyan) 60%, var(--xp-mint)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* seamless top blend under the preserved header */
.xp-topblend { position: absolute; inset-block-start: 0; inset-inline: 0; height: 220px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(2,8,20,0.92), rgba(2,8,20,0)); }

/* ---- Buttons (mirror existing brand button language) -------------------- */
.xp-cta { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 700; font-size: 0.98rem;
  padding: 15px 26px; border-radius: 14px; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.25s var(--xp-ease), box-shadow 0.25s, background 0.25s; will-change: transform; }
.xp-cta:focus-visible { outline: 3px solid var(--xp-cyan); outline-offset: 3px; }
.xp-cta--primary { background: linear-gradient(120deg, var(--xp-gold), var(--xp-gold-soft)); color: #241a02; box-shadow: 0 10px 30px rgba(244,205,85,0.28); }
.xp-cta--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(244,205,85,0.4); }
.xp-cta--ghost { background: var(--xp-panel); color: var(--xp-ink); border-color: var(--xp-panel-brd); }
.xp-cta--ghost:hover { transform: translateY(-3px); border-color: var(--xp-cyan); }
.xp-ctarow { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---- SCENE 1 · Mashhor Core hero ---------------------------------------- */
.xp-hero { min-height: 100svh; display: grid; align-items: center; position: relative; padding-block: 120px 80px; }
.xp-core-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.xp-hero__inner { position: relative; z-index: 3; }
.xp-hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.xp-hero h1 { font-family: 'Syne','Tajawal',sans-serif; font-weight: 800; line-height: 1.02; letter-spacing: -0.025em;
  font-size: clamp(2.6rem, 6.4vw, 5rem); margin: 0 0 22px; text-wrap: balance; }
.xp-hero .xp-lead { font-size: clamp(1.05rem, 1.8vw, 1.32rem); }
.xp-scrollcue { position: absolute; inset-block-end: 26px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 3;
  color: var(--xp-muted); font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; display: grid; justify-items: center; gap: 8px; }
.xp-scrollcue span::after { content: ""; display: block; width: 1px; height: 34px; margin: 6px auto 0;
  background: linear-gradient(var(--xp-cyan), transparent); animation: xp-cue 1.8s var(--xp-ease) infinite; }
@keyframes xp-cue { 0% { opacity: 0; transform: scaleY(0.2); transform-origin: top; } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; } }

.xp-hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 38px; max-width: 640px; }
.xp-hero__stats div { display: grid; align-content: start; gap: 6px; }
.xp-hero__stats strong { font-family: 'Syne',sans-serif; font-weight: 800; font-size: clamp(1.7rem, 2.6vw, 2.3rem); color: var(--xp-gold); line-height: 1;
  font-variant-numeric: tabular-nums; }
.xp-hero__stats span { font-size: 0.8rem; color: var(--xp-muted); line-height: 1.5; }
@media (max-width: 560px) { .xp-hero__stats { grid-template-columns: 1fr; gap: 14px; max-width: none; } }

/* Hero mascot (the Mashhor "M" 3D character) */
.xp-hero__art { display: grid; place-items: center; position: relative; }
.xp-hero__art::before { content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(54,218,245,0.22), rgba(244,205,85,0.10) 45%, transparent 70%); filter: blur(6px); }
.xp-mascot { position: relative; z-index: 1; width: min(100%, 440px); height: auto;
  filter: drop-shadow(0 34px 70px rgba(2,8,20,0.6)) drop-shadow(0 0 40px rgba(54,218,245,0.18));
  animation: xp-float 6.5s var(--xp-ease) infinite; will-change: transform; }
@keyframes xp-float { 0%,100% { transform: translateY(0) rotate(-0.5deg); } 50% { transform: translateY(-18px) rotate(0.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .xp-mascot, .xp-eco__hub, .xp-eco__hub::before, .xp-eco__hub::after,
  .xp-work__media::before, .xp-work__media::after { animation: none !important; }
}
@media (max-width: 900px) { .xp-hero__art { margin-top: 6px; } .xp-mascot { width: min(58%, 260px); } .xp-hero__art::before { width: 60%; } }
/* smaller mascot crowning the final CTA */
.xp-mascot--final { display: block; width: min(42%, 190px); margin: 0 auto 10px; animation-duration: 7.5s; }

/* ---- SCENE 2 · Growth ecosystem (pinned, scroll-scrubbed) --------------- */
.xp-eco { position: relative; }
.xp-eco__pin { position: sticky; inset-block-start: 0; height: 100svh; display: grid; place-items: center; overflow: clip; }
.xp-eco__stage { position: relative; width: min(100% - 44px, var(--xp-max)); height: 100%; display: grid; place-items: center; }
.xp-eco__svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; }
.xp-eco__hub { position: relative; z-index: 2; width: clamp(120px, 16vw, 190px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center; font-family: 'Syne',sans-serif; font-weight: 800;
  background: radial-gradient(circle at 40% 35%, rgba(244,205,85,0.32), rgba(4,17,33,0.5) 70%);
  border: 1px solid rgba(244,205,85,0.4); box-shadow: 0 0 70px rgba(244,205,85,0.25), inset 0 0 44px rgba(54,218,245,0.16);
  animation: xp-core-pulse 4.5s var(--xp-ease) infinite; transform-style: preserve-3d; }
/* two tilted orbit rings give the flat hub a dimensional, spinning-core feel */
.xp-eco__hub::before, .xp-eco__hub::after { content: ""; position: absolute; inset: -16%; border-radius: 50%;
  border: 1px solid rgba(54,218,245,0.28); }
.xp-eco__hub::before { transform: rotateX(72deg); animation: xp-core-spin 9s linear infinite; }
.xp-eco__hub::after { inset: -30%; border-color: rgba(244,205,85,0.22); transform: rotateX(72deg) rotateZ(60deg); animation: xp-core-spin 14s linear infinite reverse; }
@keyframes xp-core-pulse { 0%,100% { box-shadow: 0 0 70px rgba(244,205,85,0.25), inset 0 0 44px rgba(54,218,245,0.16); } 50% { box-shadow: 0 0 100px rgba(244,205,85,0.4), inset 0 0 60px rgba(54,218,245,0.24); } }
@keyframes xp-core-spin { to { transform: rotateX(72deg) rotateZ(360deg); } }
.xp-eco__hub b { font-size: 1.05rem; color: var(--xp-gold); }
.xp-eco__hub small { display: block; font-size: 0.66rem; color: var(--xp-muted); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 4px; }
.xp-node { position: absolute; z-index: 3; width: max(96px, 8vw); transform: translate(-50%, -50%);
  inset-block-start: var(--y); inset-inline-start: var(--x); text-align: center;
  opacity: 0.28; transition: opacity 0.5s var(--xp-ease), transform 0.5s var(--xp-ease); }
.xp-node__dot { width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--xp-panel); border: 1px solid var(--xp-panel-brd); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.xp-node__t { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.xp-node.is-active { opacity: 1; }
.xp-node.is-active .xp-node__dot { border-color: var(--xp-cyan); box-shadow: 0 0 26px rgba(54,218,245,0.4); background: rgba(54,218,245,0.08); }
.xp-eco__caption { position: absolute; inset-block-end: 5vh; inset-inline: 0; text-align: center; z-index: 4; padding: 20px 20px 12px;
  background: radial-gradient(ellipse 70% 100% at 50% 100%, rgba(4,17,33,0.92) 0%, rgba(4,17,33,0.6) 55%, rgba(4,17,33,0) 100%); }
.xp-eco__caption h3 { font-family: 'Syne','Tajawal',sans-serif; font-size: clamp(1.3rem, 3vw, 2rem); margin: 0 0 6px; min-height: 1.2em; }
.xp-eco__caption p { color: var(--xp-muted); margin: 0 auto; max-width: 52ch; min-height: 2.6em; }
.xp-eco__caption a { color: var(--xp-cyan); font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; }
.xp-eco__caption a:hover, .xp-eco__caption a:focus-visible { border-color: var(--xp-cyan); }

/* ---- SCENE 3 · Business impact (editorial marquee) ---------------------- */
.xp-impact { padding-block: clamp(90px, 14vh, 200px); overflow: clip; }
.xp-impact__intro { max-width: 22ch; }
/* Each phrase flips up in 3D as it scrolls into view (staggered by the JS). */
.xp-impact__line { font-family: 'Syne','Tajawal',sans-serif; font-weight: 800; font-size: clamp(1.5rem, 3.6vw, 2.9rem); line-height: 1.2;
  white-space: normal; text-wrap: balance; opacity: 0; will-change: transform, opacity;
  transform: perspective(760px) rotateX(-52deg) translateY(26px); transform-origin: center bottom;
  transition: opacity 0.7s var(--xp-ease), transform 0.7s var(--xp-ease); }
.xp-impact__line.is-lit { opacity: 1; transform: perspective(760px) rotateX(0deg) translateY(0); }
.xp-impact__track { display: flex; justify-content: center; gap: 0.6em; margin-block: 6px; perspective: 900px; }

/* ---- SCENE 4 · AI engine (scroll pipeline) ------------------------------ */
.xp-ai { position: relative; }
.xp-ai__pin { position: sticky; inset-block-start: 0; min-height: 100svh; display: grid; align-content: center; padding-block: 80px; }
.xp-ai__pipe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 40px; align-items: stretch; }
.xp-ai__step { background: var(--xp-panel); border: 1px solid var(--xp-panel-brd); border-radius: 14px; padding: 18px 14px;
  opacity: 0.3; transform: translateY(14px); transition: all 0.5s var(--xp-ease); text-align: center; }
.xp-ai__step.is-on { opacity: 1; transform: none; border-color: rgba(54,218,245,0.5); box-shadow: 0 0 24px rgba(54,218,245,0.16); }
.xp-ai__step .ic { font-size: 1.5rem; } .xp-ai__step b { display: block; font-size: 0.82rem; margin-top: 8px; }
.xp-ai__out { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
.xp-ai__out span { font-size: 0.82rem; padding: 8px 14px; border-radius: 999px; background: rgba(93,230,177,0.08); border: 1px solid rgba(93,230,177,0.28); opacity: 0.35; transition: opacity 0.5s; }
.xp-ai__out span.is-on { opacity: 1; }
@media (max-width: 760px) { .xp-ai__pipe { grid-template-columns: repeat(2, 1fr); } }

/* ---- SCENE 5 · Influencer network --------------------------------------- */
.xp-net { padding-block: clamp(90px, 12vh, 180px); }
.xp-net__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.xp-net__viz { position: relative; aspect-ratio: 1; }
.xp-net__viz svg { width: 100%; height: 100%; overflow: visible; }
.xp-net__chip { position: absolute; transform: translate(-50%,-50%); background: var(--xp-panel); border: 1px solid var(--xp-panel-brd);
  border-radius: 999px; padding: 7px 14px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (max-width: 860px) { .xp-net__grid { grid-template-columns: 1fr; } }

/* ---- SCENE 6 · Selected work (cinematic) -------------------------------- */
.xp-work { position: relative; }
.xp-work__item { position: relative; min-height: 82svh; display: grid; align-items: center; }
.xp-work__media { position: sticky; inset-block-start: 14vh; height: 62svh; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--xp-panel-brd);
  background: linear-gradient(125deg, #0a2444, #071a33 55%, #0a2a3a); }
/* living surface: a drifting dot grid + roving brand light, so the cover is never a flat solid */
.xp-work__media::before { content: ""; position: absolute; inset: -20%; z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.22) 1px, transparent 1.4px); background-size: 30px 30px; opacity: 0.14;
  animation: xp-work-drift 22s linear infinite; }
@keyframes xp-work-drift { to { transform: translate(30px, 30px); } }
.xp-work__media::after { content: ""; position: absolute; inset: 0; z-index: 0; animation: xp-work-glow 12s var(--xp-ease) infinite alternate;
  background: radial-gradient(circle at 30% 35%, rgba(244,205,85,0.16), transparent 55%),
              radial-gradient(circle at 72% 60%, rgba(54,218,245,0.14), transparent 55%); }
@keyframes xp-work-glow { from { opacity: 0.55; transform: translateX(-4%); } to { opacity: 1; transform: translateX(4%); } }
.xp-work__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s var(--xp-ease); }
.xp-work__item.is-in .xp-work__media img { transform: scale(1); }
/* cinematic entry: the stage opens from a slim band, caption slides up after */
.xp-work__media { clip-path: inset(14% 0 14% 0 round 22px); opacity: 0.55; transform: translateY(28px);
  transition: clip-path 1.05s var(--xp-ease), opacity 0.9s var(--xp-ease), transform 1.05s var(--xp-ease); }
.xp-work__item.is-in .xp-work__media { clip-path: inset(0 0 0 0 round 22px); opacity: 1; transform: none; }
.xp-work__cap { position: absolute; inset-block-end: 0; inset-inline: 0; padding: 30px; z-index: 2;
  background: linear-gradient(0deg, rgba(2,8,20,0.9), rgba(2,8,20,0));
  transform: translateY(24px); opacity: 0; transition: transform 0.8s var(--xp-ease) 0.25s, opacity 0.8s var(--xp-ease) 0.25s; }
.xp-work__item.is-in .xp-work__cap { transform: none; opacity: 1; }
.xp-work__cap .cat { color: var(--xp-cyan); font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; }
.xp-work__cap h3 { font-family: 'Syne',sans-serif; font-size: clamp(1.4rem,3.4vw,2.4rem); margin: 6px 0; }

/* ---- SCENE 7 · Idea to growth pathway ----------------------------------- */
.xp-path { padding-block: clamp(90px, 12vh, 180px); }
.xp-path__track { position: relative; margin-top: 50px; }
.xp-path__svg { width: 100%; height: 120px; overflow: visible; }
.xp-path__steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
.xp-path__step { text-align: center; opacity: 0.35; transition: opacity 0.5s var(--xp-ease); }
.xp-path__step.is-on { opacity: 1; }
.xp-path__step .n { font-family: 'Syne',sans-serif; color: var(--xp-gold); font-size: 0.8rem; }
.xp-path__step b { display: block; margin-top: 4px; }
.xp-path__step small { color: var(--xp-muted); font-size: 0.78rem; }
@media (max-width: 760px) { .xp-path__steps { grid-template-columns: repeat(2,1fr); } }

/* ---- SCENE 8 · Trust ----------------------------------------------------- */
.xp-trust { padding-block: clamp(80px, 10vh, 150px); }
.xp-trust__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 36px; }
.xp-trust__stats div { background: var(--xp-panel); border: 1px solid var(--xp-panel-brd); border-radius: 16px; padding: 24px 18px; text-align: center; }
.xp-trust__stats strong { display: block; font-family: 'Syne',sans-serif; font-size: clamp(1.6rem, 4vw, 2.6rem); color: var(--xp-gold); }
.xp-trust__stats span { color: var(--xp-muted); font-size: 0.86rem; }
.xp-trust__logos { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; margin-top: 34px; opacity: 0.85; }
/* height:30px must beat ui-polish.css `img:not([width])… { height:auto }` (higher
 * specificity), so !important + max-height are required here. */
.xp-trust__logos img { height: 34px !important; max-height: 34px; width: auto !important; max-width: 150px;
  filter: grayscale(1) brightness(1.6); opacity: 0.7; object-fit: contain; }
@media (max-width: 760px) { .xp-trust__stats { grid-template-columns: repeat(2,1fr); } }

/* ---- SCENE 9 · Final conversion ----------------------------------------- */
.xp-final { position: relative; min-height: 92svh; display: grid; place-items: center; text-align: center; padding-block: 100px; overflow: clip; }
/* width/height:100% are required: .xp-final is a `place-items:center` grid, which
   would otherwise shrink this absolutely-positioned canvas to its default 300×150
   and centre it (tiny network on desktop; invisible/"no animation" on mobile). */
.xp-final__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.xp-final__inner { position: relative; z-index: 2; }
.xp-final h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); }
.xp-botblend { position: absolute; inset-block-end: 0; inset-inline: 0; height: 200px; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, rgba(2,8,20,0.9), rgba(2,8,20,0)); }

/* ---- Reveal primitive (IO-driven) --------------------------------------- */
.xp-rise { opacity: 0; transform: translateY(28px); filter: blur(7px); will-change: transform, filter;
  transition: opacity 0.9s var(--xp-ease), transform 0.9s var(--xp-ease), filter 0.9s var(--xp-ease); }
.xp-rise.is-in { opacity: 1; transform: none; filter: blur(0); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .xp-hero__grid { grid-template-columns: 1fr; }
  .xp-node { width: 78px; }
  .xp-node__dot { width: 44px; height: 44px; font-size: 1.2rem; }
}

/* ---- Reduced motion: full, calm editorial experience -------------------- */
@media (prefers-reduced-motion: reduce) {
  .xp-core-canvas, .xp-final__canvas { display: none; }
  .xp-eco__pin, .xp-ai__pin { position: static; height: auto; min-height: 0; }
  .xp-work__media { position: static; height: auto; clip-path: none !important; opacity: 1 !important; transform: none !important; }
  .xp-work__cap { opacity: 1 !important; transform: none !important; }
  .xp-node, .xp-ai__step, .xp-ai__out span, .xp-path__step, .xp-impact__line { opacity: 1 !important; transform: none !important; }
  .xp-rise { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
  .xp-scrollcue span::after { animation: none; }
  .xp-mascot { animation: none; }
  .xp-impact__track { flex-wrap: wrap; }
  .xp-impact__line { white-space: normal; }
}
.xp-reduced .xp-core-canvas, .xp-reduced .xp-final__canvas { display: none; }
.xp-reduced .xp-eco__pin, .xp-reduced .xp-ai__pin { position: static; height: auto; min-height: 0; }
.xp-reduced .xp-work__media { position: static; height: auto; clip-path: none; opacity: 1; transform: none; }
.xp-reduced .xp-work__cap { opacity: 1; transform: none; }
.xp-reduced .xp-node, .xp-reduced .xp-ai__step, .xp-reduced .xp-ai__out span, .xp-reduced .xp-path__step, .xp-reduced .xp-impact__line { opacity: 1 !important; transform: none !important; }
.xp-reduced .xp-rise { opacity: 1; transform: none; filter: none; }

/* ============================================================================
 * 3D STORY (POC) — Mashhor Growth Core narrative. Progressive enhancement over
 * the accessible editorial default below. Activated by JS adding `.is-3d`.
 * ==========================================================================*/
.xp3d { position: relative; }

/* Default (no-WebGL / reduced-motion / mobile-lite): clean editorial sequence. */
.xp3d__stage { position: relative; }
.xp3d__canvas { display: none; }
.xp3d__chapter { position: relative; z-index: 2; min-height: 62vh; display: grid; align-content: center;
  padding-block: 40px; }
.xp3d__chapter .xp-wrap { width: min(100% - 44px, 760px); }
.xp3d__num { font-family: 'Syne',sans-serif; color: var(--xp-gold); font-size: 0.8rem; letter-spacing: 0.2em; }
.xp3d__chapter h2 { font-family: 'Syne','Tajawal',sans-serif; font-weight: 800; line-height: 1.06;
  font-size: clamp(1.9rem, 4.6vw, 3.3rem); margin: 10px 0 14px; text-wrap: balance; }
.xp3d__chapter p { color: var(--xp-muted); font-size: clamp(1rem,1.5vw,1.18rem); line-height: 1.8; max-width: 54ch; }
/* Static fallback visual per chapter (shown only when 3D is NOT active) */
.xp3d__fallback { margin-top: 26px; height: 220px; border-radius: 20px; border: 1px solid var(--xp-panel-brd);
  background:
    radial-gradient(circle at 30% 40%, rgba(244,205,85,0.18), transparent 55%),
    radial-gradient(circle at 72% 62%, rgba(54,218,245,0.16), transparent 55%),
    linear-gradient(135deg, #0a2444, #071a33);
  position: relative; overflow: hidden; }
.xp3d__fallback::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.25) 1px, transparent 1.4px); background-size: 26px 26px; opacity: 0.25; }

/* ---- Activated 3D mode -------------------------------------------------- */
/* canvas is ABSOLUTE inside a STICKY rail (scoped to the story region) — avoids
 * position:fixed stacking-context pitfalls and keeps WebGL off the header. */
.xp3d.is-3d .xp3d__stage { height: 1040vh; position: relative; }  /* scroll runway for the 10 chapters */
.xp3d.is-3d .xp3d__rail { position: sticky; inset-block-start: 0; height: 100svh; overflow: hidden; z-index: 1; }
.xp3d.is-3d .xp3d__canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s var(--xp-ease); }
.xp3d.is-3d.is-live .xp3d__canvas { opacity: 1; }
.xp3d.is-3d .xp3d__chapter { position: absolute; inset: 0; min-height: 0; display: grid; align-content: center;
  z-index: 2; opacity: 0; transform: translateY(30px); transition: opacity 0.5s var(--xp-ease), transform 0.5s var(--xp-ease);
  pointer-events: none; }
.xp3d.is-3d .xp3d__chapter.is-active { opacity: 1; transform: none; pointer-events: auto; }
.xp3d.is-3d .xp3d__fallback { display: none; }
.xp3d.is-3d .xp3d__chapter h2 { text-shadow: 0 2px 30px rgba(2,8,20,0.8); }
.xp3d.is-3d .xp3d__chapter p { text-shadow: 0 1px 20px rgba(2,8,20,0.9); }

/* the hero/next real sections sit above the fixed canvas */
.xp3d ~ .xp-scene, .xp-hero { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .xp3d.is-3d .xp3d__canvas { display: none; }
  .xp3d.is-3d .xp3d__stage { height: auto; }
  .xp3d.is-3d .xp3d__rail { position: static; height: auto; }
  .xp3d.is-3d .xp3d__chapter { position: relative; opacity: 1; transform: none; min-height: 40vh; }
  .xp3d.is-3d .xp3d__fallback { display: block; }
}

/* ============================================================================
 * v375 additions — numbered AI, terminal Why-it-matters, glitch Selected Work,
 * new final figure. All decorative motion is disabled under reduced-motion.
 * ==========================================================================*/
.xp-ai__step { position: relative; }
.xp-ai__n { position: absolute; inset-block-start: 8px; inset-inline-start: 10px; font-family: 'Syne',sans-serif;
  font-size: 0.72rem; font-weight: 800; color: var(--xp-gold); letter-spacing: 0.05em; opacity: 0.9; }

/* Terminal */
.xp-term { max-width: 820px; margin-top: 26px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(93,230,177,0.25);
  background: rgba(2,10,20,0.85); box-shadow: 0 30px 70px rgba(2,8,20,0.6); }
.xp-term__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.06); }
.xp-term__bar span { width: 11px; height: 11px; border-radius: 50%; }
.xp-term__bar span:nth-child(1){ background:#ff5f56 } .xp-term__bar span:nth-child(2){ background:#ffbd2e } .xp-term__bar span:nth-child(3){ background:#27c93f }
.xp-term__bar b { margin-inline-start: 10px; font-family: ui-monospace,'JetBrains Mono',monospace; font-size: 0.74rem; color: var(--xp-muted); font-weight: 500; }
.xp-term__body { margin: 0; padding: 22px 20px; min-height: 320px; font-family: ui-monospace,'JetBrains Mono','Courier New',monospace;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem); line-height: 1.95; color: #cfe8da; white-space: pre-wrap; word-break: break-word; text-align: left; }
.xp-term__body .cmd { color: var(--xp-cyan); } .xp-term__body .ok { color: var(--xp-mint); } .xp-term__body .out { color: var(--xp-gold-soft); }
.xp-term__cursor { display: inline-block; width: 9px; height: 1.1em; vertical-align: -0.18em; background: var(--xp-mint); margin-inline-start: 3px; animation: xp-blink 1s steps(1) infinite; }
@keyframes xp-blink { 50% { opacity: 0; } }

/* Selected Work — single glitch card */
.xp-work__glitch { position: relative; height: 60svh; min-height: 380px; border-radius: 22px; overflow: hidden; display: grid; align-items: end;
  border: 1px solid var(--xp-panel-brd); background: linear-gradient(135deg, #0a2444, #071a33 60%, #0a2a3a); }
.xp-work__gnoise { position: absolute; inset: 0; z-index: 0; opacity: 0.55;
  background: radial-gradient(circle at 30% 30%, rgba(244,205,85,0.18), transparent 55%), radial-gradient(circle at 70% 65%, rgba(54,218,245,0.18), transparent 55%);
  animation: xp-work-glow 10s var(--xp-ease) infinite alternate; }
.xp-work__gcap { position: relative; z-index: 2; padding: 34px; }
.xp-work__gcat { display: inline-block; color: var(--xp-cyan); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 700; }
.xp-work__gtitle { font-family: 'Syne','Tajawal',sans-serif; font-weight: 800; font-size: clamp(1.6rem, 4.4vw, 3.2rem); margin: 8px 0 0; line-height: 1.08; color: #fff; }
.xp-work__gdots { display: flex; gap: 7px; margin-top: 18px; }
.xp-work__gdots i { width: 22px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.18); transition: background 0.4s; }
.xp-work__gdots i.on { background: var(--xp-gold); }
[data-glitch].is-glitch { animation: xp-glitch 0.42s steps(2) 1; }
@keyframes xp-glitch {
  20% { text-shadow: -3px 0 var(--xp-cyan), 3px 0 #ff4d6d; transform: translateX(-2px); }
  40% { text-shadow: 3px 0 var(--xp-cyan), -3px 0 #ff4d6d; transform: translateX(2px); }
  60% { text-shadow: -2px 0 var(--xp-mint), 2px 0 var(--xp-gold); transform: translateX(-1px); }
  100% { text-shadow: 0 0 0 transparent; transform: translateX(0); }
}

/* Final figure (new model, distinct entrance + sway) */
.xp-figure--final { display: block; width: min(40%, 210px); height: auto; margin: 0 auto 12px;
  filter: drop-shadow(0 34px 70px rgba(2,8,20,0.6)) drop-shadow(0 0 40px rgba(54,218,245,0.18));
  transform-origin: bottom center; animation: xp-figure-in 1.1s var(--xp-ease) both; }
.xp-figure--final.is-in { animation: xp-figure-in 1.1s var(--xp-ease) both, xp-figure-sway 8s var(--xp-ease) 1.1s infinite; }
@keyframes xp-figure-in { from { opacity: 0; transform: translateY(40px) rotateY(-28deg) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes xp-figure-sway { 0%,100% { transform: rotateY(-6deg) translateY(0); } 50% { transform: rotateY(6deg) translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .xp-term__cursor, .xp-work__gnoise, .xp-figure--final { animation: none !important; }
  [data-glitch].is-glitch { animation: none !important; }
}

/* ============================================================================
 * v376 — Mobile polish (Sprint 1). The elaborate scroll story was built for
 * desktop; on phones it must read as a tight, intentional editorial page.
 * Fixes: (1) hero mascot leads at a confident size; (2) the 10 story chapters
 * no longer each reserve 62vh (which left huge empty voids); (3) terminal /
 * glitch card / final CTA fit the viewport. Content-only; nothing removed.
 * ==========================================================================*/
@media (max-width: 767px) {
  /* Hero: mascot becomes the lead visual, centered above the copy */
  .xp-hero__grid { gap: 16px; }
  .xp-hero__art { order: -1; margin: 2px auto 4px; }
  .xp-mascot { width: min(72%, 300px); }
  .xp-hero__art::before { width: 64%; }
  .xp-hero__stats { margin-top: 26px; }

  /* 3D story → clean stacked editorial cards on mobile (no 3D rail, no empty voids). */
  .xp3d__stage { height: auto !important; }
  .xp3d__rail { position: static !important; height: auto !important; overflow: visible !important; }
  .xp3d__canvas { display: none !important; }
  .xp3d__chapter { position: relative !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; min-height: 0; padding: 14px 0; }
  .xp3d__chapter .xp-wrap { width: min(100% - 32px, 640px); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 22px 20px; }
  .xp3d__chapter h2 { font-size: clamp(1.5rem, 6.5vw, 2rem); margin: 6px 0 12px; }
  .xp3d__chapter p { font-size: 1rem; line-height: 1.75; }
  .xp3d__fallback { display: none !important; }  /* remove the empty gradient voids on mobile */

  /* Terminal + glitch card fit small screens */
  .xp-term { margin-top: 20px; }
  .xp-term__body { min-height: 220px; padding: 18px 16px; font-size: 0.86rem; line-height: 1.85; }
  .xp-work__glitch { height: auto; min-height: 300px; }
  .xp-work__gcap { padding: 24px; }

  /* Closing CTA row wraps cleanly */
  .xp-final .xp-ctarow { gap: 10px; }
}
