/* The board of Hex (hex/board.py). Fonts are local, OFL (fonts/OFL-*.txt). */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
/* Layout: hall signage. Header with the movement board, then the line, progress against the previous week, the time budget, one timeline row per product. */
:root {
  --bg: #eceeeb; --surface: #fbfbfa; --ink: #161a1d; --muted: #5a636a; --line: #d0d6d4;
  --machine: #2456c8; --machine-soft: #dde6f8; --human: #c98500; --human-soft: #f8ebcd;
  --fault: #c93c24; --fault-soft: #f7ded8; --done: #1f7f55; --done-soft: #d9eee3;
  --night: #46557a; --belt: #2b3136; --roll: #eceeeb; --board: #161a1d; --board-ink: #e9ecec;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --sans: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #101316; --surface: #181c20; --ink: #e6eaec; --muted: #98a2a8; --line: #2d3439;
  --machine: #7aa2ff; --machine-soft: #1b2947; --human: #f0b232; --human-soft: #3a2d10;
  --fault: #f27a62; --fault-soft: #3e1f19; --done: #55c48f; --done-soft: #163325;
  --night: #9aa8cf; --belt: #5a646c; --roll: #101316; --board: #050607; --board-ink: #e6eaec; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #101316; --surface: #181c20; --ink: #e6eaec; --muted: #98a2a8; --line: #2d3439;
  --machine: #7aa2ff; --machine-soft: #1b2947; --human: #f0b232; --human-soft: #3a2d10;
  --fault: #f27a62; --fault-soft: #3e1f19; --done: #55c48f; --done-soft: #163325;
  --night: #9aa8cf; --belt: #5a646c; --roll: #101316; --board: #050607; --board-ink: #e6eaec; color-scheme: dark }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 20px 56px; display: grid; gap: 52px; }
.wrap > * { min-width: 0; }  /* a wide diagram scrolls in its own box, never the page */
h2 { font: 700 32px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 0; text-wrap: balance; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.mono { font-family: var(--mono); }
a { color: var(--machine); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--machine); outline-offset: 2px; }

.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 3px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* header */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: stretch; }
.hero h1 { font: 700 112px/.9 var(--display); margin: 10px 0 6px; letter-spacing: -.01em; }
.hero .claim { font-size: 19px; color: var(--muted); margin: 0 0 26px; max-width: 30ch; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.stat b { display: block; font: 700 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--muted); }
.board { background: var(--board); color: var(--board-ink); border-radius: 6px; padding: 18px 20px; font: 400 13px/1.55 var(--mono); min-width: 0; }
.board .head { display: flex; justify-content: space-between; opacity: .65; letter-spacing: .08em; margin-bottom: 6px; }
.board .day { margin: 12px 0 4px; font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--board); background: var(--board-ink); display: inline-block; padding: 2px 7px; border-radius: 2px; }
.board .day.old { background: transparent; color: var(--board-ink); opacity: .55; border: 1px solid; }
.board .e { display: grid; grid-template-columns: auto 10px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.board .e i { width: 8px; height: 8px; border-radius: 1px; display: inline-block; }
.board .e .tm { opacity: .6; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 84px; } }

