/* =========================================================
   Triasols - Motion, interactivity & polish
   Loaded after style.css
   ========================================================= */

/* ---------- Film grain for depth ---------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: radial-gradient(ellipse at 50% 40%, #1a1030, var(--bg) 70%);
  transition: opacity .8s var(--ease), visibility .8s;
}
.no-js .preloader, html:not(.js) .preloader { display: none; }
.loaded .preloader { opacity: 0; visibility: hidden; }
.pl-logo { width: min(260px, 64vw); position: relative; }
.pl-logo img { width: 100%; height: auto; clip-path: inset(0 100% 0 0); filter: blur(8px) drop-shadow(0 0 24px rgba(166, 76, 166, .6)); animation: plWipe 1.2s var(--ease) .1s forwards; }
@keyframes plWipe { to { clip-path: inset(0 0 0 0); filter: blur(0) drop-shadow(0 0 18px rgba(166, 76, 166, .45)); } }
@keyframes fadeIn { to { opacity: 1; } }
.pl-bar { width: 140px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pl-bar span { display: block; height: 100%; width: 100%; background: var(--grad-btn); transform-origin: right; transform: scaleX(0); animation: plBar 1.3s var(--ease) forwards; }
@keyframes plBar { to { transform: scaleX(1); } }

/* Hero waits for the preloader */
.js body:not(.ready) .hero .reveal { opacity: 0 !important; translate: 0 30px !important; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 101; pointer-events: none;
  background: var(--grad-btn); transform-origin: right; transform: scaleX(var(--sp, 0));
  box-shadow: 0 0 12px rgba(166, 76, 166, .8);
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 998; pointer-events: none; opacity: 0; transition: opacity .3s; }
.has-cursor .cursor-dot, .has-cursor .cursor-ring { opacity: 1; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 1px solid rgba(201, 176, 220, .55);
  display: grid; place-items: center; transition: opacity .3s, width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
}
.cursor-ring span { font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.cursor-hover .cursor-ring { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(166, 76, 166, .12); border-color: rgba(201, 176, 220, .8); }
.cursor-label .cursor-ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--grad-btn); border-color: transparent; }
.cursor-label .cursor-ring span { opacity: 1; }
.cursor-label .cursor-dot { opacity: 0; }
.cursor-down .cursor-ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }

/* ---------- Header hide on scroll ---------- */
.header { transition: background .4s, border-color .4s, transform .5s var(--ease); }
.header.hide { transform: translateY(-100%); }

/* ---------- Eyebrow numbering ---------- */
.eyebrow b { font-family: var(--font-en); font-weight: 600; color: var(--text); opacity: .55; padding-inline-end: 10px; margin-inline-end: 2px; border-inline-end: 1px solid var(--border-strong); line-height: 1; }
.eyebrow::before { order: -1; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #3ee08f; animation: ping 1.8s ease-out infinite; }
@keyframes ping { to { transform: scale(2.8); opacity: 0; } }
.hero .eyebrow::before { display: none; }

/* ---------- Split headings ---------- */
/* each word slides up inside its own mask; the mask leaves room for Arabic marks above and below the line */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .4em; margin-block: -.4em; }
.split .w > .grad-text, .hero-words > span { margin-block: -.18em; }
.split .w > span { display: inline-block; translate: 0 110%; transition: translate 1s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.split.in .w > span { translate: 0 0; }
.no-motion .split .w > span { translate: 0 0; }

/* ---------- Card glow border + tilt ---------- */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(201, 176, 220, .85), rgba(166, 76, 166, .4) 30%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover::after { opacity: 1; }
[data-tilt] { transform-style: preserve-3d; will-change: transform; }
[data-tilt].tilting { transition: border-color .4s, background .4s, transform .12s linear; }
.card .icon-box { transition: transform .5s var(--ease), box-shadow .5s; }
.card:hover .icon-box { transform: translateZ(30px) scale(1.06) rotate(-6deg); box-shadow: 0 10px 30px -10px rgba(166, 76, 166, .7); }

/* ---------- Magnetic buttons + shine ---------- */
[data-magnetic] { transition: translate .35s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease), background .3s, border-color .3s; }
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(120%); transition: transform .8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(-120%); }

/* ---------- Hero extras ---------- */
.hero-spot { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 40%), rgba(123, 79, 224, .14), transparent 60%); }

