:root {
  --bg: #ffffff;
  --surface: #f6f6f5;
  --ink: #000000;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e4e4e2;
  --accent: #ff3001;       /* E2B Fire Orange: marks and rules only, never body text */
  --accent-ink: #c42400;   /* darker orange that passes contrast for links on white */
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Commit Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #111111;
    --ink: #ffffff;
    --ink-2: #d4d4d4;
    --muted: #9a9a9a;
    --line: #262626;
    --accent-ink: #ff7a5c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.site-header { border-bottom: 1px solid var(--line); padding: 56px 0 32px; }
.eyebrow {
  margin: 0 0 12px; font: 600 13px/1.4 var(--mono);
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.eyebrow::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px;
  background: var(--accent); vertical-align: 1px;
}
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; }
.tagline { color: var(--ink-2); font-size: 19px; margin: 0 0 12px; }
.byline { color: var(--muted); margin: 0; font-size: 15px; }

.toc {
  margin: 32px 0 8px; padding: 20px 24px;
  background: var(--surface); border-radius: var(--radius);
}
.toc ol { margin: 0; padding-left: 20px; }
.toc > ol > li { font-weight: 600; margin: 4px 0; }
.toc ol ol { font-weight: 400; margin: 4px 0 10px; list-style: lower-alpha; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }

section { padding-top: 40px; }
h2 { font-size: 28px; letter-spacing: -.01em; margin: 0 0 20px; display: flex; align-items: center; gap: 12px; }
.num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px;
  background: var(--accent); color: #000; font: 700 16px/1 var(--mono);
}
h3 { font-size: 20px; margin: 36px 0 8px; scroll-margin-top: 16px; }
h4 { font-size: 14px; margin: 0; color: var(--muted); font-weight: 600; }
section h3:first-of-type { margin-top: 28px; }
.muted { color: var(--muted); font-weight: 400; }
[id] { scroll-margin-top: 16px; }

.post {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin: 0 0 24px;
}
.post h3 { margin: 0; font-size: 18px; }
.post-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-body p { margin: 0 0 14px; }
.post-body p:last-child { margin-bottom: 0; }
.post-meta { color: var(--muted); font-size: 14px; margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.reply {
  margin-top: 16px; padding: 14px 16px; background: var(--surface);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
}
.reply .post-head { margin-bottom: 6px; }
.reply p { margin: 0; overflow-wrap: anywhere; }

.copy {
  font: 600 13px/1 var(--font); color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.copy:hover { border-color: var(--ink); }
.copy.is-done { border-color: var(--accent); }

figure { margin: 8px 0 0; }
.post-media { margin: 16px 0 0; }
figure img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

.lede { font-size: 19px; color: var(--ink-2); }
ul, ol { padding-left: 22px; }
li { margin: 6px 0; }
.closer {
  margin: 40px 0 0; padding: 20px 0 0; border-top: 2px solid var(--accent);
  font-size: 19px; font-weight: 600;
}

.page-end { border: 0; border-top: 2px solid var(--accent); margin: 56px 0 96px; }

.site-footer { color: var(--muted); font-size: 14px; padding-top: 48px; padding-bottom: 56px; }
.site-footer p { margin: 6px 0; }
.site-footer a { color: var(--muted); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header { padding-top: 40px; }
  .post { padding: 16px; }
  .post-head { align-items: flex-start; }
}
