/* Danikakes design language, shared with https://danikakes.dev: lavender from the avatar, with plum and
   blonde accents, a slowly rolling gradient on the header and main buttons, and gradient link text. */
:root {
  --brand-grad: linear-gradient(90deg, #6c70b3, #79689f, #845863, #79689f, #6c70b3);
  --roll: 10s;          /* one sweep of the rolling gradients */
  --fade: 0.35s ease;   /* hover fades */
  --card-radius: 0.6rem;
}
:root > * {
  --md-primary-fg-color: #7276b8;
  --md-primary-fg-color--light: #9396cc;
  --md-primary-fg-color--dark: #5a5e9e;
  --md-accent-fg-color: #5a5e9e;
  --md-accent-fg-color--transparent: rgba(114, 118, 184, 0.1);
}
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #18161b;
  --md-typeset-a-color: #b3b5e6;
  --md-accent-fg-color: #b3b5e6;
  --md-accent-fg-color--transparent: rgba(179, 181, 230, 0.1);
  --card-bg: #1f1c23;
  --card-border: #2f2a33;
  --text-grad: linear-gradient(90deg, #a9acec, #c7a3d0, #e0a9b6, #c7a3d0, #a9acec);
}
[data-md-color-scheme="default"] {
  --card-bg: #fff;
  --card-border: #e2e5ec;
  --text-grad: linear-gradient(90deg, #4f53a0, #6d5a92, #845863, #6d5a92, #4f53a0);
}

@keyframes gradient-roll {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* Header */
.md-header {
  background: var(--brand-grad);
  background-size: 300% 100%;
  animation: gradient-roll var(--roll) ease-in-out infinite alternate;
}

/* Text: headings are heavy, links use the rolling gradient in lighter tones so they stay readable. */
.md-typeset h1 { font-weight: 800; }
.md-typeset h2 { font-weight: 700; }
.md-typeset a:not(.md-button, .headerlink, .glightbox),
.md-typeset .md-button:not(.md-button--primary),
.md-nav__link--active {
  background-image: var(--text-grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradient-roll var(--roll) ease-in-out infinite alternate;
}
.md-typeset a:not(.md-button, .headerlink, .glightbox):hover { filter: brightness(1.25); }

/* Buttons */
.md-typeset .md-button {
  margin: 0 0.5rem 0.5rem 0;
  padding: 0.55em 1.4em;
  border-radius: 0.4rem;
  font-size: 0.72rem;
}
.md-typeset .md-button--primary {
  border-color: transparent;
  background: var(--brand-grad);
  background-size: 300% 100%;
  animation: gradient-roll var(--roll) ease-in-out infinite alternate;
}
.md-typeset .md-button--primary:hover,
.md-typeset .md-button--primary:focus-visible {
  border-color: transparent;
  filter: brightness(1.2);
  box-shadow: 0 6px 18px rgba(114, 118, 184, 0.35);
}
/* Outlined buttons: gradient text and a lavender border. On hover the gradient fill fades in on its own
   layer, and the text fades to white over it. */
.md-typeset .md-button:not(.md-button--primary) {
  position: relative;
  isolation: isolate;
  border-color: var(--md-primary-fg-color--light);
}
.md-typeset .md-button:not(.md-button--primary)::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--brand-grad);
  background-size: 300% 100%;
  animation: gradient-roll var(--roll) ease-in-out infinite alternate;
  opacity: 0;
}
.md-typeset .md-button:not(.md-button--primary):hover,
.md-typeset .md-button:not(.md-button--primary):focus-visible {
  border-color: transparent;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 6px 18px rgba(114, 118, 184, 0.3);
}
.md-typeset .md-button:not(.md-button--primary):hover::before,
.md-typeset .md-button:not(.md-button--primary):focus-visible::before {
  opacity: 1;
}

/* Cards */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
}
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  border-color: var(--md-primary-fg-color--light);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

/* "More plugins" in the header: a white pill on the gradient, linking to danikakes.dev. Icon only on
   phones. */
.dk-more {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.dk-more svg { width: 1rem; height: 1rem; fill: currentColor; }
.dk-more:hover,
.dk-more:focus-visible { background-color: rgba(255, 255, 255, 0.18); border-color: #fff; }
@media screen and (max-width: 44.984375em) {
  .dk-more { padding: 0.3rem; }
  .dk-more span { display: none; }
}

/* Hover fades, a little slower than the theme's. */
.md-typeset a,
.md-nav__link,
.md-footer__link,
.md-social__link,
.md-header__button,
.dk-more,
.md-search__input {
  transition: color var(--fade), background-color var(--fade), opacity var(--fade), filter var(--fade);
}
.md-typeset .md-button {
  transition: color var(--fade), -webkit-text-fill-color var(--fade), background-color var(--fade),
    border-color var(--fade), filter var(--fade), box-shadow var(--fade), transform var(--fade);
}
.md-typeset .md-button::before { transition: opacity var(--fade); }
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  transition: border-color var(--fade), box-shadow var(--fade);
}

/* Lifts, for readers who don't ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .md-typeset .md-button:hover { transform: translateY(-1px); }
}

/* The theme turns off every transition for reduced motion. Color fades and the slow gradient drift
   aren't movement, so keep them, the drift a little gentler. */
@media (prefers-reduced-motion: reduce) {
  :root { --roll: 16s; }
  .md-typeset a,
  .md-nav__link,
  .md-footer__link,
  .md-social__link,
  .md-header__button,
  .dk-more,
  .md-search__input,
  .md-typeset .md-button,
  .md-typeset .md-button::before,
  .md-typeset .grid.cards > ul > li,
  .md-typeset .grid > .card {
    transition-property: color, -webkit-text-fill-color, background-color, border-color, opacity, filter, box-shadow !important;
    transition-duration: 0.35s !important;
    transition-timing-function: ease !important;
  }
}
