/* ─────────────────────────────────────────────────────────────────────────────
   Home page (AI Explained Lab): navy hero, featured apps, demos, career paths, steps, final CTA.
   Every rule targets a class that only exists on docs/index.md. Animations live in home-animations.css;
   learn.js adds the scroll reveal. Works in both colour schemes.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --lab-navy:   #0B1120;
  --lab-navy-2: #131C38;
  --lab-indigo: #6366F1;
  --lab-violet: #8B5CF6;
  --lab-blue:   #3B82F6;
  --lab-ring:   rgba(99, 102, 241, 0.35);
}
[data-md-color-scheme="default"] { --lab-card: #FFFFFF; --lab-tint: rgba(99, 102, 241, 0.08); --lab-accent-text: #4F46E5; }
[data-md-color-scheme="slate"]   { --lab-card: #10131D; --lab-tint: rgba(129, 140, 248, 0.12); --lab-accent-text: #A5B4FC; }

.md-typeset .lx-section-lead { color: var(--lx-muted); font-size: 0.8rem; max-width: 46rem; margin: -0.2rem 0 1rem; }
.md-typeset .lx-center { text-align: center; margin-top: 1.2rem; }
.md-typeset .lx-center .md-button { margin: 0.25rem; }

/* ── Hero: a navy panel in both schemes ─────────────────────────────────── */
.lx-hero--lab {
  margin-top: 0.6rem; padding: clamp(2.2rem, 6vw, 4rem) clamp(1rem, 4vw, 3rem) clamp(1.8rem, 5vw, 3rem);
  border-radius: 20px; color: #E2E8F0;
  background:
    radial-gradient(60rem 22rem at 50% -6rem, rgba(99, 102, 241, 0.32), transparent 70%),
    radial-gradient(30rem 14rem at 100% 100%, rgba(139, 92, 246, 0.18), transparent 70%),
    linear-gradient(180deg, var(--lab-navy-2), var(--lab-navy));
  border: 1px solid rgba(129, 140, 248, 0.22);
  overflow: hidden;
}
.lx-hero--lab::before { display: none; }                         /* the old breathing glow: the panel has its own */
.md-typeset .lx-hero--lab h1 { color: #F8FAFC; max-width: 20ch; }
.lx-hero--lab .lx-gradient {
  background-image: linear-gradient(90deg, #A5B4FC, #818CF8 40%, #C4B5FD 70%, #93C5FD);
}
.lx-hero--lab .lx-eyebrow { color: #C7D2FE; border-color: rgba(165, 180, 252, 0.35); background: rgba(99, 102, 241, 0.12); }
.md-typeset .lx-hero--lab p { color: #CBD5E1; margin-bottom: 1.4rem; }
.lx-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.md-typeset .lx-hero--lab .md-button { margin: 0; }
.md-typeset .lx-hero--lab .md-button--primary,
.md-typeset .lx-final .md-button--primary {
  background: var(--lab-indigo); border-color: var(--lab-indigo); color: #fff;
}
.md-typeset .lx-hero--lab .md-button--primary:hover,
.md-typeset .lx-final .md-button--primary:hover { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.md-typeset .lx-hero--lab .md-button:not(.md-button--primary) { color: #E0E7FF; border-color: rgba(199, 210, 254, 0.5); background: transparent; }
.md-typeset .lx-hero--lab .md-button:not(.md-button--primary):hover { background: rgba(199, 210, 254, 0.1); color: #fff; border-color: #C7D2FE; }
.md-typeset ul.lx-hero__facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem;
  list-style: none; margin: 1.6rem 0 0 !important; padding: 0 !important; font-size: 0.7rem; color: #A5B4FC;
}
.md-typeset ul.lx-hero__facts > li { margin: 0; list-style: none; color: #C7D2FE; }
.lx-hero__facts li::before { content: "✓ "; color: #34D399; font-weight: 700; }

/* ── Featured apps ──────────────────────────────────────────────────────── */
.lx-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: 0.9rem; }
.lx-app {
  display: flex; flex-direction: column; padding: 1.1rem 1.15rem 1rem; border-radius: 14px;
  background: var(--lab-card); border: 1px solid var(--lx-card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lx-app:hover { transform: translateY(-3px); border-color: var(--lab-ring); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12); }
[data-md-color-scheme="slate"] .lx-app:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.lx-app { padding-top: 0; overflow: hidden; }
.md-typeset .lx-app__thumb { display: block; margin: 0 -1.15rem 0.8rem; aspect-ratio: 16 / 9; background: var(--lab-navy); }
.lx-app__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lx-app__cat { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lab-accent-text); }
.md-typeset .lx-app h3 a { color: var(--md-default-fg-color); }
.md-typeset .lx-app h3 a:hover { color: var(--md-typeset-a-color); }
.md-typeset .lx-app__price { margin: 0 0 0.7rem; font-size: 0.68rem; color: var(--lx-muted); }
.lx-app__price strong { font-size: 0.95rem; color: var(--md-default-fg-color); }
.lx-app__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.lx-app__icon {
  display: inline-flex; width: 2.3rem; height: 2.3rem; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--lab-tint); color: var(--lab-accent-text);
}
.lx-app__icon svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lx-app__status {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px; color: #B45309; background: rgba(245, 158, 11, 0.12);
}
[data-md-color-scheme="slate"] .lx-app__status { color: #FCD34D; }
.md-typeset .lx-app h3 { margin: 0.5rem 0 0.35rem; font-size: 0.95rem; }
.md-typeset .lx-app p { margin: 0 0 0.7rem; font-size: 0.74rem; line-height: 1.55; color: var(--lx-muted); }
.md-typeset ul.lx-app__stack { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0 0 0.9rem !important; padding: 0 !important; }
.md-typeset ul.lx-app__stack > li {
  list-style: none;
  margin: 0; font-size: 0.6rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 6px;
  background: var(--lab-tint); color: var(--lab-accent-text);
}
.lx-app__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; font-size: 0.7rem; font-weight: 600; }
.lx-app__actions a { display: inline-flex; align-items: center; min-height: 28px; }
.md-typeset .lx-app__actions .lx-app__notify {
  margin-left: auto; padding: 0.25rem 0.7rem; border-radius: 8px; border: 1px solid var(--lab-ring); color: var(--lab-accent-text);
}
.md-typeset .lx-app__actions .lx-app__notify:hover { background: var(--lab-tint); }

/* ── Why: five reasons ─────────────────────────────────────────────────── */
.lx-apps ~ .lx-why, #why ~ .lx-why { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lx-why__item > span { color: var(--lab-accent-text); }

/* ── Free demos ────────────────────────────────────────────────────────── */
.lx-demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.7rem; }
.md-typeset a.lx-demo {
  display: flex; flex-direction: column; gap: 0.25rem; padding: 0.95rem 1rem; border-radius: 12px;
  background: var(--lab-card); border: 1px solid var(--lx-card-border); color: var(--md-default-fg-color);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.md-typeset a.lx-demo:hover { border-color: var(--lab-ring); transform: translateY(-2px); }
.lx-demo strong { font-size: 0.82rem; }
.lx-demo span { font-size: 0.72rem; color: var(--lx-muted); line-height: 1.5; }
.lx-demo em { font-style: normal; font-size: 0.68rem; font-weight: 700; color: var(--lab-accent-text); margin-top: 0.25rem; }

/* ── Career paths ──────────────────────────────────────────────────────── */
.lx-careers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.lx-career {
  display: flex; flex-direction: column; padding: 1.05rem 1.1rem; border-radius: 14px;
  background: var(--lab-card); border: 1px solid var(--lx-card-border); border-top: 3px solid var(--lab-indigo);
}
.lx-career:nth-child(2) { border-top-color: var(--lab-blue); }
.lx-career:nth-child(3) { border-top-color: #10B981; }
.lx-career:nth-child(4) { border-top-color: var(--lab-violet); }
.md-typeset .lx-career h3 { margin: 0 0 0.5rem; font-size: 0.86rem; }
.md-typeset .lx-career ul { margin: 0 0 0.6rem; padding-left: 1rem; font-size: 0.72rem; }
.md-typeset .lx-career li { margin: 0.15rem 0; }
.md-typeset .lx-career__skills { font-size: 0.65rem; color: var(--lx-muted); margin: 0 0 0.7rem; }
.md-typeset .lx-career > a { margin-top: auto; font-size: 0.72rem; font-weight: 700; }

/* ── How it works ──────────────────────────────────────────────────────── */
.md-typeset ol.lx-flow {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem;
  list-style: none; margin: 0 !important; padding: 0 !important; counter-reset: none;
}
.md-typeset ol.lx-flow > li { list-style: none; }
.md-typeset .lx-flow__step { margin: 0 !important; padding: 1rem 1.05rem; border-radius: 14px; background: var(--lab-tint); position: relative; }
.lx-flow__n {
  display: inline-flex; width: 1.8rem; height: 1.8rem; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--lab-indigo); color: #fff; font-weight: 800; font-size: 0.8rem;
}
.md-typeset .lx-flow__step h3 { margin: 0.6rem 0 0.3rem; font-size: 0.86rem; }
.md-typeset .lx-flow__step p { margin: 0; font-size: 0.72rem; line-height: 1.55; color: var(--lx-muted); }

/* ── Testimonials (hooks/home.py renders them only when data/testimonials.yml has entries) ── */
.lx-quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.8rem; }
.md-typeset .lx-quote { margin: 0; padding: 1rem 1.1rem; border-radius: 14px; background: var(--lab-card); border: 1px solid var(--lx-card-border); }
.md-typeset .lx-quote blockquote { margin: 0 0 0.6rem; padding: 0; border: 0; color: var(--md-default-fg-color); font-size: 0.78rem; }
.md-typeset .lx-quote figcaption { font-size: 0.68rem; color: var(--lx-muted); }

/* ── Final CTA ─────────────────────────────────────────────────────────── */
.lx-final {
  margin: 2.6rem 0 1rem; padding: clamp(1.6rem, 5vw, 2.6rem) clamp(1rem, 4vw, 2.4rem); border-radius: 20px; text-align: center;
  color: #E2E8F0; background: radial-gradient(40rem 16rem at 50% 0, rgba(99, 102, 241, 0.3), transparent 70%),
              linear-gradient(180deg, var(--lab-navy-2), var(--lab-navy));
  border: 1px solid rgba(129, 140, 248, 0.22);
}
.md-typeset .lx-final h2::before { content: none; }
.md-typeset .lx-final h2 { margin: 0 0 0.6rem; color: #F8FAFC; font-size: clamp(1.3rem, 3.5vw, 1.8rem); }
.md-typeset .lx-final > p { color: #CBD5E1; max-width: 36rem; margin: 0 auto 1.2rem; font-size: 0.82rem; }
.lx-final__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.md-typeset .lx-final .md-button { margin: 0; }
.md-typeset .lx-final .md-button:not(.md-button--primary) { color: #E0E7FF; border-color: rgba(199, 210, 254, 0.5); }
.lx-final .lx-signup {
  max-width: 30rem; margin: 1.4rem auto 0; text-align: left; background: rgba(15, 23, 42, 0.5); border-color: rgba(165, 180, 252, 0.3);
}
.lx-final .lx-signup input { background: #0B1120; color: #F1F5F9; border-color: rgba(165, 180, 252, 0.35); }
.lx-final .lx-signup button { background: var(--lab-indigo); color: #fff; }
.lx-final .lx-signup .lx-msg { color: #CBD5E1; }
.lx-final .lx-signup .lx-msg.ok { color: #6EE7B7; }
.lx-final .lx-google__or { color: #94A3B8; }

/* ── Tablet and phone ──────────────────────────────────────────────────── */
@media (max-width: 76em) {
  .lx-apps ~ .lx-why, #why ~ .lx-why { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lx-careers, .md-typeset ol.lx-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 44.9375em) {
  .lx-apps ~ .lx-why, #why ~ .lx-why, .lx-careers, .md-typeset ol.lx-flow { grid-template-columns: 1fr; }
  .lx-hero__actions .md-button, .lx-final__actions .md-button { flex: 1 1 100%; text-align: center; }
  .md-typeset .lx-app__actions .lx-app__notify { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lx-app, .md-typeset a.lx-demo { transition: none; }
  .lx-app:hover, .md-typeset a.lx-demo:hover { transform: none; }
}
