/* qm-motion-v2-20261025 — Palantir-style typewriter headings + hairline & card reveal layer. */
:root {
  --qm2-out: cubic-bezier(.215, .61, .355, 1);
  --qm2-expo: cubic-bezier(.22, 1, .36, 1);
  --qm2-in: cubic-bezier(.55, .055, .675, .19);
  --qm2-io: cubic-bezier(.645, .045, .355, 1);
  --qm2-t1: .15s;
  --qm2-t2: .25s;
  --qm2-t3: .35s;
  --qm2-t4: .48s;
  --qm2-t5: .62s;
  --qm-ease: var(--qm2-out);
}

/* 1. Headline & section title typewriter (打字感): sequential left-to-right per-character strike with traveling caret.
   Pre-hide only while JS is expected; CSS failsafe shows it after 2.5s. */
html.qm2-pre h1:not(.qm2-done):not([data-qm-owned]) {
  opacity: 0;
  animation: qm2-fs 0s 1.5s forwards; /* 20261027: 1.5s failsafe; headings owned by other typing modules are not pre-hidden */
}
@keyframes qm2-fs { to { opacity: 1; } }

/* Keep split heading container itself visible and unshifted so characters type in place without overlapping siblings */
html.qm2-pre .qm2-split,
html.qm-motion-ready .qm2-split {
  opacity: 1 !important;
  transform: none !important;
  translate: none !important;
  animation: none !important;
}

/* Neutralize premature page-load animations from qm-motion-about.css when qm2 controls scroll reveal */
html.qm2-pre.qm-motion-ready :is(#qm-about-intro h2, #qm-about-intro > div > *, .qac-section > *, .qac-section-head, .qac-section > div:nth-child(2) > *, #qa-capability-proof > div, #qa-capability-proof .wp-block-column) {
  opacity: 1;
  transform: none;
  animation: none;
}

.qm2-w {
  display: inline-block !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Site rules like `.qmh-claim span{display:block}` must never reach the char spans */
qm-c.qm2-ch,
span.qm2-ch,
.qm2-split span.qm2-ch {
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
  transform: none !important;
  white-space: inherit !important;
  opacity: 0;
  animation: none;
}

.qm2-split.qm2-go qm-c.qm2-ch,
.qm2-split.qm2-go span.qm2-ch {
  animation: qm2-type .095s linear var(--qm2-d, 0s) forwards;
}

.qm2-split.qm2-go qm-c.qm2-ch.qm2-last,
.qm2-split.qm2-go span.qm2-ch.qm2-last {
  animation: qm2-type-last .48s linear var(--qm2-d, 0s) forwards;
}

@keyframes qm2-type {
  0% {
    opacity: 0;
    box-shadow: none;
  }
  10%, 54% {
    opacity: 1;
    box-shadow: 2px 0 0 0 currentColor;
  }
  55%, 100% {
    opacity: 1;
    box-shadow: none;
  }
}

@keyframes qm2-type-last {
  0% {
    opacity: 0;
    box-shadow: none;
  }
  8%, 36% {
    opacity: 1;
    box-shadow: 2px 0 0 0 currentColor;
  }
  37%, 62% {
    opacity: 1;
    box-shadow: none;
  }
  63%, 88% {
    opacity: 1;
    box-shadow: 2px 0 0 0 currentColor;
  }
  89%, 100% {
    opacity: 1;
    box-shadow: none;
  }
}

/* Statement subtitle note inside blockquote: rises after quote types */
.qm2-split .qm2-note {
  opacity: 0;
  translate: 0 14px;
  transition: opacity var(--qm2-t4) var(--qm2-out) var(--qm2-note-d, .42s), translate var(--qm2-t5) var(--qm2-expo) var(--qm2-note-d, .42s);
}
.qm2-split.qm2-go .qm2-note {
  opacity: 1;
  translate: 0 0;
}

/* 2. Palantir-style section leads, cards & rows: clean rise without colliding with neighbours */
.qm2-rise {
  opacity: 0 !important;
  translate: 0 20px;
  transition: opacity var(--qm2-t4) var(--qm2-out) var(--qm2-d, 0s), translate var(--qm2-t5) var(--qm2-expo) var(--qm2-d, 0s) !important;
}
.qm2-rise.qm2-in {
  opacity: 1 !important;
  translate: 0 0;
}

/* Avoid duplicate rule under section head when cards/rows below carry their own Palantir top rule */
html:not(#qmT) .qa-modular .qac-section-head {
  border-bottom: 0 !important;
}

/* Palantir-style animatedLineRule: top hairline draws left -> right as row/card enters viewport */
.qm2-line {
  position: relative;
  border-top-color: transparent !important;
}
.qm2-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--qm2-rule-h, 1px));
  height: var(--qm2-rule-h, 1px);
  background: var(--qm2-rule, #d0d1d2);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .72s var(--qm2-expo) var(--qm2-d, 0s), background-color .25s ease;
  pointer-events: none;
}
.qm2-line.qm2-in::before {
  transform: scaleX(1);
}
@media (hover: hover) and (pointer: fine) {
  a.qm2-line.qm2-in:hover::before,
  li.qm2-line.qm2-in:hover::before {
    background: #171a20;
  }
}

