/* =============================================================================================
   Motion preview (.mx). Loaded only on pages with `motionPage: true`.
   Editorial layer on top of site.css tokens: large type, generous whitespace, scroll scenes.
   Animations only touch transform and opacity (plus clip-path for the two wipes).
   ============================================================================================= */

/* ---------- 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: clip; }

/* ---------- Type scale and primitives ---------- */
.mx-container { width: min(1320px, 100% - 48px); margin-inline: auto; }
.mx-section { padding: clamp(80px, 12vw, 168px) 0; position: relative; }
.mx-kicker { display: block; font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 22px; }
.mx-display { font-size: clamp(44px, 7.6vw, 128px); line-height: 1; letter-spacing: -.055em; font-weight: 600; color: var(--text); text-wrap: balance; }
.mx-display-2 { font-size: clamp(34px, 4.8vw, 76px); line-height: 1.02; letter-spacing: -.05em; font-weight: 600; color: var(--text); }
.mx-line { display: block; }

/* Letter-roll characters: one line tall, overflow hidden, two stacked copies inside. */
.mx-word { display: inline-block; white-space: nowrap; }
.mx-ch { display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.12; height: 1.12em; padding-inline: .005em; }
.mx-ch__in { display: block; will-change: transform; }
.mx-ch__in > span { display: block; height: 1.12em; }
.mx-ready:not(.mx-reduced) [data-mx-roll] .mx-ch__in > span:first-child,
.mx-ready:not(.mx-reduced) #mxHeroTitle .mx-ch__in > span:first-child { opacity: 0; }
/* Hover-roll labels inside buttons/links keep normal line height. */
.mx-btn .mx-ch, .nav .mx-ch, .site-footer .mx-ch { line-height: 1.25; height: 1.25em; }
.mx-btn .mx-ch__in > span, .nav .mx-ch__in > span, .site-footer .mx-ch__in > span { height: 1.25em; }

.mx-ready [data-mx-reveal] { opacity: 0; }
.mx-ready.mx-reduced [data-mx-reveal] { opacity: 1; }

/* Buttons */
.mx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; transition: border-color .3s, background-color .3s, color .3s; }
.mx-btn:hover { border-color: var(--text-3); }
.mx-btn--primary { border-color: transparent; color: #1a0a00; background: linear-gradient(180deg, #ffa357, #ff7a1a); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 30px -10px rgba(255,122,26,.8); }
.mx-btn--primary:hover { border-color: transparent; }
.mx-btn--lg { height: 60px; padding: 0 32px; font-size: 16px; }
.mx-btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; }

