/* dream: terminal-native, dark-first, one electric accent. */

[data-md-color-scheme="default"] {
  --dream-accent: #5b3df5;
  --dream-ok: #16a34a;
  --dream-hairline: rgba(12, 12, 24, 0.09);
  --dream-dots: rgba(12, 12, 24, 0.09);
  --dream-glow-a: rgba(108, 76, 255, 0.16);
  --dream-glow-b: rgba(0, 190, 220, 0.08);
  --md-default-bg-color: #fbfbfc;
  --md-default-fg-color: rgba(11, 11, 16, 0.92);
  --md-default-fg-color--light: rgba(11, 11, 16, 0.58);
  --md-default-fg-color--lighter: rgba(11, 11, 16, 0.3);
  --md-default-fg-color--lightest: rgba(11, 11, 16, 0.07);
  --md-primary-fg-color: #5b3df5;
  --md-primary-fg-color--light: #7b62ff;
  --md-primary-fg-color--dark: #4528d8;
  --md-accent-fg-color: #7b62ff;
  --md-typeset-a-color: #5b3df5;
  --md-code-bg-color: #f3f3f6;
  --md-code-fg-color: #1d1b2a;
}

[data-md-color-scheme="slate"] {
  --dream-accent: #a493ff;
  --dream-ok: #4ade80;
  --dream-hairline: rgba(255, 255, 255, 0.08);
  --dream-dots: rgba(255, 255, 255, 0.07);
  --dream-glow-a: rgba(124, 92, 255, 0.24);
  --dream-glow-b: rgba(0, 200, 230, 0.1);
  --md-default-bg-color: #08080b;
  --md-default-fg-color: rgba(237, 237, 244, 0.92);
  --md-default-fg-color--light: rgba(237, 237, 244, 0.58);
  --md-default-fg-color--lighter: rgba(237, 237, 244, 0.3);
  --md-default-fg-color--lightest: rgba(237, 237, 244, 0.07);
  --md-primary-fg-color: #a493ff;
  --md-primary-fg-color--light: #c0b4ff;
  --md-primary-fg-color--dark: #8a76ff;
  --md-accent-fg-color: #c0b4ff;
  --md-typeset-a-color: #a493ff;
  --md-code-bg-color: #111117;
  --md-code-fg-color: #e3e2ee;
}

/* Layout: one column for header, page and footer. */

.md-grid {
  max-width: 46rem;
}

.md-main {
  position: relative;
}

.md-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 46rem;
  background:
    radial-gradient(
      40rem 22rem at 30% -6rem,
      var(--dream-glow-a),
      transparent 70%
    ),
    radial-gradient(
      30rem 18rem at 85% 2rem,
      var(--dream-glow-b),
      transparent 70%
    ),
    radial-gradient(var(--dream-dots) 1px, transparent 1.4px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  pointer-events: none;
}

.md-main__inner {
  position: relative;
}

/* Header: a translucent strip with a mono wordmark and a live caret. */

.md-header {
  background-color: color-mix(
    in srgb,
    var(--md-default-bg-color) 75%,
    transparent
  );
  color: var(--md-default-fg-color);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}

.md-header--shadow {
  box-shadow: 0 1px 0 var(--dream-hairline);
}

.md-header__button.md-logo,
.md-header__button[for="__drawer"] {
  display: none;
}

.md-header__title {
  margin-left: 0.8rem;
  font-family: var(--md-code-font-family);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.md-header__topic:first-child .md-ellipsis::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 0.2em;
  vertical-align: -0.18em;
  background: var(--dream-accent);
  animation: dream-blink 1.1s steps(1) infinite;
}

.md-source {
  font-family: var(--md-code-font-family);
  font-size: 0.6rem;
  color: var(--md-default-fg-color--light);
}

@media screen and (max-width: 59.984375em) {
  .md-header__source {
    display: block;
    width: auto;
    margin-left: 0.4rem;
  }

  .md-source__icon + .md-source__repository {
    display: none;
  }
}

/* Type. */

.md-typeset {
  font-size: 0.8rem;
  line-height: 1.7;
}

.md-content__inner {
  padding-top: 1rem;
  padding-bottom: 3rem;
  counter-reset: dream-section;
}

.md-typeset a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
}

.md-typeset code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--dream-hairline);
  border-radius: 0.35em;
}

/* Sections: a numbered mono index, then a tight sans heading. */

.md-typeset h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin: 2.6em 0 0.8em;
  padding-top: 1.4em;
  border-top: 1px solid var(--dream-hairline);
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--md-default-fg-color);
  counter-increment: dream-section;
}

.md-typeset h2::before {
  content: counter(dream-section, decimal-leading-zero);
  font-family: var(--md-code-font-family);
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--dream-accent);
}

.md-typeset .headerlink {
  color: var(--md-default-fg-color--lighter);
  text-decoration: none;
}

/* Hero. */

.dh {
  padding: 3.2rem 0 1rem;
}

.md-typeset .dh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.4rem;
  padding: 0.3em 0.8em;
  border: 1px solid var(--dream-hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--md-default-bg-color) 70%, transparent);
  font-family: var(--md-code-font-family);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.dh-pulse {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--dream-ok);
  animation: dream-pulse 2.4s ease-out infinite;
}

.md-typeset .dh-headline {
  margin: 0 0 1rem;
  font-size: 2.9rem;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--md-default-fg-color);
  text-wrap: balance;
}

.md-typeset .dh-lede {
  max-width: 34rem;
  margin: 0 0 2.4rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
  text-wrap: pretty;
}

