
/* ============================================================================
   unitgates.css — design tokens and components
   v0.1.0 · augustus 2026

   One stylesheet for every UnitGates surface: the consoles, the questionnaire,
   the process modeller, the website, and the HTML that becomes a PDF.

   USAGE
     <link rel="stylesheet" href="unitgates.css">
     <body class="ug">

   Everything is namespaced --ug-* / .ug-* so it cannot collide with anything
   already in the existing consoles. Adopt it a component at a time.

   SELF-CONTAINED DELIVERABLES
     Client deliverables must stay single-file. Run inline_ug_css.py to fold
     this stylesheet into a <style> block between the marker comments. Also
     drop the @import below in that case — the fallback stacks are chosen to
     hold up without any webfont.

   CONTENTS
     1. Fonts
     2. Tokens — colour
     3. Tokens — type, space, line, motion
     4. Base
     5. Typography
     6. Layout: shell, header, panels
     7. Controls: buttons, inputs, questionnaire
     8. Data: tables, badges, maturity bars, scores
     9. Process notation: steps, gates, arrows
    10. Callouts and status
    11. Print
   ========================================================================= */

/* -- 1. Fonts ------------------------------------------------------------ */
/* Remove this line for offline / single-file deliverables. */

/* -- 2. Tokens — colour -------------------------------------------------- */
:root{
  /* Brand */
  --ug-concrete:    #EDEEF0;  /* page ground — cool, never cream */
  --ug-surface:     #FFFFFF;  /* panels, tables, cards */
  --ug-surface-alt: #F7F8F9;  /* toolbars, table headers, zebra */
  --ug-ink:         #14161A;  /* all primary text and structural rules */
  --ug-steel:       #61697A;  /* secondary text, labels, captions */
  --ug-hair:        #C7CBD2;  /* dividers, borders, empty bar segments */
  --ug-cobalt:      #1F3BD1;  /* structure and permission. The brand colour. */
  --ug-cobalt-deep: #172C9C;  /* hover / active */
  --ug-cobalt-tint: #E7EAFB;  /* selected rows, focus fills */
  --ug-denied:      #C4321F;  /* RESERVED: denied, failed, conflict. Nothing else. */
  --ug-denied-tint: #FBEAE7;

  /* Semantic aliases — prefer these in component CSS */
  --ug-bg:          var(--ug-concrete);
  --ug-fg:          var(--ug-ink);
  --ug-fg-muted:    var(--ug-steel);
  --ug-border:      var(--ug-hair);
  --ug-border-firm: var(--ug-ink);
  --ug-accent:      var(--ug-cobalt);
  --ug-danger:      var(--ug-denied);

  /* Maturity ramp. One hue, five steps: readable in greyscale, and it never
     implies that L2 is "bad red" and L5 is "good green" — the rubric is a
     measurement, not a verdict. L0 = not assessed. */
  --ug-l0: #DDE0E6;
  --ug-l1: #C3CBE6;
  --ug-l2: #9CACDD;
  --ug-l3: #6E86D6;
  --ug-l4: #4460D4;
  --ug-l5: #1F3BD1;

  /* The mark, as a background image (closed gate, ink). */
  --ug-mark: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon fill='%2314161A' points='6,12 29,24 29,52 6,40'/%3E%3Cpolygon fill='%2314161A' points='58,12 35,24 35,52 58,40'/%3E%3C/svg%3E");
}

/* -- 3. Tokens — type, space, line, motion ------------------------------- */
:root{
  /* Two faces, two jobs. Archivo = written by a person.
     IBM Plex Mono = produced by the engine. Never mix the signal. */
  --ug-font: Archivo, "Helvetica Neue", Arial, system-ui, sans-serif;
  --ug-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ug-fs-xs:   11px;
  --ug-fs-sm:   12.5px;
  --ug-fs-base: 15px;
  --ug-fs-md:   17px;
  --ug-fs-lg:   21px;
  --ug-fs-xl:   28px;
  --ug-fs-2xl:  38px;
  --ug-fs-3xl:  clamp(32px, 5vw, 56px);

  --ug-lh-tight: 1.12;
  --ug-lh-base:  1.55;
  --ug-track-label: .18em;   /* uppercase mono labels */
  --ug-track-display: -.03em;

  /* 4 px base */
  --ug-s1: 4px;   --ug-s2: 8px;   --ug-s3: 12px;  --ug-s4: 16px;
  --ug-s5: 24px;  --ug-s6: 32px;  --ug-s7: 48px;  --ug-s8: 64px;
  --ug-s9: 96px;

  --ug-radius: 2px;          /* almost square. This is engineering, not a SaaS card. */
  --ug-hairline: 1px;
  --ug-firm: 1.5px;

  --ug-maxw: 1180px;
  --ug-gutter: 24px;

  --ug-dur: .18s;
  --ug-dur-slow: .5s;
  --ug-ease: cubic-bezier(.2,.7,.2,1);
}

