/* ==========================================================================
   Crucible Management — operational fieldbook / systems atlas
   Basalt ink, river-silt field paper, oxidized survey orange, lichen green.
   Hard corners, heavy rules, measured spacing. No remote assets, no build.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Basalt / graphite ink */
  --basalt: #16181a;
  --basalt-2: #1d2123;
  --basalt-3: #272c2f;
  --graphite: #3b4245;

  /* River-silt field paper */
  --silt: #d9d3c6;
  --silt-2: #cec7b7;
  --silt-3: #e4dfd4;
  --silt-4: #efebe2;

  /* Type on ink */
  --on-ink: #e4dfd4;
  --on-ink-mute: #a6a294;
  --on-ink-faint: #7e7a6e;

  /* Type on paper */
  --on-paper: #1f2224;
  --on-paper-mute: #4d514c;
  --on-paper-faint: #6d7069;

  /* Oxidized survey orange */
  --rust: #b4491d;
  --rust-bright: #d2662f;
  --rust-deep: #8a3411;

  /* Restrained utility green */
  --lichen: #4f5f46;

  /* Rules */
  --rule-paper: rgba(31, 34, 36, 0.22);
  --rule-paper-hair: rgba(31, 34, 36, 0.13);
  --rule-ink: rgba(228, 223, 212, 0.2);
  --rule-ink-hair: rgba(228, 223, 212, 0.11);

  --sheet-max: 1360px;
  --gutter: clamp(1.15rem, 3.2vw, 3rem);
  --band: clamp(3.5rem, 6.5vw, 6.5rem);

  --font-cond: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue Condensed",
    "Liberation Sans Narrow", "Roboto Condensed", "DejaVu Sans Condensed", "Segoe UI", sans-serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    "DejaVu Sans Mono", monospace;

  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);
}

* {
  box-sizing: border-box;
}

*::selection {
  background: var(--rust);
  color: var(--silt-4);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-paper);
  background-color: var(--silt);
  /* Drafting grid, cut into the field paper. */
  background-image:
    linear-gradient(to right, rgba(31, 34, 36, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 34, 36, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure,
figcaption {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.22em;
  transition: color 150ms var(--ease), background-color 150ms var(--ease),
    border-color 150ms var(--ease);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--rust-bright);
  outline-offset: 2px;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   Condensed industrial headline voice
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
.cover__title,
.node__name,
.item__name,
.phase__name {
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.55rem, 6.1vw, 5.6rem);
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 3.15rem);
}

h3 {
  font-size: clamp(1.35rem, 2.05vw, 1.9rem);
}

/* Monospaced utility labels — used sparingly, always small. */

.stamp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-deep);
  margin: 0;
}

.stamp--rust {
  color: var(--rust-deep);
}

.stamp--ink {
  color: var(--rust-bright);
}

.stamp--dim {
  color: var(--on-ink-faint);
}

/* --------------------------------------------------------------------------
   Sheet container
   -------------------------------------------------------------------------- */

