/* MFLOW company website
   Fonts: MFLOW Trace (drawn for this site, see tools/trace_font.py) and Spectral (SIL OFL 1.1). */

@font-face { font-family: "MFLOW Trace"; src: url("fonts/MFLOWTrace-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MFLOW Trace"; src: url("fonts/MFLOWTrace-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Spectral; src: url("fonts/Spectral-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Spectral; src: url("fonts/Spectral-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Spectral; src: url("fonts/Spectral-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f3f0e7;
  --paper-2: #eae6da;
  --sheet: #fbfaf6;
  --ink: #14221c;
  --ledger: #1e5641;
  --muted: #5b6158;
  --rule: #c9c6b6;
  --rule-strong: #9c9a8c;
  --pale: #dce5da;
  --face-l: #c4d2c6;
  --face-r: #afc1b3;
  --face-in: #9db2a3;
  --signal: #d8452a;
  --signal-ink: #b23a1f;

  --display: "MFLOW Trace", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: Spectral, "Iowan Old Style", Georgia, serif;

  --gutter: clamp(20px, 4vw, 56px);
  --measure: 34em;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.62 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ledger); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
abbr[title] { text-decoration: none; }
::selection { background: var(--pale); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -200px; z-index: 50;
  padding: .7em 1.1em; background: var(--ink); color: var(--paper);
  font: 700 .8125rem/1 var(--display); letter-spacing: .08em; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(1320px, 100% - var(--gutter) * 2); margin-inline: auto; }

/* Label voice: the display face at small sizes, heavier cut. */
.kicker, .fig-no, .fig-spec, .fig-foot, .fig-ref, .parts, .fig-toggle, .contents, .chapter-meta,
.product-no, .spec dt, .btn, .site-nav, .topics .n, .topics-title, .principles .n,
.colophon-facts dt, .copy-status, .doc-meta, .doc-toc {
  font-family: var(--display);
  font-weight: 700;
  font-size: .75rem;
  line-height: 1.5;
  letter-spacing: .09em;
}

.arrow { font-family: var(--display); }   /* Spectral has no arrows; Trace does */

/* ------------------------------------------------------------------ masthead */
.masthead { position: relative; z-index: 10; background: var(--paper); overflow-x: clip; }
.masthead-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px 18px; }
.brand, .brand:hover { display: inline-flex; color: var(--ink); text-decoration: none; }
.brand .logo { height: 32px; width: auto; max-width: none; }
.site-nav ol { display: flex; gap: clamp(14px, 2.4vw, 36px); }
.site-nav a { display: inline-flex; gap: .55em; padding-block: 6px; text-decoration: none; color: var(--ink); position: relative; }
.site-nav .n { color: var(--muted); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--signal);
  transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.site-nav a[aria-current="true"] .n { color: var(--signal-ink); }

.ruler {
  position: relative; height: 12px; border-top: 1px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 64px) top left / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 8px) top left / 100% 5px no-repeat;
}
.ruler-mark {
  position: absolute; top: -1px; left: 0; width: 1px; height: 16px; background: var(--signal);
  transform: translateX(var(--x, -10px)); opacity: 0; transition: opacity 200ms ease;
}
.ruler-mark::after {
  content: attr(data-x); position: absolute; top: 15px; left: 5px;
  font: 700 .625rem/1 var(--display); letter-spacing: .08em; color: var(--signal-ink); white-space: nowrap;
}
.ruler-mark.is-flip::after { left: auto; right: 5px; }
.ruler.is-tracking .ruler-mark { opacity: 1; }

@media (min-width: 900px) {
  :root { --header-h: 84px; }   /* refined by site.js; this keeps anchors clear without JavaScript */
  .masthead { position: sticky; top: 0; }
}

/* ------------------------------------------------------------------ cover */
.cover {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding-block: clamp(36px, 6vw, 84px) clamp(40px, 6vw, 96px);
  align-items: start;
}
.cover-head { grid-column: 1 / -1; padding-bottom: clamp(28px, 4vw, 48px); margin-bottom: clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--ink); }
.cover-copy { grid-column: 1 / span 5; }
.fig-cover { grid-column: 6 / span 7; }

