/* Autolab docs theme — "Sharp Dark" (Modal-grade).
   Mirrors app.autolab.ai (dark zinc, emerald accent, Inter Tight + IBM Plex Mono)
   with a sharp, technical finish: 1px hairline borders, ~2px corners, sectioned
   nav with uppercase labels, green left-rail active states, vertical rules. */

:root {
  --al-green: #34d399;
  --al-green-strong: #10b981;
  --al-ink: #f4f4f5;
  --al-bg: #0a0a0b;
  --al-surface: #0e0e11;
  --al-elevated: #141417;
  --al-border: #1d1d21;     /* hairline */
  --al-border-2: #26262b;   /* inputs / stronger edges */
  --al-muted: #a1a1aa;
  --al-faint: #6b6b73;
  --al-radius: 2px;
}

/* Custom primary (header / brand) — near-black in both schemes. */
[data-md-color-primary="custom"] {
  --md-primary-fg-color: #0a0a0b;
  --md-primary-fg-color--light: #141417;
  --md-primary-fg-color--dark: #050506;
  --md-primary-bg-color: #f4f4f5;
  --md-primary-bg-color--light: #a1a1aa;
}

/* Custom accent — emerald. */
[data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--al-green);
  --md-accent-fg-color--transparent: rgba(52, 211, 153, 0.1);
  --md-accent-bg-color: #0a0a0b;
  --md-accent-bg-color--light: #141417;
}

/* ── Dark scheme (default) ─────────────────────────────────────────────── */
[data-md-color-scheme="slate"] {
  --md-hue: 240;
  --md-default-bg-color: var(--al-bg);
  --md-default-fg-color: var(--al-ink);
  --md-default-fg-color--light: var(--al-muted);
  --md-default-fg-color--lighter: var(--al-faint);
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.05);
  --md-typeset-color: #c7c7cd;
  --md-typeset-a-color: var(--al-green);

  --md-code-bg-color: #0c0c0f;
  --md-code-fg-color: #d4d4d8;

  --md-footer-bg-color: #050506;
  --md-footer-bg-color--dark: #050506;
  --md-accent-fg-color: var(--al-green);
}

[data-md-color-scheme="slate"] .md-typeset kbd {
  background-color: #18181c;
  border-radius: var(--al-radius);
  box-shadow: none;
  border: 1px solid var(--al-border-2);
}

/* Light scheme — keep links/accents emerald, header stays dark. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: var(--al-green-strong);
  --md-accent-fg-color: var(--al-green-strong);
}

/* ── Typography ────────────────────────────────────────────────────────── */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.md-typeset {
  font-size: 0.78rem;
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color);
}
.md-typeset h1 {
  font-weight: 650;
  font-size: 1.72rem;
  margin-bottom: 0.5em;
}
.md-typeset h2 {
  margin-top: 2.2em;
  padding-top: 0.4em;
}

/* ── Header: thin, hairline underline, no shadow ───────────────────────── */
.md-header {
  border-bottom: 1px solid var(--al-border);
  box-shadow: none !important;
}
.md-tabs { border-bottom: 1px solid var(--al-border); }
.md-header__title { font-weight: 600; letter-spacing: -0.01em; }

/* Search: sharp + hairline. */
.md-search__form {
  border-radius: var(--al-radius);
  border: 1px solid var(--al-border-2);
  background: var(--al-surface);
  box-shadow: none;
}
[data-md-color-scheme="slate"] .md-search__input::placeholder { color: var(--al-faint); }
.md-search__output { border-radius: var(--al-radius); }

/* ── Sidebars: vertical hairline rules (the SkyPilot/Modal signature) ───── */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary { border-right: 1px solid var(--al-border); }
  .md-sidebar--secondary { border-left: 1px solid var(--al-border); }
  /* The repeated site title in the sidebar is redundant with the header. */
  .md-nav--primary > .md-nav__title { display: none; }
}

/* ── Left nav: uppercase section labels + green-rail active item ────────── */
.md-nav { font-size: 0.7rem; }
.md-nav__item--section > .md-nav__link,
.md-nav--primary .md-nav__item--section > label.md-nav__link {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--al-faint);
  margin-top: 1.1rem;
  opacity: 1;
}
.md-nav__link { border-radius: var(--al-radius); }
.md-nav__link:hover { color: var(--al-ink); }
.md-nav__item .md-nav__link--active,
.md-nav__link--active {
  color: var(--al-ink);
  font-weight: 600;
}
/* primary-nav active gets the green rail + subtle tint */
.md-sidebar--primary .md-nav__link--active {
  background: var(--al-elevated);
  box-shadow: inset 2px 0 0 var(--al-green);
}

/* ── Right TOC: green-rail active item ─────────────────────────────────── */
.md-nav--secondary .md-nav__link--active {
  color: var(--al-green);
  box-shadow: inset 2px 0 0 var(--al-green);
  padding-left: 0.6rem;
}
.md-nav--secondary .md-nav__title { color: var(--al-muted); }

