/* Hero 3D fijado al scroll: the violet stage stays pinned while a WebGL particle field tells three beats —
   constellation (mouse-reactive) → the onbrainy symbol assembled from the nodes → a flowing 3D mesh the camera dips over —
   and finally closes into a card. --close (0 → 1) is written by hero-pin.js. */

.hpin .hero { display: block; min-height: 0; height: 360vh; --close: 0; }
.hpin .hero::after { display: none; }
.hpin .panel { position: sticky; top: 0; height: 100svh; padding-bottom: 0; overflow: hidden;
  clip-path: inset(0 calc(var(--close) * 4vw) calc(var(--close) * 6vh) round calc(var(--close) * 40px)); }
.hpin #gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hpin .panel .veil { background: radial-gradient(46% 40% at 50% 48%, rgba(85,42,204,.55) 10%, rgba(106,53,255,0) 75%); }
.hpin .hero .wrap { padding-block: 84px 40px; will-change: opacity, transform; }

/* beats 2 and 3: copy over the scene, faded in by hero-pin.js */
.hpin .beat { position: absolute; z-index: 2; inset: 0; display: flex; pointer-events: none; opacity: 0; will-change: opacity, transform; }
.hpin .beat .wrap { display: flex; flex: 1; padding-block: 96px 64px; }
.hpin .beat-2 .wrap { align-items: center; }
.hpin .beat-3 .wrap { align-items: flex-start; justify-content: center; text-align: center; padding-top: clamp(110px, 18vh, 170px); }
.hpin .beat-in { display: grid; gap: 18px; max-width: 34rem; }
.hpin .beat-3 .beat-in { max-width: 46rem; justify-items: center; }
.hpin .beat .eyebrow { color: rgba(255,255,255,.75); }
.hpin .beat .eyebrow::before { background: var(--chispa); }
.hpin .beat h2 { color: #fff; font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4.6rem); line-height: 1.02; }
.hpin .beat h2 em { font-style: normal; color: var(--chispa); }
.hpin .beat p { color: rgba(255,255,255,.85); font-size: var(--step-1); font-weight: 400; line-height: 1.4; max-width: 34ch; }

/* progress rail, right edge: 01 · 02 · 03 */
.hpin .rail { position: absolute; z-index: 3; right: max(var(--pad-x), calc((100% - 1320px) / 2)); top: 50%; translate: 0 -50%;
  display: grid; gap: 14px; font: 600 .7rem var(--f-label); letter-spacing: .14em; color: rgba(255,255,255,.45); }
.hpin .rail b { font-weight: 400; display: flex; align-items: center; gap: 10px; transition: color .3s; }
.hpin .rail b::before { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.hpin .rail b.on { color: #fff; }
.hpin .rail b.on::before { width: 32px; }
/* below ~1100px the symbol reaches the right edge, so the rail would sit on top of it */
@media (max-width: 1100px) { .hpin .rail { display: none; } }
/* where the page's scroll ruler shows (styles.css), it takes over from this rail */
@media (hover: hover) and (min-width: 1180px) { .hpin .rail { display: none; } }

/* scroll cue */
.hpin .scroll-cue { position: absolute; z-index: 3; left: 50%; bottom: 28px; translate: -50% 0; display: grid; justify-items: center; gap: 6px;
  font: 600 .68rem var(--f-label); letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.7); transition: opacity .3s; }
.hpin .scroll-cue::after { content: "↓"; letter-spacing: 0; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0%, 100% { translate: 0 0; opacity: .5; } 50% { translate: 0 5px; opacity: 1; } }

/* interaction hint, bottom-left; fades in once the story starts (hero-pin.js) */
.hpin .hint { position: absolute; z-index: 3; left: max(var(--pad-x), calc((100% - 1320px) / 2)); bottom: 28px; opacity: 0;
  display: inline-flex; align-items: center; gap: 10px; font: 600 .68rem var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.hpin .hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; animation: hint-ping 2s var(--ease) infinite; }
@keyframes hint-ping { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
.hpin .h-touch { display: none; }
@media (hover: none) { .hpin .h-mouse { display: none; } .hpin .h-touch { display: inline; } }

@media (max-width: 760px) {
  .hpin .rail { display: none; }
  .hpin .beat-2 .wrap { align-items: flex-start; padding-top: 110px; }
}
@media (max-height: 640px) { .hpin .scroll-cue { display: none; } }

/* reduced motion: no pin, the first beat only */
@media (prefers-reduced-motion: reduce) {
  .hpin .hero { height: auto; }
  .hpin .panel { position: relative; height: 100svh; clip-path: none; }
  .hpin .beat, .hpin .rail, .hpin .scroll-cue { display: none; }
}