.kicker { display: flex; flex-wrap: wrap; gap: .4em 1.2em; color: var(--muted); margin-bottom: clamp(20px, 3vw, 36px); }
.kicker span + span::before { content: "/"; content: "/" / ""; margin-right: 1.2em; color: var(--rule-strong); }
.kicker .kicker-end { margin-left: auto; }
.kicker .kicker-end::before { content: none; }

.display {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.625rem, 9vw, 4.75rem); line-height: 1.08; letter-spacing: .02em;
  text-wrap: balance; overflow-wrap: break-word;
}
.lead { font-size: clamp(1.1875rem, 1.6vw, 1.375rem); line-height: 1.5; max-width: 30em; text-wrap: pretty; }
.lead a { color: var(--ledger); text-decoration-color: var(--signal); }
.lead-note { margin-top: 14px; font-size: 1.125rem; font-style: italic; color: var(--muted); }

.contents { margin-top: clamp(36px, 5vw, 64px); }
.contents-title { display: flex; justify-content: space-between; gap: 12px; font: inherit; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.contents-title .meta { color: var(--muted); }
.contents a {
  display: grid; grid-template-columns: 2.6em auto minmax(2em, 1fr) auto; align-items: baseline; gap: .8em;
  padding-block: 11px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink);
}
.contents .n { color: var(--muted); transition: color 200ms ease; }
.contents .t { font: 400 1.0625rem/1.3 var(--serif); letter-spacing: 0; }
.contents .leader { align-self: end; height: 1px; margin-bottom: .45em; background: radial-gradient(circle, var(--rule-strong) .7px, transparent .8px) left center / 6px 1px repeat-x; }
.contents .m { color: var(--muted); font-weight: 400; }
.contents a:hover .n, .contents a:focus-visible .n { color: var(--signal-ink); }
.contents a:hover .t { color: var(--ledger); }

/* ------------------------------------------------------------------ figures */
.fig-frame {
  position: relative; padding: 36px 40px 32px;
  border: 1px solid var(--rule);
  background: radial-gradient(circle, rgb(30 86 65 / .22) .8px, transparent 1px) -8px -8px / 16px 16px, var(--paper);
}
.fig-no, .fig-spec, .fig-foot { position: absolute; color: var(--muted); font-weight: 400; font-size: .6875rem; }
.fig-no { top: 14px; left: 12px; writing-mode: vertical-rl; transform: rotate(180deg); }
.fig-spec { top: 14px; right: 12px; writing-mode: vertical-rl; }
.fig-foot { bottom: 10px; right: 14px; }
.fig-art { position: relative; }
.fig-art svg { width: 100%; height: auto; overflow: visible; }
figcaption { margin-top: 14px; }
.fig-caption { font-size: .9375rem; line-height: 1.5; color: var(--muted); max-width: 40em; }
.fig-ref { color: var(--ink); margin-right: .6em; font-weight: 700; font-size: .6875rem; }

.parts { margin-top: 14px; border-top: 1px solid var(--rule); counter-reset: part; }
.parts li { border-bottom: 1px solid var(--rule); }
.parts .part {
  display: flex; gap: .9em; align-items: baseline; width: 100%;
  padding: 9px 0; border: 0; background: none; text-align: left; cursor: default;
  font: inherit; letter-spacing: inherit; color: var(--ink);
}
.parts button.part { cursor: pointer; }
.parts .n { color: var(--muted); min-width: 2.2em; }
.parts .v { margin-left: auto; color: var(--muted); font-weight: 400; }
.parts button.part:hover .n, .parts button.part:focus-visible .n, .parts button.part.is-hot .n, .parts button.part[aria-pressed="true"] .n { color: var(--signal-ink); }
.parts button.part[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--signal); padding-left: 12px; }
.parts button.part { transition: padding 200ms var(--ease), box-shadow 200ms var(--ease); }
.fig-toggle {
  margin-top: 14px; padding: 8px 14px; border: 1px solid var(--ink); background: none; cursor: pointer;
}
.fig-toggle:hover { background: var(--ink); color: var(--paper); }

