/* Design Hub pieces on code-connected-design.html (site-src/articles/design-hub.html).
   Site rules only (Samuel, 14 Oct 2026): Geist and Geist Mono, Reach theme greys, 6px radii, flat.
   Solid ink marks what is built; a dashed outline marks what is planned. No colour literals: every
   colour is a site token or a canvas role (--fg, --fg-2, --fg-3, --rule, --caption). */

/* Pieces wider than the reading measure (design skill §3: wide figures up to 1120px) */
.flow > .hub-wide { width: min(100% - 2 * var(--inset), var(--wide)); }
.flow > .hub-wide, .flow > .hub-compare, .flow > .hub-card { margin-block: var(--figure-gap); }

/* Mono label: same voice as .fig__code and .meta dt */
.hub-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-small);
  line-height: var(--small-lh);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Cards: paper with a hairline; tint = paper-2; ink = the built / emphasised state; dashed = planned */
.hub-card {
  display: grid;
  align-content: start;
  gap: var(--s-8);
  padding: var(--s-24);
  border: 1px solid var(--rule);
  border-radius: var(--r-inline);
  background: var(--paper);
}
.hub-card--tint { background: var(--paper-2); border-color: var(--paper-2); }
.hub-card--dashed { border-style: dashed; border-color: var(--fg-3); }
.hub-card--ink {
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --focus: var(--ink);
  background: var(--paper-ink);
  border-color: var(--paper-ink);
  color: var(--ink);
}
.hub-card__title { font-size: var(--fs-body); line-height: 1.35; font-weight: 500; letter-spacing: -.01em; color: var(--fg); }
.hub-card__title--big { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -.015em; }
.hub-small { font-size: var(--fs-caption); line-height: 1.55; color: var(--fg-2); }
.hub-small strong, .hub-list strong { font-weight: 500; color: var(--fg); }

/* Overview numbers */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-32);
  padding-block: var(--s-32);
  border-block: 1px solid var(--rule);
}
.hub-stat { display: grid; align-content: start; gap: var(--s-8); }
.hub-stat__num { font-size: var(--fs-h2); line-height: 1; font-weight: 500; letter-spacing: -.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.hub-stat__text { font-size: var(--fs-caption); line-height: 1.55; color: var(--caption); }

/* Two- and three-up rows */
.hub-compare, .hub-outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-16); }
.hub-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-16); }

/* Lists inside cards */
.hub-list { display: grid; gap: var(--s-8); }
.hub-list li {
  position: relative;
  padding-left: var(--s-16);
  font-size: var(--fs-caption);
  line-height: 1.55;
  color: var(--fg-2);
}
.hub-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .65em;
  width: var(--dot);
  height: 1px;
  background: var(--fg-3);
}

/* Diagrams: real figures, so they take .fig's wide width and caption */
.hub-diagram__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-8) var(--s-24);
  margin-bottom: var(--s-16);
}
.hub-diagram__title { font-size: var(--fs-h3); line-height: 1.25; font-weight: 500; letter-spacing: -.015em; color: var(--fg); }
.hub-diagram figcaption { margin-top: var(--s-12); }
.hub-scroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: var(--r-inline); }
.hub-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.hub-svg { display: block; width: 100%; height: auto; font-family: var(--font-sans); }
.hub-swipe { display: none; margin-bottom: var(--s-8); }

/* SVG paint, all from tokens */
.f-ink { fill: var(--paper-ink); }
.f-deep { fill: var(--line); }
.f-tint { fill: var(--paper-2); }
.f-paper { fill: var(--paper); }
.f-muted { fill: var(--paper-muted); }
.f-none { fill: none; }
.s-ink { stroke: var(--paper-ink); }
.s-muted { stroke: var(--paper-muted); }
.s-line { stroke: var(--paper-line); }
.t-ink { fill: var(--paper-ink); }
.t-muted { fill: var(--paper-muted); }
.t-meta { fill: var(--paper-meta); }
.t-inv { fill: var(--ink); }
.t-inv2 { fill: var(--ink-2); }
.t-inv3 { fill: var(--ink-3); }
.t-strong, .t-title { font-weight: 500; }
.t-title { letter-spacing: -.01em; }
.t-mono { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; }

/* Diagram B: fork × brand = page */
.hub-equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: var(--s-12); }
.hub-eq__op { align-self: center; font-size: var(--fs-h3); line-height: 1; color: var(--fg-3); }

/* Diagram C: two inputs, one engine, guardrails */
.hub-model { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: var(--s-16); }
.hub-model__col { display: grid; gap: var(--s-16); }

/* Diagram E: roadmap */
.hub-roadmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-16); }

/* Figure HUB 03: four brands */
.hub-brands__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-16); }
.hub-brands__grid li { display: grid; gap: var(--s-8); }
.hub-brands figcaption { margin-top: var(--s-12); }

/* Closing line */
.hub-close { margin-block: var(--chapter-gap) 0; padding-top: var(--s-32); border-top: 1px solid var(--rule); }
.hub-close__line { font-size: var(--fs-closing); line-height: 1.05; font-weight: 500; letter-spacing: -.03em; color: var(--fg); margin-bottom: var(--s-16); }

/* Tablet: three-up rows and the equation stack */
@media (max-width: 899px) {
  .hub-stats, .hub-roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-trio, .hub-model { grid-template-columns: minmax(0, 1fr); }
  .hub-equation { grid-template-columns: minmax(0, 1fr); }
  .hub-eq__op { justify-self: center; }
}

/* Below 1200px the wide container is narrower than the 1040-unit diagrams: scroll them at full size
   instead of shrinking, so SVG labels never drop below 11px (design skill §1 [S1]). */
@media (max-width: 1199px) {
  .hub-swipe { display: block; }
  .hub-scroll .hub-svg { width: 1040px; max-width: none; }
}

/* Phone */
@media (max-width: 599px) {
  .hub-compare, .hub-outcomes, .hub-roadmap, .hub-brands__grid { grid-template-columns: minmax(0, 1fr); }
  .hub-stats { gap: var(--s-24); }
}