.sheet {
  width: min(var(--sheet-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  background: var(--rust);
  color: var(--silt-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 140ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   1. Masthead — utility bar + work-order tabs
   -------------------------------------------------------------------------- */

.masthead {
  position: relative;
  z-index: 5;
  background: var(--basalt);
  border-bottom: 3px solid var(--rust);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0 0.55rem;
  border-bottom: 1px solid var(--rule-ink-hair);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand__stack {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.brand__word {
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--silt-4);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
  line-height: 1.2;
}

.masthead__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--on-ink-mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.masthead__mail:hover {
  color: var(--rust-bright);
  border-bottom-color: var(--rust-bright);
}

.index-tabs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  padding-top: 0.7rem;
}

.index-tabs a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.05rem 0.65rem;
  border: 1px solid var(--rule-ink);
  border-bottom: 0;
  border-left-width: 0;
  background: var(--basalt-2);
  color: var(--on-ink-mute);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
}

.index-tabs li:first-child a {
  border-left-width: 1px;
}

.index-tabs a:hover,
.index-tabs a:focus-visible {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--silt-4);
}

.tab__num {
  color: var(--rust-bright);
  font-weight: 700;
}

.index-tabs a:hover .tab__num,
.index-tabs a:focus-visible .tab__num {
  color: var(--silt-4);
}

/* --------------------------------------------------------------------------
   2. Cover — asymmetric technical composition + system topology
   -------------------------------------------------------------------------- */

.cover {
  background-color: var(--basalt);
  background-image:
    linear-gradient(to right, rgba(228, 223, 212, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(228, 223, 212, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--on-ink);
  padding-bottom: clamp(2.5rem, 4.5vw, 4rem);
}

.cover__sheet {
  position: relative;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

/* Registration marks at the sheet corners. */
.cover__sheet::before,
.cover__sheet::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.cover__sheet::before {
  top: clamp(1.5rem, 3vw, 2.5rem);
  left: -14px;
  border-left: 2px solid var(--rust);
  border-top: 2px solid var(--rust);
}

.cover__sheet::after {
  top: clamp(1.5rem, 3vw, 2.5rem);
  right: -14px;
  border-right: 2px solid var(--rust);
  border-top: 2px solid var(--rust);
}

.stamp-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule-ink-hair);
}

.stamp-row .stamp {
  color: var(--rust-bright);
}

.cover__head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(1.75rem, 4vw, 4.5rem);
  align-items: end;
  padding: clamp(2rem, 4.5vw, 3.75rem) 0 clamp(2.25rem, 4vw, 3.5rem);
}

.cover__title {
  color: var(--silt-4);
  letter-spacing: -0.005em;
  margin: 0;
}

.cover__lead {
  color: var(--on-ink-mute);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.6;
  max-width: 44ch;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--rule-ink-hair);
  margin-bottom: 1.35rem;
}

.jump {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-ink-mute);
  text-decoration: none;
}

.jump span[aria-hidden] {
  color: var(--rust-bright);
  font-size: 0.6rem;
}

.jump:hover {
  color: var(--silt-4);
  text-decoration: underline;
}

/* -------- Systems topology diagram -------- */

.topo {
  border-top: 2px solid var(--rust);
  padding-top: 1.1rem;
}

.topo__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.topo__fig {
  flex: none;
  padding: 0.2rem 0.5rem;
  background: var(--rust);
  color: var(--silt-4);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topo__desc {
  flex: 1 1 24ch;
  color: var(--on-ink-mute);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 74ch;
}

.topo__rail {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(110px, 0.85fr) minmax(0, 1fr) minmax(110px, 0.85fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.node {
  padding: 1.05rem 1.15rem 1.2rem;
  border: 1px solid var(--rule-ink);
  border-left-width: 3px;
  border-left-color: var(--on-ink-faint);
  background: var(--basalt-2);
}

.node--hub {
  border-left-color: var(--rust);
  background: var(--basalt-3);
}

.node__id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
  margin-bottom: 0.4rem;
}

.node__name {
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  color: var(--silt-4);
  margin-bottom: 0.5rem;
}

.node__role {
  color: var(--on-ink-mute);
  font-size: 0.88rem;
  line-height: 1.5;
}

.link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.05rem clamp(0.7rem, 1.4vw, 1.15rem);
  text-align: center;
}

.link__label {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
}

.link--variable .link__label {
  color: var(--rust-bright);
}

.link__trace {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  height: 3px;
}

.link__trace > span {
  display: block;
  height: 3px;
  background: var(--on-ink-faint);
}

.link--steady .link__trace > span {
  flex: 1 1 auto;
  background: var(--on-ink-mute);
}

.link--variable .link__trace {
  gap: 9px;
}

.link--variable .link__trace > span {
  background: var(--rust);
}

.link--variable .link__trace > span:nth-child(1) { flex: 5; }
.link--variable .link__trace > span:nth-child(2) { flex: 1; }
.link--variable .link__trace > span:nth-child(3) { flex: 3; opacity: 0.45; }
.link--variable .link__trace > span:nth-child(4) { flex: 2; }

.link__note {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--on-ink-faint);
}

.topo__premise {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 0.85rem;
  margin-top: 1.15rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--rule-ink-hair);
  color: var(--on-ink-mute);
  font-size: 0.95rem;
  line-height: 1.55;
}

