/* =========================================================================
   Homepage motion layer — loaded on index.php only.
   Uses the existing theme tokens (--accent, --text, --bg …); no new colours.
   Hidden "before" states apply only under html.hm-anim, which the head
   script removes after 4s if the animation scripts never load.
   ========================================================================= */

/* ---------- scroll progress ---------- */
.hm-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 260; pointer-events: none; }
.hm-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px var(--accent); }

/* ---------- partners strip: logo lockups ---------- */
.tm2-marquee-track .tm2-partner {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 21px; font-weight: 700; color: #fff; letter-spacing: -.01em; flex: 0 0 auto;
}
.tm2-partner i {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
}
.tm2-partner img { height: 34px; width: auto; max-width: 150px; object-fit: contain; filter: brightness(0) invert(1); opacity: .95; }
@media (max-width: 768px) {
    .tm2-marquee-track .tm2-partner { font-size: 13px; gap: 8px; }
    .tm2-partner i { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
    .tm2-partner img { height: 22px; }
}

/* ---------- hero ---------- */
html.hm-anim .tm2-hero .tm2-badge,
html.hm-anim .tm2-hero > p,
html.hm-anim .tm2-hero .tm2-email-form { opacity: 0; transform: translateY(18px); }
html.hm-anim .tm2-hero h1:not(.hm-split) { opacity: 0; }
.hm-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hm-line-in { display: inline-block; will-change: transform; }
.hm-w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .1em; margin: 0 -.02em -.1em; }
em .hm-w { padding-right: .14em; margin-right: -.14em; } /* italic overhang */
.hm-wi { display: inline-block; will-change: transform; }
.tm2-hero-glow { transition: none; }

/* ---------- bullseye game (black & white, from the logo mark) ---------- */
.hm-has-target { position: relative; overflow: hidden; isolation: isolate; }
.hm-target { position: absolute; z-index: 0; pointer-events: none; aspect-ratio: 1; }
.hm-target svg { width: 100%; height: 100%; overflow: visible; display: block; }
.hm-rings { opacity: .07; }
[data-theme="light"] .hm-rings { opacity: .06; }
.hm-rings .rk { fill: var(--text); }
.hm-rings .rw { fill: var(--bg); }
.hm-rings .ro { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 3 12; }
.hm-target--accent .hm-rings { opacity: .16; }
.hm-target--accent .rk { fill: #fff; }
.hm-target--accent .rw { fill: transparent; }
.hm-target--accent .ro { stroke: #fff; }
.hm-arrow .shaft { stroke: var(--text); stroke-width: 4; stroke-linecap: round; opacity: .55; }
.hm-arrow .tip { fill: var(--text); opacity: .55; }
.hm-arrow .fl { fill: var(--accent); }
.hm-target--accent .hm-arrow .shaft, .hm-target--accent .hm-arrow .tip { stroke: #fff; fill: #fff; opacity: .9; }
.hm-target--accent .hm-arrow .fl { fill: #fff; }
.hm-ripple { fill: none; stroke: var(--accent); stroke-width: 2; }
.hm-target--accent .hm-ripple { stroke: #fff; }

.hm-target--hero { width: min(1000px, 135vw); left: 50%; top: 52%; translate: -50% -50%; }
.hm-target--side { width: min(620px, 90vw); right: -170px; top: 50%; translate: 0 -50%; }
.hm-target--cta { width: 560px; right: -150px; top: 50%; translate: 0 -50%; z-index: 0; }

.tm2-hero.hm-has-target { cursor: crosshair; }
.tm2-hero.hm-has-target form { cursor: auto; }
.tm2-hero.hm-has-target :is(a, button) { cursor: pointer; }
.tm2-hero.hm-has-target input { cursor: text; }
.tm2-cta-band.hm-has-target { cursor: crosshair; }
.tm2-cta-band.hm-has-target :is(a, button) { cursor: pointer; }

.hm-pop {
    position: absolute; z-index: 3; pointer-events: none; white-space: nowrap; translate: -50% -100%;
    font: 700 13px/1 'Geist Mono', monospace; letter-spacing: .04em; color: var(--accent);
    background: var(--card); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.hm-pop.is-miss { color: var(--muted); }
.tm2-cta-band .hm-pop { color: #15803d; background: #fff; border-color: transparent; }

.hm-hud {
    position: absolute; z-index: 2; right: 18px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px;
    font: 500 11px/1 'Geist Mono', monospace; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    pointer-events: none; white-space: nowrap; transition: color .3s, border-color .3s;
}
.hm-hud b { color: var(--accent); font-weight: 700; }
.hm-hud.is-hot { color: var(--text); border-color: var(--accent); }
.hm-hud i { color: var(--accent); }
@media (max-width: 640px) { .hm-hud { right: 50%; translate: 50% 0; bottom: 10px; } }

/* ---------- cards: cursor spotlight ---------- */
.tm2-card.hm-spot { position: relative; isolation: isolate; overflow: hidden; }
.tm2-card.hm-spot::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s ease; pointer-events: none;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
}
.tm2-card.hm-spot:hover::before { opacity: 1; }
.tm2-card.hm-spot:hover { box-shadow: 0 18px 40px -22px rgba(22,163,74,.45); }

/* ---------- problem timeline: connectors draw in ---------- */
html.hm-anim .tm2-timeline-step:not(:last-child)::after {
    transform-origin: 0 50%; transform: scaleX(0); background: var(--accent);
    transition: transform 1s cubic-bezier(.16,1,.3,1);
}
html.hm-anim .tm2-timeline-step.is-on:not(:last-child)::after { transform: scaleX(1); }
.tm2-timeline-num { transition: transform .5s cubic-bezier(.34,1.56,.64,1), box-shadow .5s ease; }
.tm2-timeline-step.is-on .tm2-timeline-num { box-shadow: 0 0 0 8px var(--accent-soft); }

/* ---------- CTA band: moving sheen ---------- */
html.hm-anim .tm2-cta-band::before { animation: hm-sheen 7s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes hm-sheen { 0%, 15% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
.tm2-cta-band > .hm-target { position: absolute; z-index: 0; }

/* ---------- footer wordmark letters ---------- */
.tm2-footer-mark.hm-split { background: none; }
/* gradient text doesn't paint through transformed children, so each letter carries its own */
.tm2-footer-mark .hm-ch {
    display: inline-block;
    background: linear-gradient(180deg, var(--accent) 0%, #4ade80 55%, transparent 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons: press feedback ---------- */
.tm2-btn, .tm2-cta-btn-solid, .tm2-cta-btn-glass, .tm2-email-form button { will-change: transform; }
.tm2-btn:active, .tm2-cta-btn-solid:active, .tm2-cta-btn-glass:active, .tm2-email-form button:active { scale: .97; }

@media (prefers-reduced-motion: reduce) {
    html.hm-anim .tm2-cta-band::before { animation: none; }
}
