:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --text: #16171b;
  --muted: #5d5a55;
  --line: #e7e2da;
  --accent: #ff5a1f;      /* brand orange: fills only, text on it is dark */
  --link: #b8400f;        /* orange darkened for 5:1 on --bg */
  --todo: #fff1b8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07080b; --card: #0e1015; --text: #f5f3ef; --muted: #b9b4ab;
    --line: rgba(255,255,255,.1); --link: #ff8a3d; --todo: #4a3b00;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 17px/1.65 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 800; color: var(--text); text-decoration: none; }
.logo::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; margin-right: 8px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

main { padding-top: 40px; padding-bottom: 56px; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 24px; line-height: 1.25; font-weight: 800; margin: 44px 0 12px; }
h3 { font-size: 19px; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 6px; }
.lead { font-size: 19px; color: var(--text); border-left: 4px solid var(--accent); padding-left: 14px; }
.muted { color: var(--muted); font-size: 15px; }
.updated { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.btn {
  display: inline-block; background: var(--accent); color: #16171b; font-weight: 800;
  text-decoration: none; padding: 13px 20px; border-radius: 10px; margin: 6px 0 10px;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 20px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-weight: 800; }
.scroll { overflow-x: auto; }

details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; }

/* draft placeholders: build.py --prod refuses to ship while any are left */
.todo { background: var(--todo); color: inherit; padding: 0 4px; border-radius: 4px; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 15px; }
.foot .links a { color: var(--muted); }

/* articles */
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; margin: 6px 0 18px; }
.prompt { margin: 8px 0 22px; }
.prompt pre {
  margin: 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px 10px 0 0;
  white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.copy {
  display: block; width: 100%; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px;
  background: var(--accent); color: #16171b; font: 800 15px Manrope, system-ui, sans-serif; padding: 11px; cursor: pointer;
}
.copy:hover { filter: brightness(1.06); }
.copy:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

/* navigation */
nav a[aria-current] { color: var(--text); font-weight: 700; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.foot-nav a { color: var(--text); text-decoration: none; font-weight: 700; }
