/* ============================================================
   MDS LOGISTICS — ART DIRECTION LAYER
   ------------------------------------------------------------
   Loaded AFTER tokens.css. This file adds an engineering-drawing
   register on top of the house grammar. It does not override any
   house constant: the Bodoni display face, the Archivo UI face,
   the type scale, the credit-block grid, the lockup and the
   colophon all come through untouched from tokens.css.

   What it adds is a third, subordinate voice — a monospace data
   face used only for labels, coordinates, step numbers and
   schematic annotation — plus the drawing surfaces those labels
   sit on: blueprint rules, node-and-edge diagrams, failure
   markers and the two signature interactions.

   Same architect. Different building.
   ============================================================ */

:root {
  --data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* schematic-specific derivations of the logistics theme */
  --blueprint:  color-mix(in srgb, var(--line) 55%, transparent);
  --signal:     var(--accent);
  --signal-dim: var(--accent-dim);
  /* Rust, deliberately distinct from the amber signal. Set light
     enough to clear 4.5:1 as text on both the ground and the raised
     ground, since it labels content and is not merely decorative. */
  --fault:      #D97A50;
  --fault-dim:  #7A3F22;
  --ok:         #6E9A78;
}

/* ============================================================
   1. DATA TYPE — the third voice
   ============================================================ */

.data {
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .06em;
  color: var(--type-3);
  text-transform: uppercase;
}
.data--signal { color: var(--signal); }
.data--bright { color: var(--type-2); }

/* A numeric prefix, as on a drawing sheet: 01 / 02 / 03 */
.sheetno {
  font-family: var(--data);
  font-size: var(--step--1);
  color: var(--signal);
  letter-spacing: .1em;
}

/* Title-block strip — the annotation bar along the top of a drawing */
.titleblock {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2.5rem;
  padding: .85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .08em;
  color: var(--type-2);
  text-transform: uppercase;
  max-width: 78rem;
}
.titleblock span strong {
  font-weight: 500;
  color: var(--type-2);
}

/* ============================================================
   2. BLUEPRINT SURFACES
   ============================================================ */

/* A drafting grid, held deliberately near the threshold of
   visibility — it should read as paper, not as decoration. */
.band--blueprint {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.band--blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--blueprint) 1px, transparent 1px),
    linear-gradient(to bottom, var(--blueprint) 1px, transparent 1px);
  background-size: 5.5rem 5.5rem;
  mask-image: radial-gradient(ellipse 85% 70% at 22% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 22% 30%, #000 0%, transparent 78%);
  pointer-events: none;
}

/* Section rule carrying a mono label, as a dimension line does */
.dimline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2rem;
  max-width: 78rem;
}
.dimline span {
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--type-2);
  white-space: nowrap;
}
.dimline::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============================================================
   3. THE OPERATING CYCLE — signature interaction 1
   ------------------------------------------------------------
   Seven steps. Rendered as a tablist so it is keyboard-operable
   and announced correctly; styled as a process schematic.
   ============================================================ */

.cycle {
  max-width: 78rem;
}

.cycle-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.cycle-step {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--type-2);
  font-family: var(--ui);
  font-size: .95rem;
  text-align: left;
  padding: 1.5rem 1rem 1.6rem;
  cursor: pointer;
  position: relative;
  transition: background-color .18s ease, color .18s ease;
}
.cycle-step:last-child { border-right: 0; }
.cycle-step:hover { background: color-mix(in srgb, var(--signal) 7%, transparent); color: var(--type); }

.cycle-step .n {
  display: block;
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .1em;
  color: var(--type-3);
  margin-bottom: .7rem;
}
.cycle-step .t {
  display: block;
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1.2;
  color: inherit;
}

/* The node marker sitting on the top rule of the strip */
.cycle-step::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 1rem;
  width: 7px;
  height: 7px;
  background: var(--ground);
  border: 1px solid var(--type-3);
  border-radius: 50%;
  transition: background-color .18s ease, border-color .18s ease;
}

.cycle-step[aria-selected="true"] {
  background: var(--ground-raised);
  color: var(--type);
}
/* Inside a raised band the selected fill would match its surroundings
   and disappear, so it inverts to the base ground instead. */
.band--raised .cycle-step[aria-selected="true"] { background: var(--ground); }
.cycle-step[aria-selected="true"] .n { color: var(--signal); }
.cycle-step[aria-selected="true"]::before {
  background: var(--signal);
  border-color: var(--signal);
}

