/* Invisible marker on the home page, used only to scope home-specific CSS. */
.md-home {
  display: none;
}

/* Home hero: a branded, dark-green→neon panel with the title and primary CTAs,
   echoing the dashboard's gradient cards. Dark in both themes (light text). */
.md-typeset .hero {
  margin: 0.6rem 0 2rem;
  padding: 2rem 2.2rem;
  border-radius: var(--md-radius);
  text-align: left;
  color: var(--mx-strong);
  background: var(--mx-bg);
  border: 1px solid var(--mx-rule);
  overflow: hidden;
}
.md-typeset .hero__eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mx-lime);
}
/* Brand wordmark instead of typed text, sized like a hero title. */
.md-typeset .hero__title {
  /* The home hero title is the MATVIS wordmark image, not text, so keep it clean. */
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 0.7rem;
}
.md-typeset .hero__logo {
  height: clamp(1.8rem, 3.4vw, 2.4rem);
  width: auto;
  display: block;
  margin: 0;
}
/* glightbox auto-wraps content images and our screenshot styling centres +
   frames them; undo all of that for the hero wordmark so it sits left, clean. */
.md-typeset .hero__title a.glightbox {
  display: inline-block;
  cursor: default;
}
.md-typeset .hero__title a.glightbox img {
  margin: 0;
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.md-typeset .hero__lead {
  max-width: 42rem;
  margin: 0 0 1.3rem;
  font-size: 1rem;
  color: color-mix(in srgb, var(--mx-strong) 82%, transparent);
}
.md-typeset .hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
/* CTAs on the dark hero: a neon primary and an outline secondary. */
.md-typeset .hero__cta .md-button {
  border-radius: 8px;
  padding: 0.5em 1.2em;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--mx-strong) 40%, transparent);
  color: var(--mx-strong);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.md-typeset .hero__cta .md-button:hover {
  background-color: color-mix(in srgb, var(--mx-strong) 12%, transparent);
}
.md-typeset .hero__cta .md-button--primary {
  background: var(--mx-lime);
  border-color: var(--mx-lime);
  color: var(--mx-bg);
}
.md-typeset .hero__cta .md-button--primary:hover {
  background: color-mix(in srgb, var(--mx-lime) 85%, var(--mx-strong));
  border-color: var(--mx-lime);
}

/* Card grid: two columns across the text's full width, one on narrow screens, so a row never
   ends with a card on its own. */
.md-typeset .grid.cards,
.md-typeset .grid {
  grid-template-columns: 1fr;
}
@media screen and (min-width: 45em) {
  .md-typeset .grid.cards,
  .md-typeset .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* A last card alone on its row takes the whole row. */
  .md-typeset .grid.cards > ul > li:last-child:nth-child(odd),
  .md-typeset .grid > .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* Grid cards ease into their hover state. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li,
.md-typeset .grid > .card {
  transition: background-color 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease;
}
.md-typeset .scards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.md-typeset .scard-row {
  display: flex;
  gap: 0.7rem;
}
.md-typeset .scard-row .scard {
  flex: 1 1 0;
  min-width: 0;
}
/* Each sub-card: a small panel, title over description. */
.md-typeset .scard {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  color: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}
.md-typeset .scard__d {
  font-size: 0.8em;
  color: var(--md-default-fg-color--light);
}
.md-typeset .grid.cards a .twemoji,
.md-typeset .grid.cards a svg {
  transition: transform 0.15s ease;
}
.md-typeset .grid.cards a:hover .twemoji,
.md-typeset .grid.cards a:hover svg {
  transform: translateX(3px);
}

/* On the home page, hide the redundant top-level "Home" link in the left nav
   (you are already on it). The sidebar space and the rest of the nav stay, so
   the layout matches every other page. Scoped via the home-only hero element. */
.md-main__inner:has(.md-home)
  .md-sidebar--primary
  .md-nav--primary
  > .md-nav__list
  > .md-nav__item--active
  > .md-nav__link--active {
  display: none;
}

/* A sub-card's fill clears on hover. */
.md-typeset .scard:hover {
  background-color: transparent;
}
.md-typeset .scard__t {
  font-weight: 700;
  color: var(--md-default-fg-color);
}
/* The link inside a grid card: plain bold text in the text colour, the arrow after it. */
.md-typeset .grid.cards a[href] {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font-weight: 600;
  color: var(--md-default-fg-color);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.md-typeset .grid.cards a[href]:hover {
  background: none;
  border: none;
  color: var(--md-primary-fg-color);
}

/* Cards as the guide's panels: a panel surface with a thin rule, no shadow, no icon. A card's
   title carries the guide's lime tick on its left edge. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li,
.md-typeset .grid > .card,
.md-typeset .mcard,
.md-typeset .scard,
[data-md-color-scheme="default"] .md-typeset .grid.cards > ul > li,
[data-md-color-scheme="default"] .md-typeset .grid.cards > ol > li,
[data-md-color-scheme="default"] .md-typeset .grid > .card,
[data-md-color-scheme="default"] .md-typeset .mcard,
[data-md-color-scheme="default"] .md-typeset .scard {
  background-color: var(--mx-surface);
  border: 1px solid var(--mx-line);
  border-radius: var(--md-radius);
  box-shadow: none;
}
.md-typeset .scard {
  background-color: var(--mx-page);
}
.md-typeset .scard:hover,
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  border-color: var(--mx-accent);
  box-shadow: none;
}
.md-typeset .mcard > h3,
.md-typeset .grid.cards > ul > li > p:first-child,
.md-typeset .grid > .card > p:first-child {
  padding-left: 0.6rem;
  background: var(--mx-tick) left / 3px 100% no-repeat;
}
.md-typeset .mcard > h3::before {
  display: none;
}
.md-typeset .mcard > h3 .twemoji,
.md-typeset .grid.cards > ul > li > p:first-child > .twemoji:first-child,
.md-typeset .grid > .card > p:first-child > .twemoji:first-child {
  display: none;
}

/* "What MATVIS does": Chat security and Agent security as two equal panels, each listing its five
   capabilities with the guide's one-line description, each linked to its page. */
.md-typeset .halves {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin: 1.2em 0;
}
.md-typeset .half {
  display: flex;
  flex-direction: column;
  background: var(--mx-surface);
  border: 1px solid var(--mx-line);
  border-radius: var(--md-radius);
  padding: 0.9rem 1rem;
}
.md-typeset .half__head {
  display: block;
  padding-left: 0.7rem;
  margin-bottom: 0.4rem;
  background: var(--mx-tick) left / 3px 100% no-repeat;
  color: inherit;
}
.md-typeset .half__head b {
  display: block;
  font-family: var(--mx-mono);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--mx-ink-strong);
}
.md-typeset .half__head span {
  font-size: 0.66rem;
  color: var(--mx-ink-muted);
}
.md-typeset .half__cap {
  display: block;
  padding: 0.55rem 0 0.55rem 0.7rem;
  border-top: 1px solid var(--mx-line);
  color: inherit;
}
.md-typeset .half__head + .half__cap {
  border-top: 0;
}
.md-typeset .half__cap b {
  display: block;
  font-size: 0.76rem;
  color: var(--mx-ink-strong);
}
.md-typeset .half__cap span {
  display: block;
  font-size: 0.68rem;
  color: var(--mx-ink-muted);
}
.md-typeset .half__cap:hover b,
.md-typeset .half__head:hover b {
  color: var(--md-typeset-a-color);
}
@media screen and (max-width: 44.9375em) {
  .md-typeset .halves {
    grid-template-columns: 1fr;
  }
}
