/* KavanaStock landing - shared motion. Plain CSS, no libraries. */
:root { --kv-ease: cubic-bezier(.22, 1, .36, 1); }

/* Scroll reveal (only hides when JS is running) */
html.js [data-reveal]:not(.is-in) { opacity: 0; transform: translate3d(0, 22px, 0); }
html.js [data-reveal="fade"]:not(.is-in) { transform: none; }
html.js [data-reveal="scale"]:not(.is-in) { transform: scale(.96); }
html.js [data-reveal] {
    transition: opacity .8s var(--kv-ease), transform .8s var(--kv-ease);
    transition-delay: var(--d, 0ms);
}

/* Header: gentle shrink and shadow once you scroll */
body > header { transition: padding .35s var(--kv-ease), box-shadow .35s var(--kv-ease), background-color .35s; }
body > header.is-scrolled { padding-top: .7rem; padding-bottom: .7rem; box-shadow: 0 6px 24px rgba(0,0,0,.05); }

/* Buttons and links */
a[href*="register"], button[data-action], button[data-nav] {
    transition: transform .25s var(--kv-ease), box-shadow .25s var(--kv-ease), background-color .2s, border-color .2s, color .2s;
}
a[href*="register"]:hover { transform: translateY(-2px); }
a[href*="register"]:active, button[data-action]:active { transform: translateY(0) scale(.97); }
nav a, footer a { transition: color .2s; }

/* Card lift */
#pricing .grid > div, #post-list > a, .group.bg-white {
    transition: transform .4s var(--kv-ease), box-shadow .4s var(--kv-ease), border-color .3s;
}
#pricing .grid > div:hover, #post-list > a:hover { transform: translateY(-5px); }
#pricing .grid > div.md\:-mt-4:hover { transform: translateY(-5px); }

/* FAQ: height + fade are animated in animations.js (works in every browser) */
details > summary { -webkit-tap-highlight-color: transparent; }
.faq-plus { display: inline-block; transition: transform .45s var(--kv-ease), color .25s; will-change: transform; }
details[open]:not(.kv-closing) .faq-plus { transform: rotate(135deg); color: #111; }
details summary:hover .faq-plus { color: #111; }

/* Doodles drift gently, like in the app */
@keyframes kvFloat {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r)); }
    50% { transform: translate3d(12px, -16px, 0) rotate(calc(var(--r) + 12deg)); }
}
.kv-doodles span { animation: kvFloat 30s ease-in-out infinite; will-change: transform; }
.kv-doodles span:nth-child(2n) { animation-duration: 38s; animation-delay: -9s; }
.kv-doodles span:nth-child(3n) { animation-duration: 44s; animation-delay: -21s; }
.kv-doodles span:nth-child(5n) { animation-duration: 34s; animation-delay: -14s; }
@keyframes kvTwinkle { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }
.kv-doodles span.white { animation: kvFloat 26s ease-in-out infinite, kvTwinkle 5s ease-in-out infinite; }

/* Demo transitions */
@keyframes kvIn { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes kvCap { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.98); } to { opacity: 1; transform: none; } }
#kv-main.kv-in { animation: kvIn .45s var(--kv-ease); }
#kv-cap.kv-in { animation: kvCap .5s var(--kv-ease); }
#kv-main .h-full { transition: width .6s var(--kv-ease); }

/* Reading progress bar (blog post) */
#kv-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: #111; z-index: 60; }

/* Page-to-page fade where supported */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .25s ease both kvFadeOut; }
::view-transition-new(root) { animation: .35s ease both kvFadeIn; }
@keyframes kvFadeOut { to { opacity: 0; } }
@keyframes kvFadeIn { from { opacity: 0; } }