/* -- 4. Base ------------------------------------------------------------- */
.ug *, .ug *::before, .ug *::after{ box-sizing: border-box; }

.ug{
  margin: 0;
  background: var(--ug-bg);
  color: var(--ug-fg);
  font-family: var(--ug-font);
  font-size: var(--ug-fs-base);
  line-height: var(--ug-lh-base);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

.ug :focus-visible{
  outline: 2px solid var(--ug-cobalt);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  .ug *{ transition: none !important; animation: none !important; }
}

/* -- 5. Typography ------------------------------------------------------- */
.ug h1, .ug h2, .ug h3, .ug h4{
  font-weight: 700;
  line-height: var(--ug-lh-tight);
  letter-spacing: var(--ug-track-display);
  margin: 0 0 var(--ug-s4);
}
.ug h1{ font-size: var(--ug-fs-3xl); }
.ug h2{ font-size: var(--ug-fs-2xl); }
.ug h3{ font-size: var(--ug-fs-xl); }
.ug h4{ font-size: var(--ug-fs-lg); letter-spacing: -.02em; }
.ug p{ margin: 0 0 var(--ug-s4); max-width: 68ch; }

/* Every label, everywhere: mono, small, uppercase, wide. */
.ug-label,
.ug-eyebrow{
  font-family: var(--ug-font-mono);
  font-size: var(--ug-fs-xs);
  font-weight: 500;
  letter-spacing: var(--ug-track-label);
  text-transform: uppercase;
  color: var(--ug-fg-muted);
  display: block;
}
.ug-eyebrow{ color: var(--ug-accent); margin-bottom: var(--ug-s3); }

.ug-lede{ font-size: var(--ug-fs-md); color: #3D434E; max-width: 62ch; }
.ug-meta{ font-family: var(--ug-font-mono); font-size: var(--ug-fs-sm); color: var(--ug-fg-muted); }
.ug-mono{ font-family: var(--ug-font-mono); }
.ug-muted{ color: var(--ug-fg-muted); }

/* Section rule: the seam, reused as a divider. */
.ug-rule{
  border: 0; border-top: var(--ug-hairline) solid var(--ug-border);
  margin: var(--ug-s6) 0;
}
.ug-seam{ display: inline-block; width: 2px; background: var(--ug-accent); align-self: stretch; }

/* Wordmark */
.ug-wordmark{
  font-family: var(--ug-font);
  font-weight: 700;
  letter-spacing: var(--ug-track-display);
  line-height: 1;
  display: inline-flex;
  align-items: stretch;
  white-space: nowrap;
}
.ug-wordmark .u{ font-weight: 400; color: var(--ug-steel); }
.ug-wordmark .ug-seam{ margin: 0 .09em; }

/* -- 6. Layout ----------------------------------------------------------- */
.ug-wrap{ max-width: var(--ug-maxw); margin: 0 auto; padding: 0 var(--ug-gutter); }
.ug-stack > * + *{ margin-top: var(--ug-s4); }
.ug-row-2{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--ug-s5); }
.ug-row-3{ display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ug-s4); }
.ug-auto{ display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--ug-s4); }

.ug-panel{
  background: var(--ug-surface);
  border: var(--ug-hairline) solid var(--ug-border);
  border-radius: var(--ug-radius);
}
.ug-panel--firm{ border: var(--ug-hairline) solid var(--ug-border-firm); }
.ug-panel__body{ padding: var(--ug-s5); }

