/* Motion for content below the first screen (see src/styles/motion.css for the
 * rules: everything scoped to html.m, only once on screen). Loaded without
 * blocking the first paint, from layouts/Base.astro. */

@keyframes pop { from { opacity: 0; transform: scale(0.8); } }
@keyframes jumpin { 0% { opacity: 0; transform: translateY(70px) scale(0.9); } 60% { opacity: 1; transform: translateY(-12px) scale(1.02); } 100% { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 50% { opacity: 0.35; } }
@keyframes bounce { 50% { transform: scaleY(calc(var(--h) * 0.45)); } }
@keyframes ring { 0% { opacity: 0; } 25%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ringStay { from { opacity: 0; } to { opacity: 1; } }
@keyframes glow { 50% { opacity: 0.25; } }

/* ---------- Shared "comes into view" effect ---------- */

/* Blocks: blurred, transparent and 20px lower until they are on screen; cards one after another. */
html.m :is(.eyebrow, .lead-text, .how-head p, .features-head p, .features-head picture, .cta-box > p, .sources, .stat, .step-card, .glass, .level, .p-card, .faq details, .wl-form, .cta-closed, .hints-note) {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(20px);
  transition: opacity var(--dur) ease, filter var(--dur) ease, transform var(--dur) ease;
  transition-delay: var(--d, 0s);
}
html.m :is(.eyebrow, .lead-text, .how-head p, .features-head p, .features-head picture, .cta-box > p, .sources, .stat, .step-card, .glass, .level, .p-card, .faq details, .wl-form, .cta-closed, .hints-note).is-in {
  opacity: 1;
  filter: none;
  transform: none;
}

/* Headings: word by word. */
html.m .h2 .w { display: inline-block; opacity: 0; filter: blur(12px); transform: translateY(20px); transition: opacity var(--dur) ease, filter var(--dur) ease, transform var(--dur) ease; transition-delay: calc(var(--i) * var(--word)); }
html.m .h2.is-in .w { opacity: 1; filter: none; transform: none; }

/* ---------- Problem: numbers count up (motion.js) ---------- */
html.m .stat .value { font-variant-numeric: tabular-nums; }

/* ---------- How it works: Lexa pops in with a small bounce ---------- */
html.m .step-card .step-head img { opacity: 0; transform: scale(0.8); }
html.m .step-card.is-in .step-head img { animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--d, 0s) + 0.2s); opacity: 1; transform: none; }

/* ---------- Features ---------- */

/* "Ekrana çizer": the yellow underline is drawn, then the handwritten note appears. */
html.m .glass.draw .under::after { transform: scaleX(0); transition: transform 0.7s ease 0.45s; }
html.m .glass.draw.is-in .under::after { transform: scaleX(1); }
html.m .glass.draw .hand { opacity: 0; transition: opacity 0.5s ease 1.2s; }
html.m .glass.draw.is-in .hand { opacity: 1; }

/* "Tahtayı kendisi açar": lines open one by one, then the line under "?" blinks. */
html.m .glass.board .board-demo > span { clip-path: inset(0 100% 0 0); }
html.m .glass.board.is-in .board-demo > span { animation: unclip 0.6s ease-out both; }
html.m .glass.board.is-in .board-demo > span:nth-child(1) { animation-delay: 0.35s; }
html.m .glass.board.is-in .board-demo > span:nth-child(2) { animation-delay: 0.85s; }
html.m .glass.board.is-in .board-demo > span:nth-child(3) { animation-delay: 1.35s; }
html.m .glass.board.is-in .board-demo > span:nth-child(4) { animation-delay: 1.85s; }
html.m .glass.board.is-in .blank::after { animation: glow 1s ease-in-out 2.4s infinite; }

/* Voice card: the sound wave keeps bouncing softly, each bar a little later. */
html.m .wave i { animation: bounce 1.2s ease-in-out infinite; animation-delay: calc(var(--k) * -0.09s); }

/* ---------- Hint levels light up in turn: blue, purple, then orange stays ---------- */
html.m .level { position: relative; }
html.m .level::after { content: ''; position: absolute; inset: -4px; border-radius: 24px; border: 3px solid var(--ring-color, #2F5BFF); opacity: 0; pointer-events: none; }
html.m .level.l1 { --ring-color: #2F5BFF; }
html.m .level.l2 { --ring-color: #7B5CFF; }
html.m .level.l3 { --ring-color: #FF8A1F; }
html.m .level.l1.is-in::after { animation: ring 0.9s ease 0.5s both; }
html.m .level.l2.is-in::after { animation: ring 0.9s ease 1.3s both; }
html.m .level.l3.is-in::after { animation: ringStay 0.5s ease 2.1s both; }

/* ---------- CTA ---------- */

/* Lexa jumps up into place, then keeps floating; the stars turn and twinkle. */
html.m .cta-lexa img { opacity: 0; }
html.m .cta-lexa.is-in img { opacity: 1; animation: jumpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both, float 3s ease-in-out 0.9s infinite; }
html.m .cta-star { animation: spin 14s linear infinite, twinkle 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.7s), calc(var(--i) * -0.6s); }

/* Star burst on a successful sign-up (motion.js creates the stars). */
.burst { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; }
