/* One typeface, hairlines, ink for what's done and one accent for what's moving. Colour only where it means something:
   green up, red down or failed, amber waiting on a person. Gold marks the site's own frame (labels, the selected
   thing) and where a change stands right now. */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --ink: #131313;
  --ink-2: #4b4b47;
  --ink-3: #85847e;
  --line: #e2e1dc;
  --line-2: #c8c7c0;
  --accent: #2448d6;
  --accent-soft: #e6ebfb;
  --gold: #8f6a12;
  --gold-soft: #f5ecd6;
  --bar-gold: #d6b25e;   /* gold on the inverted production bar */
  --bar-red: #ff5a63;    /* and its red, for what is live */
  --up: #1d8348;
  --warn: #b26a00;
  --down: #c8372b;
  --cta: #c1121f;
  --unknown: #a3a29b;
  --i-ui: #2448d6;
  --i-behaviour: #131313;
  --i-tests: #a3a29b;
  --i-tooling: #cfcec7;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.03), 0 8px 24px -12px rgb(0 0 0 / 0.12);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f10;
    --surface: #161719;
    --surface-2: #1d1f21;
    --ink: #eeeeea;
    --ink-2: #b4b4ae;
    --ink-3: #7c7c77;
    --line: #26282a;
    --line-2: #3a3c3f;
    --accent: #7d97ff;
    --accent-soft: #1b2340;
    --gold: #d6b25e;
    --gold-soft: #2b2416;
    --bar-gold: #7a5a0c;
    --bar-red: #c1121f;
    --up: #46c37b;
    --warn: #e6a23c;
    --down: #f06b5f;
    --cta: #ff5a63;
    --unknown: #5d5e5c;
    --i-ui: #7d97ff;
    --i-behaviour: #eeeeea;
    --i-tests: #6d6e6b;
    --i-tooling: #3d3f41;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0f10;
  --surface: #161719;
  --surface-2: #1d1f21;
  --ink: #eeeeea;
  --ink-2: #b4b4ae;
  --ink-3: #7c7c77;
  --line: #26282a;
  --line-2: #3a3c3f;
  --accent: #7d97ff;
  --accent-soft: #1b2340;
  --gold: #d6b25e;
  --gold-soft: #2b2416;
  --bar-gold: #7a5a0c;
  --bar-red: #c1121f;
  --up: #46c37b;
  --warn: #e6a23c;
  --down: #f06b5f;
  --cta: #ff5a63;
  --unknown: #5d5e5c;
  --i-ui: #7d97ff;
  --i-behaviour: #eeeeea;
  --i-tests: #6d6e6b;
  --i-tooling: #3d3f41;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; }
