:root {
  --bg: #f4f1ea;
  --bg-elev: #fffcf7;
  --ink: #1c1914;
  --muted: #5c564c;
  --line: #ddd4c4;
  --accent: #c8890a;
  --accent-ink: #8a5c00;
  --sidebar: #171410;
  --sidebar-ink: #f3ead8;
  --sidebar-muted: #b7aa94;
  --code-bg: #1c1914;
  --code-ink: #f4ead8;
  --ok: #2f7d4a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: var(--accent-ink);
}

code,
pre {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 1.75rem 1.15rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.75rem;
}

.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.brand span {
  color: var(--sidebar-muted);
  font-size: 0.78rem;
}

.nav-label {
  color: var(--sidebar-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1.2rem 0.4rem 0.45rem;
}

.nav a {
  display: block;
  color: var(--sidebar-ink);
  text-decoration: none;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  font-size: 0.92rem;
}

.nav a:hover,
.nav a.active {
  background: rgba(200, 137, 10, 0.18);
}

.nav a.active {
  color: #f6c453;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}

.topbar a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.content {
  max-width: 820px;
  padding: 2.4rem 2rem 4rem;
}

.content h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.7rem;
}

.content h3 {
  font-size: 1.02rem;
  margin: 1.4rem 0 0.5rem;
}

.content p,
.content li {
  color: var(--ink);
}

.content p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
}

.note {
  background: #fff6e4;
  border: 1px solid #ebd5a3;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 1.2rem 0;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.1rem;
  border-radius: 10px;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.45;
}

.content :not(pre) > code {
  background: #ece4d4;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0 1.5rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.4rem;
  vertical-align: top;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1.4rem 0 1.8rem;
}

.card {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  text-decoration: none;
  color: inherit;
}

.card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.scalar-wrap {
  height: calc(100vh - 53px);
}

.scalar-wrap #app {
  height: 100%;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 1.5rem 1.1rem 3rem;
  }
}