@keyframes chipIn { to { opacity: 1; scale: 1; } }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 1.5px solid var(--border-strong); border-radius: 14px; display: flex; justify-content: center; padding-top: 8px; z-index: 2; }
.scroll-hint span { width: 3px; height: 8px; border-radius: 2px; background: var(--lavender); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; translate: 0 -4px; } 40% { opacity: 1; } 100% { opacity: 0; translate: 0 14px; } }

/* ---------- Marquee rows ---------- */
.marquee-wrap { display: grid; gap: 18px; padding-block: 30px; }
.marquee-track { align-items: center; gap: 36px; }
.marquee-track i { font-style: normal; color: var(--accent); font-size: 14px; opacity: .7; }
.marquee-track .ar { font-family: var(--font-ar); font-size: 18px; color: var(--muted); direction: rtl; }
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 50s; }

/* ---------- Bento visuals ---------- */
.bento .featured { flex-direction: row; gap: 28px; align-items: stretch; }
.featured-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mini-dash, .mini-chat { flex: 0 0 42%; align-self: center; border-radius: 14px; border: 1px solid var(--border-strong); background: rgba(10, 8, 20, .6); padding: 16px; direction: ltr; }
.md-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.md-head i { width: 34px; height: 7px; border-radius: 4px; background: var(--surface-2); }
.md-head b { margin-left: auto; font-size: 12px; color: #6ee7a8; font-weight: 600; }
.md-bars { display: flex; align-items: flex-end; gap: 7px; height: 92px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.md-bars i { flex: 1; height: var(--h); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #a64ca6, rgba(123, 79, 224, .35)); transform-origin: bottom; animation: barGrow 3.6s var(--ease) infinite; }
.md-bars i:nth-child(2) { animation-delay: .15s; } .md-bars i:nth-child(3) { animation-delay: .3s; } .md-bars i:nth-child(4) { animation-delay: .45s; }
.md-bars i:nth-child(5) { animation-delay: .6s; } .md-bars i:nth-child(6) { animation-delay: .75s; } .md-bars i:nth-child(7) { animation-delay: .9s; }
@keyframes barGrow { 0%, 100% { transform: scaleY(.35); } 45%, 70% { transform: scaleY(1); } }
.md-rows { display: grid; gap: 7px; margin-top: 12px; }
.md-rows i { height: 7px; border-radius: 4px; background: var(--surface-2); }
.md-rows i:nth-child(1) { width: 85%; } .md-rows i:nth-child(2) { width: 60%; } .md-rows i:nth-child(3) { width: 72%; }

.mini-chat { display: flex; flex-direction: column; gap: 10px; min-height: 150px; justify-content: center; direction: rtl; }
.bubble { max-width: 88%; padding: 9px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6; opacity: 0; animation: chatLoop 8s infinite; }
.bubble.me { align-self: flex-start; background: var(--grad-btn); border-end-start-radius: 4px; }
.bubble.bot { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--border); border-end-end-radius: 4px; }
.bubble.typing { display: flex; gap: 4px; padding: 12px 14px; animation-name: chatTyping; position: absolute; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--lavender); animation: dot 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
.mini-chat { position: relative; }
.bubble.answer { animation-name: chatAnswer; }
@keyframes chatLoop { 0%, 4% { opacity: 0; translate: 0 8px; } 8%, 88% { opacity: 1; translate: 0 0; } 94%, 100% { opacity: 0; } }
@keyframes chatTyping { 0%, 14% { opacity: 0; } 18%, 34% { opacity: 1; } 38%, 100% { opacity: 0; } }
@keyframes chatAnswer { 0%, 36% { opacity: 0; translate: 0 8px; } 42%, 88% { opacity: 1; translate: 0 0; } 94%, 100% { opacity: 0; } }
@keyframes dot { 50% { translate: 0 -4px; opacity: .5; } }
.bubble.typing { inset-inline-end: 16px; bottom: 16px; }

/* ---------- Builder ---------- */
.builder { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: stretch; }
.builder-tabs { display: grid; gap: 10px; align-content: start; }
.builder-tabs button {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; text-align: start;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 15px;
  transition: color .3s, background .3s, border-color .3s, translate .4s var(--ease); position: relative; overflow: hidden;
}
.builder-tabs button .icon { width: 20px; height: 20px; }
.builder-tabs button:hover { color: var(--text); border-color: var(--border-strong); translate: -4px 0; }
.builder-tabs button[aria-selected="true"] { color: #fff; border-color: rgba(166, 76, 166, .6); background: linear-gradient(120deg, rgba(123, 79, 224, .3), rgba(166, 76, 166, .18)); translate: -8px 0; }
.builder-tabs button[aria-selected="true"]::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--grad-btn); }
.builder-panel { padding: clamp(28px, 4vw, 44px); min-height: 100%; }
.builder-panel:hover { transform: none; }
.builder-bg { position: absolute; width: 260px; height: 260px; inset-inline-end: -40px; bottom: -50px; color: rgba(201, 176, 220, .07); stroke-width: .8; z-index: -1; }
.bp-inner { transition: opacity .35s var(--ease), translate .35s var(--ease); }
.bp-inner.swap { opacity: 0; translate: 0 14px; }
.bp-title { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.bp-desc { color: var(--muted); font-size: 16px; max-width: 560px; }
.bp-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-block: 26px; }
.bp-features li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.bp-features .icon { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: rgba(166, 76, 166, .2); color: var(--lavender); stroke-width: 2.4; }
.bp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.bp-meta div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.bp-meta .icon { grid-row: span 2; color: var(--accent); }
.bp-meta span { font-size: 12.5px; color: var(--muted); }
.bp-meta b { font-size: 16px; }
.bp-cta { margin-top: 26px; }

/* ---------- Industries arrow ---------- */
.industry .go { width: 18px; height: 18px; margin-inline-start: auto; color: var(--lavender); opacity: 0; translate: 8px 0; transition: opacity .3s, translate .4s var(--ease); }
.industry:hover .go { opacity: 1; translate: 0 0; }

/* ---------- Process progress line ---------- */
.process::before { display: none; }
.process-line { position: absolute; top: 34px; inset-inline: 10%; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.process-line span { display: block; height: 100%; background: var(--grad-btn); transform-origin: right; transform: scaleX(var(--p, 0)); box-shadow: 0 0 14px var(--accent); }
.step-num { transition: border-color .5s, box-shadow .5s, background .5s, color .5s, scale .5s var(--ease); }
.step.active .step-num { border-color: transparent; background: var(--grad-btn); box-shadow: 0 0 0 6px rgba(166, 76, 166, .15), 0 0 40px -6px var(--accent); scale: 1.06; }
.step h3, .step p { transition: color .5s; }
.step:not(.active) h3 { color: var(--muted); }

/* ---------- Stats shine + spotlight ---------- */
.stats-band::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(500px circle at var(--sx, 50%) var(--sy, 50%), rgba(201, 176, 220, .12), transparent 60%);
}
.stat-num { transition: -webkit-text-stroke-color .4s, color .4s; }
.stat:hover .stat-num { color: rgba(201, 176, 220, .15); }

/* ---------- Work hover ---------- */
.work-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(7, 6, 11, .6)); opacity: 0; transition: opacity .5s; }
.work-card:hover .work-thumb::after { opacity: 1; }

