:root {
  --bg: #ffffff;
  --panel: #faf8f6;
  --ink: #16120f;
  --muted: #6b625b;
  --line: #e7e1db;
  --accent: #a85327;
  --accent-ink: #8c4320;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0806;
    --panel: #141010;
    --ink: #f3efec;
    --muted: #a49a92;
    --line: #2a2320;
    --accent: #d4703a;
    --accent-ink: #e8895a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

header.masthead {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand .dot {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.45rem;
  background: linear-gradient(140deg, var(--accent), #6d3318);
  display: inline-block;
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 1.5rem 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.75rem;
  padding-top: 0.25rem;
}

h3 {
  font-size: 1.02rem;
  margin: 1.75rem 0 0.4rem;
}

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

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

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }

ul { padding-left: 1.15rem; }
li { margin: 0.35rem 0; }

.callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0.65rem;
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0;
}

.callout p { margin: 0.4rem 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.96rem;
  display: block;
  overflow-x: auto;
}

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

th { color: var(--muted); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
}

footer.foot {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.todo {
  background: #fff6e5;
  border: 1px dashed #d19b3d;
  color: #6b4a12;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  .todo { background: #2a2008; border-color: #7a5a1c; color: #e8cf9a; }
}
