/* ==========================================================================
   VEGA CoreTech — Design 2 · Version D hero (index3.html)
   Big layered headline with a rotating service line, three 3D figures in
   light columns and floating 3D coins on a deep violet stage.
   Works with assets/js/version-d.js; without JS it shows a static headline.
   ========================================================================== */
.hd {
  --W: min(1080px, 94vw);
  --CW: min(var(--W), calc(100vw - 32px)); /* text block never wider than the screen */
  --gap: calc(var(--W) * .028);
  --hd-ease: cubic-bezier(.16, 1, .3, 1);
  --hd-spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding-top: clamp(108px, 6vw + 82px, 178px);
  text-align: center; color: #fff;
  background-color: #110D36;
  background:
    radial-gradient(70% 55% at 50% 80%, rgba(124, 92, 255, .34), transparent 70%),
    radial-gradient(45% 40% at 10% 16%, rgba(36, 83, 255, .16), transparent 70%),
    radial-gradient(40% 42% at 92% 28%, rgba(180, 118, 229, .14), transparent 70%),
    linear-gradient(180deg, #090824 0%, #110D36 42%, #1D1550 100%);
}

/* Background: light columns, arcs, circuit lines, stars, glow ------------- */
.hd__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hd__panels { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--W); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1.12fr 1fr; column-gap: var(--gap); }
.hd__panels i { background: linear-gradient(180deg, rgba(140, 120, 255, 0) 0%, rgba(140, 120, 255, .05) 42%, rgba(140, 120, 255, .1) 100%); transform-origin: 50% 100%; }
.hd__panels i:nth-child(2) { background: linear-gradient(180deg, rgba(150, 130, 255, 0) 0%, rgba(150, 130, 255, .08) 38%, rgba(150, 130, 255, .15) 100%); }
.hd__panels::before, .hd__panels::after { content: ""; position: absolute; top: 0; bottom: 0; width: calc(var(--W) * .2); background: linear-gradient(180deg, rgba(3, 2, 18, 0), rgba(3, 2, 18, .3)); }
.hd__panels::before { right: calc(100% + var(--gap)); }
.hd__panels::after { left: calc(100% + var(--gap)); }
.hd__glow { position: absolute; left: 50%; top: 30%; width: min(980px, 130vw); height: min(980px, 130vw); transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(124, 92, 255, .22), rgba(36, 83, 255, .08) 60%, transparent); }
.hd__stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.hd__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hd__arc { fill: none; stroke: rgba(167, 139, 250, .2); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.hd__arc--2 { stroke: rgba(111, 216, 255, .1); }
.hd__circuit path { fill: none; stroke: rgba(150, 140, 230, .22); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.hd__circuit circle { fill: #241C5E; stroke: rgba(150, 140, 230, .28); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hd__pulses path { fill: none; stroke: #6FD8FF; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: .14 1.2; stroke-dashoffset: .14; opacity: 0; }

/* Copy ------------------------------------------------------------------- */
.hd__copy { position: relative; z-index: 3; width: var(--CW); }
.hd__kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 clamp(14px, 1.6vw, 24px); font: 700 clamp(11px, .25vw + 10px, 13px)/1 "Mulish", var(--font-b); letter-spacing: .26em; text-transform: uppercase; color: rgba(214, 206, 255, .78); }
.hd__kicker::before, .hd__kicker::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .8)); }
.hd__kicker::after { transform: scaleX(-1); }
.hd__title { display: grid; justify-items: center; gap: clamp(4px, 1.1vw, 16px); margin: 0; font-family: "Mulish", var(--font-h); font-weight: 900; font-size: clamp(27px, 6.6vw, 96px); line-height: 1.12; letter-spacing: -.005em; }
.hd__l1 { position: relative; display: inline-flex; align-items: center; gap: .16em; }
.hd__l2 { display: grid; justify-items: center; }
.hd__l2 > .hd__ph { grid-area: 1 / 1; }
.hd__ph { position: relative; display: inline-grid; white-space: nowrap; }
.hd__s, .hd__f { grid-area: 1 / 1; position: relative; -webkit-perspective: 5em; perspective: 5em; }

