/* brutalhq.dev, coming soon. Tokens and type follow the BRUTAL 2027 frame
   (web/src/style.css in the BRUTAL repository): a warm steel ground with
   plates on it; temper colours mark object types on icons and marks, never on
   text, except in code, where syntax has its own roles; glow (red, orange,
   yellow) marks work that is running; green and red are results only. Archivo names things, Barlow Condensed labels, JetBrains
   Mono identifies. Every font is served from this host; the page makes no
   request to another one. */
@font-face {
  font-family: "Archivo Variable";
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #15130f; --plate: #1d1a16; --plate-2: #26221d; --plate-3: #322d26;
  --line: #3a352d; --line-2: #575046;
  --ink: #f4efe6; --muted: #b9b1a3; --faint: #a49b8b;
  --straw: #ebc86f; --purple: #b98cf6; --blue: #7ea9ff; --teal: #52cbd5;
  --ok: #74d79e; --bad: #ff838d;
  --glow-1: #ff5125; --glow-2: #ff9b33; --glow-3: #ffd36b; --hot: #ff9b33;
  --glow: linear-gradient(90deg, var(--glow-1), var(--glow-2), var(--glow-3));
  /* The row a run stands on. */
  --here: var(--plate-3);
  --f-display: "Archivo Variable", "Arial Black", system-ui, sans-serif;
  --f-body: "Archivo Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-mono: "JetBrains Mono Variable", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  /* Head and status line run full width; their contents line up with main. */
  --column: 1320px;
  --edge-l: max(var(--gutter-l), (100% - var(--column)) / 2 + var(--gutter-l));
  --edge-r: max(var(--gutter-r), (100% - var(--column)) / 2 + var(--gutter-r));
  font-synthesis: none;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #f1eee7; --plate: #fffdf8; --plate-2: #f2eee6; --plate-3: #e4ded3;
    --line: #dcd5c8; --line-2: #b9b0a1;
    --ink: #1b1813; --muted: #574f44; --faint: #5f574c;
    --straw: #87670d; --purple: #7440cc; --blue: #2456d4; --teal: #0b7782;
    --ok: #1a7042; --bad: #b02338;
    --glow-1: #e8400f; --glow-2: #f58a1f; --glow-3: #f2b821; --hot: #b3470c;
    /* Lighter than plate-3, so teal syntax keeps 4.5:1 on it. */
    --here: var(--plate-2);
  }
}

/* Object types: a colour for marks, nodes and icons. */
.k-commit { --c: var(--faint); }
.k-review { --c: var(--purple); }
.k-agent { --c: var(--teal); }
.k-pipe { --c: var(--blue); }
.k-key { --c: var(--straw); }
.k-run { --c: var(--hot); }
.k-plain { --c: var(--muted); }

* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0;
  color: var(--ink); background: var(--ground);
  font: 400 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* Code shows its exact characters: FLUX's `|>` must not become a ligature. */
code { font-family: var(--f-mono); font-size: .92em; font-variant-ligatures: none; }
.label { margin: 0; color: var(--muted); font: 600 14px/1.2 var(--f-label); letter-spacing: .12em; text-transform: uppercase; }
.dim { color: var(--faint); }
/* The chamfer: one cut top-right, like the block B. */
.chip, .panel, .plate, .tone, .st, .keys span, .term, .summary {
  clip-path: polygon(0 0, calc(100% - var(--cut, 6px)) 0, 100% var(--cut, 6px), 100% 100%, 0 100%);
}

/* Head */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(18px, env(safe-area-inset-top, 0px)) var(--edge-r) 18px var(--edge-l);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand .mark { display: block; width: 32px; height: auto; }
.brand .wordmark { display: block; width: auto; height: 17px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 7px 14px 7px 11px;
  background: var(--plate-3); font: 600 14px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase;
}
.glow { display: inline-block; width: 9px; height: 9px; flex: none; background: var(--hot); }