.muted { color: var(--ink-3); }
.num, time, .tab-count, .handle-count { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.eyebrow { font: 500 0.72rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.brief > .eyebrow { margin-bottom: 12px; }
.eyebrow a { color: inherit; text-decoration: none; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; margin: 16px 0 0; }

/* The production bar: the way into the live app, above everything, and what's new in it. Ink on paper inverted, in
   both themes; Open Geno is the one red thing in it. */
.prod { position: relative; z-index: 35; background: var(--ink); color: var(--bg); box-shadow: inset 0 -2px var(--gold); }
.prod-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
/* The name, in the very top left: the mark Wordmark.cs draws, in the bar's inverted colours. The link to EnMax sits in the menu bar below */
.brand { display: grid; justify-items: start; gap: 6px; padding: 12px 0 10px; }
.brand-mark { display: block; line-height: 0; color: var(--bg); border-radius: 4px; }
.brand-mark:focus-visible { outline-color: var(--gold); outline-offset: 6px; }
.wm { display: block; width: clamp(170px, 22vw, 228px); height: auto; overflow: visible; }
.wm-last { fill: var(--bg); font: 800 37px var(--sans); font-feature-settings: "ss01", "cv11"; }
.wm-first { fill: var(--bar-gold); font: 500 10.5px var(--mono); }
.wm-rail { stroke: url(#wm-fade); stroke-width: 1.3; }
.wm-fade-from { stop-color: var(--bar-gold); stop-opacity: 0.15; }
.wm-fade-to { stop-color: var(--bar-gold); }
.wm-stop { fill: var(--bar-gold); }
/* The one red thing in the mark: Production, live, the same red as Open Geno */
.wm-prod { fill: var(--bar-red); }
.wm-ring { fill: none; stroke: var(--bar-red); stroke-opacity: 0.45; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) { .wm-ring { animation: wm-pulse 2.8s var(--ease) infinite; } }
@keyframes wm-pulse { 0% { transform: scale(0.6); stroke-opacity: 0.7; } 100% { transform: scale(1.6); stroke-opacity: 0; } }
.prod-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.prod-cta {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  padding: 11px 24px; border-radius: 999px; background: var(--bg); color: var(--cta);
  font-weight: 800; font-size: 1rem; letter-spacing: -0.005em; text-decoration: none;
  transition: gap 0.2s var(--ease), transform 0.2s var(--ease);
}
.prod-cta:hover { gap: 14px; }
.prod-cta:active { transform: translateY(1px); }
.prod-cta:focus-visible { outline-color: var(--bg); outline-offset: 3px; }

/* The tab beside Open Geno, and the panel it slides out */
.news-tab {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--bg) 30%, var(--ink));
  color: var(--bg); font-weight: 600; font-size: 0.9rem; white-space: nowrap; transition: background 0.2s var(--ease);
}
.news-tab::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s var(--ease); }
.news-tab[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.news-tab:hover, .news-tab[aria-expanded="true"] { background: color-mix(in srgb, var(--bg) 12%, var(--ink)); }
.news-tab:focus-visible { outline: 2px solid var(--bg); outline-offset: 3px; }
.news-wrap { position: relative; height: 0; }
.news-panel {
  position: absolute; top: 10px; right: 32px; width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 620px); overflow: auto;
  padding: 20px 22px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.45);
}
@media (prefers-reduced-motion: no-preference) { .news-panel:not([hidden]) { animation: drop 0.22s var(--ease); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.news-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.01em; }
.news-updated { color: var(--ink-3); font-size: 0.78rem; white-space: nowrap; }
.news-k { margin: 18px 0 4px; color: var(--gold); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.news-row:last-child { border-bottom: 0; }
.news-title { font-size: 0.92rem; line-height: 1.4; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ink-3); font-size: 0.76rem; }
.news-where { color: var(--gold); font-weight: 600; }
.news-empty { margin: 14px 0 0; color: var(--ink-3); font-size: 0.88rem; }
.news-all { display: inline-block; margin-top: 16px; color: var(--cta); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.news-all:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .prod-inner { min-height: 60px; gap: 0 12px; flex-wrap: wrap; }
  .brand { padding-bottom: 12px; }
  .prod-actions { margin: 0 0 12px; width: 100%; justify-content: space-between; }
  .prod-cta { padding: 10px 20px; }
  .news-panel { right: 16px; }
}

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 97%, transparent); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.top nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--ink-3); text-decoration: none; font-size: 0.9rem; white-space: nowrap; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav a[aria-current] { box-shadow: inset 0 -1.5px var(--gold); }
@media (max-width: 560px) { .top-inner { gap: 16px; } .top nav { gap: 16px; } .top nav a[href^="http"] { display: none; } }

/* Status dots */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--unknown); display: inline-block; }
.dot[data-state="up"] { background: var(--up); }
.dot[data-state="down"] { background: var(--down); }
.dot[data-state="warn"] { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .dot[data-state="up"] { animation: beat 3s ease-in-out infinite; }
}
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 40%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--up) 0%, transparent); } }

/* ---------- The deployment map ---------- */

.map { padding-bottom: 120px; }

/* The brief: the newest change and where everything stands */
.brief { padding: clamp(24px, 4vw, 40px) 0 clamp(24px, 4vw, 36px); border-bottom: 1px solid var(--line); }
/* The brief keeps to a 720px reading column; the pipeline below it runs wider */
.brief > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.fresh { display: flex; align-items: center; gap: 8px; margin: 0 auto clamp(18px, 3vw, 28px); font-size: 0.82rem; color: var(--ink-3); }
.fresh strong { color: var(--warn); font-weight: 500; }
.brief-title { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }

