/* Motion layer for the public site. Loaded after style.css. Delete this file and its <link> to remove all of it.
   Everything here is progressive: without assets/motion.js the page looks exactly as before. */

:root { --bad: #b4452f; --bad-soft: #f6e3de; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bad: #ec8b75; --bad-soft: #3a211c; } }
:root[data-theme="dark"] { --bad: #ec8b75; --bad-soft: #3a211c; }

/* ---- Scroll progress + nav + sticky CTA ---- */
.scroll-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transform-origin: 0 50%; transform: scaleX(0); z-index: 80; pointer-events: none; }
.nav { transition: box-shadow .25s ease; }
.nav.scrolled { box-shadow: 0 6px 24px rgba(21,32,28,.08); }
.sticky-cta { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 90px); z-index: 70; padding: 13px 24px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 15.5px; text-decoration: none; box-shadow: 0 10px 30px rgba(0,0,0,.28); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .3s; opacity: 0; pointer-events: none; white-space: nowrap; }
.sticky-cta.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
@media (min-width: 901px) { .sticky-cta { left: 24px; right: auto; transform: translateY(90px); } .sticky-cta.show { transform: none; } }

/* ---- Reveal on scroll ---- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero .wrap { position: relative; z-index: 1; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.hero::before { width: 620px; height: 620px; right: -140px; top: -180px; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 24%, transparent), transparent); animation: drift-a 16s ease-in-out infinite alternate; }
.hero::after { width: 480px; height: 480px; left: -160px; bottom: -200px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 20%, transparent), transparent); animation: drift-b 19s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(-70px, 60px) scale(1.12); } }
@keyframes drift-b { to { transform: translate(80px, -50px) scale(1.15); } }

.hero h1 em { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0% 4px no-repeat; padding-bottom: 4px; animation: underline 1.1s .9s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes underline { to { background-size: 100% 4px; } }

.hero-photo img { transform: translate3d(0, calc(var(--py, 0) * 1px), 0) scale(1.08); will-change: transform; }
.hero-chat { animation: bob 7s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.hero-chat .b { transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1); }
.hero-chat .b.pre { opacity: 0; transform: translateY(10px) scale(.96); }
.hero-typing { display: inline-flex; gap: 4px; padding: 11px 13px; }
.hero-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: cd-dot 1s infinite; }
.hero-typing span:nth-child(2) { animation-delay: .15s; } .hero-typing span:nth-child(3) { animation-delay: .3s; }
.float-note { transition: opacity .5s ease, transform .55s cubic-bezier(.2,1.3,.3,1); }
.float-note.pre { opacity: 0; transform: translateY(14px) scale(.9); }
.float-note .dot { position: relative; }
.float-note .dot::after { content: ""; position: absolute; inset: 0; border-radius: 10px; border: 2px solid var(--ok); opacity: 0; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---- Buttons ---- */
.btn { transition: background .15s, border-color .15s, color .15s, transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .ic { transition: transform .2s ease; }
.btn:hover .ic { transform: translateX(4px); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.3) 50%, transparent 70%); transform: translateX(-120%); }
.btn-primary:hover::after { transform: translateX(120%); transition: transform .7s ease; }
.btn-primary:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 38%, transparent); }
.hero-ctas .btn-primary { animation: cta-pulse 3s 2.5s ease-out infinite; }
@keyframes cta-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 14px transparent; } }

/* ---- Cards and photos ---- */
.card, .price, .industry { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover, .price:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.industry:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.icon { transition: transform .3s cubic-bezier(.2,1.3,.3,1), background .2s; }
.card:hover .icon { transform: rotate(-7deg) scale(1.1); }
.step-num { transition: color .25s ease, transform .25s ease; }
.card:hover .step-num { transform: translateX(4px); }
.price.featured { animation: glow 3.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent), var(--shadow); } }

/* ---- Key facts strip ---- */
.stats { padding: 0 0 8px; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; color: var(--brand); letter-spacing: -.02em; }
.stat b i { font-style: normal; }
.stat span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
@media (max-width: 800px) { .stats .wrap { grid-template-columns: 1fr 1fr; } }

/* ---- With / without comparison ---- */
.diff-switch { display: flex; justify-content: center; gap: 6px; padding: 5px; width: fit-content; margin: 34px auto 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }
.diff-switch button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 99px; cursor: pointer; transition: background .2s, color .2s; }
.diff-switch button[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.diff-switch button[data-mode="without"][aria-selected="true"] { background: var(--bad); color: #fff; }
.diff-stage { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 28px 24px; }
.diff-stage[data-mode="with"] .pane-without, .diff-stage[data-mode="without"] .pane-with { display: none; }
.tl { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 20px; }
.tl li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.pane-without .tl li::before { border-color: var(--bad); }
.tl .t { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.tl .m { display: block; font-size: 16px; color: var(--ink); }
.tl .m em { font-style: normal; font-weight: 600; color: var(--bad); }
.pane-with .tl .m em { color: var(--ok); }
.result { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 14px 16px; border-radius: 12px; font-weight: 600; }
.pane-without .result { background: var(--bad-soft); color: var(--bad); }
.pane-with .result { background: var(--ok-soft); color: var(--ok); }
.result .ic { width: 22px; height: 22px; flex: none; }
.diff-note { text-align: center; margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.diff-stage.anim .tl li, .diff-stage.anim .result { opacity: 0; transform: translateX(-14px); }
.diff-stage.anim.play .tl li, .diff-stage.anim.play .result { animation: tl-in .55s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i, 0) * .75s); }
@keyframes tl-in { to { opacity: 1; transform: none; } }

/* ---- Monthly / yearly price switch ---- */
.billing-toggle { display: flex; gap: 4px; padding: 4px; width: fit-content; margin: 30px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }
.billing-toggle button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 600; font-size: 15px; padding: 9px 18px; border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.billing-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.save-chip { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: #fff; }
.bill-note { min-height: 22px; margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--ok); }

/* ---- Lead celebration in the live demo ---- */
.counter b.bump { animation: bump .5s cubic-bezier(.2,1.5,.3,1); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--accent); } }
.confetti { position: fixed; width: 0; height: 0; z-index: 90; pointer-events: none; }
.confetti span { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: confetti 1.2s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }

/* ---- Respect reduced motion: show everything in its final state ---- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero h1 em { background-size: 100% 4px; }
  .hero-chat .b.pre, .float-note.pre { opacity: 1; transform: none; }
  .diff-stage.anim .tl li, .diff-stage.anim .result { opacity: 1; transform: none; }
  .hero-photo img { transform: none; }
  .scroll-progress { display: none; }
}
