/* ============================================================================
   codalume.com — static site skeleton
   Dark, terminal-inspired, no framework. Single stylesheet, no build step.
   Sections: 1 tokens · 2 reset · 3 layout · 4 header/nav · 5 footer
             6 typography · 7 components · 8 page blocks · 9 data views
             10 forms · 11 utilities · 12 responsive · 13 a11y/motion
   ========================================================================== */

/* 1 ── Tokens ------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg: #07090b;
  --bg-elev: #0b0f12;
  --panel: #0f1518;
  --panel-2: #131b1f;
  --line: #1c252b;
  --line-strong: #3a4a55;
  /* interactive controls need a 3:1 boundary against their own fill */
  --line-control: #4e6069;

  /* ink */
  --text: #dce5eb;
  --muted: #8fa0ac;
  --dim: #74868f;

  /* accents */
  --accent: #3ddc97;
  --accent-dim: #2aa876;
  --accent-soft: rgba(61, 220, 151, 0.1);
  --accent-glow: rgba(61, 220, 151, 0.22);
  --sky: #6cb6ff;
  --amber: #f0b429;
  --red: #ef6b6b;

  /* type */
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", "SFMono-Regular",
    "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* metrics */
  --wrap: 1120px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --pad: clamp(1.1rem, 2.6vw, 2rem);
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 64px;

  /* effects */
  --shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* 2 ── Reset -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint grid + top glow: reads as a console, stays quiet */
  background-image:
    radial-gradient(900px 420px at 50% -12%, rgba(61, 220, 151, 0.07), transparent 70%),
    linear-gradient(to right, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 100% 100%, 64px 64px, 64px 64px;
  background-attachment: fixed;
}

