/* Aurora OS Documentation: a plain, readable reference layout. Light and dark
   follow the system unless the reader picks one (◐ in the header). */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eef0f4;
  --text: #1c2027;
  --muted: #5a6372;
  --border: #d9dde4;
  --accent: #6d28d9;
  --accent-soft: rgba(109, 40, 217, 0.09);
  --code-bg: #f2f3f6;
  --kbd-bg: #ffffff;
  --note: #2563eb;
  --tip: #15803d;
  --warn: #b45309;
  --shadow: 0 8px 28px rgba(15, 20, 30, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116;
    --surface: #151820;
    --surface-2: #1b1f28;
    --text: #e3e7ee;
    --muted: #98a1b0;
    --border: #2a303b;
    --accent: #b794ff;
    --accent-soft: rgba(183, 148, 255, 0.12);
    --code-bg: #1a1e27;
    --kbd-bg: #222733;
    --note: #7aa7ff;
    --tip: #5bd391;
    --warn: #f0b35a;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1116;
  --surface: #151820;
  --surface-2: #1b1f28;
  --text: #e3e7ee;
  --muted: #98a1b0;
  --border: #2a303b;
  --accent: #b794ff;
  --accent-soft: rgba(183, 148, 255, 0.12);
  --code-bg: #1a1e27;
  --kbd-bg: #222733;
  --note: #7aa7ff;
  --tip: #5bd391;
  --warn: #f0b35a;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 600; color: var(--muted); }
.version { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 34px; padding: 0 34px 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search .hint { position: absolute; right: 8px; top: 6px; }
#results {
  display: none; position: absolute; top: 40px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
#results.open { display: block; }
#results a { display: block; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
#results a:last-child { border-bottom: none; }
#results a:hover, #results a.active { background: var(--accent-soft); text-decoration: none; }
#results small { display: block; color: var(--muted); font-size: 12.5px; }
#results mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }
.links { display: flex; align-items: center; gap: 14px; font-size: 14px; white-space: nowrap; }
.links a { color: var(--muted); }
.theme, .menu {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; height: 32px; min-width: 32px; cursor: pointer; font-size: 15px;
}
.menu { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 18px 10px 40px 16px; border-right: 1px solid var(--border); background: var(--surface);
  font-size: 14px;
}
.sidebar details { margin-bottom: 4px; }
.sidebar summary {
  cursor: pointer; padding: 6px 8px; border-radius: 6px; font-weight: 600; list-style: none;
  color: var(--text);
}
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); transition: transform 0.15s; }
.sidebar details[open] > summary::before { transform: rotate(90deg); }
.sidebar ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; }
.sidebar li a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.sidebar li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { display: grid; grid-template-columns: minmax(0, 820px) 220px; gap: 40px; padding: 28px 40px 80px; justify-content: center; }
article { min-width: 0; }
.crumbs { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; }
.lead { font-size: 1.12rem; color: var(--muted); margin-top: 0; }
h2 { font-size: 1.5rem; margin: 2.2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--border); }
h3 { font-size: 1.17rem; margin: 1.8em 0 0.5em; }
h4 { font-size: 1rem; margin: 1.4em 0 0.4em; }
h2 .anchor, h3 .anchor { float: left; margin-left: -1em; padding-right: 0.3em; color: var(--muted); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; text-decoration: none; }
p, li { max-width: 78ch; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.2em 0; }
code {
  font: 0.88em "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: var(--code-bg); padding: 0.12em 0.38em; border-radius: 5px;
}
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5; position: relative;
}
pre code { background: none; padding: 0; font-size: 0.86em; }
pre .copy {
  position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--muted);
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
pre:hover .copy { opacity: 1; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0.05em 0.45em; text-align: center;
  font: 600 0.8em/1.6 Inter, system-ui, sans-serif; color: var(--text);
  background: var(--kbd-bg); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
  white-space: nowrap;
}
.table-wrap { overflow-x: auto; margin: 1em 0 1.4em; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
table.keys td:first-child { white-space: nowrap; width: 1%; }
table.gsettings td:first-child, table.gsettings td:nth-child(2) { white-space: nowrap; }
.muted { color: var(--muted); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: 1px;
}
.note, .tip, .warning {
  margin: 1.2em 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border);
  border-left: 4px solid var(--note); background: var(--surface);
}
.note::before, .tip::before, .warning::before { display: block; font-weight: 700; font-size: 0.85em; margin-bottom: 2px; }
.note::before { content: "Note"; color: var(--note); }
.tip { border-left-color: var(--tip); }
.tip::before { content: "Tip"; color: var(--tip); }
.warning { border-left-color: var(--warn); }
.warning::before { content: "Warning"; color: var(--warn); }
.note > :last-child, .tip > :last-child, .warning > :last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.4em; margin: 0.8em 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1em; width: 1.7em; height: 1.7em;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700;
  font-size: 0.85em; display: grid; place-items: center;
}
.generated p.group { font-weight: 600; margin: 1em 0 0.2em; }
.generated ul { margin-top: 0.2em; }
.source { font-size: 12.5px; color: var(--muted); }
dl { margin: 1em 0; }
dt { font-weight: 600; margin-top: 0.8em; }
dd { margin: 0.2em 0 0 1.2em; color: var(--text); }
.path { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; }
.figure { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--surface); }

/* on this page */
.toc { position: sticky; top: 80px; align-self: start; font-size: 13px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc p { margin: 0 0 6px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
.toc li.h3 a { padding-left: 24px; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }

/* home */
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 24px; }
.area { border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px 14px; background: var(--surface); }
.area h2 { border: none; margin: 0.8em 0 0.4em; padding: 0; font-size: 1.1rem; }
.area ul { list-style: none; padding: 0; margin: 0; }
.area li { margin: 0.45em 0; }
.area li span { display: block; font-size: 13px; color: var(--muted); }

.meta { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; }
.pager a { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; font-size: 12px; color: var(--muted); }
.pager .next { text-align: right; }

@media (max-width: 1200px) {
  main { grid-template-columns: minmax(0, 820px); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu { display: inline-block; }
  .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; width: 290px; height: auto; z-index: 15;
    transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  main { padding: 20px 16px 60px; }
  .brand b, .version, .links a { display: none; }
  h1 { font-size: 1.7rem; }
}
@media print {
  .top, .sidebar, .toc, .pager { display: none; }
  .layout, main { display: block; padding: 0; }
}