/* line */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.line-svg { display: block; width: 100%; min-width: 920px; height: auto; }
.line-svg text { fill: var(--ink); }
.st, .bin { cursor: pointer; }
.st rect.box { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.st:hover rect.box, .bin:hover rect.binbox { stroke-width: 2.6; }
.st.sel rect.box { stroke: var(--machine); stroke-width: 3; fill: var(--machine-soft); }
.bin.sel rect.binbox { stroke-width: 3.4; }
.belt { stroke: var(--belt); fill: none; }
.roll { stroke: var(--roll); stroke-width: 2; stroke-dasharray: 2 14; fill: none; animation: roll 1.6s linear infinite; }
@keyframes roll { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .roll { animation: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); align-items: center; margin-top: 10px; }
.legend svg { vertical-align: -4px; margin-right: 6px; }

.drawer { margin-top: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 22px 32px; }
.drawer h3 { font: 700 28px/1.05 var(--display); text-transform: uppercase; margin: 6px 0 8px; }
.drawer p { margin: 0; color: var(--muted); max-width: 52ch; }
.role { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; padding: 6px 12px; border: 1px dashed var(--muted); border-radius: 4px; font-size: 15px; }
.role .mono { font-size: 13px; color: var(--muted); }
.mini { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 10px; }
.mini b { font: 700 30px/1 var(--display); display: block; font-variant-numeric: tabular-nums; }
.mini span { font-size: 13px; color: var(--muted); }
.drawer svg text { fill: var(--muted); font: 400 11px var(--mono); }
@media (max-width: 760px) { .drawer { grid-template-columns: 1fr; } }

/* progress */
.cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.card .k { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card .v { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card .v b { font: 700 46px/1 var(--display); font-variant-numeric: tabular-nums; }
.delta { font: 600 14px var(--mono); padding: 3px 7px; border-radius: 3px; }
.delta.good { background: var(--done-soft); color: var(--done); }
.delta.bad { background: var(--fault-soft); color: var(--fault); }
.delta.flat { background: var(--line); color: var(--muted); }
.card .sub2 { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .sub2 b { color: var(--ink); font-weight: 600; }
.days { margin-top: 20px; }
.days svg { display: block; width: 100%; min-width: 620px; height: auto; }
.days text { fill: var(--muted); font: 400 11px var(--mono); }
@media (max-width: 760px) { .cmp { grid-template-columns: 1fr; } }

.budget { display: flex; height: 40px; border-radius: 4px; overflow: hidden; margin-top: 18px; }
.budget div { min-width: 3px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 10px; font-size: 15px; }
.keys i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.keys b { font-variant-numeric: tabular-nums; }
.keys .mono { color: var(--muted); font-size: 12px; }

/* products */
.products { display: grid; gap: 14px; margin-top: 18px; }
.prod { border-top: 2px solid var(--ink); padding-top: 14px; }
.phead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.phead h3 { font: 700 26px/1 var(--display); text-transform: uppercase; margin: 0; }
.phead a { font-size: 15px; }
.chip { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 3px; }
.chip.auto { background: var(--machine); color: var(--surface); }
.chip.shadow { border: 1px solid var(--muted); color: var(--muted); }
.rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rules span { font: 400 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 5px 7px; }
.tl { display: block; width: 100%; min-width: 560px; height: auto; margin-top: 8px; }
.tl text { fill: var(--muted); font: 400 11px var(--mono); }
details { margin-top: 6px; }
summary { cursor: pointer; color: var(--machine); font-size: 15px; font-weight: 600; padding: 4px 0; }
.runs, .prs { display: grid; gap: 8px; margin: 10px 0 4px; }
.run { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.run .id { font: 600 13px var(--mono); }
.route { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.route span { font: 600 10.5px/1 var(--mono); padding: 5px 6px; border-radius: 2px; background: var(--machine-soft); color: var(--machine); }
.route span.code { background: var(--line); color: var(--ink); }
.route span.wait { background: var(--human-soft); color: var(--human); }
.route span.err { background: var(--fault-soft); color: var(--fault); }
.route span.ok { background: var(--done); color: var(--surface); }
.run .dur { font: 400 12px var(--mono); color: var(--muted); white-space: nowrap; }
.run .quote { grid-column: 2 / -1; font-size: 14px; color: var(--muted); font-style: italic; }
.pr { display: grid; grid-template-columns: 52px 54px 80px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 15px; }
.pr .n { font: 600 13px var(--mono); }
.tag { font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 2px; text-align: center; }
.tag.hex { background: var(--machine); color: var(--surface); }
.tag.hand { border: 1px solid var(--muted); color: var(--muted); }
.gate { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.gate i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pr .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }
@media (max-width: 560px) { .pr { grid-template-columns: 44px 50px minmax(0, 1fr); } .pr .gate { display: none; } .run { grid-template-columns: 60px minmax(0, 1fr); } .run .dur { grid-column: 2; } }

.public .private { display: none !important; }
footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; }
[hidden] { display: none !important; }
.board a, .route a { color: inherit; }
a.pkg:hover rect:first-child { opacity: .85; }