/* Before the script builds the letters (or if it never runs) */
.hd__l1 > .hd__ph:not(.is-built) { color: #fff; }
.hd__l2 > .hd__ph:not(.is-built) { background: linear-gradient(90deg, #B47BFF 0%, #7C8CFF 50%, #3EC6FF 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hd__l2 > .hd__ph:not(.is-built):not(:first-child) { display: none; }
.js .hd__ph:not(.is-built) { visibility: hidden; -webkit-animation: hdShow 0s 2.5s forwards; animation: hdShow 0s 2.5s forwards; }
@-webkit-keyframes hdShow { to { visibility: visible; } }
@keyframes hdShow { to { visibility: visible; } }

/* The 3D "extrude": a dark outlined copy sits behind and pops out on entry */
.hd__s { color: #0C0A2C; -webkit-text-fill-color: #0C0A2C; -webkit-text-stroke: .022em rgba(170, 152, 255, .5); transform: translate3d(0, 0, 0); transition: transform .9s var(--hd-spring) .55s; }
.hd__l2 .hd__s { -webkit-text-stroke-color: rgba(124, 110, 255, .6); }
.hd__ph.is-on .hd__s { transform: translate3d(.06em, .06em, 0); }
.hd__ph.is-out .hd__s { transform: translate3d(0, 0, 0); transition: transform .25s ease 0s; }

/* Letters: each one carries its slice of the gradient */
.hd .c { display: inline-block; white-space: pre; transform-origin: 50% 85%; }
.hd__l1 .hd__f .c { background: linear-gradient(180deg, #FFFFFF 52%, #D9D3F7 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hd__l2 .hd__f .c { background-image: linear-gradient(90deg, #B47BFF 0%, #7C8CFF 50%, #3EC6FF 100%); background-repeat: no-repeat; background-size: var(--gw, 100%) 100%; background-position: var(--gx, 0) 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hd__ph.is-built .c { opacity: 0; transform: translate3d(0, .55em, 0) rotateX(-80deg); transition: transform 1s var(--hd-ease), opacity .55s ease; transition-delay: calc(var(--i) * 38ms); }
.hd__ph.is-on .c { opacity: 1; transform: none; }
.hd__ph.is-out .c { opacity: 0; transform: translate3d(0, -.45em, 0) rotateX(80deg); transition-duration: .5s, .32s; transition-delay: calc(var(--i) * 18ms); }
.hd__ph.no-tr .c, .hd__ph.no-tr .hd__s { transition: none !important; }

/* VEGA star beside the first line, and the burst behind it */
.hd__markw { display: inline-flex; flex: none; }
.hd__mark { width: .72em; height: .72em; overflow: visible; filter: drop-shadow(0 0 .16em rgba(46, 219, 255, .55)); -webkit-animation: hdBob 6s ease-in-out infinite; animation: hdBob 6s ease-in-out infinite; }
.js .hd__markw { opacity: 0; transform: scale(.3) rotate(-120deg); transition: transform 1.3s var(--hd-spring) .75s, opacity .5s ease .75s; }
.hd.is-in .hd__markw { opacity: 1; transform: none; }
.hd__burst { position: absolute; z-index: -1; left: -.52em; top: 50%; width: 1.34em; height: 1.34em; margin-top: -.74em; overflow: visible; }
.hd__burst g { transform-origin: 0 0; -webkit-animation: hdSpin 60s linear infinite; animation: hdSpin 60s linear infinite; }
.js .hd__burst { opacity: 0; transform: scale(.2); transition: opacity 1s ease .35s, transform 1.6s var(--hd-ease) .35s; }
.hd.is-in .hd__burst { opacity: .95; transform: none; }

.hd__sub { margin: clamp(16px, 2vw, 28px) auto 0; max-width: min(92vw, 40ch); font: 700 clamp(15.5px, .5vw + 12.5px, 21px)/1.45 "Mulish", var(--font-b); letter-spacing: -.005em; color: rgba(255, 255, 255, .93); text-wrap: balance; }

/* Floating coins --------------------------------------------------------- */
.hd__coins { position: absolute; inset: 0; pointer-events: none; }
.hd__coin { position: absolute; display: block; }
.hd__coin img { display: block; width: 100%; height: auto; }
.hd__in { display: block; position: relative; width: 100%; height: 100%; }
.hd__fl { display: block; -webkit-animation: hdFloat 7s ease-in-out infinite; animation: hdFloat 7s ease-in-out infinite; }
/* sit just outside the text block, but never closer than 14px to the screen edge */
.hd__coin--l { left: max(calc((var(--CW) - 100vw) / 2 + 14px), calc(-1 * clamp(8px, 4.4vw, 72px))); top: 58%; width: clamp(54px, 5.4vw, 84px); }
.hd__coin--r { right: max(calc((var(--CW) - 100vw) / 2 + 14px), calc(-1 * clamp(8px, 4.6vw, 76px))); top: 30%; width: clamp(74px, 7.6vw, 118px); height: clamp(74px, 7.6vw, 118px); }
.hd__coin--r .hd__fl { position: absolute; }
.hd__coin--r .hd__fl--b { left: -2%; top: -4%; width: 60%; -webkit-animation-duration: 8.5s; animation-duration: 8.5s; -webkit-animation-delay: -3s; animation-delay: -3s; }
.hd__coin--r .hd__fl:not(.hd__fl--b) { right: -4%; bottom: -6%; width: 70%; -webkit-animation-delay: -1.2s; animation-delay: -1.2s; }
.hd__sync { position: absolute; inset: -8%; width: 116%; height: 116%; overflow: visible; stroke: #E9E4FF; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.hd__sync circle { fill: #FF6FB1; stroke: none; }
.hd__sync circle + circle { fill: #6FD8FF; }
.js .hd__coin .hd__in { opacity: 0; transform: scale(.4) translateY(30px); transition: opacity .8s ease 1.1s, transform 1.3s var(--hd-spring) 1.1s; }
.js .hd__coin--r .hd__in { transition-delay: 1.25s; }
.hd.is-in .hd__coin .hd__in { opacity: 1; transform: none; }

/* Figures ---------------------------------------------------------------- */
.hd__figs { position: relative; z-index: 2; flex: none; width: var(--W); height: calc(var(--W) * .45); margin-top: clamp(10px, 1.4vw, 20px); display: grid; grid-template-columns: 1fr 1.12fr 1fr; column-gap: var(--gap); }
.hd__fig { position: relative; margin: 0; min-width: 0; }
.hd__fig--l, .hd__fig--r { padding-top: calc(var(--W) * .08); }
.hd__par { display: block; position: relative; }
.hd__fig img { display: block; width: 100%; height: auto; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.hd__fig--l img, .hd__fig--r img { -webkit-filter: brightness(.94) saturate(.96); filter: brightness(.94) saturate(.96); }
.hd__fig--c .hd__par::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -14%; width: 120%; height: 0; padding-bottom: 120%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(160, 128, 255, .55), rgba(70, 130, 255, .2) 55%, transparent); -webkit-animation: hdPulse 6s ease-in-out infinite; animation: hdPulse 6s ease-in-out infinite; }
.js .hd__fig { opacity: 0; transform: translate3d(0, 24%, 0); transition: opacity 1s ease var(--d, 0s), transform 1.5s var(--hd-ease) var(--d, 0s); }
.hd.is-in .hd__fig { opacity: 1; transform: none; }
.hd::after { content: ""; position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 14%; pointer-events: none; background: linear-gradient(180deg, rgba(14, 10, 44, 0), rgba(14, 10, 44, .5)); }

/* Intro for the background */
.js .hd__panels i { transform: scaleY(0); transition: transform 1.6s var(--hd-ease) var(--d, 0s); }
.hd.is-in .hd__panels i { transform: none; }
.js .hd__arc { stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s var(--hd-ease) .2s; }
.hd.is-in .hd__arc { stroke-dashoffset: 0; }
.hd.is-in .hd__pulses path { -webkit-animation: hdPulseLine 6s linear var(--d, 0s) infinite; animation: hdPulseLine 6s linear var(--d, 0s) infinite; }
.js .hd__kicker, .js .hd__sub { opacity: 0; transform: translateY(14px); transition: opacity .9s ease var(--d, 1s), transform 1.1s var(--hd-ease) var(--d, 1s); }
.js .hd__kicker { --d: .1s; }
.hd.is-in .hd__kicker, .hd.is-in .hd__sub { opacity: 1; transform: none; }

@-webkit-keyframes hdSpin { to { transform: rotate(360deg); } }
@keyframes hdSpin { to { transform: rotate(360deg); } }
@-webkit-keyframes hdBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.06em) rotate(12deg); } }
@keyframes hdBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.06em) rotate(12deg); } }
@-webkit-keyframes hdFloat { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-14px) rotate(5deg); } }
@keyframes hdFloat { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-14px) rotate(5deg); } }
@-webkit-keyframes hdPulse { 0%, 100% { opacity: .8; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.06); } }
@keyframes hdPulse { 0%, 100% { opacity: .8; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.06); } }
@-webkit-keyframes hdPulseLine { 0% { stroke-dashoffset: .14; opacity: 0; } 4% { opacity: 1; } 30% { stroke-dashoffset: -1; opacity: 1; } 31%, 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes hdPulseLine { 0% { stroke-dashoffset: .14; opacity: 0; } 4% { opacity: 1; } 30% { stroke-dashoffset: -1; opacity: 1; } 31%, 100% { stroke-dashoffset: -1; opacity: 0; } }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hd__coin--l { top: 64%; }
  .hd__coin--r { top: 26%; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .hd { --W: 122vw; }
  .hd__title { font-size: 7.2vw; }
}
@media (max-width: 760px) {
  .hd { --W: 172vw; padding-top: 106px; }
  .hd__title { font-size: clamp(25px, 9vw, 46px); gap: 4px; }
  .hd__coins, .hd__panels::before, .hd__panels::after { display: none; }
  .hd__figs { margin-top: 14px; }
  .hd__kicker { letter-spacing: .2em; }
  .hd__kicker::before, .hd__kicker::after { width: 16px; }
}
@media (max-width: 380px) {
  .hd__kicker { font-size: 10px; letter-spacing: .14em; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hd *, .hd *::before, .hd::after { -webkit-animation: none !important; animation: none !important; transition: none !important; }
  .hd__ph.is-on .hd__s { transform: translate3d(.06em, .06em, 0); }
}
