/* Oxide documentation — palette lifted from the app's own `oxide` theme
   (src/config/theme.rs), matching the marketing page at /. */

:root {
  --bg: #100d0c;
  --bg-1: #16120f;
  --bg-2: #1d1815;
  --ink: #e8ddd5;
  --ink-soft: #a3938a;
  --ink-dim: #8a786d;
  --rust: #e2725b;
  --rust-bright: #f0876f;
  --apricot: #fab387;
  --amber: #e5a458;
  --sage: #a6b86a;
  --steel: #7d9bb8;
  --sel: #4a3428;
  --rule: rgba(232, 221, 213, 0.09);
  --rule-strong: rgba(232, 221, 213, 0.16);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;

  --topbar-h: 60px;
  --sidebar-w: 252px;
  --toc-w: 210px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 20px);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(16, 13, 12, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.topbar .brand img {
  width: 25px;
  height: 25px;
  border-radius: 6px;
}

.topbar .brand .tag {
  color: var(--ink-dim);
  font-weight: 400;
}

.topbar-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}

.topbar-links a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.topbar-links a:hover {
  color: var(--ink);
}

.topbar-links a.cta {
  color: var(--bg);
  background: var(--rust);
  padding: 7px 15px;
  border-radius: 7px;
  font-weight: 600;
}

.topbar-links a.cta:hover {
  background: var(--rust-bright);
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 11px;
  cursor: pointer;
}

/* ── Layout ────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 48px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 34px 0 60px;
  font-size: 14.5px;
}

.sidebar .group {
  margin-bottom: 26px;
}

.sidebar .group-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
  padding-left: 12px;
}

.sidebar a {
  display: block;
  padding: 5px 12px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.sidebar a:hover {
  color: var(--ink);
}

.sidebar a.active {
  color: var(--rust-bright);
  border-left-color: var(--rust);
  background: rgba(226, 114, 91, 0.07);
}

/* ── Content ───────────────────────────────────────────── */
.content {
  min-width: 0;
  padding: 34px 0 40px;
}

.crumbs {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

.crumbs a {
  color: var(--ink-dim);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink-soft);
}

article {
  max-width: 760px;
}

article h1 {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

article .lede {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 34px;
}

article h2 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 52px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

/* Changelog version headings: "0.5.5  Sep 18, 2026" */
article h2 a {
  color: inherit;
  text-decoration: none;
}

article h2 a:hover {
  text-decoration: underline;
}

article h2 time {
  margin-left: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}

article h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 34px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

article h4 {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 8px;
}

article p {
  color: var(--ink-soft);
  margin-bottom: 16px;
}

article p strong,
article li strong {
  color: var(--ink);
  font-weight: 600;
}

/* Heading anchors */
.anchor {
  opacity: 0;
  margin-left: 9px;
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 400;
}

h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}

/* Lists */
article ul,
article ol {
  color: var(--ink-soft);
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}

article ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}

article ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  background: var(--rust);
}

article ol {
  counter-reset: step;
}

article ol li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  counter-increment: step;
}

article ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--rust);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  line-height: 20px;
}

article li ul {
  margin: 8px 0 0;
}

/* Code */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--apricot);
  word-break: break-word;
}

pre {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

pre code {
  font-size: inherit;
  color: inherit;
}

pre .c {
  color: var(--ink-dim);
}

pre .k {
  color: var(--steel);
}

pre .s {
  color: var(--sage);
}

pre .n {
  color: var(--amber);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-2);
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

pre:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--ink);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0 14px 9px 0;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}

tbody td {
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  vertical-align: top;
}

tbody td:last-child,
thead th:last-child {
  padding-right: 0;
}

table.keys td:first-child {
  white-space: nowrap;
  width: 38%;
}

table.keys td:nth-child(3) {
  white-space: nowrap;
  text-align: right;
  font-size: 12px;
  color: var(--ink-dim);
}

table.opts td:first-child {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

table.opts td:nth-child(2),
table.opts td:nth-child(3) {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--ink-dim);
}

kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.sep {
  color: var(--ink-dim);
  font-size: 12px;
  padding: 0 3px;
}

/* Callouts */
.note {
  border-left: 2px solid var(--steel);
  background: rgba(125, 155, 184, 0.07);
  border-radius: 0 7px 7px 0;
  padding: 13px 18px;
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.note.warn {
  border-left-color: var(--amber);
  background: rgba(229, 164, 88, 0.07);
}

.note.tip {
  border-left-color: var(--sage);
  background: rgba(166, 184, 106, 0.07);
}

.note strong {
  color: var(--ink);
}

.note :last-child {
  margin-bottom: 0;
}

/* Card grid (used on the docs index) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 2px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 24px;
}

.cards a {
  background: var(--bg);
  padding: 20px 20px 22px;
  text-decoration: none;
  transition: background 0.18s ease;
}

.cards a:hover {
  background: var(--bg-1);
}

.cards h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}

.cards p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
}

/* Theme swatches */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.swatch {
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.swatch .name {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--rule);
}

.swatch .chips {
  display: flex;
  padding: 12px;
  gap: 5px;
}

.swatch .chips i {
  display: block;
  width: 100%;
  height: 20px;
  border-radius: 3px;
}

/* Prev / next pager */
.pager {
  display: flex;
  gap: 14px;
  max-width: 760px;
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}

.pager a {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 13px 16px;
  text-decoration: none;
  transition: border-color 0.18s ease;
}

.pager a:hover {
  border-color: var(--rule-strong);
}

.pager a.next {
  text-align: right;
}

.pager .dir {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 3px;
}

.pager .label {
  font-size: 14.5px;
  color: var(--ink);
}

/* ── On-this-page ──────────────────────────────────────── */
.toc {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 40px 0 60px;
  font-size: 13.5px;
}

.toc .toc-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--rule);
  color: var(--ink-dim);
  text-decoration: none;
  line-height: 1.45;
}

.toc a.sub {
  padding-left: 24px;
}

.toc a:hover {
  color: var(--ink-soft);
}

.toc a.active {
  color: var(--rust-bright);
  border-left-color: var(--rust);
}

/* ── Footer ────────────────────────────────────────────── */
.doc-footer {
  max-width: 760px;
  margin-top: 40px;
  padding: 22px 0 44px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
}

.doc-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.doc-footer a:hover {
  color: var(--ink);
}

a.link {
  color: var(--apricot);
  text-decoration: none;
  border-bottom: 1px solid rgba(250, 179, 135, 0.3);
  transition: border-color 0.2s ease;
}

a.link:hover {
  border-color: var(--apricot);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 40px;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 20px;
  }

  .menu-btn {
    display: block;
  }

  .topbar-links a:not(.cta) {
    display: none;
  }

  .sidebar {
    display: none;
    position: static;
    max-height: none;
    padding: 20px 0 4px;
    border-bottom: 1px solid var(--rule);
  }

  .sidebar.open {
    display: block;
  }

  .content {
    padding-top: 26px;
  }

  article h1 {
    font-size: 28px;
  }

  article .lede {
    font-size: 16.5px;
  }

  .pager {
    flex-direction: column;
  }

  .pager a.next {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 480px) {
  .topbar .brand .tag {
    display: none;
  }
}
