/* ============================================================================
   GHALVERA — visual system

   True black, bone type, monospace throughout. Two semantic colours and no
   others:

     HELD    cold steel   — a boundary that survived, evidence that verified
     CROSSED signal red   — a boundary that failed, a chain that broke

   Nothing on this site is coloured for decoration. If something is red, it
   means something did not hold.

   Committed to a single dark world. This is an instrument panel, not a
   document, and it does not have a light mode.
   ========================================================================= */

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("assets/fonts/dm-mono-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: optional;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --void: #000000;
  --ground: #050507;
  --raised: #0a0a0d;
  --raised-2: #101014;

  --ink: #e8e5df;
  --ink-2: #8e8b85;
  --ink-3: #77736c;

  --line: #16161a;
  --line-2: #242429;

  --held: #7fa3b3;
  --held-dim: #3d5560;
  --crossed: #d8453d;
  --crossed-dim: #6b2320;
  --crossed-glow: rgba(216, 69, 61, 0.16);

  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --shell: 1180px;
  --gutter: clamp(18px, 4.5vw, 56px);
  --section-y: clamp(70px, 9vw, 132px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* a faint horizontal rule texture — the panel, not a screen effect */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0 1px,
    transparent 1px 3px
  );
}

::selection { background: var(--crossed); color: var(--void); }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--crossed); outline-offset: 3px; }

.skip {
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 100;
  transform: translateY(-160%);
  padding: 0.55rem 0.75rem;
  background: var(--ink);
  color: var(--void);
  font-size: 0.72rem;
  text-decoration: none;
}
.skip:focus { transform: translateY(0); }

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 2; }

.k {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.k b { color: var(--crossed); font-weight: 400; }

/* ==========================================================================
   masthead
   ========================================================================= */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--void) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-2);
}

.bar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  height: 54px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.brand .glyph {
  color: var(--crossed);
  animation: blink 1.4s steps(2, start) infinite;
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .brand .glyph { animation: none; } }

.bar nav { display: flex; align-items: center; gap: clamp(0.75rem, 2.2vw, 1.7rem); }

.bar nav a {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.bar nav a::before { content: "/"; color: var(--ink-3); margin-right: 0.35rem; }
.bar nav a:hover { color: var(--crossed); }

@media (max-width: 700px) {
  .bar nav a[data-opt] { display: none; }
  .bar nav { gap: 0.7rem; }
  .bar nav a { font-size: 0.61rem; letter-spacing: 0.08em; }
  .bar nav a::before { margin-right: 0.18rem; }
}
@media (max-width: 460px) {
  .bar .shell { gap: 0.65rem; }
  .brand { font-size: 0.73rem; letter-spacing: 0.2em; }
  .bar nav { gap: 0.48rem; }
  .bar nav a { font-size: 0.57rem; }
}
@media (max-width: 350px) { .bar nav a[data-narrow] { display: none; } }

/* ==========================================================================
   hero
   ========================================================================= */
.hero { padding-block: clamp(48px, 7vw, 92px) clamp(40px, 6vw, 76px); border-bottom: 1px solid var(--line-2); position: relative; }

.hero::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  width: min(880px, 100%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--crossed-glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid { display: grid; gap: clamp(2rem, 4.5vw, 3.4rem); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); } }

.hero-copy { display: flex; flex-direction: column; gap: 1.4rem; }

h1 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.4vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
h1 .x { color: var(--crossed); }

.lede { font-family: var(--sans); font-size: clamp(0.98rem, 1.7vw, 1.1rem); line-height: 1.68; color: var(--ink-2); margin: 0; max-width: 46ch; }

.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }

.btn {
  /* inline-flex + nowrap: as bare flex items these stretched to the tallest
     sibling and the longer label wrapped, so the pair rendered at different
     heights with the text off-centre. 2026-08-18. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--crossed);
  color: var(--crossed);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--crossed); color: var(--void); }
.btn.q { border-color: var(--line-2); color: var(--ink-2); }
.btn.q:hover { background: transparent; border-color: var(--ink-2); color: var(--ink); }

/* -- the chain instrument -------------------------------------------------- */
.panel { border: 1px solid var(--line-2); background: var(--ground); margin: 0; min-width: 0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line-2);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.status { display: inline-flex; align-items: center; gap: 0.4rem; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--held); }
.status.bad { color: var(--crossed); }
.status.bad i { background: var(--crossed); box-shadow: 0 0 8px var(--crossed); }
.status.ok { color: var(--held); }

