/* Küttekool – liikumine. Laaditakse ainult avalehel. */

/* Lenis (lenis.css 1.3.27 põhjal). Avalehe CSS paneb html-ile scroll-behavior:smooth, mis tülitseb Lenisega. */
html.lenis,
html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

/* Hero: peidame teksti ainult seni, kuni GSAP selle sisse toob. Ilma JS-ita võtab head-skript klassi 3 s pärast maha. */
html.kk-motion:not(.kk-motion-ready) .kk-hero-copy > * { opacity: 0; }

.kk-hero h1 .kk-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.kk-hero h1 .kk-line-in { display: inline-block; }
.kk-motion-ready .kk-hero-image { overflow: hidden; }

/* Tempo-punktid "oma tempos." all (92 BPM) */
.kk-tempo { display: flex; align-items: center; gap: 10px; margin: 18px 0 2px; }
.kk-tempo i { width: 10px; height: 10px; border-radius: 50%; background: rgba(98, 190, 201, .28); animation: kk-tick 2.608s linear infinite; }
.kk-tempo i:first-child { width: 12px; height: 12px; }
.kk-tempo i:nth-child(2) { animation-delay: .652s; }
.kk-tempo i:nth-child(3) { animation-delay: 1.304s; }
.kk-tempo i:nth-child(4) { animation-delay: 1.956s; }
.kk-tempo.is-paused i { animation-play-state: paused; }
@keyframes kk-tick {
	0%   { transform: scale(1.7); background: var(--kk-accent, #62bec9); box-shadow: 0 0 16px rgba(98, 190, 201, .8); }
	25%  { transform: scale(1); background: rgba(98, 190, 201, .55); box-shadow: none; }
	100% { transform: scale(1); background: rgba(98, 190, 201, .28); }
}

/* Tähed ja sõnad, mida JS tükeldab */
.kk-strip .kk-char,
.kk-final h2 .kk-word { display: inline-block; }
/* Avalehe CSS stiilib kõiki .kk-strip span-e väikese kirjeldustekstina; EST tähed peavad pärima pealkirja stiili. */
.kk-home .kk-strip strong .kk-char { all: unset; display: inline-block; }

/* Lõpusektsiooni "taldriku" välgatus */
.kk-final .kk-flash {
	position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: screen;
	background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(255, 255, 255, .22), rgba(98, 190, 201, .12) 40%, transparent 70%);
}

/* Nupu löök: ring vajutuskohast */
.kk-motion-ready .kk-hero .wp-block-button__link,
.kk-motion-ready .kk-section .wp-block-button__link,
.kk-motion-ready .kk-final .wp-block-button__link,
.kk-motion-ready .kk-plan-button { position: relative; overflow: hidden; }
.kk-ripple {
	position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
	border: 2px solid currentColor; pointer-events: none; animation: kk-ring .6s ease-out forwards;
}
@keyframes kk-ring { from { transform: scale(1); opacity: .7; } to { transform: scale(22); opacity: 0; } }
.kk-motion-ready .wp-block-button__link span[aria-hidden="true"] { display: inline-block; transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.kk-motion-ready .wp-block-button__link:hover span[aria-hidden="true"] { transform: translate(3px, -3px); }
.kk-motion-ready .wp-block-button__link:active,
.kk-motion-ready .kk-plan-button:active { transform: scale(.96); }

/* Kerimisriba (valikuline) */
.kk-progress {
	position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none;
	background: var(--kk-accent, #62bec9); transform-origin: 0 50%; transform: scaleX(0);
}
.admin-bar .kk-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .kk-progress { top: 46px; } }

@media (prefers-reduced-motion: reduce) {
	html.kk-motion .kk-hero-copy > * { opacity: 1 !important; }
	.kk-tempo, .kk-ripple, .kk-flash, .kk-progress { display: none !important; }
	.kk-motion-ready .wp-block-button__link span[aria-hidden="true"] { transition: none; }
}
