/*
 * cmp.wiki shared header, palette, fonts and status badges.
 * Served at https://cmp.wiki/shared/header.css and included by all three parts
 * (WordPress front door, MediaWiki at /wiki/, Kanboard at /board/).
 * Everything is scoped under .cmp-* classes and --cmp-* variables so it never
 * restyles the host application. Fonts are self-hosted (SIL OFL 1.1, see the OFL.txt in each fonts/ subfolder).
 * Version 2, 2026-10-30 (eight tabs, Menu dropdown under 720px). Bump the ?v= query on every include when this
 * file changes.
 */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/unbounded/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Palette ---------- */
:root {
  --cmp-bg: #07080a;          /* page background, hero */
  --cmp-bg-2: #0f1216;        /* content panels below the hero, wiki/board body */
  --cmp-surface: #13171c;     /* inputs, table hover */
  --cmp-surface-2: #151a20;   /* cards, board columns */
  --cmp-surface-3: #1d232b;   /* card inside a column */
  --cmp-text: #e9e6df;        /* warm off-white */
  --cmp-muted: #a6acb4;
  --cmp-teal: #5ef2e8;
  --cmp-orange: #ff8a3d;
  --cmp-border: #222830;
  --cmp-ink: #071012;         /* text on a teal fill */
  --cmp-red: #ff6464;         /* warning badge only */
  --cmp-violet: #c6b0ff;      /* contested badge only */

  --cmp-font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --cmp-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cmp-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --cmp-header-h: 60px;
  --cmp-gutter: 16px;
}
@media (min-width: 720px) { :root { --cmp-gutter: 24px; } }

/* ---------- Header / nav ---------- */
/* Three layouts. Under 720px: one 60px bar with the wordmark and a Menu button; the tabs and the sign-in slot open
   under it as a dropdown (CSS only: a checkbox and its label). 720 to 1139px: wordmark and sign-in on the first row,
   the tabs on a second row that wraps instead of scrolling. From 1140px: one row.
   Markup note: the checkbox carries the hidden attribute so the header still reads cleanly with an older cached
   header.css; this file overrides that to keep it keyboard-focusable.
   --cmp-header-h follows the layout, for parts that offset content under the header. */
@media (min-width: 720px) and (max-width: 1139px) { :root { --cmp-header-h: 94px; } }

.cmp-header {
  position: relative;
  z-index: 50;
  display: block;            /* hosts may style the header element (Kanboard: flex, padding); position and margin stay theirs */
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  background: var(--cmp-bg);
  border-bottom: 1px solid var(--cmp-border);
  color: var(--cmp-text);
  font-family: var(--cmp-font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}
.cmp-header *, .cmp-header *::before, .cmp-header *::after { box-sizing: border-box; }
/* Over the landing hero: transparent, no rule. */
.cmp-header--overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(7,8,10,.72) 0%, rgba(7,8,10,0) 100%);
  border-bottom-color: transparent;
}

.cmp-header .cmp-nav {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand burger" "links links" "signin signin";
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  max-width: 1440px;
  min-height: 60px;
  margin: 0 auto;
  padding: 8px var(--cmp-gutter);
}
.cmp-header a { color: inherit; text-decoration: none; background: none; }
.cmp-header a:hover, .cmp-header a:focus-visible { color: var(--cmp-teal); }
.cmp-header a:focus-visible { outline: 1px solid var(--cmp-teal); outline-offset: 3px; }

.cmp-header .cmp-nav__brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  min-height: 44px;
  font-family: var(--cmp-font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.cmp-nav__mark {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--cmp-teal);
  box-shadow: 0 0 12px rgba(94,242,232,.6);
}

/* Menu button (under 720px): visually hidden checkbox (focusable), its label drawn as three lines, 44px target. */
.cmp-header .cmp-nav__toggle {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}
.cmp-header .cmp-nav__burger {
  grid-area: burger;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin: 0; padding: 0;
  float: none;
  border: 1px solid rgba(94,242,232,.45);
  background: none;
  color: var(--cmp-teal);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cmp-header .cmp-nav__burger::before, .cmp-header .cmp-nav__burger::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border: 0 solid var(--cmp-teal);
}
.cmp-header .cmp-nav__burger::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.cmp-header .cmp-nav__burger::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.cmp-nav__burger-lines, .cmp-nav__burger-lines::before, .cmp-nav__burger-lines::after {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  transition: transform .2s ease, background-color .2s ease;
}
.cmp-nav__burger-lines { position: relative; }
.cmp-nav__burger-lines::before, .cmp-nav__burger-lines::after { content: ""; position: absolute; left: 0; }
.cmp-nav__burger-lines::before { top: -6px; }
.cmp-nav__burger-lines::after { top: 6px; }
.cmp-header .cmp-nav__burger:hover,
.cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__burger { background: rgba(94,242,232,.10); }
.cmp-nav__toggle:checked ~ .cmp-nav__burger .cmp-nav__burger-lines { background: transparent; }
.cmp-nav__toggle:checked ~ .cmp-nav__burger .cmp-nav__burger-lines::before { transform: translateY(6px) rotate(45deg); }
.cmp-nav__toggle:checked ~ .cmp-nav__burger .cmp-nav__burger-lines::after { transform: translateY(-6px) rotate(-45deg); }
.cmp-header .cmp-nav__toggle:focus-visible ~ .cmp-nav__burger { outline: 1px solid var(--cmp-teal); outline-offset: 3px; }

