/* comfyui-node docs · the same plate, quieter: label paper for long reading,
   the Prussian band and the accession register for wayfinding. */

:root {
  --prussian: #14306b;
  --deep: #0b1d45;
  --ink: #dfeaf3;
  --paper: #f3f5f2;
  --paper-2: #e7ece9;
  --paper-3: #dbe2df;
  --text: #0b1d45;
  --text-2: #3b4f78;
  --text-3: #5d6f92;
  --rubric: #c8d43c;
  --hair: 1px;
  --f-display: "Bodoni Moda", "Didot", serif;
  --f-body: "Hanken Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (min-resolution: 2dppx) {
  :root { --hair: 0.5px; }
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: var(--text-3) var(--paper-2); scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
::selection { background: var(--prussian); color: #fff; }
:focus-visible { outline: 2px solid var(--prussian); outline-offset: 3px; }
a { color: var(--prussian); text-decoration-thickness: var(--hair); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
code, pre { font-family: var(--f-mono); font-variant-ligatures: none; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--rubric); color: var(--deep); padding: 10px 14px; font-weight: 600; }
.skip:focus { top: 12px; }

/* band */
.band { display: flex; align-items: baseline; gap: 32px; padding: 18px clamp(20px, 4vw, 48px); background: linear-gradient(180deg, var(--prussian), var(--deep)); color: var(--ink); }
.band__mark { margin-right: auto; font-family: var(--f-display); font-style: italic; font-size: 1.625rem; line-height: 1; color: #fff; text-decoration: none; }
.band__links { display: flex; gap: 28px; font-size: 0.9375rem; }
.band__links a { color: var(--ink); text-decoration: none; }
.band__links a:hover, .band__links a[aria-current="page"] { color: var(--rubric); }
.band__ver { margin: 0; font: 500 0.75rem/1 var(--f-mono); color: #a9bcd6; }
.band :focus-visible { outline-color: var(--rubric); }

/* shell */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: clamp(24px, 4vw, 64px); max-width: 1440px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

/* register sidebar */
.reg { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 36px 0 48px; scrollbar-width: thin; }
.reg ol { margin: 0; padding: 0; list-style: none; }
.reg__section + .reg__section { margin-top: 22px; }
.reg__head { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--text); font: 600 0.75rem/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.reg li a { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 8px 7px 0; border-bottom: var(--hair) solid rgba(11, 29, 69, 0.14); color: var(--text); text-decoration: none; font-size: 0.9375rem; line-height: 1.35; transition: background-color 0.2s var(--ease-out); }
.reg li a:hover { background: var(--paper-2); }
.reg li a[aria-current="page"] { background: var(--text); color: #fff; padding-left: 8px; margin-left: -8px; }
.reg li a[aria-current="page"] .acc { color: var(--rubric); }
.acc { font: 400 0.6875rem/1 var(--f-mono); letter-spacing: 0.06em; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* document */
.doc { min-width: 0; padding: 40px 0 120px; }
.doc__body { max-width: 72ch; }
.doc__title { margin: 0 0 28px; font-family: var(--f-display); font-weight: 500; font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1; letter-spacing: -0.025em; color: var(--prussian); text-wrap: balance; }
.doc__body h2 { position: relative; margin: 2.4em 0 0.6em; padding-top: 0.6em; border-top: var(--hair) solid rgba(11, 29, 69, 0.3); font-family: var(--f-display); font-weight: 500; font-size: 2rem; line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
.doc__body h3 { position: relative; margin: 1.9em 0 0.5em; font-weight: 600; font-size: 1.25rem; line-height: 1.25; }
.doc__body h4 { margin: 1.6em 0 0.4em; font-weight: 600; font-size: 1.0625rem; }
.anchor { position: absolute; left: -1.1em; color: var(--text-3); text-decoration: none; opacity: 0; font-family: var(--f-display); transition: opacity 0.2s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.doc__body p, .doc__body ul, .doc__body ol { margin: 0 0 1.1em; }
.doc__body ul, .doc__body ol { padding-left: 1.4em; }
.doc__body ul li::marker { content: "—  "; color: var(--prussian); font-family: var(--f-mono); font-size: 0.85em; }
.doc__body ol li::marker { color: var(--prussian); font-family: var(--f-mono); font-size: 0.85em; font-weight: 600; }
.doc__body li { margin: 0.25em 0; }
.doc__body li > ul, .doc__body li > ol { margin: 0.25em 0 0.4em; }
.doc__body strong { font-weight: 650; }
.doc__body :not(pre) > code { font-size: 0.875em; background: var(--paper-2); padding: 0.1em 0.35em; border: var(--hair) solid var(--paper-3); color: var(--deep); word-break: break-word; }
.doc__body blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 20px; border-left: var(--hair) solid var(--prussian); color: var(--text-2); font-family: var(--f-display); font-style: italic; font-size: 1.125rem; }
.doc__body hr { border: 0; border-top: var(--hair) solid rgba(11, 29, 69, 0.3); margin: 2.4em 0; }
.doc__body hr:has(+ h2) { display: none; }
.doc__body img { max-width: 100%; }

/* code: a cyanotype slip inside the paper */
.code { position: relative; margin: 1.4em 0 1.6em; background: var(--deep); color: var(--ink); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.65; scrollbar-color: #5a6f96 transparent; scrollbar-width: thin; }
.code pre::selection, .code pre *::selection { background: var(--rubric); color: var(--deep); }
.code__lang { position: absolute; top: 0; right: 0; padding: 4px 8px; background: var(--prussian); font: 500 0.6875rem/1 var(--f-mono); letter-spacing: 0.08em; color: #a9bcd6; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.8em; }
.doc__body table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.doc__body th { text-align: left; padding: 0 14px 8px 0; border-bottom: 2px solid var(--text); font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.04em; }
.doc__body td { padding: 9px 14px 9px 0; border-bottom: var(--hair) solid rgba(11, 29, 69, 0.18); vertical-align: top; }

.doc__source { max-width: 72ch; margin: 64px 0 0; padding-top: 14px; border-top: var(--hair) solid rgba(11, 29, 69, 0.3); font-family: var(--f-display); font-style: italic; color: var(--text-2); }
.doc__source span { font: 500 0.75rem/1 var(--f-mono); letter-spacing: 0.06em; color: var(--text); font-style: normal; }

/* toc */
.doc__toc { position: sticky; top: 0; align-self: start; padding: 40px 0; max-height: 100vh; overflow-y: auto; font-size: 0.875rem; scrollbar-width: thin; }
.doc__toc ol { margin: 0; padding: 0; list-style: none; }
.doc__toc li a { display: block; padding: 5px 0; color: var(--text-2); text-decoration: none; line-height: 1.35; }
.doc__toc li.d3 a { padding-left: 12px; font-size: 0.8125rem; }
.doc__toc li a:hover { color: var(--prussian); text-decoration: underline; }

/* index */
.index__lede { max-width: 56ch; color: var(--text-2); font-size: 1.125rem; margin: 0 0 40px; }
.index { display: grid; gap: 36px; }
.index__section h2 { margin: 0 0 4px; padding: 0 0 8px; border: 0; border-bottom: 2px solid var(--text); font: 600 0.8125rem/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; }
.index__section ol { margin: 0; padding: 0; list-style: none; }
.index__section li { margin: 0; }
.index__section a { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: var(--hair) solid rgba(11, 29, 69, 0.18); text-decoration: none; color: var(--text); }
.index__section .t { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.2; background: linear-gradient(var(--rubric), var(--rubric)) 0 100% / 0 6px no-repeat; justify-self: start; transition: background-size 0.35s var(--ease-out); }
.index__section a:hover .t, .index__section a:focus-visible .t { background-size: 100% 6px; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .doc__toc { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .reg { position: static; order: 2; max-height: none; padding: 32px 0 64px; border-top: 2px solid var(--text); }
  .doc { padding: 28px 0 40px; }
  .band { flex-wrap: wrap; gap: 12px 16px; }
  .band__links { gap: 16px; }
  .band__ver { display: none; }
  .anchor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