/* Respect reduced motion: show everything, no movement */
@media (prefers-reduced-motion: reduce) {
    html.js [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
    .kv-doodles span, #kv-main.kv-in, #kv-cap.kv-in { animation: none !important; }
    a[href*="register"]:hover, #pricing .grid > div:hover, #post-list > a:hover { transform: none; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Demo on phones: smaller doodles, no hover lift on touch */
@media (max-width: 767px) {
    #kv-demo .kv-doodles span { transform-origin: center; scale: .7; }
    #kv-demo .kv-doodles span:nth-child(n+9) { display: none; }
}
@media (hover: none) {
    a[href*="register"]:hover, #pricing .grid > div:hover, #post-list > a:hover { transform: none; }
}

/* Cookie banner */
#kv-consent { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: 12px; max-width: 34rem; margin: 0 auto;
    background: #0a0a0a; color: #e5e5e5; border-radius: 1rem; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
    display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.5;
    opacity: 0; transform: translateY(16px); transition: opacity .4s var(--kv-ease), transform .4s var(--kv-ease); }
#kv-consent.kv-in { opacity: 1; transform: none; }
#kv-consent.kv-out { opacity: 0; transform: translateY(16px); }
#kv-consent a { color: #fff; text-decoration: underline; }
#kv-consent div { display: flex; gap: 8px; justify-content: flex-end; }
#kv-consent button { border-radius: .75rem; padding: 9px 16px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid #404040; background: transparent; color: #e5e5e5; }
#kv-consent button[data-c="yes"] { background: #fff; color: #0a0a0a; border-color: #fff; }
@media (max-width: 767px) { #kv-consent { bottom: 78px; } }
@media (min-width: 640px) { #kv-consent { flex-direction: row; align-items: center; justify-content: space-between; left: auto; right: 16px; bottom: 16px; margin: 0; } }

/* Keyboard focus */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid #111; outline-offset: 3px; border-radius: 6px; }
.bg-neutral-950 a:focus-visible, #kv-consent button:focus-visible { outline-color: #fff; }

/* Article content: tables, steps, links, headings (SEO / readability) */
.article section { scroll-margin-top: 6rem; }
.article h2 { scroll-margin-top: 6rem; }
.article h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.1rem; color: #0a0a0a; margin: 1.75rem 0 .5rem; line-height: 1.35; }
.article a { color: #0a0a0a; text-decoration: underline; text-decoration-color: #a3a3a3; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.article a:hover { text-decoration-color: #0a0a0a; }
.article ol.steps { list-style: none; margin: 1.25rem 0 1.5rem; padding: 0; counter-reset: s; }
.article ol.steps li { background: #fff; border: 1px solid #e5e5e5; border-radius: .9rem; padding: .8rem 1rem; margin-bottom: .6rem; color: #404040; line-height: 1.65; }
.article table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-size: .95rem; background: #fff; }
.article caption { caption-side: top; text-align: left; font-size: .8rem; font-weight: 600; color: #737373; padding: 0 0 .5rem; }
.article th, .article td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid #e5e5e5; color: #404040; line-height: 1.5; }
.article th { background: #fafafa; color: #0a0a0a; font-weight: 700; border-top: 1px solid #e5e5e5; white-space: nowrap; }
.article tbody tr:last-child td { border-bottom: 1px solid #e5e5e5; }
.article .overflow-x-auto { border-radius: .9rem; }

/* Legal pages */
.legal hr { border: 0; border-top: 1px solid #e5e5e5; margin: 2rem 0; }
.legal > p:first-child { color: #737373; font-size: .95rem; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
.legal .website-note { background: #fff; border: 1px solid #e5e5e5; border-radius: 1rem; padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.legal .website-note h2 { margin-top: 0; }
.legal li { color: #404040; }

/* Section doodles (landing page) */
.kv-sec { position: relative; overflow: hidden; }
.kv-sec > :not(.kv-doodles) { position: relative; z-index: 1; }
.kv-doodles.page { z-index: 0; opacity: .9; }
.kv-doodles.on-dark span { color: rgba(255,255,255,.075) !important; opacity: 1 !important; }
.kv-sec.kv-paused .kv-doodles span { animation-play-state: paused; }
@media (max-width: 767px) {
    .kv-sec > .kv-doodles span { scale: .62; }
    .kv-sec > .kv-doodles span:nth-child(n+4) { display: none; }
}

/* How it works: animated step illustrations (sequenced by animations.js) */
.kv-art .art-in { opacity: 0; transform: translate3d(0, 10px, 0) scale(.98); transition: opacity .5s ease, transform .65s var(--kv-ease); }
.kv-art .art-bar > i { display: block; height: 100%; border-radius: 999px; transform: scaleX(0); transform-origin: left; transition: transform .95s var(--kv-ease) .2s; }
.kv-art .art-stock > i { display: block; height: 100%; border-radius: 999px; width: 62%; transition: width .9s var(--kv-ease); }
.kv-art .art-low { opacity: 0; transition: opacity .3s; }
.kv-art .art-pop, .kv-art .art-pop2 { display: inline-block; }
.kv-art .art-pop2, .kv-art .art-sync { opacity: 0; }
.kv-art .art-arrow { stroke-dasharray: 40; stroke-dashoffset: 40; transition: stroke-dashoffset .7s var(--kv-ease); }
.kv-art .art-mapped { opacity: 0; transform: scale(.8); transition: opacity .35s, transform .5s var(--kv-ease); }
.kv-art .art-new { transition: opacity .3s; }
.kv-art .q-to { opacity: 0; transition: opacity .35s; }
.kv-art .q-from { transition: opacity .35s; }
.kv-art.s1 .a1, .kv-art.s2 .a2, .kv-art.s3 .a3, .kv-art.s4 .a4, .kv-art.s5 .a5 { opacity: 1; transform: none; }
.kv-art.s1 .a1 .art-bar > i, .kv-art.s2 .a2 .art-bar > i, .kv-art.s3 .a3 .art-bar > i, .kv-art.s4 .a4 .art-bar > i { transform: scaleX(1); }
.kv-art.s3 .art-low { opacity: 1; animation: kvRing 1.5s ease-out infinite; }
.kv-art.s4 .art-btn { animation: kvPress .7s var(--kv-ease); }
.kv-art.s5 .art-pop { animation: kvPop .7s var(--kv-ease); }
.kv-art.s2 .art-arrow { stroke-dashoffset: 0; }
.kv-art.s2 .art-mapped { opacity: 1; transform: none; }
.kv-art.s2 .art-new { opacity: 0; }
.kv-art.s3 .art-stock > i { width: 50%; }
.kv-art.s3 .q-from { opacity: 0; }
.kv-art.s3 .q-to { opacity: 1; }
.kv-art.s4 .art-pop2 { opacity: 1; animation: kvPop .7s var(--kv-ease); }
.kv-art.s5 .art-sync { opacity: 1; transition: opacity .5s; }
@keyframes kvRing { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
@keyframes kvPress { 0%,100% { transform: scale(1); } 40% { transform: scale(.88); } }
@keyframes kvPop { 0% { transform: scale(.7); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
/* No JavaScript: just show the finished picture */
html:not(.js) .kv-art .art-in { opacity: 1; transform: none; }
html:not(.js) .kv-art .art-bar > i { transform: none; }
html:not(.js) .kv-art .art-low, html:not(.js) .kv-art .art-pop2, html:not(.js) .kv-art .art-sync, html:not(.js) .kv-art .art-mapped, html:not(.js) .kv-art .q-to { opacity: 1; }
html:not(.js) .kv-art .art-new, html:not(.js) .kv-art .q-from { opacity: 0; }
html:not(.js) .kv-art .art-arrow { stroke-dashoffset: 0; }
html:not(.js) .kv-art .art-stock > i { width: 50%; }
@media (prefers-reduced-motion: reduce) { .kv-art .art-low, .kv-art .art-pop, .kv-art .art-pop2, .kv-art .art-btn { animation: none !important; } }

/* Extra steps for the profit and SumUp panels */
.kv-art.s6 .a6, .kv-art.s7 .a7 { opacity: 1; transform: none; }
.kv-art .art-hl { transition: background-color .6s; }
.kv-art.s4 .art-hl { animation: kvHl 1.8s ease-out; }
.kv-art.s7 .art-pop7 { animation: kvPop .7s var(--kv-ease); }
@keyframes kvHl { 0% { background-color: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background-color: transparent; } }
.kv-art .m-after { opacity: 0; transform: scale(.85); transition: opacity .4s .3s, transform .5s var(--kv-ease) .3s; }
.kv-art .m-before { transition: opacity .25s .35s; }
.kv-art.s5 .m-before { opacity: 0; animation: kvPress .5s var(--kv-ease); }
.kv-art.s5 .m-after { opacity: 1; transform: none; }
.kv-art .art-stock2 > i { display: block; height: 100%; border-radius: 999px; width: 62%; transition: width 1s var(--kv-ease) .2s; }
.kv-art.s6 .art-stock2 > i { width: 30%; }
.kv-art .q2-to { opacity: 0; transition: opacity .35s .2s; }
.kv-art .q2-from { transition: opacity .35s .2s; }
.kv-art.s6 .q2-from { opacity: 0; }
.kv-art.s6 .q2-to { opacity: 1; }
html:not(.js) .kv-art .m-after, html:not(.js) .kv-art .q2-to { opacity: 1; transform: none; }
html:not(.js) .kv-art .m-before, html:not(.js) .kv-art .q2-from { opacity: 0; }
html:not(.js) .kv-art .art-stock2 > i { width: 30%; }
@media (prefers-reduced-motion: reduce) { .kv-art .art-hl, .kv-art .art-pop7 { animation: none !important; } }
