/*
 * Landing page (pages/landing) presentation.
 *
 * Playground app's look — the library ships no CSS. The hero and the closing CTA
 * are always dark (they pin `data-theme="dark"` on their subtree so the dark
 * surface/text tokens apply regardless of the site theme); the demo stage inside
 * the hero pins `data-theme="light"` so the embedded command_palette demo renders
 * on its authored light canvas.
 */

@keyframes lp-float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -12px) scale(1.08); }
}

@keyframes lp-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}

@keyframes lp-cta-glow {
  0%, 100% { box-shadow: 0 8px 22px -10px rgba(14, 168, 143, 0.55); }
  50% { box-shadow: 0 12px 36px -8px rgba(14, 168, 143, 0.85); }
}

@keyframes lp-signal {
  to { stroke-dashoffset: -220; }
}

/* ── Shared bits ──────────────────────────────────────────────────────── */
.lp-eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-primary);
}

.lp-pulse-dot {
  display: inline-block;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: #34d6a8;
  animation: lp-pulse-dot 1.8s ease-in-out infinite;
}

.lp-grad {
  background: linear-gradient(120deg, #0ea88f 0%, #34d6a8 52%, #7fe6b0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: var(--weight-bold);
  border-radius: 0.5625rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.lp-btn--primary {
  color: #06251f;
  background: linear-gradient(120deg, #0ea88f, #34d6a8);
  animation: lp-cta-glow 3.6s ease-in-out infinite;
}

.lp-btn--ghost {
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}

.lp-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lp-btn:focus-visible {
  outline: 2px solid #7fe6b0;
  outline-offset: 2px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
/* The hero band is always dark (a designed marketing surface), so its own
   background/text are hardcoded rather than token-driven — that lets it drop the
   `data-theme="dark"` wrapper so the embedded live demo inside it follows the
   *site* theme (light card in light mode, dark card in dark mode) instead of
   being pinned. Everything else in the hero already uses literal colors. */
.lp-hero {
  position: relative;
  overflow: hidden;
  background: #0a1120;
  color: #e8eef6;
  /* A hair of space below the pulse-line divider so it isn't flush against the
     seam to the next section — just enough to lift it off the edge, no more. */
  padding-bottom: 0.5rem;
}

.lp-hero__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lp-hero__glow--a {
  top: -80px;
  right: -40px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(14, 168, 143, 0.3), transparent 64%);
  animation: lp-float-glow 9s ease-in-out infinite;
}

.lp-hero__glow--b {
  bottom: -120px;
  left: -60px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(52, 214, 168, 0.14), transparent 66%);
}

.lp-hero__inner {
  position: relative;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 4.75rem 1.75rem 5.25rem;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 3.5rem;
  align-items: center;
}

.lp-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5625rem;
  margin: 0 0 1.375rem;
  padding: 0.3125rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  color: #7fe6b0;
  background: rgba(14, 168, 143, 0.12);
  border: 1px solid rgba(14, 168, 143, 0.25);
  border-radius: var(--radius-pill);
}

.lp-hero__heading {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.03;
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.035em;
  color: #fff;
}

.lp-hero__lead {
  margin: 0 0 1.875rem;
  max-width: 30rem;
  font-size: 1.0625rem;
  line-height: 1.62;
  color: #aebbcd;
}

.lp-hero__lead code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: #7fe6b0;
}

.lp-hero__lead strong {
  color: #e8eef6;
  font-weight: var(--weight-bold);
}

.lp-hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.625rem;
}

.lp-hero__meta {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #aebbcd;
}

.lp-hero__repo {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  color: #aebbcd;
  text-decoration: none;
}

.lp-hero__repo:hover {
  color: #fff;
}

.lp-hero__dot {
  color: #475569;
}

.lp-hero__count {
  color: #e8eef6;
}

.lp-hero__alpha {
  color: #7fe6b0;
}

/* Right: the live-demo stage (light island). */
.lp-stage {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 1.125rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}

.lp-stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  padding: 0 0.25rem;
}

.lp-stage__running {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.lp-stage__id {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-subtle);
}

.lp-stage__demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  padding: 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  text-align: center;
}

.lp-stage__terminal {
  margin: 0.875rem 0 0;
  padding: 0.8125rem 0.9375rem;
  border-radius: var(--radius-md);
  background: var(--surface-code);
  color: #aebbcd;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  overflow-x: auto;
}

.lp-term-sign { color: #5b6b85; }
.lp-term-ok { color: #34d6a8; }
.lp-term-em { color: #fff; }

.lp-hero__divider {
  position: relative;
  display: block;
  width: 100%;
  height: 22px;
}

.lp-hero__signal {
  animation: lp-signal 2.4s linear infinite;
}

/* ── Generic content section ──────────────────────────────────────────── */
.lp-section {
  padding-block: 4.5rem 0;
}

.lp-section:first-of-type {
  padding-top: 4.5rem;
}

.lp-section__inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.lp-section__head {
  max-width: 50rem;
  margin-bottom: 2.25rem;
}

.lp-section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: none;
  flex-wrap: wrap;
}

.lp-section__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.18;
  color: var(--color-text);
  /* Balance the lines so a long heading doesn't orphan its last character on a
     line of its own (notably the Japanese "Why headless?" title). */
  text-wrap: balance;
}

.lp-section__more {
  font-size: 0.875rem;
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.lp-section__more:hover {
  color: var(--color-primary-hover);
}

/* ── Why headless ─────────────────────────────────────────────────────── */
.lp-why {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.125rem;
}

.lp-why__card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.lp-why__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.125rem;
}

.lp-why__title {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

.lp-why__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* ── Featured ─────────────────────────────────────────────────────────── */
.lp-featured {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

.lp-featured__card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  transition:
    border-color var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.lp-featured__card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lp-featured__id {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--color-text-subtle);
  margin-bottom: 0.625rem;
}

.lp-featured__name {
  font-size: 1rem;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.lp-featured__summary {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ── Closing CTA ──────────────────────────────────────────────────────── */
.lp-cta-wrap {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 4rem 1.75rem 5.25rem;
}

.lp-cta {
  position: relative;
  overflow: hidden;
  background: var(--surface-page);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  text-align: center;
}

.lp-cta__glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 240px;
  background: radial-gradient(circle, rgba(14, 168, 143, 0.28), transparent 65%);
  animation: lp-float-glow 8s ease-in-out infinite;
  pointer-events: none;
}

.lp-cta__inner {
  position: relative;
}

.lp-cta__title {
  margin: 0 0 0.875rem;
  font-size: 2.125rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  color: #fff;
}

.lp-cta__body {
  margin: 0 auto 1.625rem;
  max-width: 36rem;
  font-size: 1rem;
  line-height: var(--leading-normal);
  color: #aebbcd;
}

.lp-cta__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .lp-hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-block: 3.5rem 3.5rem;
  }

  .lp-why {
    grid-template-columns: 1fr;
  }

  .lp-featured {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .lp-featured {
    grid-template-columns: 1fr;
  }

  .lp-cta {
    padding: 2.5rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-pulse-dot,
  .lp-hero__glow,
  .lp-hero__signal,
  .lp-btn--primary,
  .lp-cta__glow {
    animation: none;
  }
}
