/* ─────────────────────────────────────────────────────────────────────────────
   Compliance API docs — industry-grade polish over Material for MkDocs.
   Brand palette mirrors the rest of the platform (primary 67 120 162 →
   primary 45 75 101). Tweak in one place and the whole site follows.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --brand-50:   67, 120, 162;     /* primary */
  --brand-70:   45,  75, 101;     /* primary-deep */
  --brand-40:   87, 153, 211;     /* primary-bright */
  --brand-grad: linear-gradient(118.61deg, rgb(var(--brand-50)) 11.65%, rgb(var(--brand-70)) 89.65%);

  /* Material primary tokens — apply our blue everywhere Material uses primary. */
  --md-primary-fg-color:        rgb(var(--brand-50));
  --md-primary-fg-color--light: rgb(var(--brand-40));
  --md-primary-fg-color--dark:  rgb(var(--brand-70));
  --md-primary-bg-color:        #ffffff;
  --md-primary-bg-color--light: #ffffffcc;
  --md-accent-fg-color:         rgb(var(--brand-50));
  --md-accent-fg-color--transparent: rgba(67, 120, 162, 0.10);

  /* Typography. */
  --md-text-font:               "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --md-code-font:               "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #0c1019;
  --md-default-fg-color:        #e6eaf2;
  --md-default-fg-color--light: #b8c2d4;
  --md-default-fg-color--lighter: #6b7790;
  --md-code-bg-color:           #131826;
  --md-code-fg-color:           #e6eaf2;
}

/* ─── Header — denser, more polished ─────────────────────────────────────── */
.md-header {
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
}
[data-md-color-scheme="default"] .md-header {
  background-color: #ffffff;
  color: #0c1019;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.md-header__title {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.md-header__topic:first-child { font-weight: 600; }

/* Logo: a touch larger than default. */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.6rem;
  width: auto;
}

/* ─── Tabs — sleeker ─────────────────────────────────────────────────────── */
.md-tabs {
  background-color: transparent;
  color: var(--md-default-fg-color--light);
  border-bottom: 1px solid rgba(127,127,127,0.10);
}
.md-tabs__link {
  font-weight: 500;
  opacity: 0.85;
  margin-top: 0.6rem;
}
.md-tabs__link--active,
.md-tabs__link:hover {
  opacity: 1;
  color: rgb(var(--brand-50));
}