.topo__premise-tag {
  flex: none;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--rust);
  color: var(--rust-bright);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* -------- Issue block (primary mailto) -------- */

.issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 1rem;
  min-height: 60px;
  padding: 0.9rem 1.15rem;
  border: 2px solid var(--rust);
  background: var(--rust);
  color: var(--silt-4);
  text-decoration: none;
}

.issue__label {
  grid-column: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(239, 235, 226, 0.82);
}

.issue__addr {
  grid-column: 1;
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.issue__arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 30px;
  height: 3px;
  background: currentColor;
  position: relative;
  transition: transform 220ms var(--ease);
}

.issue__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -6px;
  width: 15px;
  height: 15px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
  transform-origin: top right;
}

.issue:hover,
.issue:focus-visible {
  background: var(--basalt);
  border-color: var(--basalt);
  color: var(--silt-4);
}

.issue:hover .issue__label {
  color: var(--rust-bright);
}

.issue:hover .issue__arrow {
  transform: translateX(6px);
}

.issue--compact {
  min-height: 56px;
}

.issue--compact .issue__addr {
  min-width: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.issue--compact:hover,
.issue--compact:focus-visible {
  background: var(--silt-4);
  border-color: var(--silt-4);
  color: var(--basalt);
}

.issue--compact:hover .issue__label {
  color: var(--rust-deep);
}

/* --------------------------------------------------------------------------
   3. Field note — operating premise
   -------------------------------------------------------------------------- */

.note {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0 clamp(2rem, 4vw, 3.25rem);
  border-bottom: 1px solid var(--rule-paper-hair);
}

.note__sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.note__body {
  border-left: 3px solid var(--rust);
  padding-left: clamp(1.15rem, 2.4vw, 2rem);
  max-width: 74ch;
}

.note__body .stamp {
  margin-bottom: 0.85rem;
}

.note__body h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
  max-width: 24ch;
  margin-bottom: 1.1rem;
  color: var(--on-paper);
}

.note__body p {
  color: var(--on-paper-mute);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.65;
}

.note__body p + p {
  margin-top: 0.9rem;
}

.note__margin {
  border-top: 2px solid var(--on-paper);
  padding-top: 0.15rem;
}

.note__margin li {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule-paper-hair);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--on-paper);
}

.note__margin li span {
  color: var(--on-paper-faint);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.66rem;
  padding-top: 0.09rem;
}

/* --------------------------------------------------------------------------
   Shared section head with heavy rule
   -------------------------------------------------------------------------- */

.head-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: 0.85rem;
  align-items: end;
  padding-bottom: 1.15rem;
  border-bottom: 3px solid var(--on-paper);
}

.head-rule .stamp {
  grid-column: 1;
  grid-row: 1;
}

.head-rule h2 {
  grid-column: 1;
  grid-row: 2;
  color: var(--on-paper);
  max-width: 18ch;
}

.head-rule__note {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: end;
  color: var(--on-paper-mute);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 68ch;
}

/* --------------------------------------------------------------------------
   4. Services — specification / work-order index
   -------------------------------------------------------------------------- */

.spec {
  padding: clamp(2.75rem, 5.5vw, 4.75rem) 0 clamp(2.5rem, 5vw, 4.25rem);
}

.phase {
  margin-top: clamp(2rem, 3.5vw, 3rem);
}

.phase__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 0.5rem 0.85rem;
  background: var(--basalt);
  color: var(--on-ink);
}

.phase__bar--b {
  background: transparent;
  color: var(--on-paper);
  border: 2px solid var(--on-paper);
  padding: 0.4rem 0.75rem;
}

.phase__code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust-bright);
}

.phase__bar--b .phase__code {
  color: var(--rust-deep);
}

.phase__name {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

.phase__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
}

.phase__bar--b .phase__count {
  color: var(--on-paper-faint);
}

.item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(190px, 230px);
  grid-template-areas:
    "code name stub"
    "code body stub";
  column-gap: clamp(1rem, 2.2vw, 2rem);
  row-gap: 0.65rem;
  padding: clamp(1.35rem, 2.4vw, 2rem) 0;
  border-bottom: 1px solid var(--rule-paper-hair);
}

.item:last-child {
  border-bottom: 0;
  padding-bottom: 0.5rem;
}

