/* ==========================================================================
   ENGINEERING DRAWING — the hero, from the founder's artifact (2026-09-30).
   Loaded after x-engineering-drawing.css on a/engineering-drawing.html only.
   Scope: .edh-hero. Replaces the old hero and its Assemble figure.

   One sheet: trim, grid-reference band (wider filing margin left),
   centering marks, a frame, a header strip that is the mock nav (balloons
   numbered from the page's own parts list), then copy | exploded view |
   parts list, projected views and the title block bottom right.
   Lines from one series, 4 : 2 : 1. One accent, once per view: part 3.

   Faces are the room's own (PlexSansX, PlexMonoX, x-engineering-drawing.css).
   Tokens are scoped here, never on the shell.
   ========================================================================== */
.edh-hero {
  --edh-sheet: #FFFFFF; --edh-ink: #22262B; --edh-ink-2: #5C636B; --edh-rule: #A9B0B8;
  --edh-accent: #E8641B; --edh-accent-text: #B8480C;
  --edh-w4: 4px; --edh-w2: 2px; --edh-w1: 1px;
  --edh-sans: "PlexSansX", "IBM Plex Sans", Arial, sans-serif;
  --edh-mono: "PlexMonoX", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  container-type: inline-size;
  position: relative;
  display: block;
  background: var(--edh-sheet); color: var(--edh-ink); font-family: var(--edh-sans);
  font-synthesis: none;
  padding: 0 clamp(10px, 1.6cqi, 22px);
  /* Full width of the page column, rising behind the empty top bar. */
  margin: calc(-3rem - var(--s2, 0.5rem)) calc(-1 * var(--s6, 2rem)) 0;
}
@media (max-width: 60rem) {
  .edh-hero { margin-inline: calc(-1 * var(--s4, 1rem)); }
  /* The action cluster docks at the foot of the screen here: no clearance needed. */
  .edh-hero .edh-sheet { margin-top: 12px; }
}
.edh-hero * { box-sizing: border-box; }
.edh-hero a { color: inherit; }
.edh-hero :focus-visible { outline: var(--edh-w2) solid var(--edh-accent-text); outline-offset: 3px; }
.edh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the sheet: trim, grid-reference band, frame ---------- */
/* The sheet starts at the top of the page; its header strip is the nav and the
   action bar sits under it (founder, 2026-10-01: nav on top, the bar below). */
.edh-sheet { position: relative; margin: 12px 0 clamp(10px, 1.6cqi, 22px); border: var(--edh-w2) solid var(--edh-ink); padding: 26px 26px 26px 44px; }
.edh-refs { position: absolute; display: grid; font: 500 12px/1 var(--edh-mono); color: var(--edh-ink); }
.edh-refs span { display: flex; align-items: center; justify-content: center; }
.edh-refs.h { left: 44px; right: 26px; height: 26px; grid-template-columns: repeat(4, 1fr); }
.edh-refs.h span + span { border-left: var(--edh-w1) solid var(--edh-ink); }
.edh-refs.top { top: 0; } .edh-refs.bot { bottom: 0; }
.edh-refs.v { top: 26px; bottom: 26px; grid-template-rows: repeat(4, 1fr); }
.edh-refs.v span + span { border-top: var(--edh-w1) solid var(--edh-ink); }
.edh-refs.lft { left: 0; width: 44px; } .edh-refs.rgt { right: 0; width: 26px; }
.edh-cm { position: absolute; background: var(--edh-ink); }  /* centering marks, across the band into the frame */
.edh-cm.t, .edh-cm.b { left: calc(50% + 9px); width: var(--edh-w2); height: 34px; }
.edh-cm.t { top: 0; } .edh-cm.b { bottom: 0; }
.edh-cm.l, .edh-cm.r { top: 50%; height: var(--edh-w2); width: 34px; }
.edh-cm.l { left: 18px; } .edh-cm.r { right: 0; }

.edh-frame { position: relative; border: var(--edh-w4) solid var(--edh-ink); background: var(--edh-sheet); }

