/* Home-page-only polish.
   Used by docs/index.md - won't affect any other page.

   Note: Material wraps inline markdown images in a <p>, so the logo lives
   inside <p><img class="home-logo">. We target the <img> directly, and use
   descendant (not child) selectors throughout. */

.md-typeset img.home-logo {
  width: min(280px, 72vw);
  height: auto;
  display: block;
  margin: 1.5rem auto 0.5rem;
}

/* Center the paragraph the logo gets wrapped in so margins behave. */
.md-typeset p:has(> img.home-logo) {
  text-align: center;
  margin: 0;
}

.md-typeset .home-tagline {
  max-width: 760px;
  margin: 0.4rem auto 1.6rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.55;
}

.md-typeset .home-proof {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: center;
  margin: 1.5rem auto 2.5rem;
  /* Defensive: an inner image at its natural width would otherwise
     push the grid past the viewport on phones. */
  max-width: 100%;
  overflow-x: hidden;
}

.md-typeset img.home-screenshot {
  border-radius: 8px;
  box-shadow: 0 10px 32px rgb(0 0 0 / 14%);
  /* width + max-width together: width:100% so the image fills its
     column, max-width:100% so it never exceeds the column's actual
     pixel width. height:auto preserves aspect ratio. */
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Collapse to a single column well before phone widths. 1100 covers
   tablet portrait (768) + landscape (1024) + most laptop split-screens;
   anything narrower than that doesn't have room for a code block + a
   screenshot side by side without one of them wrapping awkwardly. */
@media (max-width: 1100px) {
  .md-typeset .home-proof {
    grid-template-columns: 1fr;
  }
}

/* "Try it in your browser" hero block.

   A bordered, accent-trimmed slab between the architecture diagram and
   the "Where to go next" cards. The playground is the most
   demo-friendly thing this project has - this gives it visual weight
   without burying the rest of the page. */
.md-typeset .playground-hero {
  position: relative;
  margin: 2rem 0 2.5rem;
  padding: 2rem 2.25rem;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--md-accent-fg-color) 10%, transparent),
      color-mix(in srgb, var(--md-accent-fg-color) 3%, transparent) 60%,
      transparent 100%),
    var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-left: 4px solid var(--md-accent-fg-color);
  border-radius: 10px;
  overflow: hidden;
}

/* Title inside the hero keeps the page heading hierarchy (h2) but
   loses the default underline + tightens spacing. */
.md-typeset .playground-hero h2 {
  margin: 0 0 0.6rem;
  border-bottom: none;
  font-size: 1.45rem;
  line-height: 1.25;
}

.md-typeset .playground-hero h2 .twemoji,
.md-typeset .playground-hero h2 svg {
  color: var(--md-accent-fg-color);
  margin-right: 0.35rem;
}

.md-typeset .playground-hero p {
  margin: 0.4rem 0;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 62ch;
}

.md-typeset .playground-hero p:last-of-type {
  color: var(--md-default-fg-color--light);
  font-size: 0.88rem;
  margin-bottom: 1.1rem;
}

.md-typeset .playground-hero .playground-hero__cta {
  font-size: 1rem;
  padding: 0.65rem 1.4rem;
  margin: 0;
}

.md-typeset .playground-hero .playground-hero__cta .twemoji,
.md-typeset .playground-hero .playground-hero__cta svg {
  margin-left: 0.35rem;
}

@media (max-width: 720px) {
  .md-typeset .playground-hero {
    padding: 1.4rem 1.4rem;
  }
  .md-typeset .playground-hero h2 {
    font-size: 1.25rem;
  }
}
