/* ─────────────────────────────────────────────────────────────────────────────
   Home page animations. Every rule targets a class that only exists on docs/index.md
   (.lx-hero, .lx-topics, .lx-compare) or that learn.js adds only on the home page (.lx-reveal),
   so no other page moves. Everything is switched off for "reduce motion" users.
   ───────────────────────────────────────────────────────────────────────────── */

@keyframes lx-fade-up   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lx-pop-in    { from { opacity: 0; transform: scale(0.85); }      to { opacity: 1; transform: none; } }
@keyframes lx-shimmer   { from { background-position: 0% 50%; }             to { background-position: 200% 50%; } }
@keyframes lx-breathe   { 0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
                          50%      { opacity: 1;    transform: translateX(-50%) scale(1.08); } }
@keyframes lx-pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes lx-glow      { 0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45); }
                          50%      { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); } }
@keyframes lx-draw-line { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ── Hero: content rises in one line after another ── */
.lx-hero > * { animation: lx-fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lx-hero > :nth-child(1) { animation-delay: 0.05s; }   /* eyebrow */
.lx-hero > :nth-child(2) { animation-delay: 0.15s; }   /* heading */
.lx-hero > :nth-child(3) { animation-delay: 0.3s; }    /* intro */
.lx-hero > :nth-child(4) { animation-delay: 0.45s; }   /* buttons */
.lx-hero > :nth-child(5) { animation: none; }          /* topic chips animate one by one below */

/* Gradient words slowly shimmer */
.lx-hero .lx-gradient {
  background-image: linear-gradient(90deg, var(--lx-sky-light), var(--lx-sky), #A78BFA, var(--lx-sky), var(--lx-sky-light));
  background-size: 200% auto;
  animation: lx-shimmer 6s linear infinite;
}

/* Soft glow behind the heading "breathes" */
.lx-hero::before { animation: lx-breathe 7s ease-in-out infinite; }

/* Eyebrow dot blinks like a "live" indicator */
.lx-hero .lx-eyebrow .twemoji { animation: lx-pulse-dot 1.8s ease-in-out infinite; }

/* Topic chips pop in one after another, then lift on hover */
.lx-topics span { animation: lx-pop-in 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both; transition: border-color 0.2s, color 0.2s, transform 0.2s; }
.lx-topics span:hover { border-color: var(--lx-sky); color: var(--lx-sky); transform: translateY(-2px); }
.lx-topics span:nth-child(1) { animation-delay: 0.6s; }
.lx-topics span:nth-child(2) { animation-delay: 0.65s; }
.lx-topics span:nth-child(3) { animation-delay: 0.7s; }
.lx-topics span:nth-child(4) { animation-delay: 0.75s; }
.lx-topics span:nth-child(5) { animation-delay: 0.8s; }
.lx-topics span:nth-child(6) { animation-delay: 0.85s; }
.lx-topics span:nth-child(7) { animation-delay: 0.9s; }
.lx-topics span:nth-child(8) { animation-delay: 0.95s; }
.lx-topics span:nth-child(9) { animation-delay: 1s; }

/* ── Scroll reveal: learn.js adds .lx-reveal, then .is-visible when the element scrolls into view ── */
.lx-reveal { opacity: 0; }
.lx-reveal.is-visible { animation: lx-fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--lx-delay, 0s) both; }

/* Learning path: the timeline line draws itself downwards */
.lx-path.lx-line-hidden ol::before { transform: scaleY(0); transform-origin: top; }
.lx-path.is-visible ol::before { animation: lx-draw-line 1.2s ease-out 0.2s both; }

/* "Recommended" badge in the Free vs Pro table gently pulses */
.lx-compare .lx-plan-badge { animation: lx-glow 2.4s ease-in-out infinite; }

/* ── Hero: rotating typed phrase ("building real things" → "building AI agents" …) ── */
@keyframes lx-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.lx-type-caret {
  display: inline-block; width: 0.06em; height: 0.9em; margin-left: 0.06em; vertical-align: -0.08em;
  background: var(--lx-sky); border-radius: 2px; animation: lx-blink 1s step-end infinite;
}

/* ── "See it in action": code editor + terminal that type themselves (filled by learn.js) ── */
.lx-demo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0 0.4rem; }
.lx-win {
  background: #0B1220; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.35);
}
.lx-win-bar {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0.8rem;
  background: #111A2E; border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.lx-dots { display: inline-flex; gap: 0.35rem; }
.lx-dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #FF5F57; }
.lx-dots i:nth-child(2) { background: #FEBC2E; }
.lx-dots i:nth-child(3) { background: #28C840; }
.lx-win-title { font-family: var(--md-code-font-family); font-size: 0.62rem; color: #94A3B8; }
.md-typeset .lx-win pre {
  margin: 0; padding: 0.9rem 1rem; height: 21rem; overflow: auto; background: transparent;
  font-family: var(--md-code-font-family); font-size: 0.64rem; line-height: 1.65; color: #E2E8F0;
}
.md-typeset .lx-code { white-space: pre; }
.md-typeset .lx-term-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.lx-code .k { color: #C084FC; }                     /* keywords   */
.lx-code .s { color: #86EFAC; }                     /* strings    */
.lx-code .c { color: #64748B; font-style: italic; } /* comments   */
.lx-code .f { color: #38BDF8; }                     /* calls      */
.lx-term-body .p { color: #28C840; }                /* $ prompt   */
.lx-term-body .o { color: #94A3B8; }                /* tool output */
.lx-term-body .q { color: #38BDF8; }                /* your question */
.lx-term-body .a { color: #F1F5F9; }                /* the bot's answer */
.lx-cursor {
  display: inline-block; width: 0.5em; height: 1.1em; vertical-align: -0.2em;
  background: #38BDF8; animation: lx-blink 1s step-end infinite;
}
@media screen and (max-width: 59.9375em) {
  .lx-demo { grid-template-columns: 1fr; }
  .md-typeset .lx-win pre { font-size: 0.6rem; }
  .md-typeset .lx-code { height: 23rem; }
  .md-typeset .lx-term-body { height: 18rem; }   /* fixed, so the page doesn't jump while it types */
}

@media (prefers-reduced-motion: reduce) {
  .lx-hero > *, .lx-hero::before, .lx-hero .lx-gradient, .lx-hero .lx-eyebrow .twemoji,
  .lx-topics span, .lx-reveal.is-visible, .lx-path.is-visible ol::before, .lx-compare .lx-plan-badge { animation: none; }
  .lx-reveal { opacity: 1; }
  .lx-type-caret, .lx-cursor { animation: none; }
  .lx-path.lx-line-hidden ol::before { transform: none; }
}