/* ─── Sidebar — calmer ───────────────────────────────────────────────────── */
.md-nav__title { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
.md-nav__link { font-size: 0.82rem; }
.md-nav__link--active { color: rgb(var(--brand-50)); font-weight: 600; }

/* ─── Hero / landing cards ───────────────────────────────────────────────── */
.hero {
  margin: 1rem 0 3rem;
  padding: 3rem 2.5rem;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(var(--brand-50), 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(var(--brand-70), 0.22), transparent 50%),
    linear-gradient(180deg, #131826 0%, #0c1019 100%);
  color: #e6eaf2;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
[data-md-color-scheme="default"] .hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(var(--brand-50), 0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(var(--brand-70), 0.10), transparent 50%),
    linear-gradient(180deg, #fafbff 0%, #f1f4fa 100%);
  color: #0c1019;
  border: 1px solid rgba(0,0,0,0.08);
}
.hero h1 {
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.75rem;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.1rem;
  line-height: 1.55;
  max-width: 36rem;
  opacity: 0.85;
  margin: 0 0 1.5rem;
}
.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.hero .cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s;
}
.hero .cta--primary {
  background: var(--brand-grad);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(var(--brand-70), 0.35);
}
.hero .cta--primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero .cta--ghost {
  background: rgba(255,255,255,0.06);
  color: inherit !important;
  border: 1px solid rgba(255,255,255,0.10);
}
[data-md-color-scheme="default"] .hero .cta--ghost {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
.hero .cta--ghost:hover { background: rgba(127,127,127,0.12); }

/* Material's "grid cards" — restyle for industry feel. */
.md-typeset .grid.cards > :is(ul, ol) > li,
.md-typeset .grid.cards > :is(ul, ol) > li > div {
  border-radius: 0.75rem;
  border: 1px solid rgba(127,127,127,0.18);
  background: rgba(127,127,127,0.04);
  transition: border-color 0.15s, transform 0.15s;
}
.md-typeset .grid.cards > :is(ul, ol) > li:hover {
  border-color: rgba(var(--brand-50), 0.5);
  transform: translateY(-2px);
}
.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child {
  font-weight: 600;
  font-size: 1rem;
  color: rgb(var(--brand-50));
}

/* ─── Code blocks — tighter, branded scrollbar ───────────────────────────── */
.md-typeset code,
.md-typeset pre > code {
  font-feature-settings: "ss01", "cv11";
  font-size: 0.85em;
}
.md-typeset .highlight {
  border-radius: 0.5rem;
  border: 1px solid rgba(127,127,127,0.15);
}
.md-typeset .highlight pre { padding: 0.9rem 1.1rem; }

/* Inline `code` tags get a faint brand-tinted background. */
.md-typeset :not(pre) > code {
  background: rgba(var(--brand-50), 0.10);
  color: rgb(var(--brand-50));
  border: none;
  padding: 0.12em 0.4em;
  border-radius: 0.3em;
}
[data-md-color-scheme="slate"] .md-typeset :not(pre) > code {
  color: rgb(var(--brand-40));
  background: rgba(var(--brand-40), 0.12);
}

/* ─── Tabbed code samples (Plaid-style) ──────────────────────────────────── */
.md-typeset .tabbed-set { border-radius: 0.5rem; }
.md-typeset .tabbed-labels {
  border-bottom: 1px solid rgba(127,127,127,0.20);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.md-typeset .tabbed-labels > label {
  padding: 0.55rem 1rem;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.md-typeset .tabbed-labels > label:hover { opacity: 1; }
.md-typeset .tabbed-set > input:checked + label {
  color: rgb(var(--brand-50));
  border-bottom: 2px solid rgb(var(--brand-50));
  opacity: 1;
}

/* ─── Tables — light & confident ─────────────────────────────────────────── */
.md-typeset table:not([class]) {
  border: 1px solid rgba(127,127,127,0.18);
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.85rem;
}
.md-typeset table:not([class]) th {
  background: rgba(127,127,127,0.06);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* ─── Admonitions — subtler ──────────────────────────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.5rem;
  border-width: 1px;
  font-size: 0.85rem;
}

/* ─── Footer — strip the "Made with…" line ──────────────────────────────── */
.md-footer-meta { display: none; }
.md-footer { background: var(--md-default-bg-color); border-top: 1px solid rgba(127,127,127,0.10); }

/* ─── Search — fancier ───────────────────────────────────────────────────── */
.md-search__input {
  border-radius: 0.5rem;
  background: rgba(127,127,127,0.08);
}
.md-search__input::placeholder { opacity: 0.5; }

/* Reference page (Scalar) — flush layout, both nesting variants. */
.md-content article.md-content__inner:has(> #scalar-mount) { padding: 0; max-width: none; }
.md-content article.md-content__inner:has(> div[markdown="0"] > #scalar-mount) { padding: 0; max-width: none; }
.md-content__inner:has(#scalar-mount) { padding: 0 !important; max-width: none !important; margin: 0 !important; }
.md-content:has(#scalar-mount) { padding: 0; max-width: none; }
/* Hide the "edit on git" pencil on the reference page since the spec is generated. */
.md-content article.md-content__inner:has(#scalar-mount) .md-content__button { display: none; }

/* ─── Body typography polish ─────────────────────────────────────────────── */
.md-typeset {
  font-size: 0.86rem;
  line-height: 1.65;
}
.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.5em;
}
.md-typeset h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.4rem;
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid rgba(127,127,127,0.10);
}
.md-typeset h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.5em; }
.md-typeset h3 {
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 2em;
}
.md-typeset h2 + p,
.md-typeset h3 + p { margin-top: 0.5em; }

/* The anchor permalink (¶) — show only on hover, in brand color. */
.md-typeset h1 .headerlink,
.md-typeset h2 .headerlink,
.md-typeset h3 .headerlink {
  color: rgb(var(--brand-50));
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: 0.4em;
  font-weight: 400;
}
.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink { opacity: 0.7; }

/* ─── Admonitions + blockquotes — branded, subtle ────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
  box-shadow: none;
  border-left-width: 3px;
}
.md-typeset blockquote {
  border-left: 3px solid rgb(var(--brand-50));
  background: rgba(var(--brand-50), 0.04);
  padding: 0.6em 1em;
  border-radius: 0 0.4rem 0.4rem 0;
  color: var(--md-default-fg-color--light);
}
.md-typeset blockquote > p:first-child { margin-top: 0; }
.md-typeset blockquote > p:last-child { margin-bottom: 0; }

/* ─── Tables — striped on hover ─────────────────────────────────────────── */
.md-typeset table:not([class]) tbody tr:hover {
  background: rgba(var(--brand-50), 0.04);
}
.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  padding: 0.6em 0.9em;
}

/* ─── Code blocks — denser ──────────────────────────────────────────────── */
.md-typeset pre > code { line-height: 1.55; }

/* ─── Search focus ring ──────────────────────────────────────────────────── */
.md-search__input:focus {
  outline: 2px solid rgb(var(--brand-50));
  outline-offset: -1px;
  background: var(--md-default-bg-color);
}

/* ─── Dark-mode scrollbars ───────────────────────────────────────────────── */
[data-md-color-scheme="slate"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-md-color-scheme="slate"] ::-webkit-scrollbar-track { background: transparent; }
[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 4px;
}
[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ─── Hero refinement ────────────────────────────────────────────────────── */
.hero { position: relative; }
/* Subtle dot grid texture for depth. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  border-radius: inherit;
  mask-image: radial-gradient(ellipse at 30% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, black 0%, transparent 70%);
}
[data-md-color-scheme="default"] .hero::before {
  background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
}
.hero > * { position: relative; z-index: 1; }

@media (max-width: 76.1875em) {
  .hero { padding: 2rem 1.5rem; }
  .hero h1 { font-size: 2rem; }
}

/* Grid cards — even spacing + tighter padding. */
.md-typeset .grid.cards { margin-top: 2rem; margin-bottom: 2rem; }
.md-typeset .grid.cards > :is(ul, ol) > li { padding: 1.2rem 1.4rem; }
.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.md-typeset .grid.cards > :is(ul, ol) > li hr {
  margin: 0.4rem 0 0.6rem;
  border: 0;
  border-top: 1px solid rgba(127,127,127,0.18);
}

/* Hide Material "edit on git" / source-file affordances we don't expose. */
.md-source-file__fact { display: none; }