/* Dropdown (under 720px): closed, the tabs and sign-in rows are empty; open, they stack under the bar. */
.cmp-header .cmp-nav__links {
  grid-area: links;
  display: none;
  flex-direction: column;
  margin: 8px calc(-1 * var(--cmp-gutter)) 0;
  padding: 4px var(--cmp-gutter) 0;
  border-top: 1px solid var(--cmp-border);
  list-style: none;
}
.cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__links { display: flex; }
.cmp-header .cmp-nav__links li { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--cmp-border); }
.cmp-header .cmp-nav__links li::marker { content: none; }
.cmp-header .cmp-nav__links a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: var(--cmp-text);
  opacity: .86;
  font-size: 12px;
  letter-spacing: .14em;
}
.cmp-header .cmp-nav__links a:hover { opacity: 1; }
.cmp-header:has(.cmp-nav__toggle:checked) { box-shadow: 0 18px 36px rgba(0,0,0,.5); }
.cmp-header--overlay:has(.cmp-nav__toggle:checked) { background: var(--cmp-bg); border-bottom-color: var(--cmp-border); }

/* Active item: set data-cmp-active="<key>" on .cmp-header, or aria-current="page" on the link. */
.cmp-header [aria-current="page"],
.cmp-header[data-cmp-active="start"] [data-cmp-nav="start"],
.cmp-header[data-cmp-active="unlocks"] [data-cmp-nav="unlocks"],
.cmp-header[data-cmp-active="recipes"] [data-cmp-nav="recipes"],
.cmp-header[data-cmp-active="platforms"] [data-cmp-nav="platforms"],
.cmp-header[data-cmp-active="cooling"] [data-cmp-nav="cooling"],
.cmp-header[data-cmp-active="troubleshooting"] [data-cmp-nav="troubleshooting"],
.cmp-header[data-cmp-active="board"] [data-cmp-nav="board"],
.cmp-header[data-cmp-active="credits"] [data-cmp-nav="credits"] {
  color: var(--cmp-teal);
  opacity: 1;
}
/* Marker: a teal square before the item in the dropdown, a 1px teal underline in the row layouts. */
.cmp-header .cmp-nav__links [aria-current="page"]::before,
.cmp-header[data-cmp-active="start"] .cmp-nav__links [data-cmp-nav="start"]::before,
.cmp-header[data-cmp-active="unlocks"] .cmp-nav__links [data-cmp-nav="unlocks"]::before,
.cmp-header[data-cmp-active="recipes"] .cmp-nav__links [data-cmp-nav="recipes"]::before,
.cmp-header[data-cmp-active="platforms"] .cmp-nav__links [data-cmp-nav="platforms"]::before,
.cmp-header[data-cmp-active="cooling"] .cmp-nav__links [data-cmp-nav="cooling"]::before,
.cmp-header[data-cmp-active="troubleshooting"] .cmp-nav__links [data-cmp-nav="troubleshooting"]::before,
.cmp-header[data-cmp-active="board"] .cmp-nav__links [data-cmp-nav="board"]::before,
.cmp-header[data-cmp-active="credits"] .cmp-nav__links [data-cmp-nav="credits"]::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 12px;
  background: var(--cmp-teal);
}

/* Sign in: teal outline with Callisto-style corner ticks. Full width at the bottom of the dropdown. */
.cmp-header .cmp-nav__signin {
  grid-area: signin;
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  margin: 16px 0 10px;
  padding: 0 14px;
  border: 1px solid rgba(94,242,232,.45);
  color: var(--cmp-teal) !important;
  font-size: 10.5px;
  letter-spacing: .14em;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__signin { display: flex; }
.cmp-header .cmp-nav__signin::before, .cmp-header .cmp-nav__signin::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border: 0 solid var(--cmp-teal);
}
.cmp-header .cmp-nav__signin::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.cmp-header .cmp-nav__signin::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.cmp-header .cmp-nav__signin:hover, .cmp-header .cmp-nav__signin:focus-visible { background: rgba(94,242,232,.10); }

