/* ComfyDebug — minimal, dependency-free stylesheet.
   No web fonts, no JS: keeps LCP fast and Lighthouse happy. */

:root {
  --bg: #ffffff;
  --fg: #15181e;
  --muted: #5c6373;
  --line: #e4e7ee;
  --accent: #2563eb;
  --accent-soft: #eef3ff;
  --code-bg: #f4f6fa;
  --code-fg: #1e2430;
  --warn-bg: #fff9e8;
  --warn-line: #edd396;
  --ok-bg: #eefbf3;
  --ok-line: #a2ddbd;
  --radius: 8px;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --fg: #e7eaf1;
    --muted: #99a2b2;
    --line: #242a35;
    --accent: #7ba4ff;
    --accent-soft: #161d2c;
    --code-bg: #161a22;
    --code-fg: #dee3ee;
    --warn-bg: #261f0f;
    --warn-line: #57461c;
    --ok-bg: #10241a;
    --ok-line: #23593a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header / footer ---------- */

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.brand span { color: var(--accent); }

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1.1rem;
}

.site-header nav a:hover { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- headings ---------- */

h1 {
  font-size: 1.9rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
  padding-top: 0.25rem;
}

h3 {
  font-size: 1.08rem;
  margin: 1.9rem 0 0.5rem;
}

p, ul, ol { margin: 0 0 1.1rem; }

ul, ol { padding-left: 1.35rem; }

li { margin-bottom: 0.4rem; }

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

strong { font-weight: 650; }

/* ---------- meta / breadcrumb ---------- */

.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--accent); }

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

/* ---------- callouts ---------- */

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}

.note.warn {
  border-left-color: var(--warn-line);
  background: var(--warn-bg);
}

.note.ok {
  border-left-color: var(--ok-line);
  background: var(--ok-bg);
}

.note p:last-child { margin-bottom: 0; }

.note-title {
  font-weight: 650;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.35rem;
}

/* ---------- table of contents ---------- */

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.92rem;
}

.toc-title {
  font-weight: 650;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.toc ol { margin: 0; padding-left: 1.2rem; }

.toc li { margin-bottom: 0.25rem; }

/* ---------- code ---------- */

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.05rem;
  overflow-x: auto;
  margin: 0 0 1.3rem;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.84rem;
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 1.4rem; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}

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

th {
  background: var(--code-bg);
  font-weight: 650;
  white-space: nowrap;
}

/* ---------- article list (home) ---------- */

.post-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }

.post-list li {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0;
  margin: 0;
}

.post-list a {
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.post-list a:hover { text-decoration: underline; }

.post-list p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- misc ---------- */

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