/* The newest change, in one line */
.brief-newest { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; width: 100%; max-width: 720px; margin: 0 auto; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); font-size: 0.86rem; }
.brief-newest:hover { border-color: var(--gold); }
.brief-newest:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brief-newest-k { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.brief-newest-title { font-weight: 500; min-width: 0; flex: 1 1 260px; }

/* Impact: what a change means for people, as a mark and a word */
.impact { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; }
.impact-mark { width: 8px; height: 8px; flex: none; background: var(--i-tooling); }
.impact[data-impact="ui"] .impact-mark { background: var(--i-ui); }
.impact[data-impact="behaviour"] .impact-mark { background: var(--i-behaviour); border-radius: 50%; }
.impact[data-impact="tests"] .impact-mark { background: transparent; border: 1.5px solid var(--i-tests); border-radius: 50%; }
.impact[data-impact="tooling"] .impact-mark { background: transparent; border: 1.5px solid var(--i-tests); transform: rotate(45deg) scale(0.85); }

/* A feature's track: one segment per step, the deploy tiers set apart */
.track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 6px; margin-top: 4px; }
.track i { border-radius: 1px; background: var(--line); }
.track i[data-tier] { margin-left: 0; }
.track i[data-tier]:first-of-type { margin-left: 3px; }
.track i[data-stage="done"] { background: var(--ink); }
.track i[data-stage="running"] { background: var(--accent); }
.track i[data-stage="waiting"] { background: var(--warn); }
.track i[data-stage="failed"] { background: var(--down); }
@media (prefers-reduced-motion: no-preference) { .track i[data-stage="running"] { animation: glow 1.6s ease-in-out infinite; } }
@keyframes glow { 50% { opacity: 0.35; } }

.close { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; line-height: 1; color: var(--ink-3); flex: none; }
.close:hover { background: var(--surface-2); color: var(--ink); }
.close:focus-visible { outline: 2px solid var(--accent); }

/* Unit tests not yet run on this build: a warning, in amber, not a step anyone has to take */
.track i[data-key="tests"][data-stage="queued"] { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 35%, transparent) 3px 6px); }
.track i[data-key="tests"][data-stage="done"] { background: var(--up); }

/* EnMax's progress bars on a feature: what's counted, how far, and a line on why */
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; font-size: 0.76rem; }
.meter-label { color: var(--ink-2); font-weight: 500; }
.meter-count { color: var(--ink); font-weight: 600; font-size: 0.74rem; }
.meter-bar { grid-column: 1 / -1; display: flex; gap: 1px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.meter-bar i { display: block; min-width: 2px; }
.meter-bar [data-part="done"] { background: var(--ink); }
.meter[data-key="suite"] .meter-bar [data-part="done"], .meter[data-key="mine"] .meter-bar [data-part="done"] { background: var(--up); }
.meter-bar [data-part="failed"] { background: var(--down); }
.meter-bar [data-part="unknown"] { background: repeating-linear-gradient(135deg, var(--line-2) 0 3px, transparent 3px 6px); }
.meter-bar [data-part="rest"] { background: transparent; }
.meter[data-state="stale"] .meter-bar [data-part="done"] { opacity: 0.45; }
.meter[data-state="running"] .meter-bar { box-shadow: 0 0 0 1px var(--accent); }
@media (prefers-reduced-motion: no-preference) { .meter[data-state="running"] .meter-bar [data-part="done"] { animation: glow 1.6s ease-in-out infinite; } }
.meter[data-state="failed"] .meter-count { color: var(--down); }
.meter[data-state="done"][data-key="suite"] .meter-count, .meter[data-state="done"][data-key="mine"] .meter-count { color: var(--up); }
.meter-tiers { gap: 3px; background: transparent; }
.meter-tiers i { flex: 1; background: var(--line); border-radius: 2px; }
.meter-tiers i[data-live] { background: var(--ink); }
.meter-note { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.7rem; line-height: 1.35; }
.meter-runs { grid-column: 1 / -1; display: flex; gap: 2px; margin-top: 2px; }
.meter-runs i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--line-2); }
.meter-runs i[data-ok] { background: var(--up); border-color: var(--up); }
.meter-runs i[data-failed] { background: var(--down); border-color: var(--down); }
.meter-runs i[data-narrow] { width: 4px; height: 4px; align-self: center; }

