/* Blendy documentation. Editorial rather than promotional: one column, real
   prose, restrained palette, no decoration that is not carrying information. */

:root {
  --paper: #fbfaf8;
  --ink: #1a1917;
  --muted: #6b6862;
  --faint: #9a968e;
  --rule: #e4e1da;
  --panel: #f4f2ee;
  --accent: #8c4a2f;
  --serif: "Source Serif 4", Iowan Old Style, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 34rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.62 var(--serif);
  -webkit-font-smoothing: antialiased; font-synthesis: none;
}

/* ---- masthead ---- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: baseline; gap: 28px;
  padding: 18px 40px; border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
}
.wordmark { font: 600 17px var(--sans); letter-spacing: -0.02em; }
.wordmark span { color: var(--faint); font-weight: 400; margin-left: 8px; }
.masthead nav { margin-left: auto; display: flex; gap: 24px; }
.masthead a {
  font: 400 14px var(--sans); color: var(--muted); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.masthead a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- layout ---- */
main { padding: 0 40px 120px; }
section { max-width: 1120px; margin: 0 auto; }
.prose { max-width: var(--measure); }
.prose.wide { max-width: 740px; }
.lede { font-size: 21px; line-height: 1.55; }
p { margin: 0 0 1.15em; }
a { color: var(--ink); text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.021em; line-height: 1.16; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 62px); max-width: 20ch; }
h2 { font-size: 30px; margin: 0 0 4px; }
h3 { font-size: 20px; margin: 2.2em 0 0.5em; }
.eyebrow {
  font: 500 12px var(--sans); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}

.band { padding: 92px 0; border-top: 1px solid var(--rule); }
.band:first-of-type { border-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  main { padding: 0 20px 64px; }
  .band { padding: 56px 0; }
  .hero { padding: 44px 0 40px; }
  h1 { font-size: clamp(31px, 8.2vw, 42px); }
  h2 { font-size: 25px; }
  .lede { font-size: 18.5px; }
  .prose, .prose.wide { max-width: none; }

  /* The masthead becomes a title plus a scrollable rail of links. */
  .masthead {
    display: block; padding: 12px 20px 0; position: static;
    backdrop-filter: none; background: var(--paper);
  }
  .masthead nav {
    margin: 10px -20px 0; padding: 0 20px 10px; gap: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .masthead nav::-webkit-scrollbar { display: none; }
  .masthead a { white-space: nowrap; }

  pre { padding: 14px; font-size: 12.5px; border-radius: 3px; }
  .note { padding: 16px 18px; }
  footer { padding: 28px 20px; gap: 16px; }
  footer span:last-child { margin-left: 0 !important; flex-basis: 100%; }

  /* The pipeline diagram is far too wide to shrink; let it scroll instead. */
  .diagram { overflow-x: auto; margin-left: -20px; margin-right: -20px; padding: 0 20px; }
  .diagram svg { min-width: 720px; }
  /* A cut-off diagram gives no sign it can be dragged, so say so. */
  .diagram-wrap::after {
    content: "Scroll sideways to see the whole loop";
    display: block; margin-top: 8px;
    font: 400 13px var(--sans); color: var(--faint);
  }
}

@media (max-width: 460px) {
  main { padding: 0 16px 56px; }
  .masthead { padding: 12px 16px 0; }
  /* Full-bleed children have to match the narrower gutter or they overhang. */
  .masthead nav { margin: 10px -16px 0; padding: 0 16px 10px; }
  .diagram { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .wordmark span { display: none; }
  h1 { font-size: clamp(28px, 8.6vw, 34px); }
}

/* ---- hero ---- */
.hero { padding: 96px 0 72px; }
.hero .lede { margin-top: 26px; color: #34322e; }
.byline { margin-top: 34px; font: 400 14px var(--sans); color: var(--faint); }
.byline code { font-size: 13px; }

/* ---- figures ---- */
figure { margin: 0; }
figure img {
  display: block; width: 100%; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--panel);
}
figcaption {
  margin-top: 10px; font: 400 13.5px/1.5 var(--sans); color: var(--muted);
  max-width: 46ch;
}
.plates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
@media (max-width: 980px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .plates { grid-template-columns: minmax(0, 1fr); gap: 26px; } }

/* ---- code ---- */
pre {
  margin: 1.4em 0; padding: 18px 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 3px;
  font: 400 13.5px/1.7 var(--mono); color: #2c2a26;
}
code { font-family: var(--mono); font-size: 0.87em; }
p code, li code { background: var(--panel); padding: 1px 5px; border-radius: 3px; }

/* ---- lists ---- */
ul, ol { margin: 0 0 1.15em; padding-left: 1.25em; }
li { margin-bottom: 0.5em; }
li::marker { color: var(--faint); }
.plain { list-style: none; padding: 0; }
.plain li {
  padding: 15px 0; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 22px;
}
.plain span { overflow-wrap: anywhere; }
.plain li:last-child { border-bottom: 1px solid var(--rule); }
.plain b { font: 500 14px var(--sans); letter-spacing: -0.01em; }
.plain span { color: var(--muted); font-size: 16.5px; line-height: 1.5; }
@media (max-width: 680px) { .plain li { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 13px 0; } }

/* ---- diagram ---- */
.diagram { margin: 8px 0 0; }
.diagram svg { width: 100%; height: auto; }
.diagram text { font-family: var(--sans); }

/* ---- callout ---- */
.note {
  margin: 2em 0; padding: 20px 24px; background: var(--panel);
  border-left: 2px solid var(--accent); border-radius: 0 3px 3px 0;
}
.note p:last-child { margin-bottom: 0; }
.note strong { font-weight: 600; }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--rule); padding: 40px;
  font: 400 14px var(--sans); color: var(--faint);
  display: flex; gap: 26px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