.cycle-panel[hidden] { display: none; }
.cycle-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.cycle-panel h3 { margin-bottom: .9rem; }
.cycle-panel .outputs {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.cycle-panel .outputs li {
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--type-2);
  font-size: .95rem;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .75rem;
}
.cycle-panel .outputs li::before {
  content: "—";
  font-family: var(--data);
  color: var(--signal-dim);
}
.cycle-panel .outputs-label {
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--type-2);
  margin: 0 0 .9rem;
}

/* ============================================================
   4. THE OPERATIONAL X-RAY — signature interaction 2
   ------------------------------------------------------------
   A twelve-node company operating chain. Nodes carrying a known
   failure mode are marked; selecting any node explains the
   failure and where MDS intervenes.
   ============================================================ */

.xray {
  max-width: 78rem;
}

.xray-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1.75rem;
}
.xray-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--type-2);
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .55rem 1rem;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.xray-toggle:hover { color: var(--type); border-color: var(--type-3); }
.xray-toggle[aria-pressed="true"] {
  border-color: var(--fault);
  color: var(--fault);
}
.xray-hint {
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .06em;
  color: var(--type-2);
  text-transform: uppercase;
}

/* The chain. Twelve stages do not fit on one legible row inside the
   house grid column, so it wraps into rows of six rather than
   scrolling — a chain that reads left-to-right, then wraps, is a
   familiar drawing convention; a 40px scrollbar reads as a defect. */
.xray-chain {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2rem 0;
  padding: 1.5rem 0 1.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.xray-node {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0 .85rem 0 0;
  text-align: left;
  position: relative;
  color: var(--type-2);
  font-family: var(--ui);
  transition: color .18s ease;
}
.xray-node:hover { color: var(--type); }

/* Connective edge, suppressed where a row ends. */
.xray-node::after {
  content: "";
  position: absolute;
  top: .45rem;
  left: 1rem;
  right: -.15rem;
  height: 1px;
  background: var(--line);
}
.xray-node:nth-child(6n)::after,
.xray-node:last-child::after { display: none; }

.xray-node .dot {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid var(--type-3);
  border-radius: 50%;
  background: var(--ground);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.xray-node .stage {
  display: block;
  font-family: var(--data);
  font-size: .64rem;
  letter-spacing: .05em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--type-2);
  margin-bottom: .35rem;
}
.xray-node .label {
  display: block;
  font-size: .92rem;
  line-height: 1.35;
}

.xray-node[aria-selected="true"] { color: var(--type); }
.xray-node[aria-selected="true"] .dot {
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 18%, transparent);
}
.xray-node[aria-selected="true"] .stage { color: var(--signal); }

/* Failure marking — only while the toggle is engaged */
.xray-chain[data-faults="on"] .xray-node[data-fault="yes"] .dot {
  border-color: var(--fault);
  background: var(--fault);
}
.xray-chain[data-faults="on"] .xray-node[data-fault="yes"][aria-selected="true"] .dot {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--fault) 22%, transparent);
}
.xray-chain[data-faults="on"] .xray-node[data-fault="yes"] .stage { color: var(--fault); }

/* The attribute must beat the display rule below, or every readout
   renders at once and the widget silently stops being a widget. */
.xray-readout[hidden] { display: none; }
.xray-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  padding-top: 2rem;
}
.xray-readout h3 { margin-bottom: .75rem; }
.readout-block .k {
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--type-2);
  display: block;
  margin-bottom: .55rem;
}
.readout-block + .readout-block { margin-top: 1.6rem; }
.readout-block p { margin: 0; color: var(--type-2); }
.readout-block--fault .k { color: var(--fault); }
.readout-block--mds .k { color: var(--signal); }

/* ============================================================
   5. BEFORE / AFTER — the transformation drawing
   ============================================================ */

.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0;
  max-width: 78rem;
  border: 1px solid var(--line);
}
.compare-col { padding: clamp(1.75rem, 3.5vw, 2.5rem); }
.compare-col + .compare-col { border-left: 1px solid var(--line); }
.compare-col--after { background: var(--ground-raised); }

.compare-col h3 {
  font-family: var(--data);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--type-2);
  margin-bottom: 1.75rem;
}
.compare-col--after h3 { color: var(--signal); }

.flowlist { list-style: none; margin: 0; padding: 0; }
.flowlist li {
  position: relative;
  padding: 0 0 1.5rem 1.75rem;
  color: var(--type-2);
  font-size: .98rem;
  line-height: 1.5;
}
.flowlist li:last-child { padding-bottom: 0; }
/* the vertical run between nodes */
.flowlist li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .95rem;
  bottom: -.2rem;
  width: 1px;
  background: var(--line);
}
.flowlist li:last-child::before { display: none; }
.flowlist li::after {
  content: "";
  position: absolute;
  left: 0;
  top: .5rem;
  width: 9px;
  height: 9px;
  border: 1px solid var(--type-3);
  border-radius: 50%;
  background: var(--ground);
}
.compare-col--before .flowlist li::after { border-color: var(--fault-dim); }
.compare-col--after .flowlist li { color: var(--type); }
.compare-col--after .flowlist li::after {
  border-color: var(--signal);
  background: var(--signal);
}
.compare-col--after .flowlist li::before { background: var(--signal-dim); }