/* Feature photos settle from a subtle 1.05x zoom on enter */
.qm2-media {
  overflow: hidden;
}
.qm2-media img {
  scale: 1.05;
  transition: scale .95s var(--qm2-expo) var(--qm2-d, 0s);
}
.qm2-media.qm2-in img {
  scale: 1;
}

/* 3. Tiny decorative text removed (eyebrows, EN subtitles, 01/02 numbering) */
.qm-svc-en, .qh-kicker, .qm-evidence-eyebrow, .qm-capability-eyebrow, .qm-system-eyebrow, .qm-service-eyebrow, .qm-lab-entry-eyebrow, .ql-eyebrow,
.svc-eyebrow, .qma-eb { display: none !important; }
.qm-evidence-number, .qm-capability-number, .qm-capability-meta, .qm-service-number, .qa-home-number, .ql-explore-number,
.svc-group-index, .module-number { visibility: hidden !important; }

/* 4. Typography */
.qma-num, .qm-research-meta, time { font-variant-numeric: tabular-nums slashed-zero; }

/* 5. Hover details: pointer devices only; focus mirrors hover */
a, button {
  transition: color var(--qm2-t2) var(--qm2-out), background-color var(--qm2-t2) var(--qm2-out), border-color var(--qm2-t2) var(--qm2-out), opacity var(--qm2-t2) var(--qm2-out);
}
.qm2-arrow {
  display: inline !important;
  position: relative !important;
  left: 0;
  top: 0;
  margin: 0 !important;
  transition: left var(--qm2-t2) var(--qm2-out), top var(--qm2-t2) var(--qm2-out);
}
@media (hover: hover) and (pointer: fine) {
  a:hover .qm2-arrow, button:hover .qm2-arrow { left: 3px; top: -3px; }
  .svc-primary:hover, a[class*="btn"]:hover, a[class*="cta"]:hover, button:hover { opacity: .86; }
}
a:focus-visible .qm2-arrow, button:focus-visible .qm2-arrow { left: 3px; top: -3px; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* 6. Reduced motion & print: everything static */
@media (prefers-reduced-motion: reduce), print {
  html.qm2-pre h1:not(.qm2-done) { opacity: 1; animation: none; }
  .qm2-ch, .qm2-rise, .qm2-split .qm2-note, .qm2-media img {
    opacity: 1 !important;
    transform: none !important;
    translate: none !important;
    scale: none !important;
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
  .qm2-line::before { transform: scaleX(1) !important; transition: none !important; }
  .qm2-arrow { transition: none; }
}

/* v2 owns the hero title typing: neutralize older per-page word popUp (insight / serve-aigc-creative) when v2 is loaded */
html.qm2-pre #qit-title .qm-w,html.qm2-pre #aigc-hero-title .qm-w{animation:none!important;clip-path:none!important;transform:none!important}
/* 20261026 failsafe + case printer */
@keyframes qm2-fs{to{opacity:1;clip-path:none;transform:none}}
.qm2-split:not(.qm2-go) qm-c.qm2-ch{animation:qm2-fs 0s 1.5s forwards}
@keyframes qm2-ptype{from{opacity:0}to{opacity:1}}
.qm2-print.qm2-go qm-c.qm2-ch,.qm2-print.qm2-go qm-c.qm2-ch.qm2-last{animation:qm2-ptype .01s linear var(--qm2-d,0s) both!important;clip-path:none!important;transform:none!important}
.qm2-caret{display:inline-block;width:2px;height:.9em;margin-left:.08em;vertical-align:-.08em;background:currentColor;opacity:0}
.qm2-print.qm2-go .qm2-caret{animation:qm2-caret 1.1s steps(1,end) var(--qm2-cd,1s) both}
.qm2-print:not(.qm2-go) .qm2-caret{opacity:1;animation:qm2-blink .9s steps(1,end) infinite}
@keyframes qm2-blink{50%{opacity:0}}
@keyframes qm2-caret{0%{opacity:1}25%{opacity:0}50%{opacity:1}75%{opacity:0}85%{opacity:1}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.qm2-print qm-c.qm2-ch{animation:none!important;opacity:1!important}.qm2-caret{display:none!important}}
