/* =====================================================================
   Star Light Media — immersive layer
   Adds: wave mesh backgrounds, scroll-scrubbed exploded 3D brand stack,
   pinned horizontal gallery, custom cursor, hero line reveal.
   Re-uses the colour tokens from styles.css (--green, --lime, --bg...).
   ===================================================================== */

/* ---------- Wave mesh canvases ---------- */
.wave-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.wave-canvas--hero { z-index: 0; opacity: .9;  }
.hero .hero-grid, .hero .hero-bottom { position: relative; z-index: 1; }
.wave-canvas--stage { z-index: 0; opacity: .6; }

/* ---------- Hero headline: masked line rise ---------- */
.js-split .split-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; font-style: normal; }
.js-split .split-line > i { display: block; font-style: normal; transform: translateY(112%); transition: transform 1.05s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--li, 0) * 110ms + 120ms); }
.js-split.is-in .split-line > i { transform: none; }

/* ---------- Assemble / exploded brand stack ---------- */
.assemble { position: relative; background: #040e09; border-block: 1px solid rgba(151, 255, 181, .08); }
.assemble-track { position: relative; height: 680vh; }
.assemble-stage { position: sticky; top: 0; height: 100vh; min-height: 620px; overflow: hidden; isolation: isolate; }

.hud { position: absolute; z-index: 1; inset: clamp(84px, 11vh, 104px) clamp(14px, 3.4vw, 52px) clamp(18px, 4vh, 40px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid rgba(183, 255, 119, .3); border-radius: 18px; background: radial-gradient(900px 520px at 58% 46%, rgba(16, 185, 129, .1), transparent 70%); }
.hud-corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--lime); pointer-events: none; filter: drop-shadow(0 0 6px rgba(183, 255, 119, .6)); }
.hud-corner.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 18px; }
.hud-corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 18px; }
.hud-corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 18px; }
.hud-corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 18px; }