/* ---------- Page wipe (link transitions) ---------- */
.mx-wipe { position: fixed; inset: 0; z-index: 2900; background: #05070c; transform: translateY(100%); pointer-events: none; }

/* ---------- 2. Hero ---------- */
.mx-hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; padding-top: calc(var(--header-h) + clamp(40px, 8vh, 96px)); }
.mx-hero__copy { position: relative; z-index: 2; text-align: center; padding: 0 20px; max-width: 1240px; margin: 0 auto; }
.mx-hero__copy .mx-kicker { color: var(--text-2); }
.mx-hero__lead { margin: 28px auto 0; max-width: 620px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; color: var(--text); text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.mx-hero__summary { margin: 14px auto 0; max-width: 620px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.mx-hero__actions { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mx-hero .mx-display { text-shadow: 0 6px 40px rgba(0,0,0,.45); }

/* ---------- 3. Founder ---------- */
.mx-founder__grid { display: grid; grid-template-columns: 260px 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.mx-founder__id { display: flex; gap: 16px; align-items: center; position: sticky; top: 120px; }
.mx-founder__id img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid var(--line-2); }
.mx-founder__id h2 { font-size: 17px; letter-spacing: -.01em; }
.mx-founder__id p { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.mx-founder__text { font-size: clamp(22px, 2.8vw, 40px); line-height: 1.22; letter-spacing: -.03em; color: var(--text); font-weight: 500; }

/* ---------- 4. Quote ---------- */
.mx-quote { border-top: 1px solid var(--line); }
.mx-quote__text p { font-size: clamp(30px, 4.6vw, 76px); line-height: 1.04; letter-spacing: -.05em; font-weight: 600; color: var(--text); }
.mx-quote__text p:nth-child(2) { padding-left: clamp(0px, 8vw, 140px); color: var(--text-2); }
.mx-quote__text p:nth-child(3) { padding-left: clamp(0px, 16vw, 280px); }
.mx-quote__foot { margin-top: 56px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.mx-quote__foot cite { font: 500 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-style: normal; }

/* ---------- 6. Process ---------- */
.mx-process { position: relative; height: 100vh; height: 100svh; display: flex; align-items: center; border-top: 1px solid var(--line); }
.mx-process__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 120px); align-items: center; }
.mx-process__title { font-size: clamp(22px, 2vw, 28px); letter-spacing: -.02em; color: var(--text-2); font-weight: 500; max-width: 18ch; }
.mx-roller { margin-top: 40px; height: clamp(40px, 5vw, 80px); overflow: hidden; }
.mx-roller__list { display: flex; flex-direction: column; will-change: transform; }
.mx-roller__list span { display: block; height: clamp(40px, 5vw, 80px); font-size: clamp(32px, 4.4vw, 70px); line-height: 1.1; letter-spacing: -.05em; font-weight: 600; color: var(--text); white-space: nowrap; }
.mx-process__bar { margin-top: 36px; height: 2px; background: var(--line); max-width: 420px; overflow: hidden; }
.mx-process__bar i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }
.mx-process__right { position: relative; min-height: 320px; }
.mx-step { position: absolute; inset: 0 0 auto; }
.mx-step__num { font: 500 13px/1 var(--mono); color: var(--brand-2); letter-spacing: .1em; }
.mx-step h3 { margin: 16px 0 16px; font-size: clamp(30px, 3.4vw, 52px); letter-spacing: -.045em; line-height: 1.02; }
.mx-step p { font-size: clamp(16px, 1.3vw, 18.5px); line-height: 1.65; color: var(--text-2); max-width: 46ch; }
.mx-process.is-static { height: auto; padding: 120px 0; }
.mx-process.is-static .mx-roller, .mx-process.is-static .mx-process__bar { display: none; }
.mx-process.is-static .mx-process__right { min-height: 0; display: grid; gap: 48px; }
.mx-process.is-static .mx-step { position: static; }

/* ---------- 7. Services track ---------- */
.mx-work { position: relative; border-top: 1px solid var(--line); overflow: hidden; }
.mx-work__pin { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 110px 0 60px; }
.mx-work__head { margin-bottom: 48px; }
.mx-work__track { display: flex; gap: 28px; padding-left: max(24px, calc((100vw - 1320px) / 2)); padding-right: 8vw; width: max-content; will-change: transform; }
.mx-card { display: block; width: min(34vw, 480px); color: inherit; text-decoration: none; }
.mx-card__media { aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.mx-card__img { width: 120%; height: 100%; margin-left: -10%; display: grid; place-items: center; will-change: transform; }
.mx-card__img i { font-size: clamp(56px, 6vw, 96px); color: rgba(255,255,255,.88); filter: drop-shadow(0 10px 30px rgba(0,0,0,.4)); }
.mx-card__tag { margin-top: 22px; font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.mx-card h3 { margin-top: 10px; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.03em; line-height: 1.15; }
.mx-card p:last-child { margin-top: 10px; color: var(--text-2); line-height: 1.6; font-size: 15.5px; max-width: 42ch; }
.mx-card:hover h3 { color: var(--brand-2); }
.mx-work__more { align-self: center; width: min(34vw, 460px); padding-left: 20px; }
.mx-work__more p:nth-child(2) { margin: 18px 0 26px; color: var(--text-2); line-height: 1.6; }

/* Abstract placeholder art (no stock photos) */
.mx-art { position: relative; background-color: #0b1020; }
.mx-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.mx-art--1 { background-image: radial-gradient(circle at 30% 30%, #ffb26b, transparent 45%), radial-gradient(circle at 75% 70%, #c24c08, transparent 50%), linear-gradient(135deg, #2a1203, #0b1020); }
.mx-art--2 { background-image: radial-gradient(circle at 70% 30%, #7a9bff, transparent 45%), radial-gradient(circle at 25% 75%, #2f4fd1, transparent 50%), linear-gradient(135deg, #0a1240, #050814); }
.mx-art--3 { background-image: radial-gradient(circle at 40% 35%, #3fd0ee, transparent 45%), radial-gradient(circle at 75% 75%, #0e6b7e, transparent 50%), linear-gradient(135deg, #03222a, #050814); }
.mx-art--4 { background-image: radial-gradient(circle at 60% 30%, #34d399, transparent 42%), radial-gradient(circle at 25% 80%, #ff7a1a, transparent 45%), linear-gradient(135deg, #04261a, #120804); }
.mx-art--award { background-image: radial-gradient(circle at 50% 50%, rgba(255,194,133,.45), transparent 55%), linear-gradient(160deg, #1a0d03, #070a12); }
.mx-art--cta { background-image: radial-gradient(ellipse at 20% 30%, rgba(255,122,26,.55), transparent 50%), radial-gradient(ellipse at 80% 70%, rgba(91,140,255,.5), transparent 55%), linear-gradient(180deg, #070a12, #0b0f1c); }

/* ---------- 8. Marquee ---------- */
.mx-marquee { padding: clamp(64px, 10vw, 140px) 0; overflow: hidden; border-top: 1px solid var(--line); }
.mx-marquee__row { white-space: nowrap; }
.mx-marquee__inner { display: inline-flex; will-change: transform; }
.mx-marquee__inner span { font-size: clamp(56px, 10vw, 168px); line-height: 1.02; font-weight: 600; letter-spacing: -.055em; color: var(--text); }
.mx-marquee__row--outline .mx-marquee__inner span { color: transparent; -webkit-text-stroke: 1.5px var(--text-3); }

/* ---------- 9. Systems list ---------- */
.mx-list__head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 56px; }
.mx-list__count { font: 500 clamp(16px, 1.6vw, 22px)/1 var(--mono); color: var(--text-3); margin-top: .6em; }
.mx-list__row { position: relative; display: grid; grid-template-columns: 1fr 1.3fr 1fr 2fr; gap: 24px; padding: 26px 0; color: inherit; text-decoration: none; }
.mx-list__row--head { padding: 0 0 14px; font: 500 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.mx-list__line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-2); transform-origin: left; }
.mx-list__cell { display: block; overflow: hidden; color: var(--text-2); font-size: 15.5px; line-height: 1.5; }
.mx-list__cell > span { display: block; }
.mx-list__cell--name { color: var(--text); font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.mx-list__row:hover .mx-list__cell--name { color: var(--brand-2); }
.mx-list__table { border-bottom: 1px solid var(--line-2); }
.mx-list__all { margin-top: 44px; }
.mx-preview { position: fixed; left: 0; top: 0; z-index: 800; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 26px; background: #fff; display: grid; place-items: center; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); opacity: 0; transform: scale(.85); pointer-events: none; }
.mx-preview img { width: 110px; height: 110px; object-fit: contain; }

/* ---------- 10. Award ---------- */
.mx-award { border-top: 1px solid var(--line); }
.mx-award__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.mx-award__label { margin: 28px 0 30px; font: 500 13px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.mx-award__media { border-radius: 26px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 5 / 4; }
.mx-award__img { width: 100%; height: 100%; display: grid; place-items: center; will-change: transform; }
.mx-award__img img { width: min(56%, 263px); height: auto; filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)); }

/* ---------- 11. CTA ---------- */
.mx-cta { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; overflow: hidden; padding: 140px 0; }
.mx-cta__bg { position: absolute; inset: 0; }
.mx-cta__img { position: absolute; inset: 0; will-change: transform; }
.mx-cta__content { position: relative; z-index: 1; }
.mx-cta__content > p { margin: 34px 0 38px; max-width: 560px; font-size: 18px; line-height: 1.7; color: #d7dde6; }
.mx-cta .mx-display { color: #f6f7fb; }
.mx-cta .mx-btn:not(.mx-btn--primary) { color: #f6f7fb; }
.mx-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.mx-cta__content > .mx-cta__note { margin: 18px 0 0; max-width: 480px; font-size: 14px; line-height: 1.6; color: #aeb6c2; }
@media (max-width: 640px) {
  .mx-cta__actions { flex-direction: column; align-items: stretch; }
  .mx-cta__actions .mx-btn { width: 100%; }
}

/* ---------- Mobile (<768px): shorter scenes, stacked cards ---------- */
@media (max-width: 767px) {
  .mx-container { width: min(100% - 32px, 1320px); }
  .mx-founder__grid { grid-template-columns: 1fr; }
  .mx-founder__id { position: static; }
  .mx-process__inner { grid-template-columns: 1fr; gap: 28px; }
  .mx-process__right { min-height: 300px; }
  .mx-roller { margin-top: 20px; }
  .mx-work__pin { min-height: 0; padding: 96px 0; }
  .mx-work__track { flex-direction: column; width: auto; padding: 0 16px; gap: 48px; transform: none !important; }
  .mx-card, .mx-work__more { width: 100%; padding-left: 0; }
  .mx-list__row { grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .mx-list__row--head { display: none; }
  .mx-list__cell--name { grid-column: 1 / -1; order: -1; }
  .mx-list__cell:last-child { grid-column: 1 / -1; }
  .mx-award__grid { grid-template-columns: 1fr; }
  .mx-preview { display: none; }
}

/* ---------- Reduced motion: no scrubbed scenes, everything readable in place ---------- */
@media (prefers-reduced-motion: reduce) {
  .mx-hero { height: auto; overflow: visible; padding-bottom: 96px; }
  .mx-hero__visual { transform: none; }
}

/* Tuning after review */
.mx-quote__text p { font-size: clamp(28px, 4.2vw, 68px); }
.mx-award .mx-display-2 { font-size: clamp(32px, 4vw, 66px); }

/* ---------- 2. Hero visual: the live Revenue Pipeline, tilted in 3D ---------- */
.mx-hero .mx-display { font-size: clamp(40px, 6.4vw, 104px); }
.mx-hero__visual { position: relative; z-index: 1; width: min(1120px, 100% - 48px); margin: clamp(40px, 7vh, 72px) auto 0; transform-origin: 50% 0%; transform: perspective(1600px) rotateX(26deg) scale(.92); will-change: transform; }
.mx-hero__visual .console-wrap { margin: 0; max-width: none; }
.mx .mx-hero__visual .console { transform: none !important; } /* home.js tilt is replaced by the GSAP scene */

/* ---------- 5. Before / after: spreadsheet to pipeline ---------- */
.mx-shift { position: relative; height: 100vh; height: 100svh; overflow: hidden; border-top: 1px solid var(--line); }
.mx-shift__stage { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 5vh, 56px); padding-top: var(--header-h); }
.mx-shift__labels { position: relative; height: clamp(62px, 7.6vw, 100px); }
.mx-shift__labels p { position: absolute; inset: 0 0 auto; font-size: clamp(28px, 3.8vw, 60px); letter-spacing: -.05em; line-height: 1.02; font-weight: 600; color: var(--text); }
.mx-shift__labels .mx-kicker { margin-bottom: 12px; }
.mx-shift__canvas { position: relative; display: grid; }
.mx-sheet, .mx-board { grid-area: 1 / 1; }
.mx-sheet { align-self: start; border: 1px solid var(--line-2); border-radius: 12px; overflow: visible; font: 500 13px/1.3 var(--mono); background: rgba(255,255,255,.015); }
.mx-sheet__row { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr .9fr 1fr .6fr; }
.mx-sheet__row + .mx-sheet__row { border-top: 1px solid var(--line); }
.mx-sheet__row--head { color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; background: rgba(255,255,255,.03); }
.mx-sheet__cell { display: block; padding: 11px 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line); will-change: transform; }
.mx-sheet__cell:first-child { border-left: 0; }
.mx-sheet__cell.is-blank { background: repeating-linear-gradient(135deg, rgba(248,113,113,.10) 0 6px, transparent 6px 12px); }
.mx-sheet__row.is-dup .mx-sheet__cell { color: #fca5a5; background-color: rgba(248,113,113,.06); }
.mx-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-self: start; }
.mx-board__col { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); padding: 14px; display: grid; gap: 10px; align-content: start; min-height: 260px; }
.mx-board__head { display: flex; justify-content: space-between; align-items: baseline; font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 2px 2px 6px; }
.mx-board__head b { font: 600 16px/1 var(--font); letter-spacing: -.01em; text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; }
.mx-board__card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-elev); }
.mx-board__card strong { color: var(--text); font-size: 15px; font-weight: 600; }
.mx-board__card span { grid-column: 1; color: var(--text-3); font: 500 12.5px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.mx-board__card i { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 600 11px/1 var(--mono); font-style: normal; color: var(--brand-2); border: 1px solid rgba(255,122,26,.35); background: rgba(255,122,26,.08); border-radius: 999px; padding: 6px 8px; }
.mx-board__col.is-won { border-color: rgba(52,211,153,.35); }
.mx-board__col.is-won .mx-board__card { border-color: rgba(52,211,153,.45); box-shadow: 0 0 0 1px rgba(52,211,153,.12), 0 10px 30px -14px rgba(52,211,153,.5); }
.mx-board__col.is-won .mx-board__card i { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.mx-shift.is-static { height: auto; padding: 120px 0; }
.mx-shift.is-static .mx-shift__stage { position: static; }
.mx-shift.is-static .mx-sheet, .mx-shift.is-static [data-shift-label="a"] { display: none; }
.mx-shift.is-static .mx-shift__labels p { position: static; }

@media (max-width: 767px) {
  .mx-hero__visual { width: calc(100% - 32px); }
  .mx-sheet__row { grid-template-columns: 1.2fr 1fr .9fr; }
  .mx-sheet__cell:nth-child(2), .mx-sheet__cell:nth-child(5), .mx-sheet__cell:nth-child(6) { display: none; }
  .mx-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mx-board__col { min-height: 0; padding: 10px; }
  .mx-board__card { padding: 10px; }
  .mx-board__card i { display: none; }
}

.mx-building .deal, .mx-building .board__col, .mx-building .board__add, .mx-building .kpi, .mx-building .console__side-item { transition: none !important; }
.mx-award__img picture { display: grid; place-items: center; width: 100%; height: 100%; }
.mx-award__img img { display: block; }
.mx-award__img source { display: none; } /* a visible <source> took a grid row and pushed the badge down */

/* First paint on the home page: hide the hero and header until the intro timeline starts (see base.njk).
   The lead paragraph is hidden too (owner, Oct 2026: it showed before the intro). This moves LCP to the
   intro, so base.njk keeps the wait short: low-end phones skip the intro (mx-lite) and a 3.5 s timeout
   shows the page as is if the scripts are late. */
.mx-intro .site-header { transform: translateY(-100%); }
.mx-intro #mxHeroTitle, .mx-intro [data-mx-hero-in], .mx-intro .mx-hero__visual { opacity: 0; }
/* While the dashboard builds over the copy, keep it above the copy so the two do not overlap. */
.mx-building .mx-hero__copy { z-index: 0; }