/* ── Code: square, hairline border, filename header support ────────────── */
.md-typeset pre > code { border-radius: var(--al-radius); }
.md-typeset .highlight {
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
}
[data-md-color-scheme="slate"] .md-typeset .highlight { background: var(--al-surface); }
.md-typeset code { border-radius: var(--al-radius); font-feature-settings: "kern"; }
.md-typeset a > code { color: var(--al-green); }
/* Code blocks with a title (```bash title="…") get a header bar. */
.md-typeset .highlight [data-md-component="code"] > .filename,
.md-typeset .highlight span.filename {
  background: var(--al-elevated);
  border-bottom: 1px solid var(--al-border);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  color: var(--al-muted);
  font-weight: 500;
}
.md-clipboard { color: var(--al-faint); }
.md-clipboard:hover { color: var(--al-green); }

/* ── Buttons: sharp ────────────────────────────────────────────────────── */
.md-typeset .md-button {
  border-radius: var(--al-radius);
  border-width: 1px;
  font-weight: 550;
  color: var(--md-default-fg-color);
  border-color: var(--al-border-2);
  transition: border-color 100ms ease, background-color 100ms ease;
}
.md-typeset .md-button:not(.md-button--primary):hover,
.md-typeset .md-button:not(.md-button--primary):focus {
  color: var(--md-default-fg-color);
  border-color: var(--al-green);
  background-color: transparent;
}
.md-typeset .md-button--primary {
  background-color: var(--al-green);
  border-color: var(--al-green);
  color: #052017;
}
.md-typeset .md-button--primary:hover,
.md-typeset .md-button--primary:focus {
  background-color: var(--al-green-strong);
  border-color: var(--al-green-strong);
  color: #04140f;
}

/* ── Grid cards: hairline + square + green hover ───────────────────────── */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
  padding: 1rem 1.1rem;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--al-green);
  transform: none;
}
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li { background: var(--al-surface); }

/* ── Admonitions / details: hairline box, colored left rail + icon ─────── */
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--al-radius);
  box-shadow: none;
  font-size: 0.72rem;
}
/* `[class]` lifts specificity to match Material's per-type rules so the box is
   a uniform hairline regardless of admonition type (no cyan/amber boxes). */
.md-typeset .admonition[class],
.md-typeset details[class] {
  border: 1px solid var(--al-border);
  border-left-width: 2px;
}
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details { background: var(--al-surface); }

/* Only the 2px left rail carries the semantic color. */
.md-typeset .note[class], .md-typeset .info[class],
.md-typeset .tip[class], .md-typeset .abstract[class] { border-left-color: var(--al-green); }
.md-typeset .warning[class], .md-typeset .caution[class],
.md-typeset .attention[class] { border-left-color: #f59e0b; }
.md-typeset .danger[class], .md-typeset .failure[class],
.md-typeset .bug[class] { border-left-color: #ef4444; }

/* note / info / tip / abstract: emerald icon + faint emerald title wash. */
.md-typeset .note > .admonition-title, .md-typeset .note > summary,
.md-typeset .info > .admonition-title, .md-typeset .info > summary,
.md-typeset .tip > .admonition-title, .md-typeset .tip > summary,
.md-typeset .abstract > .admonition-title, .md-typeset .abstract > summary {
  background-color: rgba(52, 211, 153, 0.07);
}
.md-typeset .note > .admonition-title::before, .md-typeset .note > summary::before,
.md-typeset .info > .admonition-title::before, .md-typeset .info > summary::before,
.md-typeset .tip > .admonition-title::before, .md-typeset .tip > summary::before,
.md-typeset .abstract > .admonition-title::before, .md-typeset .abstract > summary::before {
  background-color: var(--al-green);
}

/* ── Tabbed (content tabs): sharp underline, no nested box ──────────────── */
.md-typeset .tabbed-set > input:checked + label { border-color: var(--al-green); color: var(--al-ink); }
.md-typeset .tabbed-labels { box-shadow: inset 0 -1px 0 var(--al-border); }
.md-typeset .tabbed-content { padding-top: 0.6rem; }

/* ── Tables: hairline, square, denser ──────────────────────────────────── */
.md-typeset table:not([class]) {
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
  font-size: 0.7rem;
}
.md-typeset table:not([class]) th {
  background: var(--al-elevated);
  font-weight: 600;
  border-bottom: 1px solid var(--al-border);
}
.md-typeset table:not([class]) td { border-top: 1px solid var(--al-border); }

/* ── Footer: quieter, hairline top ─────────────────────────────────────── */
.md-footer-meta { background: #050506; }
.md-footer { border-top: 1px solid var(--al-border); }

/* ── Homepage hero ─────────────────────────────────────────────────────── */
.al-hero { padding: 1.5rem 0 0.5rem; }
.al-hero__mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 2.9rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
.al-hero__mark .s { color: var(--al-green); }
.al-hero__tagline { color: var(--al-muted); font-size: 1.02rem; max-width: 40rem; margin: 0.6rem 0 1.2rem; }
.al-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--al-green);
}
