/*
 * Brand colors, an evening sky from navy through royal purple and mauve to a touch of sunset orange. Light mode uses
 * pastel tones for the halo and the glows, because the deep tones turn grey when blurred on white, and dark mode uses
 * lighter tones for the titles, so they stay readable on the dark background.
 */
:root > * {
  --pyprobs-gradient: linear-gradient(120deg, #2a3678, #4e3b94 45%, #7b4396 78%, #d1583e);
  --pyprobs-title-gradient: var(--pyprobs-gradient);
  --pyprobs-halo-gradient: linear-gradient(120deg, #a9b2f2, #c4a8f2 45%, #e7aee0 78%, #f7bfa3);
  --pyprobs-halo-opacity: 0.55;
  --pyprobs-link: #553c9a;
  --pyprobs-glow-start: rgb(169 178 242 / 35%);
  --pyprobs-glow-end: rgb(231 174 224 / 28%);
}

[data-md-color-scheme="slate"] {
  --pyprobs-title-gradient: linear-gradient(120deg, #8592e6, #a28cf2 45%, #c792d8 78%, #f29a74);
  --pyprobs-halo-gradient: var(--pyprobs-gradient);
  --pyprobs-halo-opacity: 0.3;
  --pyprobs-link: #b9a7f5;
  --pyprobs-glow-start: rgb(60 62 140 / 32%);
  --pyprobs-glow-end: rgb(123 67 150 / 22%);
}

:root > *,
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--pyprobs-link);
  --md-primary-fg-color--light: var(--pyprobs-link);
  --md-primary-fg-color--dark: var(--pyprobs-link);
  --md-accent-fg-color: var(--pyprobs-link);
  --md-accent-fg-color--transparent: color-mix(in srgb, var(--pyprobs-link) 12%, transparent);
  --md-typeset-a-color: var(--pyprobs-link);
}

/* Soft glows in the brand colors behind the page, fixed in place, so the background does not look empty. */
body {
  background-image:
    radial-gradient(48rem 36rem at 0% 0%, var(--pyprobs-glow-start), transparent 70%),
    radial-gradient(48rem 36rem at 100% 100%, var(--pyprobs-glow-end), transparent 70%);
  background-attachment: fixed;
}

/* Buttons */
.md-typeset .md-button {
  border-radius: 999px;
}

.md-typeset .md-button--primary {
  background: var(--pyprobs-gradient);
  border: none;
  color: #fff;
}

.md-typeset .md-button--primary:hover {
  filter: brightness(1.1);
  color: #fff;
}

/* Home page */
.pyprobs-hero {
  position: relative;
  isolation: isolate;
  padding: 1.5rem 0 1rem;
  text-align: center;
}

/* A blurred, translucent halo in the brand gradient behind the title. */
.pyprobs-hero::before {
  content: "";
  position: absolute;
  inset: 0 18% auto;
  height: 16rem;
  z-index: -1;
  border-radius: 50%;
  background: var(--pyprobs-halo-gradient);
  filter: blur(4rem);
  opacity: var(--pyprobs-halo-opacity);
}

/* The title is only as wide as its text, so the gradient spans the words instead of the whole line. */
.md-typeset .pyprobs-hero h1 {
  width: fit-content;
  margin: 0 auto 0.4rem;
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--pyprobs-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The gradient would also paint the hidden permalink sign. */
.md-typeset .pyprobs-hero h1 .headerlink {
  display: none;
}

.pyprobs-hero .pyprobs-tagline {
  font-size: 1.15rem;
  color: var(--md-default-fg-color--light);
  max-width: 34rem;
  margin: 0 auto 1.4rem;
}

@media screen and (min-width: 45em) {
  .md-typeset .grid.pyprobs-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

.md-typeset .grid.cards > ul > li {
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}

/* In light mode the feature cards are frosted glass with a soft violet shadow, so they stand out from the glows. */
[data-md-color-scheme="default"] .md-typeset .pyprobs-features > ul > li {
  background-color: rgb(255 255 255 / 65%);
  border-color: rgb(85 60 154 / 12%);
  box-shadow: 0 1px 2px rgb(42 54 120 / 6%), 0 0.6rem 1.6rem rgb(78 59 148 / 8%);
  backdrop-filter: blur(0.4rem);
}

[data-md-color-scheme="default"] .md-typeset .pyprobs-features > ul > li:hover {
  box-shadow: 0 1px 2px rgb(42 54 120 / 8%), 0 0.8rem 2rem rgb(78 59 148 / 16%);
}

/* The install command and the second button get the same frosted look in light mode. */
[data-md-color-scheme="default"] .md-typeset .pyprobs-hero + .highlight code {
  background-color: rgb(255 255 255 / 65%);
  box-shadow: 0 1px 2px rgb(42 54 120 / 6%), 0 0.6rem 1.6rem rgb(78 59 148 / 8%);
  backdrop-filter: blur(0.4rem);
}

[data-md-color-scheme="default"] .md-typeset .pyprobs-hero .md-button:not(.md-button--primary) {
  color: var(--pyprobs-link);
  background-color: rgb(255 255 255 / 70%);
  box-shadow: 0 1px 2px rgb(42 54 120 / 6%), 0 0.4rem 1rem rgb(78 59 148 / 10%);
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--md-primary-fg-color--light);
  transform: translateY(-2px);
}

.md-typeset .grid.cards .lucide {
  color: var(--md-primary-fg-color--light);
}

/* Header and page titles carry the gradient. */
.md-header {
  background: var(--pyprobs-gradient);
  color: #fff;
}

.md-typeset h1 {
  width: fit-content;
  background: var(--pyprobs-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The gradient would also paint the hidden permalink sign, and a page title does not need one. */
.md-typeset h1 .headerlink {
  display: none;
}

/* The search button is styled for a light header, so it gets light text on a translucent background here. */
.md-header .md-search__button,
.md-header .md-search__button:focus,
.md-header .md-search__button:hover {
  color: #fff;
}

.md-header .md-search__button {
  background-color: rgb(255 255 255 / 16%);
}

.md-header .md-search__button:focus,
.md-header .md-search__button:hover {
  background-color: rgb(255 255 255 / 26%);
}

.md-header .md-search__button::before {
  background-color: #fff;
}

.md-header .md-search__button::after {
  color: #fff;
  background-color: rgb(255 255 255 / 18%);
  border-color: transparent;
}