/* ---------- FAQ answer animation ---------- */
.faq details[open] .answer { animation: answerIn .5s var(--ease); }
@keyframes answerIn { from { opacity: 0; translate: 0 -8px; } }
.faq summary { transition: color .3s; }
.faq summary:hover { color: var(--lavender); }
.faq .answer p { margin: 0; }

/* ---------- CTA orbits + spotlight ---------- */
.cta-box::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(500px circle at var(--sx, 50%) var(--sy, 50%), rgba(201, 176, 220, .16), transparent 60%); }
.orbits { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; pointer-events: none; }
.orbit { position: absolute; border-radius: 50%; border: 1px dashed rgba(201, 176, 220, .14); animation: spin linear infinite; }
.orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--lavender); box-shadow: 0 0 16px var(--accent); }
.orbit.o1 { width: 360px; height: 360px; animation-duration: 18s; }
.orbit.o2 { width: 620px; height: 620px; animation-duration: 30s; animation-direction: reverse; }
.orbit.o2 i { background: var(--accent); width: 7px; height: 7px; }
.orbit.o3 { width: 900px; height: 900px; animation-duration: 46s; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Footer giant word ---------- */
.footer { position: relative; overflow: hidden; }
.footer-word { position: absolute; bottom: -3vw; inset-inline: 0; text-align: center; font-size: 18vw; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .05); pointer-events: none; }
.footer .container { position: relative; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; bottom: 24px; inset-inline-start: 24px; z-index: 90; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 15, 34, .85); backdrop-filter: blur(10px); border: 1px solid var(--border);
  opacity: 0; translate: 0 20px; pointer-events: none; transition: opacity .4s, translate .4s var(--ease), border-color .3s;
}
.to-top.show { opacity: 1; translate: 0 0; pointer-events: auto; }
.to-top:hover { border-color: var(--lavender); }
.to-top .icon { width: 20px; height: 20px; }
.to-top .ring { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.to-top .ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 138.2; stroke-dashoffset: calc(138.2 * (1 - var(--sp, 0))); stroke-linecap: round; }

