/* Koine docs. Colors and fonts from app/web/src/styles.css; dark theme follows the system setting. */
:root {
  --bg: #ffffff;
  --panel: #f3f3f3;
  --line: oklch(28% 0.05 158 / 0.1);
  --line-2: oklch(28% 0.05 158 / 0.18);
  --text: oklch(27% 0.05 158);
  --muted: oklch(46% 0.02 160);
  --accent: oklch(91% 0.16 125);
  --accent-soft: oklch(95.5% 0.09 122);
  --serif: 'Geist Serif', Georgia, 'Times New Roman', serif;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(17% 0.02 158);
    --panel: oklch(22% 0.022 158);
    --line: oklch(92% 0.02 158 / 0.1);
    --line-2: oklch(92% 0.02 158 / 0.2);
    --text: oklch(93% 0.015 150);
    --muted: oklch(72% 0.02 155);
    --accent: oklch(91% 0.16 125);
    --accent-soft: oklch(91% 0.16 125 / 0.14);
  }
}
@font-face { font-family: 'Geist'; src: url(/fonts/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Serif'; src: url(/fonts/geist-serif.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/fonts/geist-mono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font: 400 22px/1 var(--serif); letter-spacing: -0.025em; text-decoration: none; }
.brand span { color: var(--muted); }
.menu { display: none; }

.wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
nav {
  position: sticky; top: 56px; align-self: start;
  max-height: calc(100vh - 56px); overflow-y: auto;
  padding: 24px 16px 48px 24px; font-size: 14px;
}
nav h2 { margin: 20px 0 6px; font: 600 13px/1.4 var(--font); letter-spacing: 0; }
nav h2:first-child { margin-top: 0; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav a { display: block; padding: 4px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); background: var(--panel); }
nav a[aria-current] { color: var(--text); background: var(--accent-soft); }

main { padding: 40px 48px 80px; min-width: 0; }
article { max-width: 760px; overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 42px; margin: 0 0 20px; }
h2 { font-size: 28px; margin: 48px 0 12px; }
h3 { font-size: 21px; margin: 32px 0 8px; }
h4 { font-size: 18px; margin: 24px 0 8px; }
.anchor { margin-left: 6px; color: var(--muted); text-decoration: none; opacity: 0; }
:is(h2, h3, h4):hover .anchor, .anchor:focus { opacity: 1; }
p, ul, ol { margin: 0 0 16px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0 0; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }

code { font: 0.88em/1.5 var(--mono); background: var(--panel); padding: 2px 5px; border-radius: 6px; overflow-wrap: anywhere; }
a code { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
pre { margin: 0 0 16px; padding: 16px; background: var(--panel); border-radius: var(--r); overflow-x: auto; }
pre code { padding: 0; background: none; font-size: 13.5px; overflow-wrap: normal; }

.table { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--panel); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: normal; white-space: nowrap; }

.index { list-style: none; padding: 0; }
.index li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.index a { font-weight: 500; }
.index span { display: block; color: var(--muted); font-size: 14px; }

.meta { display: flex; gap: 20px; max-width: 760px; margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 820px) {
  .top { padding: 0 16px; }
  .menu {
    display: block; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px;
    background: none; color: inherit; font: 500 14px var(--font); cursor: pointer;
  }
  .wrap { display: block; }
  nav { display: none; position: static; max-height: none; padding: 16px; border-bottom: 1px solid var(--line); }
  nav.open { display: block; position: fixed; inset: 56px 0 0; align-self: auto; z-index: 2; overflow-y: auto; background: var(--bg); }
  main { padding: 24px 16px 64px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; margin-top: 36px; }
}