/* Pitch and board */
main { flex: 1 0 auto; width: 100%; max-width: var(--column); margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter-l); }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center;
  gap: clamp(32px, 5vw, 72px); padding-block: clamp(40px, 8vh, 96px) clamp(32px, 6vh, 72px);
}
.pitch { min-width: 0; }
h1 {
  margin: 16px 0 0; max-width: 14ch;
  font: 800 clamp(2.3rem, 1.3rem + 2.9vw, 3.75rem)/1.03 var(--f-display); font-stretch: 112%;
  letter-spacing: -.02em; text-wrap: balance;
}
.lead { max-width: 44ch; margin: 22px 0 0; color: var(--muted); font-size: clamp(17px, 16px + .3vw, 19px); line-height: 1.55; text-wrap: pretty; }
.facts { display: grid; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; }
.facts li { display: flex; align-items: baseline; gap: 10px; }
.facts li::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--line-2); transform: translateY(-1px); }
.facts code { color: var(--ink); }

.board { display: grid; gap: 10px; min-width: 0; }
.panel { --cut: 14px; min-width: 0; padding: 14px 16px 16px; background: var(--plate); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
.panel-head .label { font-size: 13px; }
.panel-head .dim { margin-left: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 8px; height: 8px; background: var(--c); }
.src { color: var(--faint); font-size: 12px; }

/* Pulse: the last hour runs left; now is the right edge. */
.track {
  position: relative; height: 56px; overflow: hidden;
  background: linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 25% 100%;
}
.drift { position: absolute; inset: 0 auto 0 0; display: flex; width: 200%; }
.set { position: relative; width: 50%; height: 100%; }
.mk { position: absolute; top: 4px; width: 9px; height: 9px; background: var(--c); }
.mk::after { content: ""; position: absolute; left: 3.5px; top: 9px; width: 2px; height: 16px; background: var(--c); opacity: .55; }
.rb { position: absolute; top: 38px; height: 6px; }
.rb.ok { width: 7%; background: var(--ok); }
.rb.bad { width: 5%; background: var(--bad); }
.rb.hot { right: 2px; width: 6%; background: var(--glow); }
.set > :nth-child(1) { left: 5%; }
.set > :nth-child(2) { left: 14%; }
.set > :nth-child(3) { left: 19%; }
.set > :nth-child(4) { left: 33%; }
.set > :nth-child(5) { left: 41%; }
.set > :nth-child(6) { left: 47%; }
.set > :nth-child(7) { left: 58%; }
.set > :nth-child(8) { left: 66%; }
.set > :nth-child(9) { left: 74%; }
.set > :nth-child(10) { left: 79%; width: 8%; }
.set > :nth-child(11) { left: 92%; }
.now { position: absolute; inset: 0 0 0 auto; width: 2px; background: var(--ink); }
.axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font: 11px/1 var(--f-mono); }

/* Branches */
.lanes svg { display: block; width: 100%; height: auto; overflow: visible; }
.lbl { fill: var(--muted); font: 500 13px var(--f-mono); }
.lbl .dim { fill: var(--faint); }
.lbl.tag { fill: var(--ink); font-size: 12px; }
.ln { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: square; }
.ln.trunk { stroke: var(--line-2); }
.ln[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 0; }
.node { fill: var(--c); transform-box: fill-box; transform-origin: center; }
.node.merge { fill: var(--ink); }
.node.badge { fill: var(--ok); }
.node.badge[data-state=queued] { fill: var(--line-2); }
.node.badge[data-state=running] { fill: var(--hot); }