/* ============================================================
   6. FIELD + DIGITAL — the bridge
   ============================================================ */

/* The two sides sit level; the chain label spans beneath them as a
   full-width span. Placing that unbreakable string in a middle
   column starves both sides and wraps every list item. */
.bridge {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 62rem;
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
}
.bridge-side { order: 1; }
.bridge-side h3 {
  font-family: var(--data);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--type-2);
  margin-bottom: 1rem;
}
.bridge-side ul { list-style: none; margin: 0; padding: 0; }
.bridge-side li {
  font-size: .95rem;
  color: var(--type-2);
  padding: .4rem 0;
}
.bridge-link {
  order: 2;
  grid-column: 1 / -1;
  font-family: var(--data);
  font-size: clamp(.68rem, 1.35vw, var(--step--1));
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
  text-align: center;
  padding: 0 .25rem;
}
.bridge-link::before,
.bridge-link::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--signal-dim);
  margin: .85rem 0;
}

/* ============================================================
   7. CARDS — solutions, industries, pathways
   ============================================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  max-width: 78rem;
}
.card {
  background: var(--ground);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  text-decoration: none;
  transition: background-color .18s ease;
}
a.card:hover { background: var(--ground-raised); }
.card .sheetno { margin-bottom: .4rem; }
.card h3 { font-size: var(--step-1); }
.card p { color: var(--type-2); font-size: .95rem; margin: 0; }
.card .more {
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--data);
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
}

/* ============================================================
   8. PATHWAY SELECTOR — conversion routing
   ============================================================ */

.pathways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  max-width: 78rem;
  margin-top: 2rem;
}
.pathway {
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  display: block;
  transition: border-color .18s ease, background-color .18s ease;
}
.pathway:hover { border-color: var(--signal); background: var(--ground-raised); }
.pathway .k {
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--type);
  display: block;
  margin-bottom: .35rem;
}
.pathway .d { font-size: .9rem; color: var(--type-2); }

/* ============================================================
   9. FORM EXTENSIONS
   ============================================================ */

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 1.25rem;
}
.field .hint {
  display: block;
  font-size: var(--step--1);
  color: var(--type-2);
  margin-top: .35rem;
}
.field--required label::after {
  content: " *";
  color: var(--signal);
}
/* honeypot — present for bots, gone for people and screen readers */
.trap {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.formstatus {
  margin-top: 1.25rem;
  padding: .9rem 1.1rem;
  border-left: 2px solid var(--signal);
  background: var(--ground-raised);
  font-size: .95rem;
  color: var(--type-2);
}
.formstatus[hidden] { display: none; }
.formstatus--error { border-left-color: var(--fault); }

/* ============================================================
   10. NOTE — used where content is deliberately not yet published
   ============================================================ */

.note {
  border-left: 2px solid var(--line);
  padding: .3rem 0 .3rem 1.25rem;
  color: var(--type-2);
  font-size: .95rem;
  max-width: var(--measure);
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
  .cycle-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cycle-step:nth-child(4) { border-right: 0; }
  .cycle-step:nth-child(n+5) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .cycle-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cycle-step:nth-child(4) { border-right: 1px solid var(--line); }
  .cycle-step:nth-child(even) { border-right: 0; }
  .cycle-step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cycle-panel,
  .xray-readout { grid-template-columns: minmax(0, 1fr); }
  .xray-chain { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 0; }
  .xray-node:nth-child(6n)::after { display: block; }
  .xray-node:nth-child(3n)::after { display: none; }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--line); }
  .bridge { grid-template-columns: minmax(0, 1fr); }
  /* Narrow, the chain label must be allowed to wrap or it sets the
     page width on its own. */
  .bridge-link { white-space: normal; line-height: 2; }
  .bridge-link::before, .bridge-link::after { margin: .6rem 0; }
  .titleblock { gap: .35rem 1.5rem; }
}

@media (max-width: 480px) {
  .xray-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xray-node:nth-child(3n)::after { display: block; }
  .xray-node:nth-child(2n)::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cycle-step,
  .xray-node,
  .xray-node .dot,
  .card,
  .pathway { transition: none; }
}
