/* Homepage layout and cards; chapter typography is unchanged. */
.math-home {
  --home-accent: #287a3e;
  --home-hover: rgba(40, 122, 62, 0.045);
  --home-border: #dfe7df;
  --home-card: #fbfcf9;
  max-width: 37rem;
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
}

[data-md-color-scheme="slate"] .math-home {
  --home-accent: #83c994;
  --home-hover: rgba(131, 201, 148, 0.055);
  --home-border: #39443e;
  --home-card: #252b2a;
}

.md-typeset .math-home h1 {
  margin: 0 0 0.65rem;
  color: var(--md-default-fg-color);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.math-home h1 .headerlink {
  display: none;
}

.md-typeset .math-home__intro {
  margin: 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.85rem;
  line-height: 1.7;
}

.math-home__subjects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2.4rem;
}

.md-typeset .math-home__subjects > p {
  display: flex;
  margin: 0;
}

.md-typeset .math-home__subject {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 0.25rem 0.75rem;
  min-width: 0;
  min-height: 7rem;
  padding: 1.15rem;
  border: 1px solid var(--home-border);
  border-radius: 0.6rem;
  background-color: var(--home-card);
  color: var(--md-default-fg-color);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.math-home__name {
  grid-column: 1;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.math-home__authors {
  grid-column: 1;
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
  line-height: 1.6;
}

.math-home__arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--home-accent);
  font-size: 1.1rem;
}

.md-typeset .math-home__subject:is(:hover, :focus-visible) {
  border-color: var(--home-accent);
  background-color: var(--home-hover);
  color: var(--home-accent);
}

.math-home__subject:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
}

.md-container:has(.math-home) > .md-footer {
  display: none;
}

@media (max-width: 600px) {
  .math-home {
    padding-top: 1.6rem;
  }

  .math-home__subjects {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 1.8rem;
  }

  .md-typeset .math-home__subject {
    min-height: 5.3rem;
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .math-home__subject {
    transition: none;
  }
}