.tip .meters { margin: 4px 0 2px; min-width: 260px; }

/* ---------- The repository map: main as a git graph, and the features branching off it ---------- */

.repo-map { padding: clamp(40px, 6vw, 64px) 0 0; }
.repo-map > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.repo-map > .rm-scroll { max-width: none; }
.rm-top h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
.rm-top h2 .mono { font-size: 0.92em; }
.rm-top .eyebrow { margin-bottom: 8px; }
.trk-sub { margin: 6px 0 0; color: var(--ink-3); font-size: 0.84rem; max-width: 62ch; }
.rm-scroll { margin-top: 18px; overflow-x: auto; overflow-y: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); scrollbar-width: thin; overscroll-behavior-x: contain; }
.rm-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-canvas { position: relative; }
.rm-svg { display: block; overflow: visible; }
.rm-band { fill: transparent; }
.rm-band[data-reached="production"] { fill: color-mix(in srgb, var(--gold-soft) 70%, transparent); }
.rm-band[data-reached="stage"], .rm-band[data-reached="qa"] { fill: var(--surface-2); }
.rm-band[data-reached="dev"] { fill: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.rm-band-label { position: absolute; bottom: 14px; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.rm-band-label[data-reached="production"] { color: var(--gold); }
.rm-band-label .num { color: var(--ink-2); letter-spacing: 0; }
.rm-trunk { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.rm-future { stroke: var(--line-2); stroke-dasharray: 3 5; }
.rm-pr { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.rm-branch { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.rm-branch[data-tone="waiting"] { stroke: var(--gold); }
.rm-branch[data-tone="failed"] { stroke: var(--down); }
.rm-branch[data-tone="running"] { stroke: var(--up); }
.rm-node { cursor: pointer; outline: none; }
.rm-hit { fill: transparent; }
.rm-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; transition: r 0.15s var(--ease); }
.rm-node[data-reached="production"] .rm-dot { fill: var(--gold); stroke: var(--gold); }
.rm-node[data-reached="stage"] .rm-dot, .rm-node[data-reached="qa"] .rm-dot { fill: var(--ink); }
.rm-node[data-reached="dev"] .rm-dot { fill: var(--accent); stroke: var(--accent); }
.rm-node[data-impact="tests"] .rm-dot, .rm-node[data-impact="tooling"] .rm-dot { opacity: 0.55; }
.rm-node:hover .rm-dot, .rm-node:focus-visible .rm-dot { stroke: var(--gold); stroke-width: 3; opacity: 1; }
.rm-node:hover .rm-hit, .rm-node:focus-visible .rm-hit { fill: color-mix(in srgb, var(--gold) 14%, transparent); }
.rm-gap { fill: var(--surface); stroke: var(--line-2); stroke-dasharray: 2 3; }
.rm-gap-n { font: 600 10px var(--sans); fill: var(--ink-2); }
.rm-tip-node { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.rm-node[data-tone="waiting"] .rm-tip-node { stroke: var(--gold); fill: var(--gold-soft); }
.rm-node[data-tone="failed"] .rm-tip-node { stroke: var(--down); }
.rm-node[data-tone="running"] .rm-tip-node { stroke: var(--up); }
.rm-feature { font: 500 12px var(--sans); fill: var(--ink-2); }
.rm-node:hover .rm-feature, .rm-node:focus-visible .rm-feature { fill: var(--ink); }
/* Tier labels, like refs on a git graph; while a node is pointed at, the tiers that have it light up */
.rm-ref { position: absolute; transform: translateX(-50%); }
/* A stepped-up ref keeps a stem down to its commit */
.rm-ref[data-row]::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: calc(24px * var(--row) + 16px); background: var(--line-2); }
.rm-ref-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.68rem; font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 2px var(--surface); }
.rm-ref-pill [data-stop] { cursor: help; transition: opacity 0.15s var(--ease), color 0.15s var(--ease); }
.rm-ref-sep { opacity: 0.5; }
.rm-standby { padding: 0 4px; border-radius: 999px; border: 1px dashed var(--gold); color: var(--gold); cursor: help; }
.rm-ref-pill [data-stop] { padding: 0 4px; border-radius: 999px; }
.repo-map[data-pointing] .rm-ref [data-stop][data-has="true"] { background: var(--gold); color: var(--bg); }
.repo-map[data-pointing] .rm-ref [data-stop][data-has="false"] { opacity: 0.4; text-decoration: line-through; }
.rm-key { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px auto 0; padding: 0; font-size: 0.76rem; color: var(--ink-2); }
.rm-key li { display: inline-flex; align-items: center; gap: 6px; }
.rm-key-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); }
.rm-key [data-reached="production"] .rm-key-dot { background: var(--gold); border-color: var(--gold); }
.rm-key [data-reached="stage"] .rm-key-dot, .rm-key [data-reached="qa"] .rm-key-dot { background: var(--ink); }
.rm-key [data-reached="dev"] .rm-key-dot { background: var(--accent); border-color: var(--accent); }
.rm-key-small .rm-key-dot { width: 8px; height: 8px; opacity: 0.55; }
.rm-key-branch .rm-key-dot { border-radius: 3px; border-color: var(--accent); }
.trk-foot { margin-top: 10px; font-size: 0.8rem; color: var(--ink-3); }
/* The rail inside a tip: each stop names itself */
.trk-rail.tip-rail { --n: 5; grid-template-columns: repeat(var(--n), 1fr); min-width: 270px; margin: 2px 0 4px; }
.tip-rail .trk-stop { height: auto; padding-bottom: 16px; }
.tip-rail .trk-stop::before { top: 12px; }
.tip-rail .trk-stop::after { content: attr(data-label); position: absolute; bottom: 0; font-size: 0.64rem; color: var(--ink-3); }
.tip .track { margin: 2px 0; }

/* The header's link to EnMax: live, quiet or offline, and a click checks now */
.conn { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.76rem; color: var(--ink-2); white-space: nowrap; cursor: pointer; flex: none; }
.conn:hover { border-color: var(--line-2); color: var(--ink); }
.conn[data-state="up"] { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.conn[data-state="warn"] { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--warn); }
.conn[data-state="down"] { border-color: color-mix(in srgb, var(--down) 50%, var(--line)); color: var(--down); }

/* One stop per tier, joined by a line that is ink as far as the change has got */
.trk-rail { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; }
.trk-stop { position: relative; display: grid; place-items: center; height: 24px; cursor: default; }
.trk-stop::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; background: var(--line); }
.trk-stop:first-child::before { left: 50%; }
.trk-stop:last-child::before { right: 50%; }
.trk-stop[data-state="passed"]::before { background: var(--ink); }
.trk-stop[data-state="here"]::before { background: linear-gradient(to right, var(--ink) 50%, var(--line) 50%); }
.trk-stop:first-child[data-state="here"]::before { background: var(--line); }
.trk-stop[data-state="live"]::before { background: var(--ink); }
.trk-mark { position: relative; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.trk-stop[data-state="passed"] .trk-mark { background: var(--ink); border-color: var(--ink); }
.trk-stop[data-state="here"] .trk-mark, .trk-stop[data-state="live"] .trk-mark { width: 14px; height: 14px; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.trk-stop[data-state="next"] .trk-mark { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .trk-stop[data-state="next"] .trk-mark { animation: ring 2.4s var(--ease) infinite; } }
.trk-where { font-size: 0.72rem; color: var(--gold); font-weight: 600; white-space: nowrap; }
@media (max-width: 720px) {

  /* Without the column heads, each stop names itself */
  .trk-stop { height: auto; padding-bottom: 16px; }
  .trk-stop::before { top: 12px; }
  .trk-stop::after { content: attr(data-label); position: absolute; bottom: 0; font-size: 0.64rem; color: var(--ink-3); }
}

/* ---------- The key: what each bar on the map means ---------- */

/* ---------- Hover tips ---------- */

[data-tip] { cursor: help; }
button[data-tip], a[data-tip], .trk-stop[data-tip] { cursor: pointer; }
.trk-stop[data-tip] { cursor: help; }
.tip { position: fixed; z-index: 50; max-width: 300px; padding: 9px 12px 10px; border-radius: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-top: 2px solid var(--gold); font-size: 0.78rem; line-height: 1.45; box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.35); pointer-events: none; display: grid; gap: 3px; }
.tip[hidden] { display: none; }
.tip[data-rich] { max-width: 380px; gap: 5px; }
.tip-cap { margin-top: 4px; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3) !important; }
.tip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tip-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; color: var(--ink); }
.tip-list .impact { align-self: center; }
.tip-change { color: var(--ink) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tip-when { color: var(--ink-3) !important; font-size: 0.7rem; white-space: nowrap; }
.tip-list .tip-more { display: block; color: var(--ink-3); font-size: 0.72rem; }
.tip-tick-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.72rem; }
.tip-hint { margin-top: 2px; color: var(--gold) !important; font-size: 0.72rem; font-weight: 600; }
.tip strong { font-weight: 600; color: var(--gold); }
.tip span { color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .tip:not([hidden]) { animation: fade 0.12s var(--ease); } }