/* Toolbar strip at the top of a console */
.ug-toolbar{
  display: flex; align-items: center; gap: var(--ug-s3);
  padding: var(--ug-s3) var(--ug-s4);
  background: var(--ug-surface-alt);
  border-bottom: var(--ug-hairline) solid var(--ug-border);
}
.ug-toolbar__mark{ width: 18px; height: 18px; color: var(--ug-accent); flex: none; }
.ug-toolbar__title{ font-weight: 600; font-size: var(--ug-fs-base); letter-spacing: -.01em; }
.ug-toolbar__meta{ margin-left: auto; font-family: var(--ug-font-mono); font-size: var(--ug-fs-xs); color: var(--ug-fg-muted); }

/* -- 7. Controls --------------------------------------------------------- */
.ug-btn{
  display: inline-flex; align-items: center; gap: var(--ug-s2);
  font-family: var(--ug-font); font-size: 14px; font-weight: 600;
  letter-spacing: -.005em; line-height: 1;
  padding: 11px 18px;
  border: var(--ug-hairline) solid var(--ug-border-firm);
  border-radius: var(--ug-radius);
  background: var(--ug-surface); color: var(--ug-fg);
  cursor: pointer;
  transition: background var(--ug-dur), border-color var(--ug-dur), color var(--ug-dur);
}
.ug-btn:hover{ background: var(--ug-surface-alt); }
.ug-btn--primary{ background: var(--ug-cobalt); border-color: var(--ug-cobalt); color: #fff; }
.ug-btn--primary:hover{ background: var(--ug-cobalt-deep); border-color: var(--ug-cobalt-deep); }
.ug-btn--ghost{ border-color: var(--ug-border); color: var(--ug-fg-muted); background: transparent; }
.ug-btn--ghost:hover{ border-color: var(--ug-border-firm); color: var(--ug-fg); }
.ug-btn--danger{ border-color: var(--ug-danger); color: var(--ug-danger); background: transparent; }
.ug-btn--danger:hover{ background: var(--ug-denied-tint); }
.ug-btn[disabled]{ opacity: .45; cursor: not-allowed; }

/* Verbs, not nouns: a button says what happens. "Score vaststellen", not "Verzenden". */

.ug-field{ margin-bottom: var(--ug-s4); }
.ug-field > .ug-label{ margin-bottom: var(--ug-s2); }
.ug-input, .ug-select, .ug-textarea{
  width: 100%;
  font-family: var(--ug-font); font-size: 15px; line-height: 1.4;
  padding: 10px 12px;
  background: var(--ug-surface);
  border: var(--ug-hairline) solid var(--ug-hair);
  border-radius: var(--ug-radius);
  color: var(--ug-fg);
}
.ug-input:focus, .ug-select:focus, .ug-textarea:focus{
  border-color: var(--ug-cobalt); outline: none;
  box-shadow: inset 0 0 0 1px var(--ug-cobalt);
}
.ug-textarea{ min-height: 110px; resize: vertical; }
.ug-hint{ font-size: var(--ug-fs-sm); color: var(--ug-fg-muted); margin-top: var(--ug-s2); }

/* Questionnaire answer — a whole-row target, because respondents are on laptops
   in meeting rooms and the hit area matters more than the styling. */
.ug-choice{
  display: flex; align-items: flex-start; gap: var(--ug-s3);
  padding: var(--ug-s3) var(--ug-s4);
  border: var(--ug-hairline) solid var(--ug-hair);
  border-radius: var(--ug-radius);
  background: var(--ug-surface);
  cursor: pointer;
  transition: border-color var(--ug-dur), background var(--ug-dur);
}
.ug-choice + .ug-choice{ margin-top: -1px; }
.ug-choice:hover{ border-color: var(--ug-steel); z-index: 1; position: relative; }
.ug-choice input{ margin: 3px 0 0; accent-color: var(--ug-cobalt); flex: none; }
.ug-choice__text{ font-size: 14.5px; }
.ug-choice__key{
  font-family: var(--ug-font-mono); font-size: var(--ug-fs-xs);
  color: var(--ug-fg-muted); margin-left: auto; flex: none; padding-top: 2px;
}
.ug-choice:has(input:checked){
  border-color: var(--ug-cobalt); background: var(--ug-cobalt-tint); z-index: 1; position: relative;
}

/* Progress through the 220 questions */
.ug-progress{ height: 4px; background: var(--ug-hair); border-radius: 0; overflow: hidden; }
.ug-progress__fill{ height: 100%; background: var(--ug-cobalt); transition: width var(--ug-dur-slow) var(--ug-ease); }

/* -- 8. Data ------------------------------------------------------------- */
.ug-table{ width: 100%; border-collapse: collapse; font-size: 14px; background: var(--ug-surface); }
.ug-table th{
  text-align: left;
  font-family: var(--ug-font-mono); font-size: var(--ug-fs-xs); font-weight: 500;
  letter-spacing: var(--ug-track-label); text-transform: uppercase; color: var(--ug-fg-muted);
  padding: var(--ug-s3) var(--ug-s4);
  background: var(--ug-surface-alt);
  border-bottom: var(--ug-hairline) solid var(--ug-border);
  white-space: nowrap;
}
.ug-table td{
  padding: var(--ug-s3) var(--ug-s4);
  border-bottom: var(--ug-hairline) solid var(--ug-border);
  vertical-align: top;
}
.ug-table tr:last-child td{ border-bottom: 0; }
.ug-table tbody tr:hover{ background: var(--ug-surface-alt); }
.ug-table .num, .ug-table .id{ font-family: var(--ug-font-mono); font-size: 12.5px; }
.ug-table .num{ text-align: right; }

.ug-badge{
  display: inline-block;
  font-family: var(--ug-font-mono); font-size: 10px; letter-spacing: .08em;
  padding: 3px 7px;
  border: var(--ug-hairline) solid var(--ug-border);
  border-radius: var(--ug-radius);
  color: var(--ug-fg-muted);
  white-space: nowrap;
}
.ug-badge + .ug-badge{ margin-left: var(--ug-s1); }
.ug-badge--ok{ border-color: var(--ug-cobalt); color: var(--ug-cobalt); }
.ug-badge--fail{ border-color: var(--ug-danger); color: var(--ug-danger); background: var(--ug-denied-tint); }
.ug-badge--scope{ background: var(--ug-surface-alt); border-color: var(--ug-steel); }

/* Maturity bar.
   CONVENTION: solid = human population, outlined = non-human.
   A difference in FILL, not hue, so it survives greyscale printing and
   colour vision deficiency. Never rely on it alone — always print the level. */
.ug-bar{ display: flex; align-items: center; gap: var(--ug-s3); }
.ug-bar__pop{ font-family: var(--ug-font-mono); font-size: 10px; letter-spacing: .1em; color: var(--ug-fg-muted); width: 26px; flex: none; }
.ug-bar__track{ display: flex; gap: 3px; }
.ug-bar__seg{ width: 26px; height: 9px; background: var(--ug-l0); display: block; }
.ug-bar--human .ug-bar__seg.is-on{ background: var(--ug-cobalt); }
.ug-bar--nh    .ug-bar__seg.is-on{ background: transparent; box-shadow: inset 0 0 0 2px var(--ug-cobalt); }
.ug-bar__val{ font-family: var(--ug-font-mono); font-size: 11.5px; color: var(--ug-fg-muted); }
.ug-bar.is-governing .ug-bar__val{ color: var(--ug-fg); font-weight: 500; }

/* Level chip, for legends and charts */
.ug-level{
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 22px;
  font-family: var(--ug-font-mono); font-size: 11px; color: #fff;
  border-radius: var(--ug-radius);
}
.ug-level--0{ background: var(--ug-l0); color: var(--ug-steel); }
.ug-level--1{ background: var(--ug-l1); color: var(--ug-ink); }
.ug-level--2{ background: var(--ug-l2); color: var(--ug-ink); }
.ug-level--3{ background: var(--ug-l3); }
.ug-level--4{ background: var(--ug-l4); }
.ug-level--5{ background: var(--ug-l5); }

.ug-score{ text-align: right; }
.ug-score__n{ font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -.03em; }
.ug-score__k{
  font-family: var(--ug-font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ug-fg-muted); margin-top: 5px;
}

/* Capability row, as used in the maturity console */
.ug-cap{
  display: grid; grid-template-columns: 56px 1fr auto; gap: var(--ug-s4);
  padding: var(--ug-s4);
  border-bottom: var(--ug-hairline) solid var(--ug-border);
  align-items: start;
  background: var(--ug-surface);
}
.ug-cap:last-child{ border-bottom: 0; }
.ug-cap__id{ font-family: var(--ug-font-mono); font-size: 12px; color: var(--ug-fg-muted); padding-top: 2px; }
.ug-cap__name{ font-weight: 600; font-size: var(--ug-fs-base); letter-spacing: -.01em; }
.ug-cap__dim{
  font-family: var(--ug-font-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ug-fg-muted); margin-top: var(--ug-s1);
}
.ug-cap__bars{ margin-top: var(--ug-s3); display: grid; gap: var(--ug-s2); }
.ug-cap__badges{ margin-top: var(--ug-s2); }

/* -- 9. Process notation ------------------------------------------------- */
/* ISO 5807 shapes stay intact. This fixes colour and weight only:
   ink outlines for steps, cobalt for anything that decides. */
.ug-flow{ display: flex; align-items: center; flex-wrap: wrap; gap: 0; font-size: 13.5px; }
.ug-step{
  border: var(--ug-firm) solid var(--ug-ink);
  background: var(--ug-surface);
  padding: 11px 16px; font-weight: 500;
}
.ug-gate{
  border: var(--ug-firm) solid var(--ug-cobalt);
  background: var(--ug-surface);
  color: var(--ug-cobalt); font-weight: 500;
  padding: 11px 24px;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.ug-terminal{
  border: var(--ug-firm) solid var(--ug-ink); background: var(--ug-ink); color: #fff;
  padding: 11px 18px; font-weight: 500; border-radius: 999px;
}
.ug-arrow{ width: 26px; height: var(--ug-firm); background: var(--ug-ink); position: relative; flex: none; }
.ug-arrow::after{
  content: ""; position: absolute; right: 0; top: -3px;
  border-left: 6px solid var(--ug-ink);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.ug-lane{ border-left: var(--ug-firm) solid var(--ug-ink); padding-left: var(--ug-s4); }
.ug-lane__name{
  font-family: var(--ug-font-mono); font-size: var(--ug-fs-xs);
  letter-spacing: var(--ug-track-label); text-transform: uppercase;
  color: var(--ug-fg-muted); margin-bottom: var(--ug-s3);
}

/* -- 10. Callouts and status --------------------------------------------- */
.ug-note{
  border-left: 3px solid var(--ug-cobalt);
  background: var(--ug-surface);
  padding: var(--ug-s4) var(--ug-s5);
  font-size: 14.5px;
}
.ug-note--alert{ border-left-color: var(--ug-danger); background: var(--ug-denied-tint); }
.ug-note__title{
  font-family: var(--ug-font-mono); font-size: var(--ug-fs-xs);
  letter-spacing: var(--ug-track-label); text-transform: uppercase;
  color: var(--ug-fg-muted); margin-bottom: var(--ug-s2);
}

/* Empty states are an invitation to act, not an apology. */
.ug-empty{
  padding: var(--ug-s7) var(--ug-s5); text-align: center;
  border: var(--ug-hairline) dashed var(--ug-hair);
  background: var(--ug-surface);
}
.ug-empty__mark{
  width: 40px; height: 40px; margin: 0 auto var(--ug-s4);
  background: var(--ug-mark) center / contain no-repeat; opacity: .22;
}
.ug-empty p{ margin: 0 auto; color: var(--ug-fg-muted); max-width: 44ch; }

/* -- 11. Print ----------------------------------------------------------- */
/* The console and the PDF are one system: this direction does not invert. */
@media print{
  .ug{ background: #fff; font-size: 10.5pt; }
  .ug-panel, .ug-table, .ug-cap{ break-inside: avoid; }
  .ug-toolbar{ background: #fff; }
  .ug-btn, .ug-progress{ display: none !important; }
  .ug-table th{ background: #fff; }
  .ug-bar--nh .ug-bar__seg.is-on{ box-shadow: inset 0 0 0 2px #000; }
  .ug-bar--human .ug-bar__seg.is-on{ background: #000; }
  a[href]::after{ content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

/* -- Responsive ---------------------------------------------------------- */
@media (max-width: 860px){
  .ug-row-2, .ug-row-3{ grid-template-columns: 1fr; }
  .ug-cap{ grid-template-columns: 1fr; }
  .ug-score{ text-align: left; }
  .ug-toolbar{ flex-wrap: wrap; }
  .ug-toolbar__meta{ margin-left: 0; width: 100%; }
}