/* ---------- header strip: the mock nav ---------- */
.edh-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; border-bottom: var(--edh-w2) solid var(--edh-ink); }
.edh-mark { display: flex; align-items: center; padding: 16px 26px; border-right: var(--edh-w2) solid var(--edh-ink); font: 500 20px/1 var(--edh-mono); letter-spacing: .06em; text-decoration: none; }
.edh-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.edh-nav ol { display: flex; justify-content: center; align-items: center; gap: clamp(14px, 2.2cqi, 36px); height: 100%; margin: 0; padding: 0 16px; list-style: none; }
.edh-nav a { display: flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; font: 500 14px/1 var(--edh-mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.edh-nav a:hover span:last-child { text-decoration: underline; text-underline-offset: 5px; }
.edh-bal { display: inline-grid; place-items: center; width: 22px; height: 22px; border: var(--edh-w1) solid var(--edh-ink); border-radius: 50%; font: 500 11px/1 var(--edh-mono); }
/* Build has no part number on the sheet: its balloon is the hidden-edge line, dashed and empty. */
.edh-bal--open { border-style: dashed; }
.edh-btn { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; padding: 12px 18px; border: var(--edh-w2) solid var(--edh-ink); background: var(--edh-sheet); color: var(--edh-ink); text-decoration: none; cursor: pointer; font: 500 14px/1 var(--edh-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.edh-btn:hover { background: #F4F6F8; }
.edh-btn svg { width: 18px; height: 18px; transition: transform .3s; }
.edh-btn[hidden] { display: none; }
.edh-head .edh-btn { align-self: center; margin: 0 16px; }

/* ---------- body: copy | exploded view | parts list, views, title block ---------- */
.edh-body { display: grid; grid-template-columns: 1fr minmax(0, .9fr) 1.08fr; gap: 0 clamp(16px, 2cqi, 30px); padding: clamp(20px, 2.6cqi, 36px) clamp(18px, 2.4cqi, 34px) 0; }
.edh-copy { display: flex; flex-direction: column; padding-bottom: 28px; min-width: 0; }
.edh-kind { margin: 0; font: 500 13px/1.3 var(--edh-mono); letter-spacing: .06em; text-transform: uppercase; }
.edh-title { margin: 18px 0 0; font: 500 clamp(40px, 4.9cqi, 70px)/.98 var(--edh-mono); letter-spacing: -.02em; text-transform: uppercase; overflow-wrap: normal; word-break: normal; hyphens: none; }
.edh-lede { margin: 24px 0 0; max-width: 22em; font: 500 clamp(19px, 1.75cqi, 24px)/1.3 var(--edh-sans); }
.edh-dek { margin: 12px 0 0; max-width: 26em; font: 400 17px/1.5 var(--edh-sans); color: var(--edh-ink-2); }
.edh-copy .edh-btn { align-self: flex-start; margin-top: 28px; padding: 16px 22px; font-size: 15px; }
.edh-meta { margin: 14px 0 0; font: 400 12px/1.4 var(--edh-mono); letter-spacing: .06em; color: var(--edh-ink-2); text-transform: uppercase; }

.edh-key { margin-top: auto; padding-top: 26px; }
.edh-key h2, .edh-parts caption { margin: 0 0 10px; font: 500 12px/1 var(--edh-mono); letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.edh-key ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.edh-key li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 14px; font: 400 13px/1.3 var(--edh-sans); color: var(--edh-ink-2); }
.edh-key svg { width: 64px; height: 6px; overflow: visible; }

.edh-drawing { display: flex; justify-content: center; align-items: flex-start; min-width: 0; }
.edh-iso { width: 100%; max-width: 430px; height: auto; display: block; }
.edh-num { font: 500 13px var(--edh-mono); fill: var(--edh-ink); }
.edh-dim { font: 400 11px var(--edh-mono); fill: var(--edh-ink); }
.edh-lbl { font: 500 11px var(--edh-mono); fill: var(--edh-ink); letter-spacing: .06em; }

.edh-side { display: flex; flex-direction: column; min-width: 0; }
.edh-parts { width: 100%; border-collapse: collapse; font: 400 11px/1.2 var(--edh-mono); text-transform: uppercase; }
.edh-parts th, .edh-parts td { padding: 7px 6px; border: var(--edh-w1) solid var(--edh-ink); text-align: left; white-space: nowrap; }
.edh-parts th { font-weight: 500; letter-spacing: .04em; }
.edh-parts td:first-child, .edh-parts td:nth-child(2), .edh-parts th:first-child, .edh-parts th:nth-child(2) { text-align: center; }
.edh-parts thead tr { border-bottom: var(--edh-w2) solid var(--edh-ink); }
.edh-parts tr.is-accent td { color: var(--edh-accent-text); font-weight: 500; }
.edh-parts-wrap { border: var(--edh-w2) solid var(--edh-ink); overflow-x: auto; }
.edh-parts-wrap table { margin: -1px; }

.edh-views { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0 0; }
.edh-view { width: 100%; max-width: 320px; height: auto; display: block; }

.edh-tb { display: grid; grid-template-columns: 1fr auto; margin: 18px calc(-1 * clamp(18px, 2.4cqi, 34px)) 0 0; border-top: var(--edh-w2) solid var(--edh-ink); border-left: var(--edh-w2) solid var(--edh-ink); }
.edh-tb dl { margin: 0; display: grid; }
.edh-tb .l { grid-template-rows: repeat(3, auto); }
.edh-tb .r { grid-template-columns: repeat(2, minmax(78px, auto)); border-left: var(--edh-w2) solid var(--edh-ink); }
.edh-tb div { padding: 8px 12px 10px; border-bottom: var(--edh-w1) solid var(--edh-ink); }
.edh-tb .r div:nth-child(odd) { border-right: var(--edh-w1) solid var(--edh-ink); }
.edh-tb .r div.span { grid-column: 1 / -1; border-right: 0; }
.edh-tb div:last-child, .edh-tb .r div:nth-last-child(2) { border-bottom: 0; }
.edh-tb dt { font: 500 10.5px/1 var(--edh-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--edh-ink-2); }
.edh-tb dd { margin: 7px 0 0; font: 500 15px/1.1 var(--edh-mono); text-transform: uppercase; }
.edh-tb .r dd { font-size: 14px; }
.edh-tb dd.edh-lc { text-transform: none; }

/* ---------- one row down to phone widths (founder, 2026-10-01: the nav is one
   full-width row): the strip tightens instead of wrapping ---------- */
@container (max-width: 1100px) {
  .edh-mark { padding: 14px 16px; font-size: 16px; }
  .edh-nav ol { gap: 12px; padding: 0 10px; }
  .edh-nav a { gap: 6px; font-size: 11.5px; letter-spacing: .02em; }
  .edh-bal { width: 19px; height: 19px; font-size: 10px; }
  .edh-head .edh-btn { margin: 0 10px; padding: 10px 12px; font-size: 12px; }
}
/* ---------- phones: nav under the mark ---------- */
@container (max-width: 760px) {
  .edh-head { grid-template-columns: 1fr auto; }
  .edh-nav { grid-column: 1 / -1; order: 3; border-top: var(--edh-w2) solid var(--edh-ink); }
  .edh-nav ol { justify-content: flex-start; padding: 4px 26px; }
  .edh-mark { border-right: 0; }
}
/* Beside the rail the sheet is narrower than the artifact's: the parts
   list lets its descriptions wrap rather than clip. */
@container (max-width: 1200px) {
  .edh-parts th, .edh-parts td { padding-inline: 4px; }
  .edh-parts td:nth-child(4) { white-space: normal; }
}
/* ---------- narrow: one column, the title block closes the sheet ---------- */
@container (max-width: 980px) {
  .edh-body { grid-template-columns: 1fr 1fr; }
  .edh-copy { grid-column: 1 / -1; }
  .edh-key { margin-top: 26px; }
}
@container (max-width: 700px) {
  .edh-sheet { margin-top: 12px; padding: 10px 0; border: 0; }
  .edh-refs, .edh-cm { display: none; }
  .edh-mark { padding: 14px 16px; font-size: 17px; }
  .edh-head .edh-btn { margin: 0 12px; padding: 10px 12px; font-size: 12px; }
  .edh-nav ol { padding: 4px 16px; gap: 22px; }
  .edh-body { grid-template-columns: minmax(0, 1fr); padding: 22px 16px 0; }
  .edh-copy { display: contents; }
  .edh-copy > * { grid-column: 1; }
  .edh-drawing { order: 1; padding: 10px 0 4px; }
  .edh-side { display: contents; }
  .edh-parts-wrap { order: 2; margin-top: 18px; }
  .edh-views { order: 3; }
  .edh-key { order: 4; margin-top: 10px; }
  .edh-tb { order: 5; margin: 24px -16px 0; grid-template-columns: minmax(0, 1fr); border-left: 0; }
  .edh-tb .r { border-left: 0; border-top: var(--edh-w2) solid var(--edh-ink); }
  .edh-parts th:nth-child(2), .edh-parts td:nth-child(2) { display: none; }
  .edh-iso { max-width: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .edh-btn svg { transition: none; }
}

/* ---------- under the hero: the page's parts list (the old hero's BOM) ---------- */
.ed-toc { margin-top: 28px; }
.ed-toc h2 { margin: 0 0 8px; font: 500 12px/1.4 var(--ed-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ed-g1); }
.ed-toc ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--ed-g2); border-top: 1px solid var(--ed-g2); background: var(--ed-w); }
.ed-toc li { border-right: 1px solid var(--ed-g2); border-bottom: 1px solid var(--ed-g2); min-width: 0; }
.ed-toc a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; text-decoration: none; }
.ed-toc a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.ed-toc .ed-bal { flex: none; }
@media (max-width: 820px) { .ed-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .ed-toc ol { grid-template-columns: minmax(0, 1fr); } }

/* The action bar sits under the header strip on desktop (founder, 2026-10-01: nav on top,
   the bar below): the drawing starts a bar's height lower. */
@media (min-width: 60.0625rem) { .edh-body { padding-top: calc(clamp(20px, 2.6cqi, 36px) + 48px); } }