img,
svg,
iframe {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #67f0b3;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Browsers default to `figure { margin: 1em 40px }`; inside a grid that both
   insets the card and shrinks the chart SVG (its text scales with the viewBox). */
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 1.15rem;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.86em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* 3 ── Layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.main {
  display: block;
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

.stack > * + * {
  margin-top: var(--gap);
}

.stack-sm > * + * {
  margin-top: 0.6rem;
}

.stack-lg > * + * {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.section {
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}

.section + .section {
  border-top: 1px solid var(--line);
}

/* The origin note, at the foot of the hero's right column (2026-10-21).
   It is prose, not an illustration, so it gets a rule and a quieter size and
   sits under the terminal — where the column already had the vertical slack. */
.hero__origin {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.hero__origin .eyebrow {
  margin: 0 0 0.4rem;
}

.hero__origin-text {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid > * {
  min-width: 0;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Six KPIs read as 3x2, not 4 + 2 orphans. */
.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 4 ── Header + nav ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
}

.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  row-gap: 0.25rem;
  /* The header row may wrap. It only does so when the brand and the menu
     button cannot share a line (320px at a 150% text size), and a wrapped
     button is still better than a button 63px past the right edge. */
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand__prompt {
  color: var(--accent);
  font-weight: 700;
}

.brand__tld {
  color: var(--dim);
  font-weight: 400;
}

.brand__cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  translate: 0 0.13em;
  background: var(--accent);
  animation: blink 1.25s steps(1, end) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* Six top-level entries; every other destination lives one level down.
   The row is allowed to WRAP. A header row that cannot fit must break, never
   clip: the 2026-10 nav bug was `flex-wrap: nowrap` (armed from chrome.css
   between 761px and 980px) leaving thirteen links on one line and 576px of
   horizontal document overflow at an 800px viewport. */
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  row-gap: 0.2rem;
  max-width: 100%;
  min-width: 0;
}

.nav__link {
  display: inline-block;
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav__link::before {
  content: "";
  color: var(--dim);
  margin-right: 0;
}

.nav__link:hover,
.nav__summary:hover {
  color: var(--text);
  background: var(--panel-2);
}

.nav__link[aria-current="page"],
.nav__summary[aria-current] {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav__link[aria-current="page"]::before {
  content: "▸ ";
  color: var(--accent);
}

/* A group is a <details>: the submenu opens with Enter/Space on the summary
   and with a tap — no JavaScript in the path. site.js adds Escape, closes
   siblings and resets the open state across the breakpoint. */
.nav__group {
  position: relative;
}

.nav__summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

/* `.nav__link::before` is the "current page" marker slot. A summary is a flex
   container, so that empty pseudo-element would sit in the middle and
   space-between would centre the label; summaries mark themselves with the
   accent fill instead. */
.nav__summary::before {
  content: none;
}

.nav__summary::-webkit-details-marker {
  display: none;
}

.nav__summary::marker {
  content: "";
}

.nav__chev {
  flex: none;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.nav__group[open] > .nav__summary .nav__chev {
  transform: rotate(180deg);
}

.nav__menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 12.5rem;
  padding: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.nav__group[open] > .nav__menu {
  display: block;
}

.nav__item {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.nav__item:hover {
  color: var(--text);
  background: var(--panel-2);
}

.nav__item[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav__search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav__icon {
  flex: none;
  opacity: 0.8;
}

/* The word "search" belongs to the drawer; on the header row the icon carries
   it, and the link keeps an accessible name through aria-label. */
.nav__search-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  /* space-between already pushes the button right; the auto margin keeps it
     right when the header row has wrapped and it owns the second line alone. */
  margin-left: auto;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.nav-toggle:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

/* 5 ── Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, rgba(61, 220, 151, 0.025));
  padding-block: clamp(2rem, 4vw, 2.75rem);
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
}

.site-footer__brand {
  font-family: var(--mono);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.site-footer h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-bottom: 0.7rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.4rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer__meta {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--dim);
}

/* 6 ── Typography -------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent-dim);
}

.display {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.display em {
  font-style: normal;
  color: var(--accent);
}

.h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
}

.lede {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--muted);
  max-width: 62ch;
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 0.85rem;
}

/* section head: label + title + optional aside */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}

/* flex/grid children default to min-width:auto and refuse to shrink below
   their content — the usual cause of mobile horizontal scroll */
.section-head > * {
  min-width: 0;
}

.section-head__text {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 66ch;
}

/* 7 ── Components -------------------------------------------------------- */
/* panels */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.panel__head::before {
  content: "#";
  color: var(--accent-dim);
  margin-right: -0.35rem;
}

/* Keep the trailing status pill on the right when it fits, and let it take its
   own full-width row instead of being squeezed when it does not. */
.panel__head > .pill {
  margin-left: auto;
}

.panel__body {
  padding: var(--pad);
}

.panel__body--flush {
  padding: 0;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}

.dot--amber {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.14);
}

.dot--red {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 107, 107, 0.14);
}

.dot--dim {
  background: var(--dim);
  box-shadow: none;
}

/* buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 1.05rem;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease,
    background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-dim);
  color: var(--text);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  --btn-bg: var(--accent-soft);
  --btn-fg: var(--accent);
  --btn-bd: color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn--primary:hover {
  --btn-bg: color-mix(in srgb, var(--accent) 18%, transparent);
  --btn-fg: #7cf5c2;
}

.btn--ghost {
  --btn-fg: var(--muted);
}

.btn--block {
  width: 100%;
  justify-content: center;
}

.btn__arrow {
  transition: translate 0.15s ease;
}

.btn:hover .btn__arrow {
  translate: 3px 0;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* tags */
.tag {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  white-space: nowrap;
}

.tag--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  /* long content (dataset provenance) must wrap rather than push the page wide */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* terminal chrome */
.terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080b0d;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #0c1114;
}

.terminal__light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.terminal__light:nth-child(1) {
  background: #ff5f57;
}
.terminal__light:nth-child(2) {
  background: #febc2e;
}
.terminal__light:nth-child(3) {
  background: #28c840;
}

.terminal__title {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}

.terminal__body {
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--muted);
  /* Wrap, never crop. On a 1440px desktop the hero card is ~420px wide and the
     longest line is ~516px: `pre` + `overflow-x: auto` cut the sentence in half
     and the scrollbar only appeared on hover. A terminal that hides the end of
     a line is a crop, not a terminal. */
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.terminal__body .c-prompt {
  color: var(--accent);
}
.terminal__body .c-cmd {
  color: var(--text);
}
.terminal__body .c-ok {
  color: var(--accent);
}
.terminal__body .c-dim {
  color: var(--dim);
}
.terminal__body .c-warn {
  color: var(--amber);
}

/* 8 ── Page blocks -------------------------------------------------------- */
/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(1rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3.5rem);
}

.hero__text > * + * {
  margin-top: 1.15rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* feature cards */
.feature {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.feature:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.feature__k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
}

.feature__t {
  font-family: var(--mono);
  font-size: 0.98rem;
  color: var(--text);
}

.feature__d {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* KPI tiles */
.kpi {
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.kpi__v {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi__v--accent {
  color: var(--accent);
}

.kpi__k {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

.kpi__note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* story / incident cards */
.story-list {
  display: grid;
  gap: 1rem;
}

.story {
  display: grid;
  gap: 0.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.story:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.story__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}

.story__title {
  font-family: var(--mono);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.story__title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.story__title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.story__summary {
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--muted);
  text-wrap: pretty;
}

.story__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

/* filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: var(--gap);
}

.filter {
  padding: 0.34rem 0.75rem;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.filter[aria-pressed="true"],
.filter[aria-current="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}

/* filters are rendered server-side as links, so they need anchor affordances */
a.filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

/* 2026-10-21 — proposal 10 of the persuasion audit: the theme filter is a
   <details> disclosure. At 390px the two chip rows cost ~250px and pushed the
   first note past the first screen; the codename row stays visible (it is the
   primary filter) and this one opens on a tap. The server renders it OPEN when
   a theme is active, so an active filter is never hidden. No JavaScript. */
.filters-disclosure {
  margin-bottom: var(--gap);
}

.filters-disclosure__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.75rem;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}

.filters-disclosure__summary::-webkit-details-marker {
  display: none;
}

.filters-disclosure__summary::marker {
  content: "";
}

.filters-disclosure__summary:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.filters-disclosure[open] > .filters-disclosure__summary {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}

.filters-disclosure[open] > .filters-disclosure__summary .nav__chev {
  transform: rotate(180deg);
}

/* The inner row keeps its own rhythm; the disclosure owns the section gap. */
.filters-disclosure > .filters {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.filters__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
  white-space: normal;
}

/* architecture rows (infra) */
.arch {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.arch__row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.arch__row:last-child {
  border-bottom: 0;
}

.arch__k {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dim);
  padding-top: 0.15rem;
}

.arch__v {
  color: var(--muted);
  font-size: 0.92rem;
}

.arch__v strong {
  color: var(--text);
  font-weight: 500;
}

/* dashboard frames */
.frames {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never let an iframe widen the track */
  gap: var(--gap);
}

.frame {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.frame__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.frame__head > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.frame__head a {
  font-size: 0.74rem;
  text-decoration: none;
  color: var(--sky);
}

.frame__head a:hover {
  text-decoration: underline;
}

.frame__body {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  background: #080b0d;
}

/* A height published by the liveproof lane replaces the ratio entirely: with
   both height and aspect-ratio set, the box derives its WIDTH from the ratio
   (1500px * 16/9 = 2666px) and the iframe overflows the page. */
.frame__body--fixed {
  aspect-ratio: auto;
  min-height: 0;
}

.frame__body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* link-card variant used while Grafana has framing disabled */
.frame__body--card {
  position: static;
  aspect-ratio: auto;
  min-height: 0;
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1.25rem;
  text-align: center;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.012) 0 10px,
      transparent 10px 20px
    ),
    var(--bg-elev);
}

.frame__note {
  margin: 0;
  padding: 0.55rem 1rem 0.6rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  font-size: 0.78rem;
  color: var(--dim);
}

/* placeholder shown where a data-driven widget has nothing yet */
.empty {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: clamp(1.75rem, 5vw, 3rem) 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.012) 0 10px,
      transparent 10px 20px
    ),
    var(--bg-elev);
  text-align: center;
  color: var(--muted);
}

.empty__k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.empty__t {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
}

.empty__d {
  font-size: 0.88rem;
  max-width: 52ch;
  line-height: 1.6;
}

.empty code {
  color: var(--accent-dim);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* skeleton bars for pending charts */
.skeleton-chart {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 1.25rem;
}

.skeleton-chart span {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(
    to top,
    rgba(61, 220, 151, 0.06),
    rgba(61, 220, 151, 0.16)
  );
  animation: pulse 2.4s ease-in-out infinite;
}

.skeleton-chart span:nth-child(2) {
  animation-delay: 0.15s;
}
.skeleton-chart span:nth-child(3) {
  animation-delay: 0.3s;
}
.skeleton-chart span:nth-child(4) {
  animation-delay: 0.45s;
}
.skeleton-chart span:nth-child(5) {
  animation-delay: 0.6s;
}
.skeleton-chart span:nth-child(6) {
  animation-delay: 0.75s;
}
.skeleton-chart span:nth-child(7) {
  animation-delay: 0.9s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scaleY(0.9);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* 9 ── Data views (charts) ------------------------------------------------ */
.chart-grid {
  display: grid;
  gap: var(--gap);
  /* 420px minimum gives two columns at the 1120px wrap: four charts, 2x2. */
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.chart {
  padding: 1.15rem 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.chart__t {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--text);
}

.chart__u {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}

.chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart__svg text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--dim);
}

.chart__svg .axis line,
.chart__svg .axis path {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart__svg .gridline {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart__svg .series-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__svg .series-area {
  fill: url(#areaGrad);
  stroke: none;
}

.chart__svg .bar {
  fill: color-mix(in srgb, var(--accent) 78%, transparent);
}

.chart__svg .bar:hover {
  fill: var(--accent);
}

.chart__svg .point {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart__svg .donut-seg {
  stroke: var(--panel);
  stroke-width: 2;
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart__legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.chart__note {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--dim);
}

/* data provenance strip */
.provenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.24);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}

.provenance code {
  color: var(--muted);
}

/* 10 ── Forms ------------------------------------------------------------- */
.form {
  display: grid;
  gap: 1rem;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field__label {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__label .req {
  color: var(--accent);
  margin-left: 0.2rem;
}

.field__hint {
  font-size: 0.78rem;
  color: var(--dim);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.66rem 0.8rem;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-sm);
  background: #080b0d;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--dim);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input:user-invalid,
.textarea:user-invalid {
  border-color: color-mix(in srgb, var(--red) 60%, transparent);
}

.textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form__legal {
  font-size: 0.78rem;
  color: var(--dim);
  max-width: 46ch;
}

/* honeypot — visually and semantically hidden, still in DOM for bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* status messages */
.status-msg {
  display: none;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.28);
}

.status-msg[data-state] {
  display: flex;
  flex-direction: column;
}

.status-msg[data-state="ok"] {
  border-left-color: var(--accent);
  color: var(--text);
}

.status-msg[data-state="error"] {
  border-left-color: var(--red);
  color: var(--text);
}

.status-msg[data-state="info"] {
  border-left-color: var(--sky);
  color: var(--muted);
}

.status-msg__title {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.status-msg a {
  color: var(--sky);
}

/* contact side panel list */
.contact-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.contact-list li {
  display: grid;
  gap: 0.15rem;
}

.contact-list .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.contact-list .v {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

/* 11 ── Utilities -------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  translate: -50% -140%;
  z-index: 100;
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  transition: translate 0.15s ease;
}

.skip-link:focus-visible {
  translate: -50% 0.5rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: var(--accent-glow);
  color: #fff;
}

.nowrap {
  white-space: nowrap;
}

/* 12 ── Responsive ------------------------------------------------------- */
/* Seven top-level entries (the `projects` door, 2026-10-21) is ~93px more nav
   than six, which tipped the header into a second row between 761px and ~860px.
   The links tighten there so the row stays one line; it can still wrap rather
   than clip if a longer locale or a 150% text size needs the room. */
@media (min-width: 761px) and (max-width: 900px) {
  .nav {
    gap: 0.15rem;
  }

  .nav__link {
    padding-inline: 0.45rem;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__visual {
    order: 2;
  }

  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 58px;
  }

  /* mobile nav: the toggle reveals a drawer. Every destination is reachable
     without a pointer: the drawer rows are links, the group rows are real
     <details> disclosures (Enter/Space opens them, Escape closes them). */
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    /* flex-end belongs to the header row. In a constrained column it pushes
       overflow ABOVE the panel, where it cannot be scrolled to. */
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.6rem clamp(1rem, 4vw, 2.5rem) max(1rem, env(safe-area-inset-bottom));
    border-bottom: 1px solid var(--line);
    background: var(--bg-elev);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.95);
    display: none;
    /* The panel is absolute inside the sticky header, so it does not move with
       the page: without a bound it runs past the bottom of a short phone screen
       and the last rows can never be reached (13 links ran to 706px on a
       390x667 viewport with no scroll: scrollHeight == clientHeight). Bound it
       to the viewport and let the panel scroll itself. */
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-header[data-nav-open="true"] .nav {
    display: flex;
  }

  .nav__link {
    padding: 0.7rem 0.75rem;
    font-size: 0.88rem;
  }

  /* In the drawer the groups stay disclosures, but their menus flow inline
     instead of floating: nothing is absolutely positioned, so nothing can be
     clipped, and an open group scrolls with the panel. */
  .nav__group {
    position: static;
  }

  .nav__summary {
    display: flex;
    justify-content: space-between;
  }

  .nav__chev {
    margin-left: auto;
  }

  .nav__menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 0.1rem 0 0.5rem 0.85rem;
    padding: 0 0 0 0.75rem;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav__group[open] > .nav__menu {
    display: block;
  }

  .nav__item {
    padding: 0.55rem 0.6rem;
    font-size: 0.86rem;
    white-space: normal;
  }

  .nav__search-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A 46-character monospace line does not fit 358px. Wrapping keeps every
     line readable; the horizontal-scroll version silently clipped the right
     edge (recovery / tail lines were cut mid-word). */
  .terminal__body {
    font-size: 0.78rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  /* Footer sections need their own separation once the grid is one column. */
  .site-footer__grid > div + div {
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
  }

  .arch__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .form__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters__count {
    margin-left: 0;
    width: 100%;
  }

  .chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Fixed-height embeds keep their published height; only the ratio-based
     placeholder switches to 4:3 on narrow screens. */
  .frame__body:not(.frame__body--fixed) {
    aspect-ratio: 4 / 3;
  }

  .section-head {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .btn-row .btn {
    width: 100%;
    justify-content: center;
  }

  /* Ten codename chips wrapped to four rows on a 390px phone, which is what
     still stood between a reader and the first note after the theme filter
     moved behind its disclosure (2026-10-21). Slightly denser chips fit in
     three rows and the first note starts inside the first screen. */
  .filters {
    gap: 0.35rem;
  }

  .filter {
    padding: 0.3rem 0.62rem;
    font-size: 0.72rem;
  }
}

/* 14 ── Reframe: the method lesson on a post-mortem ----------------------- */
/* The lesson line is the post-mortem's second claim: what the failure taught
   the operating structure, not just the system. It sits below the summary,
   marked with a rule, so it reads as an annotation rather than a headline. */
.story__lesson {
  margin: 0;
  padding: 0.15rem 0 0.15rem 0.8rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.story__lesson-k {
  display: inline-block;
  margin-right: 0.3rem;
  color: var(--accent-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 15 ── Hero: the puzzle at the door + the operator's byline --------------- */
/* Two small lines under the hero pills: one is a mechanism with a grin, the
   other is a signature. Both stay quiet — neither should compete with the lede. */
.hero__note {
  margin: 0.9rem 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.hero__sign {
  margin: 0.55rem 0 0;
  color: var(--dim);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.hero__sign strong {
  color: var(--text);
  font-weight: 600;
}

/* 16 ── Project register on the home page --------------------------------- */
/* Seven codenames in the arch register: the name and its status sit in the key
   column, the hint in the value column. No links until a project is complete,
   so the status badge carries the whole claim. */
.arch--projects .arch__k {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.proj-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.proj-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

.proj-status--operational {
  color: var(--accent);
}

.proj-status--prep {
  color: var(--amber);
}

.proj-status--research {
  color: var(--sky);
}

/* 13 ── Accessibility + motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .brand__cursor {
    animation: none;
    opacity: 1;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text: #f2f7fa;
    --muted: #b9c7d1;
    --dim: #93a3ad;
    --line: #34444e;
    --line-strong: #55696f;
    --line-control: #6b8087;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .site-footer,
  .nav-toggle,
  .frame__body iframe {
    display: none;
  }
}