/* Run */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.st { --cut: 8px; position: relative; display: grid; gap: 3px; min-width: 0; padding: 9px 10px 16px; background: var(--plate-2); }
.st .kind { color: var(--faint); font: 600 12px/1.2 var(--f-label); letter-spacing: .1em; text-transform: uppercase; }
.st code { overflow: hidden; color: var(--ink); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.st .state { display: grid; color: var(--muted); font-size: 13px; }
/* The state word swaps at once; a cross-fade would show two words on top of each other. */
.st .state i { grid-area: 1 / 1; font-style: normal; opacity: 0; }
.st .state .d { color: var(--ok); }
.st[data-state=queued] .q, .st[data-state=running] .r, .st[data-state=ok] .d { opacity: 1; }
.bar { position: absolute; right: 10px; bottom: 8px; left: 10px; height: 3px; overflow: hidden; background: var(--line); }
.bar span { position: absolute; inset: 0; }
.bar .fill { background: var(--glow); transform-origin: left; }
.bar .done { background: var(--ok); transition: opacity .25s; }
.st[data-state=queued] .fill { transform: scaleX(0); }
.st[data-state=running] .fill { transform: scaleX(1); transition: transform var(--dur, 1s) linear; }
.st:not([data-state=ok]) .done { opacity: 0; }

/* Debugger: a FLUX listing with a gutter. A row carries the state of its link:
   not reached, here, passed. The glow marks where the run stands. */
.debug {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center;
  gap: clamp(32px, 5vw, 72px); padding-bottom: clamp(48px, 9vh, 104px);
}
.debug-text { order: 2; min-width: 0; }
.debug h2 {
  margin: 16px 0 0; max-width: 15ch;
  font: 800 clamp(1.8rem, 1.25rem + 1.7vw, 2.6rem)/1.06 var(--f-display); font-stretch: 110%;
  letter-spacing: -.02em; text-wrap: balance;
}
.code { margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: 24px 18px minmax(0, 1fr) auto; align-items: center;
  min-height: 28px; padding-right: 10px; border-left: 3px solid transparent;
}
.row .ln { grid-column: 1; color: var(--faint); font: 11px/1 var(--f-mono); text-align: right; }
.row .bp { grid-column: 2; justify-self: center; width: 8px; height: 8px; background: var(--blue); }
.row > code { grid-column: 3; overflow: hidden; color: var(--ink); font-size: 13px; white-space: pre; }
.row .tag { grid-column: 4; display: grid; justify-items: end; color: var(--faint); font: 600 12px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; }
.row .tag i { grid-area: 1 / 1; font-style: normal; opacity: 0; }
.row .tag code { font-size: 12px; letter-spacing: 0; text-transform: none; }
.row .tag .r { color: var(--ink); }
.row .tag .d { color: var(--ok); }
.row[data-state=queued] .q, .row[data-state=running] .r, .row[data-state=ok] .d { opacity: 1; }
.row[data-state=running] { border-left-color: var(--hot); background: var(--here); }
/* Syntax roles as in the BRUTAL web interface (web/src/highlight): keywords
   violet, flow names blue, types and assertions teal, steps strong ink, link
   operators muted. A row the run has not reached stays faint. */
.hl-keyword { color: var(--purple); }
.hl-entity { color: var(--blue); font-weight: 600; }
.hl-type { color: var(--teal); }
.hl-assert { color: var(--teal); font-weight: 600; }
.hl-step { color: var(--ink); font-weight: 700; }
.hl-operator { color: var(--muted); }
.hl-parameter { color: var(--ink); }
.row[data-state=queued] > code, .row[data-state=queued] > code span { color: var(--faint); }
.row.halt[data-state=running] { background: color-mix(in srgb, var(--hot) 16%, var(--plate-2)); }
.halt-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  min-height: 27px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.halt-bar .where { display: grid; }
.halt-bar .where i { grid-area: 1 / 1; font-style: normal; opacity: 0; }
.halt-bar[data-state=running] .r, .halt-bar[data-state=ok] .d { opacity: 1; }
.halt-bar b { color: var(--ink); font: 600 13px var(--f-mono); }
.halt-bar code { margin-left: 6px; color: var(--faint); font-size: 12px; }
.keys { display: flex; gap: 6px; }
.keys span { --cut: 5px; padding: 6px 10px; color: var(--ink); background: var(--plate-3); font: 600 12px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; }
/* One primary action, in ink. */
.keys .go { color: var(--ground); background: var(--ink); }

/* The story (assets/story.js) hides what has not happened yet. Without script
   or with reduced motion, nothing is hidden and the last frame stands. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-at] { transition: opacity .35s, transform .45s cubic-bezier(.2, 1.5, .4, 1), stroke-dashoffset .6s cubic-bezier(.3, .7, .2, 1); }
  [data-at]:not(.on) { opacity: 0; }
  rect[data-at]:not(.on) { transform: scale(.2); }
  .ln[data-at]:not(.on) { stroke-dashoffset: 1; }
  .fade [data-at] { opacity: 0; }
}

/* What it does */
.plates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 10px; }
.plate { --cut: 16px; min-width: 0; padding: 22px 22px 26px; background: var(--plate); }
.tone {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--plate-2));
}
.tone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.plate h2 { margin: 18px 0 8px; font: 700 20px/1.2 var(--f-display); font-stretch: 106%; letter-spacing: -.01em; }
.plate p { max-width: 46ch; margin: 0; color: var(--muted); }