.track i:hover { outline: 1px solid var(--gold); outline-offset: 1px; }

/* ---------- The drawer: every phase's changes, tucked under the bottom edge ---------- */

.drawer-scrim { position: fixed; inset: 0; z-index: 25; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(2px); }
.drawer-scrim[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .drawer-scrim:not([hidden]) { animation: fade 0.3s var(--ease); } }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
/* The handle floats in the bottom-right corner, clear of the centred column, and steps aside while the panel is open */
.drawer-handle { pointer-events: auto; align-self: flex-end; margin: 0 clamp(16px, 3vw, 32px) clamp(16px, 3vw, 24px) 0; display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); box-shadow: 0 8px 24px -10px rgb(0 0 0 / 0.35); cursor: pointer; font-weight: 600; font-size: 0.86rem; transition: transform 0.2s var(--ease); }
.drawer[data-open] .drawer-handle { display: none; }
.drawer-handle:hover { transform: translateY(-2px); }
.handle-grip { width: 18px; height: 3px; border-radius: 2px; background: var(--gold); }
.handle-count { font-weight: 400; color: var(--ink-3); }
.drawer-panel { pointer-events: auto; position: relative; width: 100%; max-width: 1120px; height: min(72vh, 760px); display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -16px 48px -16px rgb(0 0 0 / 0.25); }
.drawer-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .drawer-panel:not([hidden]) { animation: slide 0.32s var(--ease); } }
@keyframes slide { from { transform: translateY(24px); opacity: 0; } }
.drawer-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; padding: 14px 64px 0 24px; border-bottom: 1px solid var(--line); }
.drawer-close { position: absolute; top: 10px; right: 14px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { all: unset; cursor: pointer; display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 12px 12px; font-size: 0.88rem; color: var(--ink-3); white-space: nowrap; box-shadow: inset 0 -2px transparent; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px var(--gold); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tab-count { font-size: 0.74rem; color: var(--ink-3); font-weight: 400; }
.filter { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink-2); padding-bottom: 12px; cursor: pointer; }
.filter input { accent-color: var(--ink); margin: 0; }
.phase-panel { overflow-y: auto; padding: 0 24px 40px; overscroll-behavior: contain; }
.phase-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pad { padding: 24px 0; margin: 0; }

.latest { padding: 26px 0 22px; border-bottom: 1px solid var(--line); max-width: 820px; }
.latest .eyebrow { margin-bottom: 10px; }
.latest h3 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.25; text-wrap: balance; }
.latest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0 0; font-size: 0.8rem; color: var(--ink-3); }
.latest-where { margin: 16px 0 0; color: var(--ink-2); }
.latest-impact { margin: 6px 0 0; color: var(--ink-2); }