/* Square code labels: filled for set-up, outlined for keep-running. */
.item__code {
  grid-area: code;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--rust);
  color: var(--silt-4);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.spec__list--b .item__code {
  background: transparent;
  border: 2px solid var(--on-paper);
  color: var(--on-paper);
}

.item--lead .item__code {
  width: 76px;
  height: 76px;
  font-size: 1.55rem;
}

.item__name {
  grid-area: name;
  align-self: end;
  color: var(--on-paper);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-paper);
}

.item--lead .item__name {
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  border-bottom-width: 2px;
  border-bottom-color: var(--on-paper);
}

.item__body {
  grid-area: body;
}

.item__body p {
  color: var(--on-paper-mute);
  font-size: 1rem;
  line-height: 1.62;
  max-width: 76ch;
}

.item--lead .item__body p {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

.item__caveat {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule-paper-hair);
  font-size: 0.9rem !important;
  color: var(--on-paper-faint) !important;
}

.item__caveat span {
  color: var(--rust-deep);
  flex: none;
}

.stub {
  grid-area: stub;
  align-self: start;
  border-top: 2px solid var(--on-paper);
}

.stub > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.12rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-paper-hair);
}

.stub > div:last-child {
  border-bottom: 0;
}

.stub dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-paper-faint);
}

.stub dd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--on-paper);
}

.chip {
  display: inline-block;
  padding: 0.22rem 0.45rem;
  background: var(--basalt);
  color: var(--silt-4);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spec__list--b .chip {
  background: var(--lichen);
}

/* --------------------------------------------------------------------------
   5. On-site realities — diagnostic plate
   -------------------------------------------------------------------------- */

.diag {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--rule-paper-hair);
}

.diag__body {
  max-width: 78ch;
  margin: clamp(1.5rem, 2.6vw, 2.25rem) 0 clamp(1.75rem, 3vw, 2.5rem);
  color: var(--on-paper-mute);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.65;
}

.plate {
  background: var(--basalt);
  background-image:
    linear-gradient(to right, rgba(228, 223, 212, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(228, 223, 212, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  border-left: 4px solid var(--rust);
  color: var(--on-ink);
  padding: clamp(1.15rem, 2.4vw, 1.85rem);
}

.plate__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule-ink);
}

.plate__legend {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
}

.plate__key {
  width: 22px;
  height: 3px;
  background: var(--rust);
}

.chan {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  gap: 0.5rem clamp(1rem, 2.2vw, 2rem);
  padding: clamp(1rem, 1.8vw, 1.35rem) 0;
  border-bottom: 1px solid var(--rule-ink-hair);
}

.chan:last-child {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

.chan dt {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--silt-4);
}

.chan__id {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--on-ink-faint);
}

.chan dd {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
  gap: 0.6rem clamp(1rem, 2.2vw, 2rem);
  align-items: start;
  margin: 0;
}

.chan__gauge {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.35rem;
}

.chan__trace {
  display: flex;
  align-items: center;
  height: 12px;
}

.chan__trace > span {
  display: block;
  background: var(--rust);
}

/* Interrupted: filled runs separated by real gaps. */
.chan__trace--broken {
  gap: 10px;
}

.chan__trace--broken > span {
  height: 4px;
}

.chan__trace--broken > span:nth-child(1) { flex: 6; }
.chan__trace--broken > span:nth-child(2) { flex: 2; }
.chan__trace--broken > span:nth-child(3) { flex: 1; opacity: 0.4; }
.chan__trace--broken > span:nth-child(4) { flex: 4; }
.chan__trace--broken > span:nth-child(5) { flex: 2; opacity: 0.4; }

/* Partitioned: equal cells, only the permitted ones filled. */
.chan__trace--partitioned {
  gap: 4px;
}

.chan__trace--partitioned > span {
  flex: 1;
  height: 12px;
  border: 1px solid var(--rust);
  background: transparent;
}

.chan__trace--partitioned > span:nth-child(1),
.chan__trace--partitioned > span:nth-child(3) {
  background: var(--rust);
}

/* Transfer: a run that stops at a hard terminal block. */
.chan__trace--transfer {
  gap: 0;
}