#chain { display: block; width: 100%; height: clamp(260px, 34vw, 344px); }

.panel-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.panel-foot > div { padding: 0.55rem 0.85rem; border-right: 1px solid var(--line-2); }
.panel-foot > div:last-child { border-right: 0; }
.panel-foot dt { font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.panel-foot dd { margin: 0; font-size: 0.86rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.panel-foot dd.bad { color: var(--crossed); }

/* ==========================================================================
   sections
   ========================================================================= */
.sec { padding-block: var(--section-y); border-bottom: 1px solid var(--line-2); }

.sec-head { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: clamp(1.8rem, 3.6vw, 2.8rem); max-width: 66ch; }
.sec-head h2 { font-family: var(--mono); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.16; letter-spacing: -0.028em; margin: 0; text-wrap: balance; }
.sec-head h2 .x { color: var(--crossed); }
.sec-head > p:not(.k) { margin: 0; font-family: var(--sans); color: var(--ink-2); font-size: 1rem; max-width: 60ch; line-height: 1.68; }

/* -- the loop -------------------------------------------------------------- */
.loop { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.node { background: var(--ground); padding: 1.3rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; position: relative; }
.node h3 { margin: 0; font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--crossed); }
.node p { margin: 0; font-family: var(--sans); color: var(--ink-2); font-size: 0.92rem; line-height: 1.62; }
.node .n { position: absolute; top: 1.3rem; right: 1.25rem; font-size: 0.62rem; color: var(--ink-3); }

/* -- work table ------------------------------------------------------------ */
.tbl { border: 1px solid var(--line-2); overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--crossed-dim) var(--ground); }
.tbl:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; min-width: 42rem; font-size: 0.84rem; }
th, td { text-align: left; padding: 0.72rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); background: var(--raised); white-space: nowrap; border-bottom: 1px solid var(--line-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.2s var(--ease); }
tbody tr:hover { background: var(--raised); }
td.id { color: var(--crossed); white-space: nowrap; }
td .sub { display: block; color: var(--ink-3); font-family: var(--sans); font-size: 0.82rem; margin-top: 0.2rem; line-height: 1.5; }

.pill { font-size: 0.58rem; letter-spacing: 0.13em; text-transform: uppercase; padding: 0.16rem 0.45rem; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.live { color: var(--crossed); border-color: var(--crossed-dim); }
.pill.ok { color: var(--held); border-color: var(--held-dim); }

/* -- tools ---------------------------------------------------------------- */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.tool { background: var(--ground); padding: 1.4rem 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }

/* A grid child defaults to min-width:auto, which lets a wide <pre> push the
   whole page sideways instead of scrolling inside its own box. */
.tool > * { min-width: 0; }
.tool h3 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; color: var(--ink); }
.tool h3::before { content: "$ "; color: var(--crossed); }
.tool p { margin: 0; font-family: var(--sans); color: var(--ink-2); font-size: 0.9rem; line-height: 1.62; }
.tool .limits { border-top: 1px solid var(--line); padding-top: 0.7rem; margin-top: auto; font-size: 0.68rem; color: var(--ink-3); line-height: 1.55; }
.tool .limits b { color: var(--held); font-weight: 400; }

