/* EPCIMA PMT · motion.css — preloader, 3D hero shell, captions, nav behaviour */

/* ── preloader ── */
.pre {
  position: fixed; inset: 0; z-index: 100; background: var(--navy-900); color: #fff;
  display: grid; align-content: center; justify-items: center; gap: 28px;
}
html.reduced .pre, html.no-js .pre { display: none; }
.pre__word { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 92px); letter-spacing: -0.03em; line-height: 1; display: flex; overflow: hidden; padding-bottom: 0.08em; }
.pre__word span { display: inline-block; transform: translateY(110%); opacity: 0; }
.pre__word { align-items: baseline; gap: 0.22em; flex-wrap: nowrap; white-space: nowrap; }
.pre__word .pre__logo img { height: 0.82em; width: auto; display: block; }
.pre__word .pre__o { color: var(--orange); }
.pre__meta { display: flex; align-items: center; gap: 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-navy-3); }
.pre__num { color: var(--orange); width: 3ch; }
.pre__bar { width: 160px; height: 1px; background: rgba(255,255,255,0.15); position: relative; overflow: hidden; }
.pre__bar i { position: absolute; inset: 0; background: var(--orange); transform: scaleX(0); transform-origin: left; }

/* ── 3D hero shell ── */
.h3d { position: relative; height: 100vh; height: 100svh; padding-top: 0; background: var(--navy-900); overflow: hidden; color: var(--on-navy-2); }
.h3d[hidden] { display: none; }
.h3d__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.h3d__vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,1,11,0.75) 100%),
              linear-gradient(180deg, rgba(0,1,11,0.55) 0%, transparent 22%, transparent 80%, rgba(0,1,11,0.7) 100%); }
.h3d__progress { position: absolute; right: clamp(16px, 3vw, 36px); top: 50%; transform: translateY(-50%); width: 2px; height: 160px; background: rgba(255,255,255,0.14); }
.h3d__progress i { position: absolute; inset: 0; background: var(--orange); transform: scaleY(0); transform-origin: top; }