.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; height: 48px; border-bottom: 1px solid rgba(183, 255, 119, .14); }
.hud-tabs { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0 0 0 22px; list-style: none; }
.hud-tabs li { font-size: 10px; letter-spacing: .18em; color: #6f8a79; transition: color .35s; }
.hud-tabs li.on { color: var(--lime); text-shadow: 0 0 12px rgba(183, 255, 119, .5); }
.hud-name { align-self: center; font: 800 11px Manrope, sans-serif; letter-spacing: .34em; color: #dff3e5; }
.hud-cta { justify-self: end; display: inline-flex; align-items: center; gap: 10px; padding: 0 22px; border-left: 1px solid rgba(183, 255, 119, .14); border-top-right-radius: 17px; color: #eff8f0; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-decoration: none; transition: background .25s, color .25s; }
.hud-cta:hover, .hud-cta:focus-visible { background: var(--lime); color: #062014; outline: none; }

.hud-body { position: relative; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.2fr) 70px; align-items: stretch; min-height: 0; }
.hud-left { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 0 0 clamp(18px, 3vw, 46px); }
.hud-intro { margin: 0 0 clamp(10px, 2.4vh, 26px); transition: opacity .5s; }
.hud-kicker { font-size: 9px; letter-spacing: .2em; color: #738b7b; }

.spec-list { margin: 0; padding: 0; list-style: none; display: grid; gap: clamp(0px, .4vh, 6px); transition: opacity .55s; }
.spec { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; opacity: .3; transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.spec-n { font-size: 10px; letter-spacing: .18em; color: var(--green); }
.spec-t { margin: 0; font: 800 clamp(30px, 6.3vh, 66px)/1.04 Manrope, sans-serif; letter-spacing: -.045em; color: transparent; -webkit-text-stroke: 1px rgba(242, 250, 244, .55); transition: color .45s, -webkit-text-stroke-color .45s, text-shadow .45s; }
.spec-d { grid-column: 2; margin: 0; max-width: 340px; max-height: 0; overflow: hidden; opacity: 0; color: #a9bcb0; font-size: 13px; line-height: 1.6; transition: max-height .55s cubic-bezier(.2, .8, .2, 1), opacity .45s, margin .45s; }
.spec.is-done { opacity: .5; }
.spec.is-done .spec-t { color: rgba(242, 250, 244, .6); -webkit-text-stroke-color: transparent; }
.spec.is-active { opacity: 1; transform: translateX(12px); }
.spec.is-active .spec-t { color: #f6fff8; -webkit-text-stroke-color: transparent; text-shadow: 0 0 30px rgba(116, 247, 156, .35); }
.spec.is-active .spec-d { max-height: 100px; opacity: 1; margin-top: 6px; }

.spec-final { position: absolute; left: clamp(18px, 3vw, 46px); right: 0; top: 50%; transform: translateY(-46%); opacity: 0; pointer-events: none; transition: opacity .6s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.spec-final h2 { margin: 0 0 14px; font: 800 clamp(30px, 4.2vw, 58px)/1.04 Manrope, sans-serif; letter-spacing: -.05em; }
.spec-final em { font-style: normal; color: var(--green); }
.spec-final p { max-width: 340px; margin: 0 0 24px; color: #a9bcb0; font-size: 13px; line-height: 1.7; }
.is-final .spec-final { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
.is-final .spec-list, .is-final .hud-intro { opacity: 0; pointer-events: none; }

/* the 3D object */
.rig { --pw: clamp(230px, min(30vw, 60vh), 470px); --ph: calc(var(--pw) * .64); position: relative; display: grid; place-items: center; min-width: 0; perspective: 1500px; perspective-origin: 50% 38%; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.rig.is-drag { cursor: grabbing; }
.rig-glow { position: absolute; left: 50%; top: 52%; width: calc(var(--pw) * 1.5); height: calc(var(--pw) * 1.5); translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgba(183, 255, 119, .28), rgba(16, 185, 129, .12) 40%, transparent 68%); opacity: .25; will-change: opacity; pointer-events: none; }
.obj { position: relative; width: var(--pw); height: var(--ph); transform-style: preserve-3d; will-change: transform; transform: rotateX(60deg) rotateZ(-36deg); }
.plate { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform, opacity; }
.plate-face { position: absolute; inset: 0; overflow: hidden; border-radius: calc(var(--pw) * .045); color: var(--green); background: radial-gradient(120% 120% at 50% 50%, transparent 62%, rgba(116, 247, 156, .09) 100%), linear-gradient(145deg, rgba(14, 62, 40, .95), rgba(5, 24, 15, .95)); border: 1px solid rgba(183, 255, 119, .3);  transition: border-color .45s; }
.plate-face::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .45s; background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(183, 255, 119, .2) 100%); }
.plate-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .07) 50%, transparent 62%); pointer-events: none; }
.plate-face svg { position: absolute; left: 6%; top: 15%; width: 88%; height: 80%; }
.plate-tag { position: absolute; z-index: 1; top: calc(var(--pw) * .04); left: calc(var(--pw) * .05); font-size: clamp(6px, calc(var(--pw) * .024), 10px); font-weight: 700; line-height: 1; letter-spacing: .2em; color: var(--lime); }
.plate.is-active .plate-face, .is-final .plate-face { border-color: var(--lime); }
.plate.is-active .plate-face::before, .is-final .plate-face::before { opacity: 1; }
.plate-face svg { transition: opacity .45s; }
.assemble-stage[data-phase="exploded"] .plate:not(.is-active) .plate-face svg { opacity: .32; }
.plate-star { transform-box: fill-box; transform-origin: center; }
.plate.is-active .plate-star, .is-final .plate-star { animation: plate-star 2.6s ease-in-out infinite; }
@keyframes plate-star { 50% { transform: scale(1.25) rotate(12deg); } }

.callout { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; opacity: 0; transition: opacity .35s; }
.callout path { fill: none; stroke: rgba(183, 255, 119, .75); stroke-width: 1; stroke-dasharray: 3 4; }
.callout circle { fill: var(--lime); filter: drop-shadow(0 0 6px var(--lime)); }

.hud-right { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 26px; }
.step-count { display: grid; justify-items: center; gap: 4px; }
.step-count b { font: 800 26px Manrope, sans-serif; letter-spacing: -.04em; color: #f2faf4; }
.step-count span { font-size: 9px; letter-spacing: .18em; color: #738b7b; }
.drag-tab { position: absolute; right: -1px; top: 50%; translate: 0 -50%; padding: 16px 9px; border-radius: 8px 0 0 8px; background: var(--lime); color: #062014; font-size: 9px; font-weight: 800; letter-spacing: .22em; writing-mode: vertical-rl; box-shadow: 0 0 24px rgba(183, 255, 119, .35); }

.hud-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; height: 46px; padding: 0 24px; border-top: 1px solid rgba(183, 255, 119, .14); }
.ruler { display: flex; align-items: flex-end; height: 18px; }
.ruler i { display: block; width: 1px; height: 8px; margin-right: 22px; background: rgba(183, 255, 119, .3); transition: height .35s, background .35s; }
.ruler i.on { height: 16px; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.hud-status { font-size: 9px; letter-spacing: .3em; color: #9db5a5; white-space: nowrap; }
.hud-bar { height: 2px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.hud-bar span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #24c878, var(--lime)); box-shadow: 0 0 10px rgba(116, 247, 156, .6); }

/* ---------- Pinned horizontal gallery ---------- */
.hwork { position: relative; padding: 0 !important; background: #06170f; }
.hwork-sticky { position: sticky; top: 0; height: 100vh; min-height: 640px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3vh, 34px); padding: 84px 0 56px; }
.hwork-head { display: grid; grid-template-columns: 1fr auto; column-gap: 40px; align-items: end; }
.hwork-head .section-kicker { grid-column: 1 / -1; margin-bottom: 14px; }
.hwork-head h2 { margin: 0; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.05; }
.hwork-head p { grid-column: 1; margin: 12px 0 0; max-width: 440px; color: #9eaea5; font-size: 13px; line-height: 1.7; }
.hwork-hint { grid-column: 2; grid-row: 2 / 4; align-self: end; font-size: 9px; letter-spacing: .2em; color: var(--green); }
.hwork-rail { overflow: visible; }
.hwork-grid { display: flex !important; gap: clamp(18px, 2.4vw, 34px); width: max-content; padding: 0 max(24px, calc((100vw - 1160px) / 2)); will-change: transform; }
.hwork .work-card { flex: 0 0 clamp(300px, 40vw, 600px); opacity: 1 !important; transform: none !important; }
.hwork .work-visual { height: clamp(200px, 32vh, 380px); }
.hwork .work-card:hover .work-visual { box-shadow: 0 28px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(183, 255, 119, .25); }
.work-cta { flex: 0 0 clamp(260px, 30vw, 440px); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(22px, 3vw, 38px); border-radius: 14px; text-decoration: none; color: var(--white); border: 1px dashed rgba(183, 255, 119, .4); background: radial-gradient(420px 260px at 80% 0%, rgba(116, 247, 156, .14), transparent 70%); transition: background .35s, border-color .35s, transform .35s; }
.work-cta:hover { border-style: solid; border-color: var(--lime); background: radial-gradient(420px 260px at 80% 0%, rgba(183, 255, 119, .28), transparent 70%); }
.work-cta-kicker { font-size: 9px; letter-spacing: .2em; color: var(--green); }
.work-cta b { font: 800 clamp(28px, 3.4vw, 46px)/1.05 Manrope, sans-serif; letter-spacing: -.05em; }
.work-cta em { font-style: normal; color: var(--green); }
.work-cta-go { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-radius: 30px; background: var(--green); color: #062014; font-size: 12px; font-weight: 700; }
.hwork-progress { position: absolute; left: max(24px, calc((100vw - 1160px) / 2)); right: max(24px, calc((100vw - 1160px) / 2)); bottom: 30px; height: 2px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.hwork-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #24c878, var(--lime)); }

/* ---------- Custom cursor ring (fine pointers only) ----------
   Position = transform on .cursor-ring. Size/shape = transform: scale on .ring-body.
   Nothing here changes width/height/margin, so hovering never triggers layout. */
.cursor-ring { position: fixed; left: 0; top: 0; z-index: 9000; width: 80px; height: 80px; margin: -40px 0 0 -40px; pointer-events: none; opacity: 0; transition: opacity .25s; will-change: transform; contain: layout style; }
.cursor-ring.is-on { opacity: 1; }
.ring-body { position: absolute; inset: 0; border: 2px solid rgba(183, 255, 119, .75); border-radius: 50%; transform: scale(.45); transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .25s, border-color .25s; }
.cursor-ring.is-link .ring-body { transform: scale(.7); background-color: rgba(183, 255, 119, .12); }
.cursor-ring.has-label .ring-body { transform: scale(1); background-color: var(--lime); border-color: var(--lime); }
.cursor-ring.is-ghost .ring-body { background-color: rgba(4, 14, 9, .35); border-color: var(--lime); }
.cursor-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #062014; opacity: 0; transition: opacity .2s; }
.cursor-ring.has-label span { opacity: 1; }
.cursor-ring.is-ghost span { color: var(--lime); }
.cursor-glow { left: 0; top: 0; transform: translate3d(-400px, -400px, 0); will-change: transform; }

/* magnetic elements use the individual `translate` property so they never fight existing transforms */
[data-magnetic] { translate: var(--mx, 0px) var(--my, 0px); transition: translate .35s cubic-bezier(.2, .8, .2, 1), transform .25s, background .25s, border .25s, color .25s; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hud-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr) 52px; }
  .spec-d { font-size: 12px; }
}
@media (max-width: 860px) {
  .assemble-track { height: 560vh; }
  .hud { inset: 74px 10px 14px; }
  .hud-top { grid-template-columns: 1fr; }
  .hud-cta { display: none; }
  .hud-name { display: none; }
  .hud-tabs { gap: 14px; padding-left: 14px; }
  .hud-tabs li { font-size: 8px; letter-spacing: .12em; }
  .hud-cta { padding: 0 14px; font-size: 9px; }
  .hud-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .hud-right, .callout, .hud-intro { display: none; }
  .rig { order: 1; --pw: min(54vw, 29vh); }
  .hud-left { order: 2; min-height: 168px; padding: 0 18px 16px; justify-content: flex-end; }
  .spec { display: none; transform: none; }
  .spec.is-active { display: grid; transform: none; }
  .spec-t { font-size: clamp(34px, 5.4vh, 46px); }
  .spec-d { max-width: none; font-size: 13px; }
  .spec-final { left: 18px; right: 18px; top: auto; bottom: 16px; transform: none; }
  .is-final .spec-final { transform: none; }
  .spec-final h2 { font-size: 30px; margin-bottom: 8px; }
  .spec-final p { margin-bottom: 14px; font-size: 12px; }
  .hud-bottom { grid-template-columns: auto minmax(0, 1fr); height: 40px; padding: 0 78px 0 16px; }
  .hud-bottom .hud-bar { display: none; }
  .hud-status { justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 8px; letter-spacing: .16em; }
  .ruler i { margin-right: 14px; }

  /* gallery: native horizontal swipe instead of pinned scroll */
  .hwork-sticky { position: relative; height: auto; min-height: 0; padding: 90px 0 56px; overflow: visible; }
  .hwork-head { grid-template-columns: 1fr; }
  .hwork-hint { grid-column: 1; grid-row: auto; margin-top: 14px; }
  .hwork-rail { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hwork-rail::-webkit-scrollbar { display: none; }
  .hwork-grid { padding: 0 24px; scroll-padding: 0 24px; }
  .hwork .work-card, .work-cta { scroll-snap-align: start; }
  .hwork .work-card { flex-basis: 78vw; }
  .work-cta { flex-basis: 70vw; }
  .hwork-progress { display: none; }
  .hwork .work-visual { height: 240px; }
}
@media (hover: none), (pointer: coarse) { .cursor-ring { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .wave-canvas { display: none; }
  .assemble-track { height: auto; }
  .assemble-stage { position: relative; height: auto; min-height: 0; overflow: visible; padding: 20px 0 40px; }
  .hud { position: relative; inset: auto; margin: 90px 14px 0; min-height: 640px; }
  .spec { opacity: 1; transform: none !important; }
  .spec-t { color: #f2faf4; -webkit-text-stroke-color: transparent; }
  .spec-d { max-height: none; opacity: 1; margin-top: 4px; }
  .hud-left { min-height: 0; padding-bottom: 20px; }
  .spec-final { position: relative; left: auto; top: auto; opacity: 1; pointer-events: auto; margin-top: 24px; transform: none; }
  .hwork-sticky { position: relative; height: auto; padding: 90px 0 56px; overflow: visible; }
  .hwork-rail { overflow-x: auto; }
  .js-split .split-line > i { transform: none; transition: none; }
}

/* fix: the word-reveal script wraps words in spans, which `h2 span` turns green. Inherit instead. */
.heading-word { color: inherit; }

/* performance: keep stage repaints from leaking into the rest of the page */
.assemble-stage { contain: layout paint; }
.hwork-sticky { contain: paint; }
.work-card, .hud-left { contain: layout style; }

/* real project cards */
.site-vis { display: flex; align-items: flex-start; flex-direction: column; justify-content: space-between; padding: 18px; color: #f2faf4; isolation: isolate; }
.site-vis::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sv-bg); }
.site-vis::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; right: -18%; bottom: -30%; border-radius: 50%; z-index: -1; background: radial-gradient(circle, var(--sv-glow), transparent 68%); }
.site-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .1); font-size: 11px; letter-spacing: .04em; color: #cfe3d6; }
.site-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.site-bar span { margin-left: 8px; }
.site-name { font: 800 clamp(32px, 4vw, 56px)/1 Manrope, sans-serif; letter-spacing: -.05em; }
.site-name small { display: block; margin-top: 10px; font: 600 10px/1 "DM Sans", sans-serif; letter-spacing: .2em; color: var(--lime); text-transform: uppercase; }
a.work-card { display: block; color: inherit; text-decoration: none; }
a.work-card:hover .work-visual { box-shadow: 0 28px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(183, 255, 119, .35); }

/* delivered-projects carousel (testimonials section) */
.testimonial-layout { grid-template-columns: .8fr 1.2fr; min-width: 0; }
.pr-wrap { min-width: 0; }
.pr-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.pr-track::-webkit-scrollbar { display: none; }
.pr-card { flex: 0 0 min(100%, 380px); scroll-snap-align: start; border: 1px solid var(--line); background: linear-gradient(145deg, #0b2919, #071a11); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.pr-tag { font-size: 9px; letter-spacing: .2em; color: var(--green); }
.pr-card h3 { margin: 0; font: 800 28px/1.1 Manrope, sans-serif; letter-spacing: -.04em; }
.pr-card p { margin: 0; color: #9fb2a5; font-size: 13px; line-height: 1.7; flex: 1; }
.pr-link { color: var(--lime); text-decoration: none; font-size: 13px; font-weight: 600; }
.pr-controls { display: flex; gap: 10px; margin-top: 16px; }
.pr-controls button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(183,255,119,.35); background: transparent; color: var(--lime); font-size: 16px; cursor: pointer; }
.pr-controls button:hover { background: rgba(183,255,119,.12); }
