/* HCS Site Engage (homerunner.io): the engagement layer. Companion to hcs-site-engage.php / .js.
 * Ten independent features, each gated by a class on <html> (hx-motion, hx-count, hx-calc, hx-hero, hx-form,
 * hx-accent, and from 0.2.0 hx-touch, hx-finish, hx-link, hx-field) so any one can be switched off without
 * touching the others.
 * Page CSS is scoped by YOOtheme as `#page\#N .sel`; rules that must outrank it carry the html class plus
 * `:is(#hx,[id^="page#"])`, which adds the same ID-level weight. Motion honors prefers-reduced-motion. */

:root{--hx-out:cubic-bezier(.2,.7,.3,1);--hx-ink:#0d0a46;--hx-violet:#4e40f1;--hx-muted:#626884}

/* ───────── 1. Motion layer ───────── */
/* Press feedback: every button answers the finger. The rule IS the state, so !important is safe here. */
html.hx-motion :is(.hr-btn,.hr-fbtn,.hrg3-btn,.uk-button,.hr-feat__btn,.hr-ai__row button,.hx-try):active{
	transform:scale(.97) !important;transition-duration:.08s !important}
/* Section entrances: set by JS only on elements below the fold, removed again when the move ends,
   so a failed script hides nothing and card hover transforms keep working afterwards. */
html.hx-motion [data-hx-rise]{opacity:0;transform:translateY(18px)}
html.hx-motion [data-hx-rise].hx-in{opacity:1;transform:none;
	transition:opacity .5s var(--hx-out) var(--hx-d,0ms),transform .5s var(--hx-out) var(--hx-d,0ms)}
/* Menus open from their trigger: scale from .95 at the top edge, 180ms ease-out (was a flat fade). */
@keyframes hx-pop{from{opacity:0;transform:scale(.95) translateY(-6px)}to{opacity:1;transform:none}}
html.hx-motion .uk-navbar-dropdown.uk-open{animation:hx-pop .18s var(--hx-out) both;transform-origin:var(--hx-ox,50%) 0}
/* Dropdown rows land 30ms apart. */
@keyframes hx-row{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
html.hx-motion .uk-navbar-dropdown.uk-open :is(.uk-nav > li, .el-item){animation:hx-row .22s var(--hx-out) both;animation-delay:calc(var(--hx-i,0) * 30ms + 40ms)}

/* ───────── 2. Stat count-up ───────── */
html.hx-count :is(#hx,[id^="page#"]) .hr-stats dt{font-variant-numeric:tabular-nums}

/* ───────── 3. Pricing calculator ───────── */
/* The number being chosen is the biggest thing in the panel. */
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__price b{font-size:3.5rem;line-height:1;display:inline-flex;vertical-align:baseline}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__count{display:inline-flex;line-height:1}
/* One pulse confirms the tier changed. */
@keyframes hx-pulse{from{box-shadow:0 0 0 0 rgba(78,64,241,.32)}to{box-shadow:0 0 0 9px rgba(78,64,241,0)}}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__card li.hx-pulse{animation:hx-pulse .45s ease-out 1}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__tier{transition:opacity .15s ease-out,filter .15s ease-out}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__tier.hx-swap{opacity:0;filter:blur(4px)}
/* Rolling digits: each character sits in its own clipped cell; only a cell whose character changed moves. */
.hx-digit{display:inline-block;position:relative;overflow:hidden;height:1.16em;line-height:1.16;vertical-align:bottom}
.hx-digit > span{display:block;height:1.16em;line-height:1.16}
.hx-digit > .hx-old{position:absolute;inset:0}
@keyframes hx-in-up{from{transform:translateY(100%)}to{transform:none}}
@keyframes hx-out-up{from{transform:none}to{transform:translateY(-100%)}}
@keyframes hx-in-down{from{transform:translateY(-100%)}to{transform:none}}
@keyframes hx-out-down{from{transform:none}to{transform:translateY(100%)}}
.hx-digit.hx-up > .hx-new{animation:hx-in-up .22s var(--hx-out) both}
.hx-digit.hx-up > .hx-old{animation:hx-out-up .18s var(--hx-out) both}
.hx-digit.hx-down > .hx-new{animation:hx-in-down .22s var(--hx-out) both}
.hx-digit.hx-down > .hx-old{animation:hx-out-down .18s var(--hx-out) both}
/* Track: taller hit area, the thumb grows 12% while held, tier stops sit under the track. */
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider{touch-action:pan-y;position:relative}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider::before{content:"";position:absolute;inset:-19px 0}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider::-webkit-slider-thumb{transition:transform .12s var(--hx-out),box-shadow .12s ease-out}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider:active::-webkit-slider-thumb{transform:scale(1.12);box-shadow:0 8px 20px -6px rgba(28,14,189,.7)}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider::-moz-range-thumb{transition:transform .12s var(--hx-out)}
html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__slider:active::-moz-range-thumb{transform:scale(1.12)}
.hx-stops{display:flex;margin:10px 0 0;padding:0;list-style:none;font-size:.72rem;color:var(--hx-muted);font-variant-numeric:tabular-nums}
.hx-stops li{flex:1 1 0;min-width:0;text-align:right;position:relative;padding-top:8px;transition:color .15s ease-out}
.hx-stops li::before{content:"";position:absolute;right:0;top:0;width:1px;height:5px;background:currentColor;opacity:.45}
.hx-stops li.is-on{color:var(--hx-ink)}
.hx-stops li.is-on::before{opacity:1;height:7px}
.hx-stops button{all:unset;cursor:pointer;padding:4px 0 4px 6px;margin:-4px 0}
.hx-stops button:focus-visible{outline:2px solid var(--hx-violet);outline-offset:2px;border-radius:3px}
@media (max-width:520px){.hx-stops{font-size:.66rem}.hx-stops button{padding:10px 0 10px 4px;margin:-10px 0}}

/* ───────── 4. Playable hero ───────── */
html.hx-hero :is(#hx,[id^="page#"]) .hr-screen{cursor:pointer}
/* The whole panel is one target: on hover the video dims a little and the button lifts, so the
   click reads as "open this", not "play this". */
html.hx-hero :is(#hx,[id^="page#"]) .hr-screen::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:rgba(13,10,70,0);transition:background .2s ease-out}
html.hx-hero :is(#hx,[id^="page#"]) .hr-screen:hover::after{background:rgba(13,10,70,.22)}
@media (min-width:960px){html.hx-hero .hx-try{height:48px;padding:0 24px 0 18px;font-size:16px}}
.hx-try{position:absolute;z-index:3;left:50%;bottom:18px;translate:-50% 0;display:inline-flex;align-items:center;gap:9px;
	height:44px;padding:0 20px 0 16px;border:0;border-radius:500px;background:#fff;color:var(--hx-ink);
	font:600 15px/1 inherit;font-family:inherit;white-space:nowrap;cursor:pointer;
	box-shadow:0 12px 28px -8px rgba(13,10,70,.45),0 0 0 1px rgba(13,10,70,.06);
	transition:transform .2s var(--hx-out),box-shadow .2s ease-out}
.hx-try svg{width:18px;height:18px;flex:none;color:var(--hx-violet)}
.hr-screen:hover .hx-try{transform:translateY(-2px);box-shadow:0 16px 32px -8px rgba(13,10,70,.5),0 0 0 1px rgba(13,10,70,.06)}
.hx-try:focus-visible{outline:2px solid var(--hx-violet);outline-offset:3px}
dialog.hx-stage{position:fixed;inset:0;margin:auto;width:min(1240px,calc(100vw - 48px));height:min(800px,calc(100dvh - 48px));
	max-width:none;max-height:none;padding:0;border:0;border-radius:16px;overflow:hidden;background:#fff;color:var(--hx-ink);
	box-shadow:0 40px 90px -20px rgba(13,10,70,.55);display:none;flex-direction:column;transform-origin:0 0}
dialog.hx-stage[open]{display:flex}
dialog.hx-stage::backdrop{background:rgba(13,10,70,.5);opacity:0;transition:opacity .25s ease-out}
dialog.hx-stage.hx-on::backdrop{opacity:1}
.hx-stage__bar{flex:none;display:flex;align-items:center;gap:12px;height:48px;padding:0 10px 0 16px;background:#f4f5fd;font-size:.85rem}
.hx-stage__url{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--hx-muted)}
.hx-stage__url b{color:var(--hx-ink);font-weight:600;margin-right:10px}
.hx-stage__bar a{color:var(--hx-violet);font-weight:600;text-decoration:none;white-space:nowrap}
.hx-stage__bar a:hover{text-decoration:underline}
.hx-stage__x{all:unset;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;cursor:pointer;color:var(--hx-ink)}
.hx-stage__x:hover{background:rgba(13,10,70,.08)}
.hx-stage__x:focus-visible{outline:2px solid var(--hx-violet);outline-offset:1px}
.hx-stage__view{position:relative;flex:1 1 auto;min-height:0;background:#eef0f6}
.hx-stage__view iframe{position:absolute;inset:0;width:100%;height:100%;border:0;opacity:0;transition:opacity .25s ease-out}
.hx-stage__view.is-ready iframe{opacity:1}
/* Loading state: skeleton shapes that hold the layout until the demo paints. */
.hx-skel{position:absolute;inset:0;padding:22px;display:grid;grid-template-rows:38% auto 1fr;gap:16px;transition:opacity .2s ease-out}
.hx-stage__view.is-ready .hx-skel{opacity:0;pointer-events:none}
.hx-skel i{display:block;border-radius:10px;background:linear-gradient(100deg,#e3e6f0 40%,#f1f3f9 50%,#e3e6f0 60%) 0 0/300% 100%;animation:hx-shimmer 1.4s linear infinite}
.hx-skel div{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@keyframes hx-shimmer{to{background-position:-150% 0}}
@media (max-width:640px){dialog.hx-stage{width:100vw;height:100dvh;border-radius:0}.hx-try{bottom:12px;height:40px;font-size:14px}}

/* ───────── 5. AI-Ready form ───────── */
html.hx-form .hr-ai__row button[aria-busy="true"]{pointer-events:none;opacity:.85}
.hx-spin{display:inline-block;width:14px;height:14px;margin-right:8px;vertical-align:-2px;border-radius:50%;
	border:2px solid rgba(255,255,255,.4);border-top-color:#fff;animation:hx-spin .7s linear infinite}
@keyframes hx-spin{to{transform:rotate(1turn)}}
html.hx-form :is(#hx,[id^="page#"]) .hr-ai__note.hx-err{color:#b3261e}
html.hx-form :is(#hx,[id^="page#"]) .hr-ai__row input.hx-bad{border-color:#b3261e;box-shadow:0 0 0 3px rgba(179,38,30,.14)}
@keyframes hx-nudge{20%{transform:translateX(-5px)}50%{transform:translateX(4px)}80%{transform:translateX(-2px)}}
html.hx-form .hr-ai__row.hx-nudge{animation:hx-nudge .28s ease-out}

/* ───────── 6. Accent reserved for the action ───────── */
/* Violet stays on buttons, links and the one H1 phrase. Section headings, eyebrows, chips and the
   announcement bar step back to ink and neutral so the call to action is the colored thing. */
html.hx-accent :is(#hx,[id^="page#"]) h2 .hr-grad{background:none;-webkit-background-clip:border-box;background-clip:border-box;color:inherit}
html.hx-accent :is(#hx,[id^="page#"]) [class$="__eyebrow"]{color:var(--hx-muted)}
html.hx-accent :is(#hx,[id^="page#"]) [class$="__eyebrow"]::before{background:currentColor;opacity:.55}
html.hx-accent :is(#hx,[id^="page#"]) .hr-feat__tags span{color:var(--hx-ink);background:rgba(13,10,70,.045);box-shadow:inset 0 0 0 1px rgba(13,10,70,.12)}
html.hx-accent :is(#hx,[id^="page#"]) .hr-feat__tags a:hover span{color:var(--hx-violet);background:rgba(78,64,241,.08);box-shadow:inset 0 0 0 1px rgba(78,64,241,.4)}
html.hx-accent :is(#hx,[id^="page#"]).uk-section:has(.hr-ann){background-image:none;background-color:#eceefb}
html.hx-accent :is(#hx,[id^="page#"]) .hr-ann{color:var(--hx-ink)}
html.hx-accent :is(#hx,[id^="page#"]) .hr-ann__pill{background:transparent;box-shadow:inset 0 0 0 1px rgba(13,10,70,.35)}
html.hx-accent :is(#hx,[id^="page#"]) .hr-ann__more{color:var(--hx-violet);border-color:currentColor}

/* ───────── 7. Touch (0.2.0): 44px hit areas on coarse pointers. The box grows, nothing visible moves. ───────── */
@media (pointer:coarse){
	html.hx-touch :is(#hx,[id^="page#"]) :is(.hr-aud__more,.hr-ai__more,.hr-feat__more,.hr-show__all,.hr-cl__all,.hr-pr__jump a,.hr-pr__hosp-link,.hr-faq__topics button){position:relative}
	html.hx-touch :is(#hx,[id^="page#"]) :is(.hr-aud__more,.hr-ai__more,.hr-feat__more,.hr-show__all,.hr-cl__all,.hr-pr__jump a,.hr-pr__hosp-link)::after{content:"";position:absolute;inset:-11px -6px}
	html.hx-touch :is(#hx,[id^="page#"]) .hr-faq__topics button::after{content:"";position:absolute;inset:-6px 0}
	/* Feature chips: rows sit 16px apart so each chip's 43px hit area never meets its neighbour's. */
	html.hx-touch :is(#hx,[id^="page#"]) .hr-feat__tags{row-gap:16px}
	html.hx-touch :is(#hx,[id^="page#"]) .hr-feat__tags a{position:relative}
	html.hx-touch :is(#hx,[id^="page#"]) .hr-feat__tags a::after{content:"";position:absolute;inset:-8px -4px}
	html.hx-touch .hx-stops button{display:block;padding:14px 0 14px 4px;margin:-10px 0}
	/* Site chrome: menu button, footer rows, footer social icons. */
	html.hx-touch .tm-header-mobile .uk-navbar-toggle{min-width:44px;justify-content:center;margin-right:-12px}
	html.hx-touch footer .uk-iconnav > li > a{position:relative}
	html.hx-touch footer .uk-iconnav > li > a::after{content:"";position:absolute;inset:-12px -7px}
	html.hx-touch footer .el-item > a.uk-panel::after{content:"";position:absolute;inset:-10px 0}
}

/* ───────── 8. Finish (0.2.0): balanced headline wraps on every page ───────── */
html.hx-finish #tm-main :is(h1,h2,h3){text-wrap:balance}

/* ───────── 9. Link (0.2.0): a rate row and its tier stop light each other up; a row is a shortcut ───────── */
html.hx-link :is(#hx,[id^="page#"]) .hr-pr__card li{cursor:pointer;transition:background-color .15s ease-out}
html.hx-link :is(#hx,[id^="page#"]) .hr-pr__card li.hx-hot:not(.is-on){background-color:rgba(78,64,241,.07)}
html.hx-link .hx-stops li.hx-hot{color:var(--hx-violet)}
html.hx-link .hx-stops li.hx-hot::before{opacity:1;height:7px}

/* ───────── 10. Field (0.2.0): progress shows as you type, a likely typo gets a one-tap fix ───────── */
html.hx-field :is(#hx,[id^="page#"]) .hr-ai__row.hx-ok input{
	background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a8f5a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	background-repeat:no-repeat;background-position:right 14px center;background-size:18px;padding-right:40px}
/* A paragraph with a link, not a button: Gravity Forms paints every button in a form as a solid block. */
p.hx-suggest{margin:8px 0 0;padding:0;font-size:14px;line-height:1.4;color:var(--hx-muted)}
p.hx-suggest a{color:var(--hx-violet);font-weight:600;text-decoration:underline;text-underline-offset:3px;position:relative}
p.hx-suggest a:focus-visible{outline:2px solid var(--hx-violet);outline-offset:3px;border-radius:3px}
@media (pointer:coarse){p.hx-suggest a::after{content:"";position:absolute;inset:-13px -6px}}

@media print{html.hx-motion [data-hx-rise]{opacity:1;transform:none}.hx-try{display:none}}
@media (prefers-reduced-motion:reduce){
	html.hx-motion [data-hx-rise]{opacity:1;transform:none}
	html.hx-motion .uk-navbar-dropdown.uk-open,html.hx-motion .uk-navbar-dropdown.uk-open :is(.uk-nav > li,.el-item){animation:none}
	.hx-digit > .hx-new,.hx-digit > .hx-old{animation:none !important}
	.hx-digit > .hx-old{display:none}
	html.hx-calc :is(#hx,[id^="page#"]) .hr-pr__card li.hx-pulse{animation:none}
	.hx-skel i,.hx-spin{animation-duration:0s}
	html.hx-form .hr-ai__row.hx-nudge{animation:none}
	html.hx-motion :is(.hr-btn,.hr-fbtn,.hrg3-btn,.uk-button,.hr-feat__btn,.hr-ai__row button,.hx-try):active{transform:none !important}
}