/* captions live in the pinned viewport, driven by scroll progress */
.cap { position: absolute; left: 0; right: 0; opacity: 0; pointer-events: none; will-change: opacity, transform; --dy: 0px; }
.cap h1 { color: #fff; margin: 14px 0 30px; font-size: clamp(38px, 4.8vw, 64px); }
.cap h1 em { font-style: normal; color: var(--orange); }
.cap h2 { color: #fff; font-size: clamp(30px, 4vw, 52px); margin: 10px 0 18px; text-shadow: 0 2px 24px rgba(0,0,0,0.7); }
.cap--mid > p, .cap--right > p, .cap--hero .hero__lede { text-shadow: 0 1px 12px rgba(0,0,0,0.7); }
.cap > p:not(.cap__k):not(.hero__kicker):not(.cap__hint) { font-size: clamp(16px, 1.3vw, 18.5px); line-height: 1.65; max-width: 46ch; }
.cap__k { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-hi); }
.cap--hero { top: 50%; transform: translateY(calc(-50% + var(--dy))); max-width: none; }
.cap--hero .hero__lede { max-width: 46ch; }
.cap--hero > * { max-width: 620px; }
.cap__hint { margin-top: 40px !important; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-navy-3); display: flex; align-items: center; gap: 12px; }
.cap__hint span { width: 1px; height: 38px; background: linear-gradient(var(--orange), transparent); animation: hint 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%, 100% { transform: scaleY(0.3); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }
.cap--mid { top: 50%; transform: translateY(calc(-50% + var(--dy))); }
.cap--mid > * { max-width: 520px; }
.cap--right { top: 50%; transform: translateY(calc(-50% + var(--dy))); display: grid; justify-items: end; text-align: right; }
.cap--right > * { max-width: 520px; }
.cap--crumb { bottom: clamp(28px, 5vh, 56px); transform: translateY(var(--dy)); }
.cap--crumb .cap__panel { display: inline-grid; gap: 4px; padding: 18px 22px 20px; background: rgba(0,3,16,0.72); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.cap--crumb h2 { font-size: clamp(24px, 2.6vw, 34px); max-width: 520px; text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.crumbs { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.crumbs span { padding: 7px 12px; border: 1px solid rgba(255,255,255,0.18); color: var(--on-navy-3); background: rgba(0,3,16,0.55); backdrop-filter: blur(6px); transition: color .3s, border-color .3s, background .3s; }
.crumbs span.is-on { color: var(--navy-900); background: var(--orange); border-color: var(--orange); }
.crumbs span.is-on:not(:last-child)::after { content: " ▸"; }

/* skip link */
.h3d__skip { position: absolute; right: clamp(16px, 3vw, 36px); bottom: clamp(20px, 4vh, 40px); z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-navy-3); border: 1px solid rgba(255,255,255,0.16); padding: 8px 12px; background: rgba(0,3,16,0.5); backdrop-filter: blur(6px); }
.h3d__skip:hover { color: #fff; border-color: var(--orange); }

/* HUD: data labels projected from the 3D scene */
.hud { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.hud__tag { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; display: grid; grid-template-columns: 8px auto; column-gap: 10px; align-items: start; transform-origin: 0 0; }
.hud__tag i { width: 8px; height: 8px; margin-top: 4px; border: 1.5px solid var(--orange); background: transparent; transition: background .3s; }
.hud__tag.is-done i { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.hud__tag .hud__k { grid-column: 2; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-navy-3); white-space: nowrap; }
.hud__tag .hud__v { grid-column: 2; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.hud__tag--big .hud__v { font-size: 40px; color: var(--orange); }
.hud__tag::before { content: ""; position: absolute; left: 3px; top: 12px; width: 1px; height: 26px; background: linear-gradient(var(--orange), transparent); }

/* the pin spacer that ScrollTrigger inserts should stay navy */
.pin-spacer { background: var(--navy-900); }

/* ── nav auto-hide ── */
.nav { transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1); }
.nav.is-hidden { transform: translateY(-100%); }
.h3d .btn--ghost { border-color: rgba(255,255,255,0.6); color: #fff; }
.h3d .btn--ghost:hover { border-color: var(--orange-hi); color: var(--orange-hi); }
/* Rev H.3: the blur lives on a pseudo-element, not on .nav itself. backdrop-filter turns .nav into the
   containing block of every position:fixed descendant, which pinned the phone menu (.menu) inside the 64 px
   header bar, so it opened invisibly under the intro. */
html.has-3d .nav { background: rgba(0,3,20,0.9); }
html.has-3d .nav::before { content: ""; position: absolute; inset: 0; z-index: -1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ── reveal defaults (JS sets initial state; this only keeps things tidy without JS) ── */
html.no-js [data-reveal] { opacity: 1 !important; transform: none !important; }

/* lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Rev G: issue tag + module chips ── */
.hud__tag--alert i { border-color: #ff3b30; }
.hud__tag--alert.is-done i, .hud__tag--alert i { background: #ff3b30; box-shadow: 0 0 12px rgba(255,59,48,0.9); animation: alertPulse 1s ease-in-out infinite; }
.hud__tag--alert .hud__k { color: #ff8a80; }
.hud__tag--alert .hud__v { color: #fff; }
.hud__tag--alert::before { background: linear-gradient(#ff3b30, transparent); }
@keyframes alertPulse { 0%, 100% { box-shadow: 0 0 6px rgba(255,59,48,0.6); } 50% { box-shadow: 0 0 16px rgba(255,59,48,1); } }
.hud__mod { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(6,14,34,0.92); border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 8px 24px -8px rgba(0,0,0,0.7); font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.hud__mod b { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 12px; color: #0B1830; background: var(--c, #F5822A); }
.hud__mod.is-docked { border-color: rgba(245,130,42,0.6); }
.hud__mod span { max-width: 160px; overflow: hidden; transition: max-width .35s cubic-bezier(0.16,1,0.3,1), opacity .25s; }
.hud__mod.is-docking { padding-right: 6px; gap: 0; }
.hud__mod.is-docking span { max-width: 0; opacity: 0; }
.hud__tag--alert.is-resolved i { background: #2ee6a8; border-color: #2ee6a8; box-shadow: 0 0 12px rgba(46,230,168,0.8); animation: none; }
.hud__tag--alert.is-resolved .hud__k { color: #9df0d2; }
.hud__tag--alert.is-resolved::before { background: linear-gradient(#2ee6a8, transparent); }

/* ── Rev G.3: scroll affordance: bottom nudge, cursor label, idle auto-nudge ── */
.h3d__nudge { position: absolute; left: 50%; bottom: clamp(22px, 5vh, 48px); transform: translate(-50%, 12px); z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border-radius: 999px; background: rgba(0,3,16,0.6); border: 1px solid rgba(255,255,255,0.16); backdrop-filter: blur(8px); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; opacity: 0; pointer-events: none; transition: opacity .5s, transform .6s cubic-bezier(0.16,1,0.3,1); }
.h3d__nudge.is-on { opacity: 1; transform: translate(-50%, 0); animation: nudgeBob 2.2s ease-in-out 1s infinite; }
.h3d__nudge.is-off { opacity: 0; transform: translate(-50%, 16px); animation: none; }
.h3d__mouse { width: 18px; height: 28px; border: 1.5px solid rgba(255,255,255,0.7); border-radius: 10px; position: relative; }
.h3d__mouse i { position: absolute; left: 50%; top: 5px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--orange); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes nudgeBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.h3d__cursor { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--orange); color: var(--navy-900); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; opacity: 0; transform: translate(-50%, -50%) scale(0.6); transition: opacity .25s, transform .35s cubic-bezier(0.16,1,0.3,1); will-change: transform; }
.h3d__cursor svg { display: block; flex: none; animation: cursorArrow 1.2s ease-in-out infinite; }
@keyframes cursorArrow { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
.h3d__cursor.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: none), (max-width: 899px) { .h3d__cursor { display: none; } }
@media (prefers-reduced-motion: reduce) { .h3d__nudge.is-on { animation: none; } .h3d__mouse i, .h3d__cursor svg { animation: none; } }

/* ── Rev G.13: the intro on phones and tablets ── */
html.lite-3d .cap h1 { font-size: clamp(30px, 8.6vw, 44px); margin: 10px 0 22px; }
html.lite-3d .cap h2 { font-size: clamp(24px, 6.4vw, 36px); }
html.lite-3d .cap > p:not(.cap__k) { font-size: 15px; line-height: 1.55; max-width: 36ch; }
html.lite-3d .cap--hero > *, html.lite-3d .cap--mid > *, html.lite-3d .cap--right > * { max-width: 100%; }
html.lite-3d .cap--right { justify-items: start; text-align: left; top: auto; bottom: clamp(56px, 12vh, 120px); transform: translateY(var(--dy)); }
html.lite-3d .cap--mid { top: auto; bottom: clamp(56px, 12vh, 120px); transform: translateY(var(--dy)); }
html.lite-3d .hud__tag .hud__v { font-size: 15px; }
html.lite-3d .hud__tag--big .hud__v { font-size: 26px; }
html.lite-3d .hud__tag .hud__k { font-size: 9.5px; }
html.lite-3d .hud__mod { font-size: 11px; padding: 5px 10px 5px 5px; }
html.lite-3d .hud__mod b { width: 18px; height: 18px; font-size: 10px; }
html.lite-3d .h3d__progress { display: none; }
html.lite-3d .h3d__skip { bottom: 16px; right: 16px; padding: 7px 10px; }
html.lite-3d .h3d__nudge { bottom: 16px; left: 16px; transform: translate(0, 12px); font-size: 11px; padding: 8px 12px 8px 10px; }
html.lite-3d .h3d__nudge.is-on { transform: translate(0, 0); animation: none; }
html.lite-3d .h3d__nudge.is-off { transform: translate(0, 16px); }
html.lite-3d .h3d__skip { bottom: 62px; }