.commits { list-style: none; margin: 0; padding: 0; }
.commit { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-areas: "kind title meta" ". impact impact"; gap: 2px 18px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.commit .impact { grid-area: kind; }
.commit-title { grid-area: title; font-size: 0.92rem; }
.commit-meta { grid-area: meta; display: flex; gap: 12px; font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; }
.commit-impact { grid-area: impact; font-size: 0.76rem; color: var(--ink-3); }
.commit[data-impact="tests"] .commit-title, .commit[data-impact="tooling"] .commit-title { color: var(--ink-2); }
.more { color: var(--ink-3); font-size: 0.84rem; padding: 18px 0 0; margin: 0; }
@media (max-width: 720px) {
  .drawer-panel { height: 82vh; }
  .drawer-bar { padding: 12px 56px 0 16px; }
  .phase-panel { padding: 0 16px 40px; }
  .commit { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kind" "title" "meta" "impact"; gap: 4px; }
  .commit-meta { flex-wrap: wrap; }
}

/* ---------- Writing ---------- */

.posts { list-style: none; margin: 0; padding: 0; }
.posts a { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.posts li:first-child a { border-top: 1px solid var(--line); }
.posts time { font-size: 0.8rem; color: var(--ink-3); }
.post-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.posts a:hover .post-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.post-summary { color: var(--ink-2); }

.page-head { padding: clamp(36px, 6vw, 72px) 0 24px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.prose { font-size: 1rem; line-height: 1.72; }
.prose > * { max-width: 68ch; }
.prose a { text-decoration-color: var(--accent); }
.prose h2 { font-size: 1.35rem; margin: 2em 0 0.5em; }
.prose h3 { margin: 1.6em 0 0.4em; }
.prose code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 4px; }
.prose pre { background: var(--surface-2); padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { display: block; width: 100%; max-width: 480px; height: auto; margin: 1.5em auto; border-radius: 8px; }
.prose blockquote { margin: 1.5em 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--gold); color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--ink-2); }
.back { margin: 48px 0 64px; }

/* The FAQ: one page, each question a heading */
.faq { padding-bottom: 72px; }
.faq h2 { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.faq h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: 0.84rem; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--ink); }
/* The drawer's handle sits over the bottom edge: keep the footer clear of it on the map */
body:has(.drawer) .foot { padding-bottom: 104px; }

/* Mailing-list box at the end of a post. */
.signup { margin: 2.5em 0 1em; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.signup__label { display: block; font-weight: 600; font-size: 1.05rem; }
.prose .signup__hint { margin: 4px 0 14px; color: var(--ink-2); font-size: 0.95rem; }
.signup__row { display: flex; flex-wrap: wrap; gap: 8px; }
.signup__input { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }
.signup__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.signup__button { flex: 0 0 auto; font-weight: 600; color: var(--surface); background: var(--accent); border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.signup__button:hover { filter: brightness(1.08); }
.signup__button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.prose .signup__note { margin: 12px 0 0; color: var(--ink-3); font-size: 0.85rem; }

/* Cookie consent (analytics.js): a small banner at the foot of the window, Accept and Decline alike, reopened from
   the footer's Cookie settings. */
.foot-link { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: inherit; cursor: pointer; }
.foot-link:hover { color: var(--ink); }
.consent { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: 16px; max-width: 420px; margin-left: auto; padding: 16px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-top: 2px solid var(--gold); border-radius: var(--radius); box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.35); font-size: 0.88rem; }
.consent-title { font-size: 1rem; letter-spacing: -0.01em; }
.consent p { margin: 6px 0 14px; color: var(--ink-2); }
.consent-actions { display: flex; gap: 8px; }
.consent-btn { flex: 1 1 0; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.consent-btn:hover { border-color: var(--ink-3); }
.consent-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
