/* Minimal reading stylesheet. System fonts, no animations, no decoration. */
:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --ink: #1a1d24;
  --muted: #5b6270;
  --line: #e2e5ea;
  --link: #1a56db;
  --code-bg: #f1f2f5;
}
html[data-theme="dark"] {
  --bg: #14161b;
  --panel: #1c1f26;
  --ink: #e6e8ec;
  --muted: #9aa1ad;
  --line: #2a2e37;
  --link: #7aa5ff;
  --code-bg: #1e222a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

/* Progress hairline */
#read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--link); z-index: 60; }

/* Header */
header.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 50;
}
.brand { color: var(--ink); text-decoration: none; font-weight: 650; white-space: nowrap; }
.brand small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.search-wrap { position: relative; flex: 1; min-width: 0; max-width: 440px; margin-left: auto; }
#search {
  width: 100%; padding: 7px 12px; font: inherit; font-size: 14px;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px;
}
#search-results {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  max-height: 60vh; overflow: auto; z-index: 60;
}
#search-results.open { display: block; }
#search-results a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
#search-results a:hover { background: var(--panel); }
#search-results small { color: var(--muted); }
#menu-btn, #theme-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font-size: 15px; padding: 5px 10px; cursor: pointer;
}
#menu-btn { display: none; }

/* Layout */
.layout { display: flex; align-items: flex-start; }
aside.sidebar {
  width: 264px; flex-shrink: 0; position: sticky; top: 57px;
  max-height: calc(100vh - 57px); overflow: auto;
  border-right: 1px solid var(--line); padding: 16px 12px 40px;
  font-size: 14px; line-height: 1.45;
}
.nav-group { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin: 16px 6px 4px; }
.nav-group:first-child { margin-top: 0; }
.nav-item { display: flex; gap: 8px; padding: 4px 6px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.nav-item:hover { background: var(--panel); }
.nav-item.active { background: var(--panel); font-weight: 600; }
.nav-item .num { color: var(--muted); min-width: 20px; }
.nav-item .tick { display: none; margin-left: auto; color: green; }
.nav-item.is-done .tick { display: inline; }
main { flex: 1; min-width: 0; padding: 28px 32px 90px; }

/* Article */
.article { max-width: 760px; }
.article h1 { font-size: 1.7rem; line-height: 1.3; margin: 0.4em 0 0.6em; letter-spacing: -0.01em; }
.article h2 { font-size: 1.3rem; margin: 2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.article h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
.article p, .article li { max-width: 72ch; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.meta .tag {
  display: inline-block; border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 8px; margin-right: 8px; font-size: 12px; color: var(--muted);
}
pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 14px 16px; overflow: auto; font-size: 13.5px; line-height: 1.55; position: relative;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
p code, li code, td code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre code { background: none; padding: 0; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; font-size: 12px;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; cursor: pointer;
}
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14.5px; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel); }
blockquote { border-left: 3px solid var(--line); margin: 1em 0; padding: 4px 0 4px 16px; color: var(--muted); }

/* Checklist */
li.task { list-style: none; margin: 6px 0; }
li.task input { margin-right: 8px; accent-color: var(--link); }
#checklist-count { color: var(--muted); font-size: 13px; }

/* Done / pager */
.done-bar { margin: 32px 0 8px; display: flex; gap: 12px; align-items: center; }
.done-bar button, .card-done {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px;
}
.done-bar button.is-done, .card-done.is-done { font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }

/* Company home + hub */
.page-head { max-width: 760px; margin-bottom: 24px; }
.page-head h1 { font-size: 2rem; margin: 0.3em 0 0.4em; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin: 0.4em 0; }
.stats { color: var(--muted); font-size: 14px; }
.progress-line { max-width: 760px; margin: 20px 0; font-size: 14px; color: var(--muted); }
.progress-line .bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; }
.progress-line .bar > div { height: 100%; width: 0; background: var(--link); border-radius: 2px; }
.path { max-width: 760px; margin: 24px 0; }
.path h2 { font-size: 1.1rem; }
.path ol { padding-left: 22px; }
.path li { margin: 4px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0; max-width: 1000px; }
.card { border-top: 1px solid var(--line); padding: 16px 4px; }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card h3 a { color: var(--ink); }
.card p { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.card .row { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.card.is-done h3 a { text-decoration: line-through; text-decoration-thickness: 1px; }

/* TOC */
.content-grid { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 48px; align-items: start; }
nav.toc { position: sticky; top: 73px; max-height: calc(100vh - 90px); overflow: auto; font-size: 13px; }
.toc-title { color: var(--muted); margin-bottom: 6px; }
nav.toc a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); }
nav.toc a.lvl-3 { padding-left: 24px; }
nav.toc a.seen { color: var(--ink); border-left-color: var(--link); }

footer { border-top: 1px solid var(--line); padding: 20px; color: var(--muted); font-size: 13px; }

@media (max-width: 1060px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  nav.toc { display: none; }
}
@media (max-width: 860px) {
  #menu-btn { display: block; }
  aside.sidebar {
    display: none; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    background: var(--bg); max-height: none; width: 280px;
  }
  body.nav-open aside.sidebar { display: block; }
  main { padding: 22px 16px 70px; }
  header.topbar { gap: 10px; padding: 10px 12px; }
  .brand { font-size: 15px; }
  .brand small { display: none; }
}
@media print {
  header.topbar, aside.sidebar, nav.toc, .done-bar, .pager, footer, #read-progress, .copy-btn { display: none; }
  main { padding: 0; }
  body { font-size: 12pt; }
  a { color: var(--ink); text-decoration: none; }
  pre { white-space: pre-wrap; }
}