/* SVG figure drawing styles */
.fig-svg text { font-family: var(--display); }
.f-top { fill: var(--pale); }
.f-sheet { fill: var(--sheet); }
.f-film { fill: var(--pale); fill-opacity: .6; }
.f-frame { fill: #e7eee4; }
.f-left { fill: var(--face-l); }
.f-right { fill: var(--face-r); }
.f-inner { fill: var(--face-in); }
.f-top, .f-left, .f-right, .f-inner { stroke: var(--ledger); stroke-width: 1; stroke-linejoin: round; }
.f-ink, .f-check { fill: none; stroke: var(--ledger); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.f-ink-thin { fill: none; stroke: var(--ledger); stroke-opacity: .35; stroke-width: .8; }
.f-ink-box, .f-field { fill: none; stroke: var(--ledger); stroke-width: 1; }
.f-field { stroke-dasharray: 3 2; }
.f-field-live { stroke: var(--signal); stroke-dasharray: none; stroke-width: 1.4; }
.f-ink-ring { fill: none; stroke: var(--ledger); stroke-width: 1.2; }
.f-dashed { stroke-dasharray: 3 3; }
.f-accent-fill { fill: var(--signal); }
.f-screen { fill: var(--paper); stroke: var(--ledger); stroke-width: 1; }
.f-zone { fill: none; stroke: var(--ledger); stroke-width: .9; stroke-dasharray: 2 4; }
.f-link { fill: none; stroke: var(--signal); stroke-width: 1.2; stroke-dasharray: 5 4; }
.f-ghost { fill: none; stroke: var(--signal); stroke-width: 1.2; stroke-dasharray: 4 3; }
.f-lattice { stroke: var(--ledger); stroke-opacity: .45; stroke-width: 1.8; stroke-linecap: round; }
.f-engrave { fill: var(--ledger); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.f-engrave-lg { font-size: 15px; font-weight: 400; }
.f-edge { fill: var(--ink); font-size: 6px; font-weight: 700; letter-spacing: .1em; }
.f-leader { fill: none; stroke: var(--ink); stroke-width: .8; }
.f-node { fill: var(--ink); }
.f-num { fill: var(--signal-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; }
.f-title { fill: var(--ink); font-size: 13.5px; font-weight: 700; letter-spacing: .08em; }
.f-sub { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.f-guide { stroke: var(--ledger); stroke-width: .8; stroke-dasharray: 4 4; }

.f-layer { transition: opacity 250ms ease; will-change: transform; }
.f-badge-set { will-change: transform; }
.fig[data-active] .f-layer:not(.is-active) { opacity: .32; }
.fig[data-active] .f-layer.is-active [data-part]:not(.is-active) { opacity: .32; }
.f-layer.is-active .f-top, .f-layer.is-active .f-left, .f-layer.is-active .f-right,
[data-part].is-active .f-top, [data-part].is-active .f-left, [data-part].is-active .f-right { stroke: var(--signal); }
.has-js [data-fig] .f-layer { cursor: pointer; }
/* Callouts on moving layers appear as the parts separate (site.js sets --explode; 1 without it). */
.fig-svg .f-layer:not([data-lift="0"]) .f-label,
.fig-svg .f-badge-set:not([data-lift="0"]) { opacity: clamp(0, (var(--explode, 1) - .55) * 2.5, 1); }

/* Drawn small (site.js sets data-compact and a tighter view), numbered badges on the parts replace
   the callout column; the legend carries the words. --u keeps a badge the same size on screen. */
.f-badges { display: none; }
.f-badge-body { transform: scale(var(--u, 1)); }
.f-badge circle { fill: var(--paper); stroke: var(--signal-ink); stroke-width: 1.2; }
.f-badge text { fill: var(--signal-ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-anchor: middle; }
.fig[data-compact] .f-label { display: none; }
.fig[data-compact] .f-badges { display: inline; }

/* ------------------------------------------------------------------ chapters */
.chapter { padding-block: clamp(56px, 8vw, 112px) 0; }
.chapter-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end;
  padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: clamp(28px, 4vw, 48px);
}
.chapter-no { grid-column: 1 / span 2; font: 400 clamp(3rem, 6vw, 5.5rem)/.8 var(--display); color: var(--ledger); }
.chapter-title { grid-column: 3 / span 7; font: 400 clamp(1.5rem, 3vw, 2.75rem)/1.08 var(--display); letter-spacing: .02em; text-wrap: balance; overflow-wrap: break-word; }
.chapter-meta { grid-column: 10 / span 3; justify-self: end; text-align: right; color: var(--muted); font-weight: 400; }
.chapter-intro { font-size: 1.25rem; line-height: 1.5; max-width: 32em; color: var(--ink); text-wrap: pretty; }
.chapter > .chapter-intro { margin-left: calc((100% + 24px) / 12 * 2); margin-bottom: clamp(32px, 5vw, 64px); }

.chapter-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; }
.prose p + p { margin-top: 1em; }
.prose p { max-width: var(--measure); text-wrap: pretty; }

/* 01 company */
.company-story { grid-column: 3 / span 5; }
.opening { font-size: 1.3125rem; line-height: 1.5; }
.opening::first-letter {
  float: left; font: 400 4.6em/.8 var(--display); color: var(--ledger);
  margin: .06em .1em 0 0; padding: 0 .04em;
}
.principles { grid-column: 9 / span 4; border-top: 1px solid var(--rule); }
.principles li { display: grid; grid-template-columns: 3em 1fr; column-gap: .6em; padding-block: 16px; border-bottom: 1px solid var(--rule); }
.principles .n { color: var(--signal-ink); padding-top: .25em; grid-row: span 2; }
.principles h3 { font: 600 1.0625rem/1.35 var(--serif); }
.principles p { font-size: 1rem; color: var(--muted); margin-top: 2px; }

/* 02 products */
.product {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px;
  padding-block: clamp(32px, 4vw, 56px); border-top: 1px solid var(--rule); align-items: start;
}
.product-copy { grid-column: 3 / span 4; }
.product .fig { grid-column: 7 / span 6; }
.product-no { display: flex; align-items: center; gap: 1.2em; color: var(--muted); }
.product-name { margin-top: 18px; font: 400 clamp(1.75rem, 3vw, 2.75rem)/1.08 var(--display); letter-spacing: .02em; color: var(--ink); text-wrap: balance; }
.product-line { margin-top: 14px; font-size: 1.375rem; line-height: 1.35; font-style: italic; }
.product-copy > p:not(.product-no):not(.product-line):not(.note):not(.product-actions) { margin-top: 16px; }

.spec { margin-top: 22px; border-top: 1px solid var(--rule); }
.spec div { display: grid; grid-template-columns: 9.5em 1fr; gap: 1em; padding-block: 8px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.spec dt { color: var(--muted); }
.spec dd { font-size: 1rem; }
.product-actions { margin-top: 26px; }
.note { margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--rule); font-size: .9375rem; line-height: 1.5; color: var(--muted); }


.btn {
  display: inline-flex; align-items: center; gap: 1.6em; padding: 12px 16px;
  border: 1px solid var(--ink); background: none; color: var(--ink); text-decoration: none; cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 120ms ease;
}
.btn .arrow { display: inline-block; transition: transform 220ms var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn:active { transform: translateY(1px); }
.btn-quiet { border-color: var(--muted); }

/* 03 contact */
.contact-main { grid-column: 3 / span 6; }
.topics { grid-column: 9 / span 4; align-self: start; }
.topics-title { color: var(--muted); font-weight: 400; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.contact-lead { margin-top: 18px; max-width: 32em; }
.contact-email { margin-top: 20px; font: 400 clamp(1.25rem, 2.6vw, 2.25rem)/1.2 var(--display); letter-spacing: .02em; overflow-wrap: anywhere; }
.contact-email a { text-decoration: none; background: linear-gradient(var(--signal), var(--signal)) left bottom / 0 2px no-repeat; padding-bottom: 4px; transition: background-size 400ms var(--ease); }
.contact-email a:hover, .contact-email a:focus-visible { background-size: 100% 2px; color: var(--ink); }
.contact-tools { margin-top: 20px; display: flex; align-items: center; gap: 16px; min-height: 2.6em; }
.copy-status { color: var(--ledger); font-weight: 400; }
.topics a { display: flex; gap: .9em; align-items: baseline; padding-block: 14px; border-bottom: 1px solid var(--rule); text-decoration: none; font-size: 1.0625rem; }
.topics .n { color: var(--muted); min-width: 2.4em; }
.topics .arrow { margin-left: auto; font-family: var(--display); transition: transform 220ms var(--ease); }
.topics a:hover .arrow, .topics a:focus-visible .arrow { transform: translate(3px, -3px); color: var(--signal-ink); }
.topics a:hover .n { color: var(--signal-ink); }

/* ------------------------------------------------------------------ colophon */
.colophon {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 28px;
  margin-top: clamp(80px, 10vw, 140px); padding-block: 28px 40px; border-top: 1px solid var(--ink);
}
.colophon-mark { grid-column: 1 / span 2; color: var(--ink); }
.colophon-mark .logo { width: 44px; height: auto; }
.colophon-tagline { grid-column: 3 / -1; font: 400 clamp(1.125rem, 2vw, 1.5rem)/1.2 var(--display); letter-spacing: .03em; }
.colophon-facts { grid-column: 3 / span 6; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px 36px; }
.colophon-facts dt { color: var(--muted); font-weight: 400; }
.colophon-facts dd { font-size: 1rem; }
.colophon-nav { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 6px; font-size: 1rem; }
.colophon-nav a { text-decoration: none; }
.colophon-nav a:hover { text-decoration: underline; }
.colophon-work { grid-column: 3 / -1; font-size: 1rem; }
.colophon-work .label { margin-right: 1em; color: var(--muted); font: 400 .75rem/1.5 var(--display); letter-spacing: .09em; }
.colophon-work a { text-decoration: none; }
.colophon-work a:hover { text-decoration: underline; }
.colophon-work .sep { margin-inline: .5em; color: var(--rule-strong); }
.colophon-note { grid-column: 3 / -1; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .9375rem; }

/* ------------------------------------------------------------------ documents (privacy, 404) */
.doc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-block: clamp(40px, 6vw, 88px) 0; }
.doc-head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); margin-bottom: 40px; align-items: end; }
.doc-head .display { grid-column: 3 / span 8; font-size: clamp(2.25rem, 4.6vw, 4rem); }
.doc-head .chapter-no { grid-column: 1 / span 2; }
.doc-meta { grid-column: 3 / -1; color: var(--muted); margin-top: 16px; font-weight: 400; }
.doc-lede { grid-column: 3 / span 8; margin-top: 16px; font-size: 1.1875rem; color: var(--muted); }
.doc-lede a { color: var(--ledger); }
.doc-toc { grid-column: 1 / span 2; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.doc-toc ol { display: grid; gap: 6px; }
.doc-toc a { text-decoration: none; color: var(--muted); }
.doc-toc a:hover { color: var(--ink); }
.doc-body { grid-column: 3 / span 7; }
.doc-body section + section { margin-top: 36px; }
.doc-body h2 { display: flex; gap: .8em; align-items: baseline; font: 400 1.5rem/1.2 var(--display); letter-spacing: .02em; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.doc-body h2 .n { color: var(--signal-ink); font-size: .75rem; font-weight: 700; letter-spacing: .09em; }
.doc-body p { max-width: var(--measure); text-wrap: pretty; }
.doc-body p + p { margin-top: .9em; }
.doc-body a { color: var(--ledger); overflow-wrap: anywhere; }
.doc-back { margin-top: 44px; }
.fig-404 { grid-column: 3 / span 6; margin-top: 8px; }

/* ------------------------------------------------------------------ logo */
.logo { display: block; overflow: visible; }
.logo-pen { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.logo-node { fill: var(--signal); transform-box: fill-box; transform-origin: center; }
.logo-pulse { stroke: var(--signal); stroke-dasharray: .18 1.4; stroke-dashoffset: .18; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  /* Plotted once on load: the ring and M, then F L O W in stroke order, then the output node. */
  .masthead .logo:not(.is-ready) :is(.logo-trace, .logo-letter) { stroke-dasharray: 1 1; animation: logo-draw 900ms var(--ease) both; }
  .masthead .logo:not(.is-ready) .logo-letter { animation-duration: 620ms; animation-delay: calc(380ms + var(--i) * 120ms + var(--lag, 0ms) * 1.4); }
  .masthead .logo:not(.is-ready) .logo-node { animation: logo-node 520ms var(--ease) 1300ms both; }
  /* Hover or focus (and a tap on the home page): a signal runs through each letter and arrives at the node. */
  .logo.is-pulsing .logo-pulse { animation: logo-pulse 460ms cubic-bezier(.45, 0, .2, 1) calc(var(--i) * 130ms + var(--lag, 0ms) * 1.75) both; }
  .logo.is-pulsing .logo-node { animation: logo-ping 1150ms ease both; }
}
@keyframes logo-draw { 0% { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes logo-node { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes logo-pulse { 0% { opacity: 1; stroke-dashoffset: .18; } 90% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: -1; } }
@keyframes logo-ping { 0%, 74% { transform: scale(1); } 87% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  /* The cover figure takes the full width; lead and contents sit side by side above it. */
  .cover-copy { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .cover-copy .contents { margin-top: 0; }
  .fig-cover { grid-column: 1 / -1; margin-top: 48px; }
  .company-story, .contact-main { grid-column: 1 / span 7; }
  .principles, .topics { grid-column: 8 / span 5; }
  .product-copy { grid-column: 1 / span 5; }
  .product .fig { grid-column: 6 / span 7; }
  .chapter > .chapter-intro { margin-left: 0; }
  .colophon-facts { grid-column: 3 / span 10; }
  .colophon-nav { grid-column: 3 / span 10; flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }
}
@media (max-width: 860px) {
  .masthead-bar { flex-wrap: wrap; row-gap: 12px; }
  .cover, .chapter-body, .product, .colophon, .doc, .doc-head { grid-template-columns: minmax(0, 1fr); }
  .cover-head, .cover-copy, .fig-cover, .company-story, .principles, .product-copy, .product .fig,
  .contact-main, .topics, .colophon-mark, .colophon-facts,
  .colophon-nav, .colophon-note, .colophon-tagline, .colophon-work, .doc-head .display, .doc-head .chapter-no, .doc-meta, .doc-lede, .doc-toc, .doc-body, .fig-404 { grid-column: 1 / -1; }
  .cover-copy { display: block; }
  .cover-copy .contents { margin-top: clamp(36px, 5vw, 64px); }
  .fig-cover { margin-top: 40px; }
  .chapter-head { grid-template-columns: auto 1fr; column-gap: 16px; }
  .chapter-no { grid-column: 1; }
  .chapter-title { grid-column: 2; }
  .chapter-meta { grid-column: 1 / -1; justify-self: start; text-align: left; margin-top: 10px; }
  .colophon-facts { grid-template-columns: repeat(2, auto); }
  .doc-toc { position: static; margin-bottom: 36px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
  .doc-toc ol { display: flex; flex-wrap: wrap; gap: 6px 18px; }
}
@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .masthead-bar { align-items: flex-start; }
  .site-nav { width: 100%; }
  .site-nav ol { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
  .site-nav a { padding-block: 4px; }
  .contents-title { flex-wrap: wrap; }
  .contents .m { display: none; }
  .contents a { grid-template-columns: 2.4em 1fr; }
  .parts .part { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); column-gap: .9em; }
  .parts .v { grid-column: 2; margin-left: 0; }
  .fig-frame { padding: 28px 22px 22px; }
  .contents .leader { display: none; }
  .spec div { grid-template-columns: 1fr; gap: 2px; }
  .chapter-head { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .chapter-no, .chapter-title { grid-column: 1; }
  .colophon-facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 44em) {
  .kicker { flex-direction: column; gap: 2px; }
  .kicker span + span::before { content: none; }
  .kicker .kicker-end { margin-left: 0; }
}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ruler-mark { display: none; }
}

/* ------------------------------------------------------------------ print */
@media print {
  :root { --paper: #fff; }
  .masthead { position: static; }
  .ruler, .site-nav, .skip-link, .fig-toggle, .contact-tools { display: none !important; }
  .chapter, .product, .fig { break-inside: avoid; }
  .f-layer, .f-badge-set { transform: none !important; }      /* print the drawings open and labelled */
  .fig-svg :is(.f-label, .f-badge-set) { opacity: 1 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: var(--muted); }
}
