:root {
  color-scheme: light dark;
  --bg: #f6f2e9;
  --paper: #fbf8f1;
  --fg: #1c1a14;
  --muted: #6a6155;
  --faint: #aea391;
  --rule: #e3dbc8;
  --accent: #a83a1c;
  --tag-bg: #efe7d5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120e;
    --paper: #181610;
    --fg: #ece5d6;
    --muted: #948b7d;
    --faint: #4b4439;
    --rule: #2c2820;
    --accent: #e07b4a;
    --tag-bg: #221e17;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family:
    ui-serif, Charter, "Iowan Old Style", "Apple Garamond", Cambria,
    "Times New Roman", Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 4rem 1.6rem 5rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* nav back */
.back {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 2.5rem;
}
.back:hover { color: var(--accent); }
.back .arrow { color: var(--accent); margin-right: 0.5ch; }

/* meta */
.meta {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  align-items: center;
}
.meta .sep { color: var(--faint); padding: 0 0.6em; }
.meta .cat { color: var(--accent); }

/* headings */
h1 {
  font-family:
    ui-serif, Charter, "Iowan Old Style", Cambria, Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}
h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 3rem;
  max-width: 38rem;
}

h2 {
  font-family:
    ui-serif, Charter, "Iowan Old Style", Cambria, Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.8rem;
  letter-spacing: -0.005em;
}
h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

h3 {
  font-family:
    ui-serif, Charter, "Iowan Old Style", Cambria, Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 0.6rem;
}

section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

p { margin: 0 0 1rem; }
p strong { font-weight: 600; }

ul, ol { margin: 0.5rem 0 1.2rem 1.5rem; padding: 0; }
li { margin-bottom: 0.4rem; }
li code { font-size: 0.85em; }

code {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--tag-bg);
  padding: 0.05rem 0.4em;
  border-radius: 2px;
  color: var(--fg);
}

/* feed (articles index) */
.feed {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feed > li {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.feed > li:first-child { padding-top: 0.5rem; }
.feed > li:last-child { border-bottom: none; }

.entry-meta {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.entry-meta .cat { color: var(--accent); }
.entry-meta .sep { color: var(--faint); padding: 0 0.6em; }

.entry-title {
  font-family:
    ui-serif, Charter, "Iowan Old Style", Cambria, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.4rem;
}
.entry-title a {
  text-decoration-color: transparent;
}
.entry-title a:hover {
  text-decoration-color: var(--accent);
}
.entry-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.entry-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* props grid (api-types) */
.props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
  padding: 1rem 0;
  margin: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.prop-label {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.prop-value {
  font-size: 0.92rem;
  color: var(--fg);
}

/* code block */
.code {
  margin: 1.2rem 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.code-label {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--tag-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.code-label .meta-right {
  color: var(--muted);
  font-weight: 400;
}
.code-body {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 0.9rem 1rem;
  white-space: pre;
  overflow-x: auto;
  color: var(--fg);
}
.code-body .c { color: var(--muted); font-style: italic; }
.code-body .s { color: var(--accent); }
.code-body .k { color: var(--fg); font-weight: 600; }
.code-body .t { color: var(--fg); }
.code-body .arr { color: var(--muted); }
.code-body .m { color: var(--muted); }

/* code compare (mcp-cli-api) — stacked code blocks share a container */
.code-compare {
  margin: 1.2rem 0;
  display: grid;
  gap: 0.6rem;
}

/* stack rows (mcp-cli-api) */
.stack {
  margin: 1.2rem 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper);
}
.stack-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  border-bottom: 1px solid var(--rule);
}
.stack-row:last-child { border-bottom: none; }
.stack-num {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--faint);
  background: var(--tag-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1rem;
  border-right: 1px solid var(--rule);
}
.stack-content {
  padding: 0.9rem 1.1rem;
}
.stack-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.stack-name .badge {
  display: inline-block;
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  margin-left: 0.4rem;
  vertical-align: 0.15em;
  background: var(--tag-bg);
  color: var(--muted);
}
.stack-name .badge.mid { color: var(--accent); }
.stack-name .badge.high {
  background: var(--fg);
  color: var(--bg);
}
.stack-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* stats (mcp-cli-api) */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 1.1rem 0.9rem;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family:
    ui-serif, Charter, "Iowan Old Style", Cambria, Georgia, serif;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.stat-num .unit {
  font-size: 1.1rem;
  color: var(--fg);
  font-weight: 400;
}
.stat-label {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

/* pros / cons */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.2rem 0;
}
.pros-title, .cons-title {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.pros ul, .cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pros li, .cons li {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0.4rem;
  padding-left: 1.1rem;
  position: relative;
}
.pros li::before {
  content: '+';
  position: absolute;
  left: 0;
  top: 0;
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--accent);
  font-weight: 700;
}
.cons li::before {
  content: '−';
  position: absolute;
  left: 0;
  top: 0;
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--muted);
  font-weight: 700;
}

/* usecase callout */
.usecase {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  background: var(--tag-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 2px 2px 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.usecase strong {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

/* axes (api-types intro) */
.axes {
  margin: 1.5rem 0;
  padding: 1.2rem 1.3rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.axes-title {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.axes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.axis-name {
  font-style: italic;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.axis-poles {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}
.axis-poles strong {
  color: var(--fg);
  font-weight: 500;
}

/* matrix table */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0;
}
.matrix-table th {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.matrix-table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.45;
}
.matrix-table td:first-child { font-weight: 600; }
.matrix-table tr:last-child td { border-bottom: none; }

/* pull quote */
.pullquote {
  margin: 2rem 0;
  padding: 0 0 0 1.2rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--fg);
}

/* decision (mcp-cli-api) — replaces dark callout with a light boxed quote */
.decision {
  margin: 1.5rem 0;
  padding: 1.2rem 1.3rem;
  background: var(--tag-bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 3px 3px 0;
}
.decision h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 500;
  color: var(--fg);
}
.decision .rule {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--fg);
  margin: 0.6rem 0;
}
.decision .rule .key {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}
.decision p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

/* win-grid (mcp-cli-api) */
.win-grid {
  margin: 1.2rem 0;
  border-top: 1px solid var(--rule);
}
.win {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.6rem;
}
.win-num {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.15rem;
}
.win-title {
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}
.win-body {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}
.win-body .ex {
  display: block;
  margin-top: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--tag-bg);
  border-radius: 2px;
  font-size: 0.88rem;
  border-left: 2px solid var(--rule);
}
.win-body .ex strong {
  color: var(--fg);
  font-weight: 600;
  font-style: normal;
}

/* tldr */
.tldr {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.tldr-label {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.tldr p {
  font-size: 1.05rem;
  margin: 0;
}

/* footer */
footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}
footer p { margin: 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* mobile */
@media (max-width: 32rem) {
  body { font-size: 16px; }
  main { padding: 2.5rem 1.2rem 3.5rem; }
  .props { grid-template-columns: 1fr; }
  .axes-grid { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; gap: 1rem; }
  .stack-row { grid-template-columns: 2.4rem 1fr; }
  .code-body { font-size: 0.78rem; padding: 0.7rem 0.9rem; }
  .matrix-table { font-size: 0.85rem; }
  .matrix-table th, .matrix-table td { padding: 0.5rem 0.3rem; }
}