/* The session: always dark, like the terminal it stands for. */

.md-typeset .dh-term {
  display: block;
  width: auto;
  max-width: none;
  margin: 0;
  text-align: left;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem;
  background: #0b0b10;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 30px 80px -24px rgba(108, 76, 255, 0.45);
  font-family: var(--md-code-font-family);
  font-size: 0.68rem;
  line-height: 1.85;
  color: #d8d7e4;
}

.dh-term__bar {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.6rem;
  color: rgba(216, 215, 228, 0.5);
}

.dh-term__mode,
.dh-prompt,
.dh-mark {
  color: #a493ff;
}

.dh-mark.dh-ok {
  color: #4ade80;
}

.md-typeset .dh-term__log {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  list-style: none;
}

.md-typeset .dh-term__log li {
  display: grid;
  grid-template-columns: 1.6em 12.5em 1fr;
  margin: 0;
  opacity: 0;
  animation: dream-line 0.35s ease-out forwards;
  animation-delay: calc(var(--i) * 0.32s + 0.3s);
}

.md-typeset .dh-term__log li.dh-in,
.md-typeset .dh-term__log li.dh-idle {
  display: block;
  color: #f2f1fa;
}

.md-typeset .dh-term__log li.dh-in {
  margin-bottom: 0.4em;
}

.dh-k {
  color: #f2f1fa;
}

.dh-v {
  overflow: hidden;
  color: rgba(216, 215, 228, 0.55);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dh-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: #a493ff;
  animation: dream-blink 1.1s steps(1) infinite;
}

@media screen and (max-width: 44em) {
  .dh {
    padding-top: 2rem;
  }

  .md-typeset .dh-headline {
    font-size: 1.85rem;
  }

  .md-typeset .dh-term {
    font-size: 0.62rem;
  }

  .md-typeset .dh-term__log li {
    grid-template-columns: 1.6em 1fr;
  }

  .dh-v {
    grid-column: 2;
    margin-top: -0.3em;
  }
}

/* Skill tables read like a command's help output. */

.md-typeset__scrollwrap {
  margin: 1.2em 0;
}

.md-typeset__table {
  display: block;
  padding: 0;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1em;
}

.md-typeset table:not([class]) thead {
  display: none;
}

.md-typeset table:not([class]) td {
  padding: 0.85em 1em 0.85em 0;
  border-top: 1px solid var(--dream-hairline);
  vertical-align: baseline;
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: 1px solid var(--dream-hairline);
}

/* A fixed command column, so descriptions line up across every section. */

.md-typeset table:not([class]) td:first-child {
  width: 14.5em;
  padding-right: 1.5em;
  white-space: nowrap;
}

.md-typeset table:not([class]) td:first-child code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.95em;
  font-weight: 500;
  color: var(--dream-accent);
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: transparent;
  box-shadow: none;
}

.md-typeset table:not([class]) td:last-child {
  color: var(--md-default-fg-color--light);
}

@media screen and (max-width: 44em) {
  .md-typeset table:not([class]),
  .md-typeset table:not([class]) tbody,
  .md-typeset table:not([class]) tr,
  .md-typeset table:not([class]) td {
    display: block;
    width: auto;
  }

  .md-typeset table:not([class]) tr {
    padding: 0.8em 0;
    border-top: 1px solid var(--dream-hairline);
  }

  .md-typeset table:not([class]) tr:last-child {
    border-bottom: 1px solid var(--dream-hairline);
  }

  .md-typeset table:not([class]) td,
  .md-typeset table:not([class]) td:first-child,
  .md-typeset table:not([class]) tr:last-child td {
    width: auto;
    padding: 0;
    border: 0;
  }
}

/* Code blocks: a mono tab label over a quiet panel. */

.md-typeset .highlight {
  margin: 1em 0;
}

.md-typeset .highlight pre,
.md-typeset .highlight span.filename {
  border: 1px solid var(--dream-hairline);
}

.md-typeset .highlight pre {
  margin: 0;
  border-radius: 0.6em;
}

.md-typeset pre > code {
  padding: 0.9em 1.1em;
  border: 0;
  border-radius: 0.6em;
}

.md-typeset .highlight span.filename {
  margin-top: 0;
  padding: 0.5em 1.1em;
  border-bottom: none;
  border-radius: 0.6em 0.6em 0 0;
  background-color: transparent;
  font-family: var(--md-code-font-family);
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.md-typeset .highlight span.filename::before {
  display: none;
}

.md-typeset .highlight span.filename + pre,
.md-typeset .highlight span.filename + pre > code {
  border-radius: 0 0 0.6em 0.6em;
}

/* Footer: one faint mono line. */

.md-footer,
.md-footer-meta {
  background-color: transparent;
  color: var(--md-default-fg-color--lighter);
}

.md-footer-meta {
  border-top: 1px solid var(--dream-hairline);
  font-family: var(--md-code-font-family);
}

.md-copyright {
  width: auto;
  margin: 0 auto;
  text-align: center;
}

/* Motion. */

@keyframes dream-blink {
  50% {
    opacity: 0;
  }
}

@keyframes dream-line {
  from {
    opacity: 0;
    transform: translateY(0.25em);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dream-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--dream-ok) 60%, transparent);
  }

  70%,
  100% {
    box-shadow: 0 0 0 0.6em transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset .dh-term__log li {
    opacity: 1;
    animation: none;
  }

  .dh-caret,
  .dh-pulse,
  .md-header__topic:first-child .md-ellipsis::after {
    animation: none;
  }
}