.chan__trace--transfer > span:nth-child(1) {
  flex: 1;
  height: 4px;
}

.chan__trace--transfer > span:nth-child(2) {
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--silt-4);
}

.chan__state {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rust-bright);
}

.chan__desc {
  color: var(--on-ink-mute);
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   6. Approach — connected job sequence
   -------------------------------------------------------------------------- */

.seq {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--rule-paper-hair);
}

.stations {
  position: relative;
  margin-top: clamp(2rem, 3.5vw, 3rem);
  padding-left: 0;
}

/* The spine that connects the stations. */
.stations::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 0;
  width: 2px;
  background: var(--rust);
}

.station {
  position: relative;
  padding: 0 0 clamp(2rem, 3.5vw, 3rem) clamp(2.5rem, 4vw, 3.75rem);
}

.station:last-child {
  padding-bottom: clamp(1.25rem, 2vw, 1.75rem);
}

/* Square node on the spine. */
.station::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--rust);
}

.station--carry {
  margin-left: clamp(0rem, 3.5vw, 3.5rem);
}

.station--close {
  margin-left: clamp(0rem, 7vw, 7rem);
}

.station--carry::before,
.station--close::before {
  background: transparent;
  border: 3px solid var(--rust);
}

/* Keep offset stations tied back to the spine. */
.station--carry::after,
.station--close::after {
  content: "";
  position: absolute;
  top: 11px;
  right: calc(100% - 1px);
  width: clamp(0rem, 3.5vw, 3.5rem);
  height: 2px;
  background: var(--rust);
}

.station--close::after {
  width: clamp(0rem, 7vw, 7rem);
}

.station__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.station__num {
  padding: 0.2rem 0.45rem;
  background: var(--on-paper);
  color: var(--silt-4);
  font-weight: 700;
}

.station__of {
  color: var(--on-paper-faint);
}

.station__gate {
  color: var(--rust-deep);
  letter-spacing: 0.09em;
}

.station h3 {
  color: var(--on-paper);
  margin-bottom: 0.6rem;
}

.station--open h3 {
  font-size: clamp(1.65rem, 3.1vw, 2.75rem);
}

.station--carry h3 {
  font-size: clamp(1.3rem, 1.9vw, 1.75rem);
}

.station--close h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

.station p:not(.station__meta) {
  color: var(--on-paper-mute);
  font-size: 1rem;
  line-height: 1.62;
}

.station--open p:not(.station__meta) {
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  max-width: 62ch;
}

.station--carry p:not(.station__meta) {
  max-width: 48ch;
}

.station--close p:not(.station__meta) {
  max-width: 58ch;
}

.seq__terminal {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 3px solid var(--on-paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-paper-mute);
}

.seq__terminal-mark {
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--on-paper);
}

/* --------------------------------------------------------------------------
   7. Request — issuing a work request
   -------------------------------------------------------------------------- */

.request {
  background: var(--basalt);
  background-image:
    linear-gradient(to right, rgba(228, 223, 212, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(228, 223, 212, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--on-ink);
  padding: clamp(2.75rem, 5.5vw, 4.75rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.request__head {
  padding-bottom: 1.15rem;
  border-bottom: 3px solid var(--rust);
}

.request__head h2 {
  color: var(--silt-4);
  margin: 0.7rem 0 0.9rem;
  max-width: 20ch;
}

.request__intro {
  color: var(--on-ink-mute);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.62;
  max-width: 70ch;
}

.request__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.85fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  padding: clamp(1.75rem, 3vw, 2.5rem) 0 clamp(1.75rem, 3vw, 2.5rem);
}

.request__items li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 10rem) minmax(0, 1fr);
  gap: 0.35rem 1.25rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-ink-hair);
}

.request__items li:first-child {
  border-top: 1px solid var(--rule-ink);
}

.ri__code {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust-bright);
}

.ri__name {
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silt-4);
}

.ri__desc {
  color: var(--on-ink-mute);
  font-size: 0.94rem;
  line-height: 1.55;
}

.request__return {
  border-top: 2px solid var(--rust);
  padding-top: 0.9rem;
}

