:root {
  --magic-purple: #7c4dff;
  --magic-purple-deep: #5630c9;
  --magic-pink: #f58ac5;
  --magic-blue: #52a8ff;
  --magic-green: #52d6a5;
  --magic-surface: color-mix(in srgb, var(--md-default-bg-color) 94%, var(--magic-purple) 6%);
  --md-primary-fg-color: #6543c5;
  --md-primary-fg-color--light: #8c6ee8;
  --md-primary-fg-color--dark: #45279e;
  --md-accent-fg-color: #b84c9b;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0d1220;
  --md-default-bg-color--light: #141b2d;
  --md-code-bg-color: #11182a;
  --magic-surface: #141b2d;
}

.md-header {
  background: linear-gradient(90deg, #4d2ba6, #7a3fc3 55%, #a54c9d);
}

.md-tabs {
  background: #301d67;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 700;
  letter-spacing: -0.018em;
}

.md-typeset h1 {
  color: var(--md-default-fg-color);
}

.magic-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.6rem;
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid color-mix(in srgb, var(--magic-purple) 48%, transparent);
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at 88% 18%, rgba(245, 138, 197, 0.27), transparent 26%),
    radial-gradient(circle at 66% 88%, rgba(82, 168, 255, 0.19), transparent 30%),
    linear-gradient(135deg, rgba(86, 48, 201, 0.18), rgba(124, 77, 255, 0.06));
  box-shadow: 0 1.1rem 3rem rgba(31, 19, 64, 0.16);
}

.magic-hero::after {
  position: absolute;
  top: -3rem;
  right: -1rem;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 35% 65% 65% 35% / 55% 45% 55% 45%;
  content: "";
  transform: rotate(24deg);
  pointer-events: none;
}

.magic-hero h1 {
  max-width: 16ch;
  margin: 0.35rem 0 1rem;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.02;
}

.magic-hero p {
  max-width: 52rem;
  font-size: 1.05rem;
}

.magic-kicker {
  color: var(--magic-purple);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

[data-md-color-scheme="slate"] .magic-kicker {
  color: #bca7ff;
}

.magic-hero .md-button {
  margin-top: 0.75rem;
  margin-right: 0.5rem;
  border-radius: 999px;
}

.scope-banner {
  margin: 1rem 0 1.8rem;
  padding: 0.9rem 1.15rem;
  border-left: 0.25rem solid var(--magic-blue);
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--magic-blue) 10%, var(--md-default-bg-color));
}

.scope-banner p {
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 2rem;
}

.feature-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.7rem;
  background: var(--magic-surface);
}

.feature-card h3 {
  margin-top: 0;
}

.feature-card p:last-child {
  margin-bottom: 0;
}

.step-result {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--magic-green) 58%, transparent);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--magic-green) 9%, var(--md-default-bg-color));
}

.step-result::before {
  color: #1a936f;
  content: "CHECKPOINT  ";
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

[data-md-color-scheme="slate"] .step-result::before {
  color: #72e5bc;
}

.ui-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.75rem 0;
  font-weight: 700;
}

.ui-path > span {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  background: var(--magic-surface);
}

.ui-path > i::before {
  color: var(--md-default-fg-color--lighter);
  content: "›";
  font-size: 1.2rem;
  font-style: normal;
}

.blueprint-flow {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #334866;
  border-radius: 0.65rem;
  background-color: #111827;
  background-image: radial-gradient(#334155 0.7px, transparent 0.7px);
  background-size: 15px 15px;
  color: #e5edf8;
}

.blueprint-flow code {
  color: #f3f7ff;
}

.blueprint-flow strong {
  color: #9ecbff;
}

.md-typeset img[src*="/diagrams/"] {
  display: block;
  width: 100%;
  margin: 1.25rem auto 1.8rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.75rem;
  background: #0f1727;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
}

.md-typeset td code,
.md-typeset th code {
  overflow-wrap: normal;
  white-space: nowrap;
}

.md-typeset code {
  border-radius: 0.25rem;
}

.mermaid {
  margin: 1.2rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.65rem;
  background: var(--magic-surface);
  text-align: center;
}

@media screen and (max-width: 720px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .magic-hero {
    padding: 1.65rem 1.25rem;
  }

  .magic-hero h1 {
    font-size: 2.35rem;
  }
}