.group-label {
  margin: 2rem 0 0.65rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.group-label:first-of-type { margin-top: 0; }
.tool-meta { display: flex; align-items: center; gap: 0.55rem; font-family: var(--mono) !important; font-size: 0.64rem !important; letter-spacing: 0.08em; text-transform: uppercase; }
.tool.feature { background: linear-gradient(145deg, var(--raised), var(--ground) 60%); }
.tool-links { display: flex; gap: 0.9rem; margin-top: auto !important; }
.tool-links a { color: var(--crossed); font-family: var(--mono); font-size: 0.67rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
.tool-links a::after { content: " →"; }
.tool-links a:hover { color: var(--ink); }

.note-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (min-width: 800px) { .note-grid { grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.72fr); } }
.note-grid .sec-head { margin-bottom: 0; }
.note-card { border: 1px solid var(--line-2); background: var(--ground); padding: 1.3rem; }
.note-card h3 { margin: 1rem 0 0.45rem; font-family: var(--sans); font-size: 1.05rem; font-weight: 500; }
.note-card > p:last-child { margin: 0; color: var(--ink-2); font-family: var(--sans); font-size: 0.9rem; line-height: 1.65; }

pre {
  margin: 0;
  background: var(--void);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  overflow-x: auto;
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--ink-2);
}
pre .p { color: var(--crossed); }
pre .o { color: var(--held); }


/* ==========================================================================
   foot
   ========================================================================= */
.foot { padding-block: clamp(48px, 6vw, 76px) clamp(36px, 5vw, 56px); }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 780px) { .foot-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.foot p { margin: 0; font-family: var(--sans); color: var(--ink-2); font-size: 0.9rem; max-width: 56ch; line-height: 1.68; }
.foot .legal { font-family: var(--mono); color: var(--ink-3); font-size: 0.7rem; margin-top: 1rem; letter-spacing: 0.06em; }
.links { display: flex; flex-direction: column; gap: 0.5rem; }
.links a { font-size: 0.7rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; width: fit-content; transition: color 0.2s var(--ease); }
.links a::before { content: "→ "; color: var(--ink-3); }
.links a:hover { color: var(--crossed); }

/* -- repository column ----------------------------------------------------
   Repositories are private, so a link would 404 for a visitor. The name is
   shown with an explicit private tag rather than a dead link — saying what
   exists and that you cannot see it is more honest than hiding it. */
.repocell { white-space: nowrap; }
.repo-name { font-size: 0.78rem; color: var(--ink-2); }
.priv-tag {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  padding: 0.08rem 0.32rem;
  margin-left: 0.35rem;
}
.readmore {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crossed);
  text-decoration: none;
  border: 1px solid var(--crossed-dim);
  padding: 0.26rem 0.55rem;
  width: fit-content;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.readmore:hover { background: var(--crossed); color: var(--void); }

/* Standing conduct statement. Replaced the numbered "Rules" manifesto on
   2026-08-18 — the obligations are real and must be stated, but a five-point
   manifesto reads as posture rather than practice. */
.conduct {
  margin: 0 0 2.4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  max-width: 62ch;
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--ink-3);
}

/* -- open questions --------------------------------------------------------
   Questions lead the page (2026-08-18). Rendered as a numbered register
   rather than cards: this laboratory's subject is records, and a register is
   what a record looks like. */
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.qrow {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
}
.qrow:last-child { border-bottom: 1px solid var(--line); }
.q-id {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.q-state {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
}
.q-state.running { color: var(--held); border-color: var(--held-dim); }
.qrow h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  max-width: 60ch;
}
.qrow p { margin: 0; font-family: var(--sans); font-size: 0.92rem; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.q-answer { color: var(--ink-3) !important; font-size: 0.86rem !important; }
.q-answer b { color: var(--held); font-weight: 500; }

@media (min-width: 860px) {
  .qrow { grid-template-columns: 7rem minmax(0, 1fr); column-gap: 2rem; }
  .q-id { grid-row: span 3; display: block; padding-top: 0.25rem; }
  .q-state { display: inline-block; margin-top: 0.5rem; }
}

@media (max-width: 520px) {
  :root { --gutter: 16px; --section-y: 58px; }
  .hero { padding-top: 38px; }
  .panel-head { gap: 0.45rem; padding-inline: 0.65rem; font-size: 0.56rem; }
  .panel-foot > div { padding-inline: 0.55rem; }
  .panel-foot dt { font-size: 0.5rem; }
  .panel-foot dd { font-size: 0.72rem; }
  .cta { display: grid; grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
