/* Clovis Prime landing, motion version. Everything here only applies while html.pm is set
   (motion allowed and the motion layer running); without it the page is the static landing page. */

@property --pm-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- first paint: hold the page until the motion layer has set its start states ---------- */
html.pm:not(.pm-ready) main, html.pm:not(.pm-ready) .t-nav { visibility: hidden; }
html.pm body { overflow-x: clip; }

/* ---------- scroll progress ---------- */
.pm-progress { display: none; }
html.pm .pm-progress { display: block; position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 60; pointer-events: none; }
.pm-progress i { display: block; height: 100%; background: linear-gradient(90deg, #00AAAA, #5EE0D0); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- neutralise the static reveals: GSAP owns entrances here ---------- */
html.pm .pr-rv, html.pm .pr-in .pr-rv { opacity: 1; transform: none; }
html.pm .pr-card, html.pm .pr-card.pr-rv { transition: border-color .45s ease, box-shadow .45s ease; }
html.pm .pr-meter > i, html.pm .pr-stack > i { transition: none; }
html.pm [data-count] { font-variant-numeric: tabular-nums; }

/* SplitText masks */
html.pm .pm-ln { padding-bottom: .08em; margin-bottom: -.08em; }

/* ---------- odometer (custom tags: page rules for spans can't reach them) ---------- */
pm-odo { display: inline-flex; align-items: flex-start; height: var(--lh); line-height: var(--lh); overflow: hidden; vertical-align: top; font: inherit; color: inherit; letter-spacing: inherit; }
pm-c { display: inline-block; height: var(--lh); overflow: hidden; }
pm-s { display: flex; flex-direction: column; will-change: transform; }
pm-d, pm-x { display: block; height: var(--lh); line-height: var(--lh); text-align: center; white-space: pre; }

/* ---------- hero ---------- */
html.pm .portfolio-hero { position: relative; }
html.pm .portfolio-hero > * { position: relative; z-index: 1; }
html.pm .portfolio-hero > .pm-currents { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 75% at 72% 52%, #000 0%, rgba(0,0,0,.55) 45%, transparent 78%);
          mask-image: radial-gradient(60% 75% at 72% 52%, #000 0%, rgba(0,0,0,.55) 45%, transparent 78%); }
html.pm [data-clovis-hero-options] { perspective: 1700px; }
html.pm .pr-hero, html.pm .pr-hero .pr-row3 { transform-style: preserve-3d; }
html.pm #portfolio-title em { position: relative; display: inline-block; }
html.pm #portfolio-title em::after { content: ''; position: absolute; inset: -.05em -.15em; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.85) 50%, transparent 62%) no-repeat; background-size: 260% 100%;
  background-position: 160% 0; animation: pmSheen 6.5s cubic-bezier(.6,0,.2,1) 3.2s infinite; }
@keyframes pmSheen { 0% { background-position: 160% 0; } 38%, 100% { background-position: -60% 0; } }

/* ---------- app showcase ---------- */
html.pm [data-clovis-prime-app] { perspective: 2000px; }
html.pm .pa-frame { transform-origin: 50% 0%; will-change: transform; }
.pm-cursor { position: absolute; left: 0; top: 0; z-index: 30; width: 26px; height: 26px; pointer-events: none; opacity: 0;
  filter: drop-shadow(0 6px 10px rgba(1,36,40,.28)); }
.pm-cursor svg { display: block; width: 100%; height: 100%; }
.pm-click { position: absolute; left: 0; top: 0; z-index: 29; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 2px solid rgba(0,170,170,.75); pointer-events: none; opacity: 0; }

/* ---------- account journey: story progress on the tabs ---------- */
html.pm .pf-story-tabs button { position: relative; overflow: hidden; }
.pm-tprog { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #00AAAA; transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
html.pm .pf-story-panel { overflow: hidden; }
html.pm .story-graphic .pr-g { perspective: 1400px; }

/* ---------- cards: spotlight that follows the pointer ---------- */
html.pm .pr-card:not(.dev) { background-image: radial-gradient(240px circle at var(--mx, -400px) var(--my, -400px), rgba(0,170,170,.075), transparent 62%); }
html.pm .pr-dark { background-image: radial-gradient(280px circle at var(--mx, -400px) var(--my, -400px), rgba(94,224,208,.12), transparent 62%),
  radial-gradient(130% 150% at 0% 0%, #0C4447 0%, #03302F 38%, #012428 72%); }

/* ---------- network: a living core ---------- */
/* The core's glow bleeds 30% past the card; keep it from widening the page on phones. */
.portfolio-network-section { overflow-x: clip; }
html.pm .pr-net-core { isolation: isolate; }
html.pm .pr-net-core::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
  background: conic-gradient(from var(--pm-a), transparent 0deg, rgba(94,224,208,.95) 40deg, transparent 110deg, transparent 180deg, rgba(0,170,255,.7) 220deg, transparent 290deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: pmSpin 7s linear infinite; }
html.pm .pr-net-core::after { content: ''; position: absolute; inset: -30%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,170,170,.22), transparent); animation: pmBreathe 5s ease-in-out infinite; }
@keyframes pmSpin { to { --pm-a: 360deg; } }
@keyframes pmBreathe { 0%, 100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.04); } }

/* ---------- roadmap ---------- */
html.pm .roadmap-step::after { transform: scaleX(var(--draw, 1)); transform-origin: 0 50%; }

/* ---------- closing band: particles form the Clovis mark (the crisp mark shows when motion is off) ---------- */
.pm-close { position: relative; }
.pm-logo-field { display: none; }
.portfolio-close.pm-close { display: block; padding: 0; background: radial-gradient(90% 120% at 80% 50%, #0C4447 0%, #03302F 42%, #011A1D 100%); color: #fff; overflow: hidden; }
.pm-close-in { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 40px; min-height: min(78vh, 720px); padding-block: 96px; }
.pm-close-copy { max-width: 620px; }
.pm-kicker { display: inline-block; font: 500 12px/1 'Clovis Host', Host, Arial, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: #5EE0D0; margin: 0 0 22px; }
.t-portfolio .pm-close h2 { color: #fff; font-size: clamp(44px, 6vw, 92px); line-height: 1; letter-spacing: -.045em; margin: 0 0 36px; }
.t-portfolio .pm-close .portfolio-button, .t-portfolio .pm-close .portfolio-button:disabled, .t-portfolio .pm-close .portfolio-button:hover { background: #5EE0D0; color: #012428; border-color: #5EE0D0; opacity: 1; box-shadow: 0 18px 40px -18px rgba(94,224,208,.6); }
.pm-logo-slot { flex: none; width: min(34vw, 420px); aspect-ratio: 1; display: grid; place-items: center; }
.pm-logo-slot img { display: block; width: 62%; height: auto; filter: drop-shadow(0 30px 60px rgba(0,170,170,.35)); }
html.pm .pm-logo-slot img { display: none; }
html.pm .pm-close .pm-logo-field { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pm-sl { white-space: nowrap; }
.pm-close-cta { display: inline-block; }

@media (max-width: 760px) {
  .pm-close-in { flex-direction: column; align-items: flex-start; min-height: 0; padding-block: 72px 56px; }
  .pm-logo-slot { width: 64vw; align-self: center; order: -1; }
  .t-portfolio .pm-close h2 { font-size: 46px; }
}

/* SplitText wraps the hero em in line masks, so re-apply its "h1 > em" styling */
html.pm .t-portfolio .portfolio-hero h1 em { font-family: inherit; font-style: normal; font-weight: 500; font-size: 1em; color: var(--clovis-highlight); letter-spacing: inherit; }