.request__return-body {
  margin-top: 0.6rem;
  color: var(--on-ink-mute);
  font-size: 0.96rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   8. Colophon footer
   -------------------------------------------------------------------------- */

.colophon {
  background: var(--basalt);
  border-top: 3px solid var(--rust);
  color: var(--on-ink-mute);
}

.colophon__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.35rem 0 1.6rem;
}

.colophon__brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.colophon__brand img {
  width: 30px;
  height: 30px;
  flex: none;
}

.colophon__name,
.colophon__note {
  display: block;
}

.colophon__name {
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silt-4);
}

.colophon__note {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--on-ink-faint);
  line-height: 1.4;
}

.colophon__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.colophon__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--silt-4);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-ink);
}

.colophon__meta a:hover {
  color: var(--rust-bright);
  border-bottom-color: var(--rust-bright);
}

.colophon__meta p {
  color: var(--on-ink-faint);
  font-size: 0.66rem;
}

/* --------------------------------------------------------------------------
   9. Not found sheet
   -------------------------------------------------------------------------- */

.missing {
  background-color: var(--basalt);
  background-image:
    linear-gradient(to right, rgba(228, 223, 212, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(228, 223, 212, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--on-ink);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5.5rem);
  min-height: 60vh;
}

.missing__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  gap: clamp(1.75rem, 4vw, 4rem);
  align-items: start;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.missing__code {
  font-family: var(--font-cond);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: clamp(5rem, 17vw, 12rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: var(--rust);
  margin: 0 0 1rem;
}

.missing h1 {
  color: var(--silt-4);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  margin-bottom: 1rem;
  max-width: 18ch;
}

.missing__body {
  color: var(--on-ink-mute);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 52ch;
  margin-bottom: 1.75rem;
}

.missing__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.missing__aside {
  border-top: 2px solid var(--rust);
  padding-top: 0.9rem;
}

.missing__trace {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 4px;
  margin: 1.1rem 0;
}

.missing__trace > span {
  display: block;
  height: 4px;
  background: var(--rust);
}

.missing__trace > span:nth-child(1) { flex: 5; }
.missing__trace > span:nth-child(2) { flex: 2; opacity: 0.35; }
.missing__trace > span:nth-child(3) { flex: 1; opacity: 0.35; }

.missing__aside dl {
  border-top: 1px solid var(--rule-ink-hair);
}

.missing__aside dl > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule-ink-hair);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.missing__aside dt {
  color: var(--on-ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.64rem;
  padding-top: 0.06rem;
}

.missing__aside dd {
  margin: 0;
  color: var(--on-ink);
}

/* --------------------------------------------------------------------------
   10. Motion — minimal, useful, and opt-out aware
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .cover__title,
  .cover__brief,
  .topo {
    opacity: 0;
    animation: sheet-in 520ms var(--ease) forwards;
  }

  .cover__title { animation-delay: 40ms; }
  .cover__brief { animation-delay: 140ms; }
  .topo        { animation-delay: 240ms; }

  .link--variable .link__trace > span:nth-child(3) {
    animation: link-drop 4.5s steps(1, end) infinite;
  }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes link-drop {
  0%, 45%   { opacity: 0.45; }
  50%, 95%  { opacity: 0.08; }
  100%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   11. Responsive — tablet
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .cover__head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: clamp(1.5rem, 4vw, 2.5rem);
  }

  .cover__brief {
    max-width: 560px;
  }

  .topo__rail {
    grid-template-columns: 1fr;
  }

  .node {
    border-left-width: 4px;
  }

  /* Links rotate to vertical connectors between stacked nodes. */
  .link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 0.25rem 1rem;
    text-align: left;
    padding: 0.9rem 0 0.9rem 0.35rem;
  }

  .link__trace {
    grid-column: 1;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3px;
    height: 54px;
    margin-inline: auto;
  }

  .link__trace > span {
    width: 3px;
    height: auto;
  }

  .link--steady .link__trace > span {
    flex: 1 1 auto;
  }

  .link__label,
  .link__note {
    grid-column: 2;
  }

  .item {
    grid-template-columns: 68px minmax(0, 1fr);
    grid-template-areas:
      "code name"
      "code body"
      "stub stub";
    row-gap: 0.75rem;
  }

  .stub {
    margin-top: 0.35rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.25rem;
  }

  .stub > div {
    border-bottom: 0;
  }

  .head-rule {
    grid-template-columns: 1fr;
    row-gap: 0.7rem;
  }

  .head-rule h2 {
    grid-row: 2;
    max-width: 22ch;
  }

  .head-rule__note {
    grid-column: 1;
    grid-row: 3;
  }

  .note__sheet {
    grid-template-columns: 1fr;
  }

  .note__margin {
    max-width: 520px;
  }

  .chan {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .chan dd {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .chan__gauge {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    padding-top: 0;
  }

  .chan__trace {
    flex: 1 1 auto;
    max-width: 200px;
  }

  .request__grid {
    grid-template-columns: 1fr;
  }

  .missing__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   12. Responsive — phone
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  :root {
    --gutter: 1.05rem;
  }

  body {
    font-size: 16px;
    background-size: 24px 24px;
  }

  .masthead__inner {
    flex-wrap: wrap;
    gap: 0.15rem 1rem;
    padding-top: 0.5rem;
  }

  .masthead__mail {
    font-size: 0.68rem;
    min-height: 32px;
  }

  .index-tabs__list {
    padding-top: 0.5rem;
  }

  .index-tabs li {
    flex: 1 1 auto;
  }

  .index-tabs a {
    width: 100%;
    justify-content: flex-start;
    padding: 0.7rem 0.65rem 0.6rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .cover__sheet::before,
  .cover__sheet::after {
    display: none;
  }

  .cover__title {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 2.5rem);
    line-height: 1;
    overflow-wrap: normal;
    word-break: normal;
  }

  .cover__title br {
    display: block;
  }

  .issue {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.85rem 0.95rem 1rem;
  }

  .issue__arrow {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.35rem;
  }

  .node__name {
    font-size: 1.75rem;
  }

  .note__body {
    padding-left: 1rem;
  }

  .note__margin li {
    grid-template-columns: 5.75rem minmax(0, 1fr);
    gap: 0.6rem;
    font-size: 0.72rem;
  }

  .phase__bar,
  .phase__bar--b {
    padding: 0.5rem 0.6rem;
  }

  .phase__count {
    margin-left: 0;
    width: 100%;
  }

  .item {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 0.85rem;
  }

  .item__code {
    width: 44px;
    height: 44px;
    font-size: 0.92rem;
  }

  .item--lead .item__code {
    width: 48px;
    height: 48px;
    font-size: 1.05rem;
  }

  .item__name,
  .item--lead .item__name {
    font-size: 1.32rem;
    line-height: 1.05;
  }

  .stub {
    grid-template-columns: minmax(0, 1fr);
    grid-column: 1 / -1;
  }

  .stub > div {
    grid-template-columns: 6.75rem minmax(0, 1fr);
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--rule-paper-hair);
  }

  .stub > div:last-child {
    border-bottom: 0;
  }

  .plate {
    border-left-width: 3px;
    padding: 1rem 0.9rem 1.1rem;
  }

  .chan dt {
    font-size: 1.15rem;
  }

  .chan__gauge {
    flex-wrap: wrap;
  }

  .chan__trace {
    max-width: 150px;
  }

  .stations::before {
    left: 6px;
  }

  .station {
    padding-left: 1.85rem;
  }

  .station::before {
    width: 14px;
    height: 14px;
  }

  .station--carry,
  .station--close {
    margin-left: 0;
  }

  .station--carry::after,
  .station--close::after {
    display: none;
  }

  .station--open h3 { font-size: 1.7rem; }
  .station--close h3 { font-size: 1.5rem; }
  .station--carry h3 { font-size: 1.3rem; }

  .request__items li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
    padding: 0.75rem 0;
  }

  .colophon__inner {
    gap: 1rem;
  }

  .colophon__meta {
    align-items: flex-start;
    text-align: left;
  }

  .missing__code {
    font-size: clamp(4.5rem, 30vw, 8rem);
  }

  .missing__actions {
    width: 100%;
  }

  .missing__actions .issue {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .index-tabs a {
    padding-inline: 0.5rem;
    gap: 0.35rem;
  }

  .note__margin li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .stub > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
}
