/* The /technology/ page: infographics drawn from the registry (tools/technology-page.js).
 * Tokens come from assets/fz-ui.css (DESIGN.md). Diagrams are HTML grids with inline SVG
 * connectors and packets; the packets run only while a diagram is in view (`.is-live`,
 * set by assets/fz-tech.js) and never under prefers-reduced-motion. Nothing here needs
 * script to read: the same facts are plain text in the page. */

.tech-page .tb-band { background: var(--bg-1); border-block: 1px solid var(--hair); }
.tech-page .tb-fig { margin: 0; }
.tech-page .tb-cap { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 22px 0 10px; }
.tech-page .tb-cap-text { font-size: 15px; color: var(--fg-3); margin-top: 16px; max-width: 72ch; }
.tech-page .tb-note { font: 400 12px/1.5 var(--mono); color: var(--fg-3); margin-top: 18px; }
.tech-page .tb-sec-wide .wrap { max-width: none; }
.tech-page .tb-num { font-variant-numeric: tabular-nums; }

/* ---- chips: mono labels; status by border and dot ---- */
.tech-page .tb-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 10px;
  border: 1px solid var(--hair-3); font: 500 12.5px/1.2 var(--mono); letter-spacing: .02em;
  color: var(--fg-2); background: var(--bg); white-space: nowrap; max-width: 100%;
}
.tech-page .tb-chip.is-live-chip { border-color: var(--acc); color: var(--fg); background: color-mix(in srgb, var(--acc) 12%, var(--bg)); }
.tech-page .tb-chip.is-planned { border-style: dashed; color: var(--fg-3); }
.tech-page .tb-chip.is-none { border-style: dashed; color: var(--fg-3); }
.tech-page .tb-chip--v { border-color: color-mix(in srgb, var(--t, var(--acc)) 55%, transparent); }
.tech-page .tb-chip--v.is-planned { border-color: color-mix(in srgb, var(--t, var(--acc)) 45%, transparent); }
.tech-page .tb-dot { width: 8px; height: 8px; flex: none; background: var(--t, var(--acc)); }
.tech-page .tb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tech-page .tb-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }

/* ---- KPI band ---- */
.tech-page .tb-band--kpi { padding: clamp(56px, 7vw, 96px) 0; }
.tech-page .tb-kicker { font: 500 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 36px; }
.tech-page .tb-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.tech-page .tb-kpi { padding: 0 24px; border-left: 1px solid var(--hair-2); min-width: 0; }
.tech-page .tb-kpi:first-child { border-left: 0; padding-left: 0; }
.tech-page .tb-kpi dt { margin: 0 0 16px; }
.tech-page .tb-kpi dd { margin: 0; }
.tech-page .tb-kpi-l { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.tech-page .tb-num {
  display: block; font-family: var(--sans); font-weight: 800; font-stretch: 62%;
  font-size: clamp(64px, 8.4vw, 128px); line-height: .9; letter-spacing: -.035em; color: var(--fg);
}
.tech-page .tb-kpi-s { display: block; margin-top: 16px; font: 400 13px/1.45 var(--mono); color: var(--fg-3); }

/* ---- how it is built: stepper ---- */
.tech-page .tb-stepper { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 64px 0 0; padding: 0; }
.tech-page .tb-stepper::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 1px; background: var(--hair-3); transform-origin: left center; }
.tech-page .tb-step { position: relative; padding: 52px 28px 0 0; }
.tech-page .tb-step:first-child { padding-left: 0; }
.tech-page .tb-step-n { position: absolute; top: 0; left: 0; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--hair-3); background: var(--bg); font: 500 12px var(--mono); color: var(--fg-2); }
.tech-page .tb-step-l { display: block; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.tech-page .tb-step-h { margin: 12px 0 10px; font: 600 24px/1.1 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-step p { margin: 0; color: var(--fg-2); font-size: 16px; line-height: 1.5; max-width: 40ch; }
.tech-page .tb-stepper.is-live::before { animation: tb-draw 1.4s var(--ease) both; }
@keyframes tb-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- layers ---- */
.tech-page .tb-layers { display: flex; flex-direction: column; border: 1px solid var(--hair-2); }
.tech-page .tb-layer { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 30px 34px; background: var(--bg); border-top: 1px solid var(--hair-2); }
.tech-page .tb-layer:first-child { border-top: 0; }
.tech-page .tb-layer--6 { background: var(--bg-1); }
.tech-page .tb-layer-k { display: flex; flex-direction: column; gap: 10px; }
.tech-page .tb-layer-n { font: 600 13px var(--mono); color: var(--acc); }
.tech-page .tb-layer-t { font: 500 13px/1.2 var(--mono); letter-spacing: .1em; color: var(--fg-2); }
.tech-page .tb-layer-h { margin: 0 0 10px; font: 600 clamp(20px, 1.8vw, 26px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-layer-p { margin: 0 0 20px; color: var(--fg-2); font-size: 16px; line-height: 1.55; max-width: 70ch; }
.tech-page .tb-harness { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start; }
.tech-page .tb-harness-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tech-page .tb-harness-name { font: 600 13px var(--mono); color: var(--t, var(--fg)); }
.tech-page .tb-harness-cells { min-width: 0; }
.tech-page .tb-harness-cells .tb-cap { margin-top: 0; }
.tech-page .tb-harness-cells .tb-cap + .tb-chips { margin-bottom: 14px; }

/* connectors: an SVG column between layers; the packets climb it */
.tech-page .tb-link { height: 44px; position: relative; margin-left: 0; }
.tech-page .tb-link-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.tech-page .tb-track { stroke: var(--hair-3); stroke-width: 1; fill: none; }
.tech-page .tb-pulse { stroke: var(--acc); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 12; fill: none; opacity: 0; }
.tech-page .is-live .tb-pulse { opacity: 1; animation: tb-climb 1.8s linear infinite; }
@keyframes tb-climb { to { stroke-dashoffset: -28; } }

.tech-page .tb-shelves { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.tech-page .tb-shelf { border-left: 1px solid var(--hair-2); padding: 0 16px; min-width: 0; }
.tech-page .tb-shelf:first-child { border-left: 0; padding-left: 0; }
.tech-page .tb-shelf-h { margin: 0 0 14px; font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.tech-page .tb-marks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 10px; }
.tech-page .tb-markcell { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.tech-page .tb-mark-img { width: 56px; height: 56px; box-sizing: border-box; padding: 6px; border: 1px solid color-mix(in srgb, var(--t, var(--acc)) 50%, transparent); background: color-mix(in srgb, var(--t, var(--acc)) 9%, var(--bg)); }
.tech-page .tb-markname { font: 500 12.5px/1.3 var(--mono); color: var(--fg-2); overflow-wrap: anywhere; }
.tech-page .tb-mono { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--t, var(--acc)) 50%, transparent); color: var(--t, var(--acc)); font: 700 22px var(--sans); }
.tech-page .tb-agents { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 22px; padding: 0; }
.tech-page .tb-agent-l { display: flex; flex-direction: column; gap: 6px; min-width: 150px; padding: 12px 16px; border: 1px solid var(--hair-3); }
.tech-page .tb-agent-n { font: 600 12px var(--mono); letter-spacing: .1em; color: var(--fg-2); }
.tech-page .tb-agent-c { font: 500 15px var(--sans); color: var(--fg); }
.tech-page .tb-colonizer { display: flex; align-items: center; gap: 16px; padding-top: 20px; border-top: 1px solid var(--hair-2); }
.tech-page .tb-colonizer p { margin: 0; color: var(--fg-2); font-size: 16px; }
.tech-page .tb-markcell--inline { flex: none; }
.tech-page .tb-colonizer .tb-mark-img { width: 48px; height: 48px; }

/* ---- request flow: the canvas (desktop) ---- */
.tech-page .tb-flow { position: relative; height: 470px; }
.tech-page .tb-flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tech-page .tb-edge { stroke: var(--fg-3); stroke-width: 1.5; fill: none; }
.tech-page .tb-edge.is-planned { stroke: var(--fg-4); stroke-dasharray: 6 7; }
.tech-page .tb-packet { stroke: var(--acc); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 16; opacity: 0; }
.tech-page .is-live .tb-packet { opacity: 1; animation: tb-climb 1.4s linear infinite; }
.tech-page .tb-flow-nodes { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; }
.tech-page .tb-node { position: absolute; box-sizing: border-box; margin: 0; background: var(--bg); border: 1px solid var(--hair-3); border-top: 2px solid var(--t, var(--fg-3)); padding: 16px 18px; min-width: 0; overflow: hidden; }
.tech-page .tb-node-in { position: relative; }
.tech-page .tb-node.is-planned { border-style: dashed; border-top-style: dashed; }
.tech-page .tb-node--person { border-top-color: var(--fg-3); }
.tech-page .tb-node-in { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; height: 100%; }
.tech-page .tb-node-mark { display: block; }
.tech-page .tb-node-mark .tb-mark-img, .tech-page .tb-node-mark .tb-mono { width: 40px; height: 40px; padding: 5px; }
.tech-page .tb-node-n { margin: 0; font: 600 clamp(17px, 1.5vw, 21px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-node-r { margin: 0; font-size: 14px; line-height: 1.4; color: var(--fg-3); }
.tech-page .tb-node-in .tb-chip { position: absolute; top: 12px; right: 12px; min-height: 22px; font-size: 11.5px; }

/* ---- ports matrix ---- */
.tech-page .tb-matrix { border: 1px solid var(--hair-2); }
.tech-page .tb-matrix-h, .tech-page .tb-port { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 2fr); gap: 24px; padding: 0 28px; }
.tech-page .tb-matrix-h { padding-block: 14px; background: var(--bg-1); font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.tech-page .tb-matrix-b { list-style: none; margin: 0; padding: 0; }
.tech-page .tb-port { padding-block: 20px; border-top: 1px solid var(--hair-2); align-items: center; }
.tech-page .tb-port-n { margin: 0; font: 600 16px var(--mono); color: var(--fg); }
.tech-page .tb-port-a { margin: 0; font-size: 15px; color: var(--fg-2); }
.tech-page .tb-adapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- design rules ---- */
.tech-page .tb-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border: 1px solid var(--hair-2); }
.tech-page .tb-rule { display: flex; flex-direction: column; gap: 14px; padding: 28px 26px 30px; border-left: 1px solid var(--hair-2); min-width: 0; }
.tech-page .tb-rule:first-child { border-left: 0; }
.tech-page .tb-rule-n { margin: 0; font: 600 13px var(--mono); color: var(--acc); }
.tech-page .tb-rule-h { margin: 0; font: 600 clamp(19px, 1.6vw, 23px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-rule-p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--fg-2); }
.tech-page .tb-mini { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.tech-page .tb-mini--row { flex-direction: row; flex-wrap: wrap; align-items: center; }
.tech-page .tb-mini-c { font: 500 12px var(--mono); padding: 5px 9px; border: 1px solid var(--hair-3); color: var(--fg-2); }
.tech-page .tb-mini-c.is-no { color: var(--fg-4); text-decoration: line-through; border-style: dashed; }
.tech-page .tb-mini-c.is-ok { border-color: var(--acc); color: var(--fg); }
.tech-page .tb-mini-a { color: var(--fg-3); font-size: 13px; }
.tech-page .tb-mini--boxes { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.tech-page .tb-box { flex: 1 1 60px; display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 1px solid var(--hair-3); font: 500 11px/1.2 var(--mono); color: var(--fg-2); }
.tech-page .tb-mini-note { flex-basis: 100%; margin: 4px 0 0; font: 500 11.5px var(--mono); color: var(--fg-3); }
.tech-page .tb-mini-note--no { color: var(--fg-4); }

/* ---- milestones ---- */
.tech-page .tb-ms-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; position: relative; }
.tech-page .tb-ms-row::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: var(--hair-3); transform-origin: left center; }
.tech-page .tb-ms-row.is-live::before { animation: tb-draw 1.4s var(--ease) both; }
.tech-page .tb-ms { position: relative; padding: 46px 26px 0 0; min-width: 0; }
.tech-page .tb-ms::before { content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; box-sizing: border-box; border: 1px solid var(--fg-3); background: var(--bg); border-radius: 0; }
.tech-page .tb-ms.is-done::before { background: var(--acc); border-color: var(--acc); }
.tech-page .tb-ms.is-progress::before { border-style: dashed; border-color: var(--acc); }
.tech-page .tb-ms-code { display: block; font: 600 13px var(--mono); color: var(--fg-3); letter-spacing: .08em; }
.tech-page .tb-ms-state { display: inline-block; margin: 6px 0 12px; font: 500 12px var(--mono); color: var(--acc); letter-spacing: .04em; }
.tech-page .tb-ms.is-progress .tb-ms-state { color: var(--fg-2); }
.tech-page .tb-ms-h { margin: 0 0 8px; font: 600 clamp(19px, 1.7vw, 24px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-ms p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--fg-2); max-width: 36ch; }
.tech-page .tb-facts { margin-top: 56px; }

/* ---- security: nested layers, outer first ---- */
.tech-page .tb-sec { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--hair-2); }
.tech-page .tb-sec-l {
  --i: 0;
  display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; align-items: start;
  padding: 24px 30px; margin: 0 calc(var(--i) * 2.2%); border-top: 1px solid var(--hair-2);
  background: color-mix(in srgb, var(--fg) calc(2.5% + var(--i) * 1.1%), var(--bg));
}
.tech-page .tb-sec-l:first-child { border-top: 0; }
.tech-page .tb-sec-k { font: 600 12.5px var(--mono); letter-spacing: .08em; color: var(--acc); padding-top: 4px; }
.tech-page .tb-sec-h { margin: 0; font: 600 clamp(19px, 1.6vw, 23px)/1.2 var(--sans); letter-spacing: -.02em; color: var(--fg); }
.tech-page .tb-sec-l p:not(.tb-sec-k) { margin: 0; font-size: 16px; line-height: 1.55; color: var(--fg-2); }

/* ---- licences ---- */
.tech-page .tb-lic-block .h3 { margin: 0 0 14px; }
.tech-page .tb-lic-lede { margin-bottom: 36px; }
.tech-page .tb-bar { display: flex; height: 56px; border: 1px solid var(--hair-3); }
.tech-page .tb-seg { min-width: 0; }
.tech-page .tb-seg.is-mit { background: var(--acc); }
.tech-page .tb-seg.is-apache { background: color-mix(in srgb, var(--acc) 45%, var(--bg)); }
.tech-page .tb-seg.is-none { background: repeating-linear-gradient(135deg, var(--hair-3) 0 1px, transparent 1px 7px); }
.tech-page .tb-lic-grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); border-top: 1px solid var(--hair-2); }
.tech-page .tb-lic { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 14px; border-bottom: 1px solid var(--hair-2); border-left: 3px solid var(--t, var(--fg-3)); min-width: 0; }
.tech-page .tb-lic.is-none { border-left-style: dashed; }
.tech-page .tb-lic .tb-mark-img { width: 44px; height: 44px; padding: 5px; flex: none; }
.tech-page .tb-lic .tb-mono { width: 44px; height: 44px; flex: none; }
.tech-page .tb-lic-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.tech-page .tb-lic-n { display: block; font: 600 16px/1.2 var(--sans); color: var(--fg); overflow-wrap: break-word; }
.tech-page .tb-lic .tb-chip { min-height: 24px; font-size: 11.5px; }

/* ---- reveal targets only shown when they are on screen (fz-ui.js owns [data-rv]) ---- */

/* ---- narrower screens: the same content, stacked ---- */
@media (max-width: 1100px) {
  .tech-page .tb-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-page .tb-rule:nth-child(3) { border-left: 0; }
  .tech-page .tb-rule:nth-child(n+3) { border-top: 1px solid var(--hair-2); }
  .tech-page .tb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 48px; }
  .tech-page .tb-kpi:nth-child(4) { border-left: 0; padding-left: 0; }
  .tech-page .tb-shelves { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .tech-page .tb-shelf:nth-child(odd) { border-left: 0; padding-left: 0; }
}
@media (max-width: 1023px) {
  .tech-page .tb-flow { height: auto; display: flex; flex-direction: column; gap: 14px; }
  .tech-page .tb-flow-svg { display: none; }
  .tech-page .tb-flow-nodes { position: static; display: flex; flex-direction: column; gap: 14px; }
  .tech-page .tb-node { position: static !important; width: auto !important; height: auto !important; }
  .tech-page .tb-node-in .tb-chip { position: static; align-self: flex-start; margin-top: 4px; }
  .tech-page .tb-harness { grid-template-columns: 1fr; gap: 16px; }
  .tech-page .tb-layer { grid-template-columns: 1fr; gap: 14px; padding: 26px 22px; }
  .tech-page .tb-layer-k { flex-direction: row; align-items: center; gap: 14px; }
  .tech-page .tb-matrix-h { display: none; }
  .tech-page .tb-port { grid-template-columns: 1fr; gap: 10px; padding: 20px 22px; }
  .tech-page .tb-matrix-h, .tech-page .tb-port { padding-inline: 22px; }
  .tech-page .tb-sec-l { grid-template-columns: 1fr; gap: 10px; padding: 22px; margin: 0 calc(var(--i) * 1.2%); }
  .tech-page .tb-lic-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .tech-page .tb-stepper { grid-template-columns: 1fr; gap: 36px; margin-top: 44px; }
  .tech-page .tb-stepper::before { top: 0; bottom: 0; left: 15px; right: auto; width: 1px; height: auto; transform-origin: top center; }
  .tech-page .tb-stepper.is-live::before { animation-name: tb-draw-v; }
  .tech-page .tb-step { padding: 0 0 0 58px; }
  .tech-page .tb-step:first-child { padding-left: 58px; }
  .tech-page .tb-step-n { left: 0; }
  .tech-page .tb-ms-row { grid-template-columns: 1fr; gap: 34px; }
  .tech-page .tb-ms-row::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; transform-origin: top center; }
  .tech-page .tb-ms { padding: 0 0 0 34px; }
  .tech-page .tb-ms::before { left: 0; top: 2px; }
  .tech-page .tb-ms-row.is-live::before { animation-name: tb-draw-v; }
  .tech-page .tb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .tech-page .tb-kpi { padding: 0 0 0 18px; border-left: 1px solid var(--hair-2); }
  .tech-page .tb-kpi:nth-child(odd) { border-left: 0; padding-left: 0; }
  .tech-page .tb-kpi:last-child { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .tech-page .tb-rules { grid-template-columns: 1fr; }
  .tech-page .tb-rule { border-left: 0; border-top: 1px solid var(--hair-2); }
  .tech-page .tb-rule:first-child { border-top: 0; }
  .tech-page .tb-shelves { grid-template-columns: 1fr; }
  .tech-page .tb-shelf { border-left: 0; padding: 0; }
  .tech-page .tb-marks { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .tech-page .tb-lic-grid { grid-template-columns: 1fr; }
  .tech-page .tb-facts { margin-top: 40px; }
  .tech-page .tb-sec-l { margin: 0; }
}
@keyframes tb-draw-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .tech-page .tb-pulse, .tech-page .tb-packet { display: none; }
  .tech-page .is-live .tb-pulse, .tech-page .is-live .tb-packet { animation: none; }
  .tech-page .tb-stepper.is-live::before, .tech-page .tb-ms-row.is-live::before { animation: none; }
}