/* Closing row: the licence, and the addresses as text, no form. */
.closing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: clamp(48px, 8vh, 88px); }
.closing .plate { padding: clamp(22px, 3vw, 34px); }
.closing h2 {
  margin: 14px 0 12px; font: 800 clamp(1.45rem, 1.15rem + 1vw, 1.9rem)/1.1 var(--f-display); font-stretch: 110%;
  letter-spacing: -.02em; text-wrap: balance;
}
.closing code { color: var(--ink); }
.mail { display: grid; gap: 16px; margin: 26px 0 0; }
.mail div { display: grid; gap: 4px; }
.mail dt { color: var(--faint); font: 600 13px/1.2 var(--f-label); letter-spacing: .12em; text-transform: uppercase; }
.mail dd { margin: 0; font: 600 clamp(16px, 14px + .5vw, 20px)/1.3 var(--f-mono); overflow-wrap: anywhere; }

/* Legal pages: one readable column. */
.legal { max-width: 46rem; padding-block: clamp(48px, 10vh, 112px) clamp(56px, 10vh, 120px); }
.legal h1 { max-width: none; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.legal h2 { margin: 2.4em 0 .6em; font: 700 20px/1.25 var(--f-display); font-stretch: 106%; letter-spacing: -.01em; }
.legal p, .legal li, .legal address { color: var(--muted); font-size: 16px; line-height: 1.65; }
.legal p, .legal address, .legal ul { max-width: 68ch; margin: 0 0 1em; }
.legal address { font-style: normal; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .4em; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal .summary { --cut: 14px; max-width: none; margin: 28px 0 1.2em; padding: 16px 18px; color: var(--ink); background: var(--plate); }
.legal .stand { margin-top: 2.6em; color: var(--faint); font-size: 14px; }

/* Not found (404.html) */
.lost { padding-block: clamp(56px, 16vh, 180px) clamp(48px, 10vh, 120px); }
.back { margin: 28px 0 0; font-weight: 600; }
/* The message wraps instead of scrolling, so the block needs no focus stop. */
.term {
  --cut: 14px; max-width: 46rem; margin: 44px 0 0; padding: 14px 16px;
  color: var(--muted); background: var(--plate); font: 13px/1.6 var(--f-mono);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.term code { font-size: inherit; }
.term .cmd { color: var(--ink); }

/* Status line */
.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px;
  padding: 11px var(--edge-r) max(11px, env(safe-area-inset-bottom, 0px)) var(--edge-l);
  border-top: 1px solid var(--line); color: var(--muted); background: var(--plate); font-size: 13px;
}
.status .live { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--f-mono); }
.status .live .glow { width: 8px; height: 8px; }
.status code { color: var(--ink); font-size: 13px; }
.status .note { flex: 1 1 auto; }
.status nav { display: flex; gap: 18px; }

@media (max-width: 1000px) {
  .hero, .debug { grid-template-columns: minmax(0, 1fr); }
  .debug-text { order: 0; }
  h1 { max-width: 16ch; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .closing { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .plates { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse .legend, .lanes .legend { display: none; }
  .lbl { font-size: 20px; }
  .lbl .dim { display: none; }
  .lbl.tag { font-size: 18px; }
  .brand .mark { width: 28px; }
  .brand .wordmark { height: 15px; }
}

/* Motion only for those who have not asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .drift { animation: drift 48s linear infinite; }
  .glow, .rb.hot, .node.badge[data-state=running], .row.halt[data-state=running] .bp { animation: hot 2.4s ease-in-out infinite; }
  .typing.on rect { animation: typing 1.2s ease-in-out infinite; }
  .typing.on rect:nth-child(2) { animation-delay: .2s; }
  .typing.on rect:nth-child(3) { animation-delay: .4s; }
}
@keyframes drift { to { transform: translateX(-50%); } }
@keyframes hot { 50% { opacity: .45; } }
@keyframes typing { 50% { opacity: .2; } }

@media (forced-colors: active) {
  .glow, .rb, .mk, .legend li::before, .bar span { forced-color-adjust: none; }
}
