/* =========================================================
   LIVIST documentation landing page
   ========================================================= */

/* The theme auto-renders the page's first Markdown H1 above the article
   body; the landing page supplies its own <h1> inside .livist-docs-hero,
   so the redundant auto-rendered one is hidden -- scoped with :has() so
   only the index page (the one page with a .livist-docs-home hero right
   after the H1) is affected, never the User Manual/API pages' own H1. */
.md-content__inner > h1:has(+ .livist-docs-home) {
  display: none;
}

.livist-docs-home {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.livist-docs-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 3rem;
  margin: 1rem 0 4rem;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(125, 211, 252, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at 12% 90%,
      rgba(59, 130, 246, 0.16),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      rgba(239, 246, 255, 0.98),
      rgba(248, 250, 252, 0.98)
    );
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.08),
    0 2px 8px rgba(15, 23, 42, 0.04);
}

.livist-docs-hero::after {
  position: absolute;
  top: -90px;
  right: -80px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 50%;
  content: "";
}

.livist-docs-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 0.7rem 0 1.25rem;
  color: #0f172a;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.livist-docs-hero .cryostack-hero-subtitle {
  position: relative;
  z-index: 1;
  max-width: 790px;
  margin: 0;
  color: #475569;
  font-size: 1.18rem;
  line-height: 1.75;
}

.livist-docs-hero .cryostack-docs-actions {
  position: relative;
  z-index: 1;
}

.cryostack-section {
  margin: 0 0 4.5rem;
}

.cryostack-section-label {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.8rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.6);
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.095em;
  line-height: 1;
  text-transform: uppercase;
}

.cryostack-section h2 {
  margin: 1rem 0 1.1rem;
  color: #0f172a;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.cryostack-section-intro {
  max-width: 850px;
  margin: 0 0 1rem;
  color: #475569;
  font-size: 1.05rem;
  line-height: 1.75;
}

.cryostack-docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.cryostack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none !important;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.cryostack-btn:hover {
  transform: translateY(-2px);
}

.cryostack-btn.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.cryostack-btn.primary:hover {
  background: #1d4ed8;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.28);
}

.cryostack-btn.secondary {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(255, 255, 255, 0.8);
  color: #1d4ed8 !important;
}

.cryostack-btn.secondary:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: #eff6ff;
}

.cryostack-grid {
  display: grid;
  gap: 1.25rem;
}

.livist-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.livist-resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cryostack-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.55rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 8px 25px rgba(15, 23, 42, 0.045),
    0 1px 3px rgba(15, 23, 42, 0.03);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.cryostack-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.08),
    0 3px 8px rgba(15, 23, 42, 0.04);
}

.cryostack-card-icon {
  margin-bottom: 0.8rem;
  font-size: 1.75rem;
  line-height: 1;
}

.cryostack-card h3 {
  margin: 0 0 0.65rem;
  color: #0f172a;
  font-size: 1.12rem;
  font-weight: 720;
  line-height: 1.3;
}

.cryostack-card p {
  flex: 1;
  margin: 0 0 1.1rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.65;
}

.cryostack-card a {
  color: #2563eb;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.cryostack-card a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.cryostack-workflow {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto
    minmax(0, 1fr)
    auto
    minmax(0, 1fr)
    auto
    minmax(0, 1fr)
    auto
    minmax(0, 1fr);
  align-items: stretch;
  gap: 0.7rem;
  margin-top: 2rem;
}

.cryostack-workflow-step {
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 14px;
  background: #ffffff;
  text-align: center;
}

.cryostack-workflow-step span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
}

.cryostack-workflow-step h3 {
  margin: 0 0 0.5rem;
  color: #0f172a;
  font-size: 0.98rem;
}

.cryostack-workflow-step p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.5;
}

.cryostack-workflow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  font-size: 1.3rem;
  font-weight: 800;
}

.cryostack-mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.cryostack-mini-list > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  border-left: 3px solid #60a5fa;
  border-radius: 0 12px 12px 0;
  background: #f8fafc;
}

.cryostack-mini-list strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.cryostack-mini-list span {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.cryostack-platform-section {
  padding: 2.5rem;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(239, 246, 255, 0.88),
      rgba(248, 250, 252, 0.9)
    );
}

@media (max-width: 1050px) {
  .livist-feature-grid,
  .livist-resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cryostack-workflow {
    grid-template-columns: 1fr;
  }

  .cryostack-workflow-arrow {
    transform: rotate(90deg);
    padding: 0.1rem 0;
  }
}

@media (max-width: 700px) {
  .livist-docs-home {
    padding: 0 0.25rem 3rem;
  }

  .livist-docs-hero {
    padding: 3.2rem 1.4rem;
    border-radius: 18px;
  }

  .livist-feature-grid,
  .livist-resource-grid,
  .cryostack-mini-list {
    grid-template-columns: 1fr;
  }

  .cryostack-docs-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cryostack-btn {
    width: 100%;
  }

  .cryostack-platform-section {
    padding: 1.6rem;
  }
}

/* Dark-mode support */

[data-md-color-scheme="slate"] .livist-docs-hero {
  border-color: rgba(96, 165, 250, 0.22);
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(37, 99, 235, 0.22),
      transparent 34%
    ),
    radial-gradient(
      circle at 12% 90%,
      rgba(14, 116, 144, 0.16),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(30, 41, 59, 0.98)
    );
}

[data-md-color-scheme="slate"] .livist-docs-hero h1,
[data-md-color-scheme="slate"] .cryostack-section h2,
[data-md-color-scheme="slate"] .cryostack-card h3,
[data-md-color-scheme="slate"] .cryostack-workflow-step h3,
[data-md-color-scheme="slate"] .cryostack-mini-list strong {
  color: #f8fafc;
}

[data-md-color-scheme="slate"] .livist-docs-hero .cryostack-hero-subtitle,
[data-md-color-scheme="slate"] .cryostack-section-intro,
[data-md-color-scheme="slate"] .cryostack-card p,
[data-md-color-scheme="slate"] .cryostack-workflow-step p,
[data-md-color-scheme="slate"] .cryostack-mini-list span {
  color: #cbd5e1;
}

[data-md-color-scheme="slate"] .cryostack-card,
[data-md-color-scheme="slate"] .cryostack-workflow-step {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.78);
}

[data-md-color-scheme="slate"] .cryostack-mini-list > div {
  background: rgba(30, 41, 59, 0.65);
}

[data-md-color-scheme="slate"] .cryostack-btn.secondary {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(30, 41, 59, 0.65);
  color: #93c5fd !important;
}

[data-md-color-scheme="slate"] .cryostack-platform-section {
  border-color: rgba(96, 165, 250, 0.2);
  background:
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.8),
      rgba(30, 41, 59, 0.75)
    );
}