/* ---------- Section rhythm: soft divider glow ---------- */
.section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0; width: min(600px, 80%); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 176, 220, .18), transparent);
}
#stats::before, #work::before, #testimonials::before, #faq::before { display: none; }
.builder-section { background: radial-gradient(ellipse at 50% 50%, rgba(91, 52, 176, .12), transparent 65%); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .builder { grid-template-columns: 1fr; }
  .builder-tabs { grid-template-columns: repeat(3, 1fr); }
  .builder-tabs button, .builder-tabs button:hover, .builder-tabs button[aria-selected="true"] { translate: none; justify-content: center; }
  .process-line { display: none; }
  .orbit.o3 { display: none; }
}
@media (max-width: 720px) {
  .bento .featured { flex-direction: column; }
  .mini-dash, .mini-chat { flex: none; width: 100%; }
  .builder-tabs { grid-template-columns: 1fr 1fr; }
  .builder-tabs button { padding: 12px; font-size: 13.5px; gap: 8px; }
  .bp-features, .bp-meta { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .to-top { bottom: 90px; inset-inline-start: auto; inset-inline-end: 28px; width: 46px; height: 46px; }
  .orbit.o2 { width: 480px; height: 480px; }
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal, .js body:not(.ready) .hero .reveal { opacity: 1 !important; translate: none !important; }
  .split .w > span { translate: 0 0; }
  .preloader { display: none; }
}
.pl-seen .preloader { display: none; }

/* ---------- Clients strip ---------- */
.clients { padding-block: 10px 90px; }
.clients-title { text-align: center; color: var(--faint); font-size: 14px; margin-bottom: 22px; }
.clients .marquee-track { animation-duration: 70s; }
.clients .marquee-track span { font-size: 20px; letter-spacing: .02em; }

/* =========================================================
   Hero - 3D motherboard + hologram
   ========================================================= */
.hero-mb { min-height: max(100svh, 700px); padding-bottom: 110px; background: #0a0714; }
.hero-3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hm-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(270deg, rgba(10, 7, 20, .9) 0%, rgba(10, 7, 20, .62) 34%, rgba(10, 7, 20, 0) 56%),
    linear-gradient(180deg, rgba(10, 7, 20, .5) 0%, transparent 20%, transparent 78%, var(--bg) 100%);
}
.hero-mb .hero-grid { grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.hero-mb .hero-content { align-self: center; max-width: 640px; }
.hero-mb h1 { font-size: clamp(32px, 3.9vw, 58px); line-height: 1.28; text-shadow: 0 6px 40px rgba(10, 7, 20, .7); }
.hm-line { display: block; }
.hero-mb .hero-lead { text-shadow: 0 2px 20px rgba(10, 7, 20, .9); }
.hero-mb .hero-trust { gap: 30px; max-width: 620px; }
.hero-mb .eyebrow { background: rgba(13, 10, 23, .6); backdrop-filter: blur(10px); }

/* rotating words */
.hero-words { display: grid; justify-items: start; padding-block: .06em; }
.hero-words > span {
  grid-area: 1 / 1; white-space: nowrap; opacity: 0; translate: 0 .45em; filter: blur(14px);
  transition: opacity .7s var(--ease), translate .8s var(--ease), filter .8s var(--ease);
}
.hero-words > span.on { opacity: 1; translate: 0 0; filter: blur(0); transition-delay: .25s; }
.hero-words > span.off { opacity: 0; translate: 0 -.45em; filter: blur(14px); }

/* stage column: HUD over the hologram */
.hero-stage { position: relative; min-height: 520px; user-select: none; -webkit-user-select: none; }
.hud-label { position: absolute; top: 4px; inset-inline-end: 0; display: flex; align-items: center; gap: 14px; pointer-events: none; }
.hud-idx { font-size: 44px; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--lavender); }
.hud-label small { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: .14em; }
.hud-label strong { font-size: 15px; font-weight: 600; }
.hud-tabs { position: absolute; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hud-tab { position: relative; padding: 14px 6px 4px; text-align: start; font-size: 13.5px; color: var(--muted); display: flex; align-items: baseline; gap: 8px; transition: color .3s; }
.hud-tab span { font-size: 11px; color: var(--faint); transition: color .3s; }
.hud-tab::before, .hud-tab::after { content: ""; position: absolute; top: 0; inset-inline: 0; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
.hud-tab::after { background: var(--grad-btn); transform: scaleX(0); transform-origin: right; box-shadow: 0 0 10px var(--accent); }
.hud-tab:hover { color: var(--text); }
.hud-tab[aria-selected="true"] { color: #fff; }
.hud-tab[aria-selected="true"] span { color: var(--lavender); }
.hud-tab[aria-selected="true"]::after { transform: scaleX(1); }
.hud-tab.run::after { animation: hudRun 7s linear forwards; }
@keyframes hudRun { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* bottom telemetry bar */
.hm-bar { position: absolute; bottom: 0; inset-inline: 0; z-index: 2; border-top: 1px solid rgba(201, 176, 220, .12); background: linear-gradient(180deg, rgba(10, 7, 20, .2), rgba(10, 7, 20, .75)); backdrop-filter: blur(6px); }
.hm-bar .container { display: flex; align-items: center; gap: 30px; height: 54px; font-size: 11.5px; letter-spacing: .14em; color: var(--faint); }
.hm-bar b { color: var(--lavender); font-weight: 500; font-variant-numeric: tabular-nums; }
.hm-status { display: inline-flex; align-items: center; gap: 8px; color: #8ee8b9; }
.hm-status i { width: 7px; height: 7px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 10px #3ee08f; animation: blink 1.6s steps(1) infinite; }
.hm-hint { font-family: var(--font-ar); letter-spacing: 0; font-size: 13px; color: var(--muted); margin-inline-start: auto; }
.hm-scroll { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.hm-scroll i { width: 1px; height: 22px; background: linear-gradient(var(--lavender), transparent); animation: wheel 1.8s var(--ease) infinite; }

/* fallback without WebGL */
.hero-mb.no-webgl { background: radial-gradient(circle at 28% 50%, rgba(123, 79, 224, .35), transparent 40%), #0a0714; }
.hero-mb.no-webgl .hero-stage { background: url("../img/logo-mark.webp") center 40% / 34% no-repeat; filter: drop-shadow(0 0 40px rgba(166, 76, 166, .7)); }
.no-webgl .hm-hint { display: none; }

@media (max-width: 1080px) {
  .hero-mb { padding-top: calc(var(--header-h) + 14px); align-items: flex-start; }
  .hero-mb .hero-grid { grid-template-columns: 1fr; gap: 0; }
  /* flatten the text block so the scene can sit between the buttons and the numbers */
  .hero-mb .hero-content { display: contents; }
  .hero-mb .eyebrow { order: 1; justify-self: start; }
  .hero-mb h1 { order: 2; }
  .hero-mb .hero-lead { order: 3; }
  .hero-mb .hero-cta { order: 4; }
  .hero-mb .hero-stage { order: 5; min-height: 0; height: min(96vw, 560px); margin-top: 4px; }
  .hero-mb .hero-trust { order: 6; margin-top: 18px; }
  /* light veil behind the text so the board stays visible, clear over the stage */
  .hm-shade { background: linear-gradient(180deg, rgba(10, 7, 20, .72) 0, rgba(10, 7, 20, .55) calc(var(--st, 50%) - 60px), rgba(10, 7, 20, 0) calc(var(--st, 50%) + 60px), rgba(10, 7, 20, 0) calc(100% - 200px), var(--bg) 100%); }
  .hm-bar .container > span:nth-child(2) { display: none; }
}
@media (max-width: 720px) {
  .hero-mb { padding-bottom: 70px; }
  .hero-mb h1 { font-size: clamp(30px, 8.4vw, 40px); margin-block: 16px 12px; }
  .hero-mb .hero-lead { font-size: 15px; line-height: 1.75; }
  .hero-mb .hero-cta { margin-top: 20px; gap: 10px; flex-wrap: nowrap; }
  .hero-mb .hero-cta .btn { padding: 12px 16px; font-size: 14px; flex: 1 1 auto; }
  .hero-mb .hero-cta .btn .icon { width: 16px; height: 16px; }
  .hero-mb .hero-stage { height: 104vw; }
  .hero-mb .hero-trust { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 10px; padding-top: 20px; }
  .hero-mb .hero-trust b { font-size: 21px; }
  .hero-mb .hero-trust div > span { font-size: 11.5px; }
  .hud-tab { font-size: 12px; padding-top: 12px; flex-direction: column; gap: 0; }
  .hm-hint, .hm-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-words > span { filter: none; }
}

/* =========================================================
   Floating background particles (js/particles.js)
   ========================================================= */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
