@font-face {
  font-family: "Saira";
  src: url("vendor/fonts/saira-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Saira";
  src: url("vendor/fonts/saira-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Drawing-sheet palette: drafting film, graphite ink, pencil, construction lines, flight-test orange. */
:root {
  --film: #dfe2e0;
  --film-deep: #d3d7d5;
  --ink: #1e2326;
  --pencil: #6f777c;
  --construct: #4a6272;
  --test: #e5541b;
  --rule: #a9b0b2;
  --measure: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
}

* { box-sizing: border-box; }

html { background: var(--film-deep); }

body {
  margin: 0;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  font-family: "Saira", system-ui, sans-serif;
  font-size: var(--measure);
  font-stretch: 100%;
  line-height: 1.55;
  color: var(--ink);
}

a { color: inherit; text-decoration-color: var(--test); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--test); }
:focus-visible { outline: 3px solid var(--test); outline-offset: 3px; }

/* The sheet: a drawing border with a second inner rule. */
.sheet {
  max-width: 1320px;
  margin: 0 auto;
  background: var(--film);
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 5px;
  padding: clamp(1rem, 3vw, 2.5rem);
}

/* ---------- Index sheet ---------- */

.masthead { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: end; }

.wordmark {
  margin: 0;
  font-size: clamp(4rem, 15vw, 12.5rem);
  font-weight: 850;
  font-stretch: 50%;
  line-height: 0.82;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.tagline {
  margin: 0.75rem 0 0;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 300;
  font-stretch: 85%;
}

.tagline, .intro { text-wrap: balance; }
.intro { max-width: 62ch; margin: 1.25rem 0 0; color: var(--ink); }

.masthead-aside { display: grid; gap: 1.25rem; align-self: start; justify-items: end; }

.revisions { border-collapse: collapse; font-size: 0.8rem; align-self: start; }
.revisions th, .revisions td { border: 1px solid var(--ink); padding: 0.2rem 0.55rem; text-align: left; font-weight: 400; }
.revisions th { color: var(--pencil); }

.hero { margin: 0; width: min(500px, 38vw); }
.hero img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 3px; }
.hero figcaption { margin-top: 0.55rem; font-size: 0.8rem; color: var(--pencil); }
.hero figcaption span { color: var(--ink); font-weight: 600; margin-right: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }

.drawing { margin: clamp(1.5rem, 4vw, 3rem) 0 0; }
.drawing svg { display: block; width: 100%; height: auto; overflow: visible; }

.ink { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.ink.thin { stroke-width: 1.2; }
.ink.hairline { stroke-width: 0.6; }
.ink.hidden { stroke-width: 1; stroke-dasharray: 7 5; stroke: var(--construct); }
.center { stroke: var(--construct); stroke-width: 0.9; stroke-dasharray: 26 5 3 5; }
.ext { stroke: var(--construct); stroke-width: 0.8; }
.dim { stroke: var(--construct); stroke-width: 0.9; }
.dimtext { fill: var(--construct); font-size: 15px; font-stretch: 85%; }
#arrow path { fill: var(--construct); }

.balloon circle { fill: var(--film); stroke: var(--ink); stroke-width: 1.4; }
.balloon .leader { stroke: var(--ink); stroke-width: 1; fill: none; }
.balloon .tip { fill: var(--ink); stroke: none; }
.balloon text { font-size: 19px; font-weight: 600; fill: var(--ink); }
.balloon:hover circle, .balloon:focus-visible circle, .balloon.is-lit circle { fill: var(--test); stroke: var(--test); }
.balloon:hover text, .balloon:focus-visible text, .balloon.is-lit text { fill: #fff; }
.balloon:hover .leader, .balloon.is-lit .leader { stroke: var(--test); stroke-width: 1.6; }
.balloon:focus-visible { outline: none; }
.balloon:focus-visible circle { stroke-width: 4; }

.lower { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); margin-top: clamp(1.5rem, 4vw, 3rem); }

h2 { margin: 0 0 0.6rem; font-size: 1.05rem; font-weight: 600; font-stretch: 85%; }

.parts { width: 100%; border-collapse: collapse; }
.parts th, .parts td { border: 1px solid var(--ink); padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; }
.parts th { font-size: 0.8rem; font-weight: 500; color: var(--pencil); }
.parts td.item { width: 3.2rem; text-align: center; font-weight: 600; }
.parts td.pn { white-space: nowrap; font-stretch: 85%; color: var(--pencil); }
.parts td.desc a { font-weight: 600; }
.parts td.desc span { display: block; color: var(--pencil); font-size: 0.9rem; }
.parts tr.is-lit td { background: #f0f2f1; }
.parts tr.is-lit td.item { background: var(--test); color: #fff; }
.parts td.status { white-space: nowrap; font-size: 0.85rem; }

.status[data-state="up"] { color: #2f6b3a; }
.status[data-state="down"] { color: var(--pencil); }
.status[data-state="up"]::before, .status[data-state="down"]::before {
  content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.4rem; border-radius: 50%;
  background: currentColor; vertical-align: 0.05em;
}
.status[data-state="down"]::before { background: none; border: 1.5px solid currentColor; }

.notes ol { margin: 0; padding-left: 1.3rem; }
.notes li { margin-bottom: 0.6rem; text-wrap: pretty; }
.notes code { white-space: nowrap; }
.notes code, .doc code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; background: var(--film-deep); padding: 0.05em 0.3em; }

.titleblock {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1.3fr 0.6fr 0.6fr;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border: 2px solid var(--ink);
}
.titleblock div { border-right: 1px solid var(--ink); padding: 0.45rem 0.7rem; }
.titleblock div:last-child { border-right: 0; }
.titleblock dt { font-size: 0.72rem; color: var(--pencil); }
.titleblock dd { margin: 0; font-weight: 500; }
.titleblock .title dd { font-weight: 600; }
.disclaimer { margin: 0.8rem 0 0; font-size: 0.8rem; color: var(--pencil); max-width: 90ch; }

/* ---------- Document and process sheets ---------- */

.docbar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 0.8rem; margin-bottom: 2rem; }
.docbar .home { font-size: 2rem; font-weight: 850; font-stretch: 50%; text-transform: uppercase; text-decoration: none; line-height: 1; }
.docbar nav { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: 0.95rem; }
.docbar nav a[aria-current="page"] { color: var(--test); text-decoration: none; font-weight: 600; }

.doc { max-width: 76ch; }
.doc h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 700; font-stretch: 70%; line-height: 1.05; margin: 0 0 1.5rem; }
.doc h2 { font-size: 1.45rem; font-weight: 650; font-stretch: 85%; margin: 2.6rem 0 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.doc h3 { font-size: 1.15rem; font-weight: 600; margin: 1.8rem 0 0.5rem; }
.doc blockquote { margin: 1.5rem 0; padding: 0.2rem 0 0.2rem 1rem; border-left: 4px solid var(--test); color: var(--construct); }
.doc table { border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--ink); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.doc th { font-weight: 600; background: var(--film-deep); }
.doc pre { background: var(--ink); color: var(--film); padding: 1rem 1.2rem; overflow-x: auto; font-size: 0.8rem; line-height: 1.4; }
.doc pre code { background: none; padding: 0; font-size: inherit; }
.doc img { max-width: 100%; border: 1px solid var(--ink); }
.doc .error { color: var(--test); }

.process-canvas { height: clamp(320px, 42vw, 540px); border: 1px solid var(--ink); background: #fff; }
.process-intro { max-width: 70ch; margin: 0 0 1.25rem; }
.process-hint { font-size: 0.85rem; color: var(--pencil); margin: 0.6rem 0 0; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr; }
  .revisions { display: none; }
  .masthead-aside { justify-items: stretch; }
  .hero { width: 100%; }
  .lower { grid-template-columns: 1fr; }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock div { border-bottom: 1px solid var(--ink); }
  .titleblock .title { grid-column: 1 / -1; }
  .parts td.pn, .parts th.pn { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .balloon circle, .balloon text, .balloon .leader, .parts td { transition: fill 120ms, stroke 120ms, background-color 120ms, color 120ms; }
}