/* 720 to 1139px: two rows, no Menu button; the tabs wrap if they ever run out of room. */
@media (min-width: 720px) {
  .cmp-header .cmp-nav {
    grid-template-areas: "brand signin" "links links";
    min-height: 0;
    padding: 12px var(--cmp-gutter) 0;
  }
  .cmp-header .cmp-nav__brand { min-height: 36px; }
  .cmp-header .cmp-nav__toggle, .cmp-header .cmp-nav__burger { display: none; }
  .cmp-header .cmp-nav__links,
  .cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 18px;
    margin: 0;
    padding: 10px 0 12px;
    border: 0;
  }
  .cmp-header .cmp-nav__links li { border: 0; }
  .cmp-header .cmp-nav__links a {
    display: inline-block;
    min-height: 0;
    padding: 6px 0;
    font-size: 11px;
    letter-spacing: .12em;
    opacity: .82;
  }
  .cmp-header .cmp-nav__links [aria-current="page"]::before,
  .cmp-header[data-cmp-active="start"] .cmp-nav__links [data-cmp-nav="start"]::before,
  .cmp-header[data-cmp-active="unlocks"] .cmp-nav__links [data-cmp-nav="unlocks"]::before,
  .cmp-header[data-cmp-active="recipes"] .cmp-nav__links [data-cmp-nav="recipes"]::before,
  .cmp-header[data-cmp-active="platforms"] .cmp-nav__links [data-cmp-nav="platforms"]::before,
  .cmp-header[data-cmp-active="cooling"] .cmp-nav__links [data-cmp-nav="cooling"]::before,
  .cmp-header[data-cmp-active="troubleshooting"] .cmp-nav__links [data-cmp-nav="troubleshooting"]::before,
  .cmp-header[data-cmp-active="board"] .cmp-nav__links [data-cmp-nav="board"]::before,
  .cmp-header[data-cmp-active="credits"] .cmp-nav__links [data-cmp-nav="credits"]::before {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: auto;
    height: 1px;
    margin: 0;
  }
  .cmp-header .cmp-nav__signin,
  .cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__signin {
    display: inline-flex;
    justify-self: end;
    min-height: 36px;
    margin: 0;
  }
  .cmp-header:has(.cmp-nav__toggle:checked) { box-shadow: none; }
  .cmp-header--overlay:has(.cmp-nav__toggle:checked) {
    background: linear-gradient(180deg, rgba(7,8,10,.72) 0%, rgba(7,8,10,0) 100%);
    border-bottom-color: transparent;
  }
}
/* From 1140px: one row. */
@media (min-width: 1140px) {
  .cmp-header .cmp-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand links signin";
    column-gap: 36px;
    min-height: 60px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .cmp-header .cmp-nav__links,
  .cmp-header .cmp-nav__toggle:checked ~ .cmp-nav__links { gap: 0 22px; padding: 0; }
}

/* ---------- Labels and status badges ---------- */
.cmp-label {
  font-family: var(--cmp-font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cmp-muted);
}
.cmp-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--cmp-font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.cmp-badge--proven    { background: rgba(94,242,232,.16);  color: #5ef2e8; }
.cmp-badge--reported  { background: rgba(255,138,61,.16);  color: #ff9a55; }
.cmp-badge--theory    { background: rgba(166,172,180,.16); color: #a6acb4; }
.cmp-badge--contested { background: rgba(198,176,255,.16); color: #c6b0ff; }
.cmp-badge--warning   { background: rgba(255,100,100,.16); color: #ff7a7a; box-shadow: inset 0 0 0 1px rgba(255,100,100,.55); }

/* Badges on a light page (Citizen day theme or any .cmp-on-light container). */
.skin-theme-clientpref-day .cmp-badge--proven,    .cmp-on-light .cmp-badge--proven    { background: #dcf6f2; color: #0b6f66; }
.skin-theme-clientpref-day .cmp-badge--reported,  .cmp-on-light .cmp-badge--reported  { background: #ffeddf; color: #a8500f; }
.skin-theme-clientpref-day .cmp-badge--theory,    .cmp-on-light .cmp-badge--theory    { background: #eceef1; color: #4e555d; }
.skin-theme-clientpref-day .cmp-badge--contested, .cmp-on-light .cmp-badge--contested { background: #efe9ff; color: #5b3fb0; }
.skin-theme-clientpref-day .cmp-badge--warning,   .cmp-on-light .cmp-badge--warning   { background: #ffe6e6; color: #b01d1d; box-shadow: inset 0 0 0 1px #f1a3a3; }

@media (prefers-reduced-motion: reduce) {
  .cmp-header .cmp-nav__signin, .cmp-nav__burger-lines, .cmp-nav__burger-lines::before, .cmp-nav__burger-lines::after { transition: none; }
}
