/* Homepage 3D hero, premium layer (templates/core/home.html, static/js/home-hero-plus.js).
   On top of the original hero: a cursor spotlight and fine grain, a soft glow behind the text so it always reads
   over the orb, a proof row, and three small product cards that float around the orb and tilt with the pointer.
   Everything here is decorative; with reduced motion it all stands still. */

/* ---------- Light that follows the cursor + film grain ---------- */
html body .hm-hero .hm-spot { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: 0; transition: opacity .6s ease;
    background: radial-gradient(520px circle at var(--hm-mx, 70%) var(--hm-my, 40%), rgba(123, 60, 245, .11), rgba(233, 53, 143, .05) 40%, transparent 70%); }
html body .hm-hero.is-pointer .hm-spot { opacity: 1; }
html body .hm-hero .hm-grain { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .05; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- The 3D scene eases back as the page scrolls ---------- */
html body .hm-hero .hm-3d { translate: 0 calc(var(--hm-sp, 0) * -70px); scale: calc(1 - var(--hm-sp, 0) * .1); }
html body .hm-hero .hm-orbit { translate: 0 calc(var(--hm-sp, 0) * -40px); }

/* ---------- Laptops and desktops: the text always fits one screen and reads over the orb ---------- */
@media (min-width: 901px) {
    html body .hm-hero .hm-copy::before { content: ''; position: absolute; z-index: -1; inset: -6% -16% -8% -20%; pointer-events: none;
        background: radial-gradient(closest-side, rgba(245, 247, 251, .9), rgba(245, 247, 251, .62) 58%, rgba(245, 247, 251, 0)); }
    html body .hm-hero .hm-title { font-size: clamp(2.6rem, min(4.7vw, 7.4vh), 4.7rem); margin: clamp(.9rem, 2.2vh, 1.4rem) 0 clamp(.9rem, 2.2vh, 1.3rem); }
    html body .hm-hero .hm-lead { font-size: clamp(1rem, min(1.35vw, 2.2vh), 1.2rem); margin-bottom: clamp(1.3rem, 3.2vh, 2.2rem); max-width: 540px; }
    html body .hm-hero .hm-trust { margin-top: .9rem; }
}

/* ---------- Proof row under the buttons (named hm-assure: an older .hm-proof style exists in calm-hand.css) ---------- */
html body .hm-assure { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.2rem; margin-top: clamp(1.1rem, 2.6vh, 1.6rem); font-size: .9rem; font-weight: 600; color: #3F4A66; }
html body .hm-assure-g { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .85rem .42rem .7rem; border-radius: 999px; text-decoration: none;
    color: #0B1438; background: rgba(255, 255, 255, .85); border: 1px solid #E2E6EF; box-shadow: 0 10px 24px -16px rgba(46, 30, 120, .5);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .3s ease, border-color .3s ease; }
html body .hm-assure-g:hover { color: #0B1438; transform: translateY(-1px); border-color: #D8CCFF; }
html body .hm-assure-stars { letter-spacing: .06em; background: linear-gradient(90deg, #F59E0B, #FBBF24); -webkit-background-clip: text; background-clip: text; color: transparent; }
html body .hm-assure-item { display: inline-flex; align-items: center; gap: .45rem; }
html body .hm-assure-item i { font-size: .8rem; background: linear-gradient(135deg, #2D5BFF, #7B3CF5 55%, #E9358F); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Product cards around the orb ---------- */
.hm-pc { display: none; }
@media (min-width: 1280px) {
    html body .hm-pc { display: block; position: absolute; z-index: 1; width: 214px; padding: .85rem .95rem .9rem; border-radius: 18px; pointer-events: none;
        color: #0B1438; background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
        border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 1px rgba(11, 20, 56, .05), 0 30px 60px -30px rgba(46, 30, 120, .55), inset 0 1px 0 #fff;
        transform: perspective(700px) translate3d(var(--px, 0px), var(--py, 0px), 0) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
        transition: transform .5s cubic-bezier(.16, 1, .3, 1);
        animation: hmPcIn 1s cubic-bezier(.16, 1, .3, 1) both, hmPcFloat 7s ease-in-out infinite; }
    /* positions inside the orb column; chips sit at 10%/30%/18%/4% (see home-v3.css), the cards fill the gaps between them */
    html body .hm-pc-chat { right: 6%; top: -4%; width: 222px; animation-delay: 1.35s, -2.4s; }
    html body .hm-pc-dash { right: 3%; top: 40%; width: 206px; animation-delay: 1.1s, 1.1s; }
    html body .hm-pc-health { left: 30%; bottom: -3%; width: 200px; animation-delay: 1.6s, -4.6s; }

    /* a fine light catching the top edge */
    html body .hm-pc::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
        background: linear-gradient(135deg, rgba(255, 255, 255, .9), transparent 38%); opacity: .55; }
}
/* wide screens: three cards; the chips make room for them */
@media (min-width: 1440px) {
    html body .hm-hero .hm-chip-3 { left: 0; bottom: 30%; }
    html body .hm-hero .hm-chip-4 { right: 2%; bottom: 14%; }
}
/* laptops 1280-1439px: the orb column is smaller, so two smaller cards (chat, dashboard) and the last chip takes the third card's place */
@media (min-width: 1280px) and (max-width: 1439px) {
    html body .hm-pc { width: 188px !important; padding: .7rem .8rem .75rem; }
    html body .hm-pc-health { display: none; }
    html body .hm-pc-dash { top: 41%; right: 3%; }
    html body .hm-pc-big { font-size: 1.45rem; }
    html body .hm-pc-spark { height: 34px; }
    html body .hm-pc-msg { font-size: .72rem; }
    html body .hm-hero .hm-chip-4 { right: auto; left: 30%; bottom: 2%; }
}
@keyframes hmPcIn { from { opacity: 0; translate: 0 26px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: none; } }
@keyframes hmPcFloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -10px; } }

html body .hm-pc-head { position: relative; display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; font-size: .74rem; font-weight: 700; letter-spacing: .01em; color: #3F4A66; }
html body .hm-pc-head em { margin-left: auto; font-style: normal; font-weight: 600; font-size: .68rem; color: #8A93AD; }
html body .hm-pc-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); animation: hmPcPulse 2s ease-out infinite; }
@keyframes hmPcPulse { to { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }

/* dashboard: a number, a sparkline that draws itself and bars that grow */
html body .hm-pc-big { display: inline-block; font-family: var(--font-heading, inherit); font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
    background: linear-gradient(100deg, #2D5BFF, #7B3CF5 50%, #E9358F); -webkit-background-clip: text; background-clip: text; color: transparent; }
html body .hm-pc-big small { font-size: .9rem; }
html body .hm-pc-sub { display: inline-block; margin-left: .35rem; font-size: .72rem; font-weight: 600; color: #5B6480; }
html body .hm-pc-spark { display: block; width: 100%; height: 42px; margin: .5rem 0 .4rem; overflow: visible; }
/* the chart draws once, then stays; a live dot pulses at its newest point */
html body .hm-pc-line { stroke-dasharray: 260; stroke-dashoffset: 260; animation: hmSpark 1.8s cubic-bezier(.65, 0, .35, 1) 1.6s forwards; }
html body .hm-pc-area { opacity: 0; animation: hmArea 1.2s ease 2.6s forwards; }
html body .hm-pc-live { fill: #E9358F; opacity: 0; transform-box: fill-box; transform-origin: center; animation: hmArea .4s ease 3.3s forwards, hmLive 1.8s ease-out 3.6s infinite; }
@keyframes hmSpark { to { stroke-dashoffset: 0; } }
@keyframes hmArea { to { opacity: 1; } }
@keyframes hmLive { 0% { transform: scale(1); } 60% { transform: scale(1.9); opacity: .25; } 100% { transform: scale(1); opacity: 1; } }
html body .hm-pc-bars { display: flex; align-items: flex-end; gap: 5px; height: 26px; }
html body .hm-pc-bars i { flex: 1; height: var(--h); border-radius: 4px 4px 2px 2px; transform-origin: bottom; transform: scaleY(.12);
    background: linear-gradient(180deg, #A78BFA, #E9E3FF); animation: hmBar 1.1s cubic-bezier(.16, 1, .3, 1) 1.4s forwards; }
html body .hm-pc-bars i:last-child { background: linear-gradient(180deg, #7B3CF5, #E9358F); }
html body .hm-pc-bars i:nth-child(2) { animation-delay: 1.5s; } html body .hm-pc-bars i:nth-child(3) { animation-delay: 1.6s; }
html body .hm-pc-bars i:nth-child(4) { animation-delay: 1.7s; } html body .hm-pc-bars i:nth-child(5) { animation-delay: 1.8s; } html body .hm-pc-bars i:nth-child(6) { animation-delay: 1.9s; }
@keyframes hmBar { to { transform: scaleY(1); } }

/* AI chat: the visitor asks, the assistant "types", then answers; on a loop */
html body .hm-pc-bot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: .62rem; color: #fff;
    background: linear-gradient(135deg, #2D5BFF, #7B3CF5 55%, #E9358F); }
html body .hm-pc-head em::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: .3rem; border-radius: 50%; background: #22C55E; vertical-align: 1px; }
html body .hm-pc-msg { margin: 0 0 .4rem; padding: .45rem .65rem; border-radius: 12px; font-size: .76rem; line-height: 1.35; max-width: 92%; }
html body .hm-pc-msg.is-user { margin-left: auto; color: #fff; border-bottom-right-radius: 4px; background: linear-gradient(135deg, #2D5BFF, #7B3CF5); width: max-content; }
html body .hm-pc-msg.is-bot { position: relative; margin-bottom: 0; min-height: 2.1em; color: #0B1438; background: #F1EEFD; border-bottom-left-radius: 4px; }
html body .hm-pc-msg.is-bot b { color: #16A34A; }
html body .hm-pc-typing { position: absolute; left: .65rem; top: 50%; translate: 0 -50%; display: inline-flex; gap: 3px; animation: hmTyping 7s linear 1.8s infinite; }
html body .hm-pc-typing i { width: 5px; height: 5px; border-radius: 50%; background: #7B3CF5; animation: hmDot 1s ease-in-out infinite; }
html body .hm-pc-typing i:nth-child(2) { animation-delay: .15s; } html body .hm-pc-typing i:nth-child(3) { animation-delay: .3s; }
html body .hm-pc-reply { display: block; opacity: 0; animation: hmReply 7s ease 1.8s infinite; }
@keyframes hmDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes hmTyping { 0%, 22% { opacity: 1; } 24%, 100% { opacity: 0; } }
@keyframes hmReply { 0%, 23% { opacity: 0; translate: 0 4px; } 28%, 92% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }

/* site health card: light glass, meters fill once */
html body .hm-pc-bot.is-shield { background: linear-gradient(135deg, #16A34A, #22C55E); }
html body .hm-pc-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: .55rem; padding: .28rem 0; font-size: .74rem; font-weight: 600; color: #3F4A66; }
html body .hm-pc-row b { min-width: 2.6em; text-align: right; font-size: .76rem; font-weight: 800; color: #0B1438; font-variant-numeric: tabular-nums; }
html body .hm-pc-row b.is-ok { color: #16A34A; }
html body .hm-pc-meter { position: relative; height: 6px; border-radius: 6px; background: #EEF0F7; overflow: hidden; }
html body .hm-pc-meter i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; transform: scaleX(0); transform-origin: left;
    background: linear-gradient(90deg, #22C55E, #2D5BFF 60%, #7B3CF5); animation: hmMeter 1.4s cubic-bezier(.16, 1, .3, 1) 2s forwards; }
html body .hm-pc-row:nth-child(3) .hm-pc-meter i { animation-delay: 2.2s; } html body .hm-pc-row:nth-child(4) .hm-pc-meter i { animation-delay: 2.4s; }
@keyframes hmMeter { to { transform: scaleX(1); } }

/* ---------- Reduced motion: everything still, all content visible ---------- */
@media (prefers-reduced-motion: reduce) {
    html body .hm-pc, html body .hm-pc *, html body .hm-pc-line, html body .hm-pc-area { animation: none !important; }
    html body .hm-pc-line { stroke-dashoffset: 0; } html body .hm-pc-area, html body .hm-pc-live { opacity: 1; } html body .hm-pc-bars i { transform: none; }
    html body .hm-pc-typing { display: none; } html body .hm-pc-reply { opacity: 1 !important; } html body .hm-pc-meter i { transform: none; }
    html body .hm-hero .hm-3d, html body .hm-hero .hm-orbit { translate: none; scale: none; }
}

/* phones and tablets: the hero stacks badge, headline, buttons, intro, then the proof row and ticks */
@media (max-width: 900px) {
    html body .hm-copy > .hm-assure { order: 4; margin-top: .2rem; gap: .5rem .9rem; font-size: .85rem; }
    html body .hm-copy > .hm-trust { order: 5; }
}

/* card titles on one line; a small green "live" dot at the end */
html body .hm-pc-head { white-space: nowrap; }
html body .hm-pc-on { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
@media (min-width: 1280px) and (max-width: 1439px) { html body .hm-pc-head { font-size: .7rem; gap: .4rem; } }

/* the right-hand chip keeps a little air from the screen edge */
@media (min-width: 901px) { html body .hm-hero .hm-chip-2 { right: 3%; } }

/* "Free website check" card: the only clickable card, it opens the Website Grader */
@media (min-width: 1280px) { html body .hm-pc-check { pointer-events: auto; text-decoration: none; cursor: pointer; } }
html body .hm-pc-check:hover { color: #0B1438; box-shadow: 0 0 0 1px rgba(123, 60, 245, .35), 0 34px 70px -30px rgba(76, 29, 149, .6), inset 0 1px 0 #fff; }
html body .hm-pc-bot.is-gauge { background: linear-gradient(135deg, #2D5BFF, #7B3CF5); }
html body .hm-pc-score { display: grid; grid-template-columns: 58px 1fr; align-items: center; column-gap: .7rem; margin: .2rem 0 .65rem; position: relative; }
html body .hm-pc-score svg { grid-row: 1 / span 2; width: 58px; height: 58px; }
html body .hm-pc-ring { stroke-dasharray: 0 100; animation: hmRing 1.6s cubic-bezier(.16, 1, .3, 1) 1.8s forwards; }
@keyframes hmRing { to { stroke-dasharray: 72 100; } }
html body .hm-pc-score-n { position: absolute; left: 0; top: 50%; width: 58px; translate: 0 -50%; text-align: center; font-family: var(--font-heading, inherit);
    font-size: 1.05rem; font-weight: 800; color: #0B1438; line-height: 1; }
html body .hm-pc-score-n small { display: block; font-size: .5rem; font-weight: 700; color: #8A93AD; letter-spacing: .02em; }
html body .hm-pc-score-t { grid-column: 2; font-size: .72rem; line-height: 1.4; font-weight: 600; color: #3F4A66; white-space: normal; }
html body .hm-pc-cta { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .8rem; border-radius: 12px;
    font-size: .78rem; font-weight: 800; color: #fff; background: var(--cm-btn, linear-gradient(135deg, #2D5BFF, #7B3CF5 60%, #DB2777));
    box-shadow: 0 10px 22px -12px rgba(123, 60, 245, .8); transition: filter .25s ease; }
html body .hm-pc-cta i { font-size: .7rem; transition: transform .3s ease; }
html body .hm-pc-check:hover .hm-pc-cta { filter: brightness(1.08); }
html body .hm-pc-check:hover .hm-pc-cta i { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { html body .hm-pc-ring { stroke-dasharray: 72 100; } }

/* phones: "Book a free call" full width, the two white buttons side by side under it (shorter stack, clear of the robot) */
@media (max-width: 640px) {
    html body .hm-hero .hm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
    html body .hm-hero .hm-actions .hm-btn-main { grid-column: 1 / -1; }
    html body .hm-hero .hm-actions .hm-btn-ghost { justify-content: center; padding: .85rem .6rem; font-size: .9rem; gap: .4rem; white-space: nowrap; }
}
@media (max-width: 359px) { html body .hm-hero .hm-actions .hm-btn-ghost { font-size: .8rem; padding: .8rem .4rem; } }
/* short laptops (1280-1439 wide, up to 760 tall): the orb column is short, so chip 1 sits right of the headline
   and "Mobile Apps" sits above the website-check card */
@media (min-width: 1280px) and (max-width: 1439px) and (max-height: 760px) {
    html body .hm-hero .hm-chip-1 { left: 22%; top: 2%; }
    html body .hm-hero .hm-chip-2 { top: 30%; }
    html body .hm-pc-dash { top: 48%; }
}
