/* lacuna — terminal-core / whitepaper
   one accent. hairlines. no radius, no shadow, no gradient. */

:root {
  --bg:   #000000;
  --fg:   #e8e6e0;
  --g1:   #b8b6b0;
  --g2:   #8a8884;
  --g3:   #5e5c58;
  --line: #2c2c2b;
  --acc:  #f04a23;

  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;

  --col: 680px;
  --wide: 920px;
  --t: 120ms;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 60px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--acc); color: var(--bg); }

a { color: inherit; text-decoration: none; transition: color var(--t), border-color var(--t); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--acc); outline-offset: 2px; }

.g3 { color: var(--g3); }
.fg { color: var(--fg); }
.sep { color: var(--g3); padding: 0 .5em; }

.label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--g2);
  line-height: 1.4;
}
.center { text-align: center; }

.col  { max-width: calc(var(--col) + 32px);  margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
.wide { max-width: calc(var(--wide) + 32px); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }

/* ── top bar ─────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 20;
  height: 36px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  height: 100%;
  max-width: calc(var(--wide) + 32px);
  margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.mark { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--fg); }
.mark span { color: var(--acc); }

.nav { display: flex; align-items: center; gap: 18px; font-family: var(--mono); font-size: 11px; }
.nav a { color: var(--g1); }
.nav a .g { color: var(--g3); margin-right: 5px; transition: color var(--t); }
.nav a:hover, .nav a.is-active { color: var(--acc); }
.nav a:hover .g, .nav a.is-active .g { color: var(--acc); }

.btn {
  font-family: var(--mono); font-size: 11px; line-height: 1;
  color: var(--fg);
  border: 1px solid var(--g3);
  padding: 5px 10px 6px;
  transition: color var(--t), border-color var(--t);
}
.btn:hover, .btn.on { color: var(--acc); border-color: var(--acc); }

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }

/* ── hero ────────────────────────────────── */

.hero { padding-top: 84px; padding-bottom: 44px; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 230px; gap: 48px; align-items: end;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.meta { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--g2); }
.hero h1 {
  margin-top: 22px;
  font-weight: 400;
  font-size: 96px;
  line-height: .95;
  letter-spacing: -.035em;
  font-variation-settings: "opsz" 60;
}
/* the missing part of the word */
.hero h1 .gap {
  display: inline-block; width: .34em; height: .05em;
  margin: 0 .04em; vertical-align: baseline;
  background: var(--acc);
}
.pron { margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--g2); }
.pron i { font-family: var(--serif); font-size: 14px; color: var(--g1); }
.def { margin-top: 8px; display: grid; grid-template-columns: 22px 1fr; font-style: italic; font-size: 19px; line-height: 1.45; color: var(--g1); max-width: 560px; }
.def .k { font-family: var(--mono); font-style: normal; font-size: 10.5px; color: var(--g3); padding-top: 6px; }
.docmeta { font-family: var(--mono); font-size: 10.5px; border-top: 1px solid var(--line); }
.docmeta div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.docmeta dt { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--g2); }
.docmeta dd { color: var(--fg); }
.lede { max-width: 620px; margin-top: 26px; font-size: 15px; color: var(--g1); line-height: 1.66; }
.prompt { margin-top: 26px; font-family: var(--mono); font-size: 11px; color: var(--g2); }

.cursor {
  display: inline-block; width: .6em; height: 1.15em; margin-left: 4px;
  vertical-align: -3px; background: var(--acc);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── stats ───────────────────────────────── */

.grid3 { display: grid; grid-template-columns: 1.35fr 1fr 1fr; border: 1px solid var(--line); }
.stat { padding: 14px 16px 13px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.val {
  display: block; width: 100%; text-align: left;
  margin-top: 8px;
  font-family: var(--mono); font-size: 17px; line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--t);
}
.val.acc { color: var(--acc); }
.val.copy:hover { color: var(--acc); }
.subv { margin-top: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--g3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.statusrow {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  border: 1px solid var(--line); border-top: 0;
  padding: 8px 16px;
  font-family: var(--mono); font-size: 10.5px; color: var(--g2);
  font-variant-numeric: tabular-nums;
}
.chips { display: flex; align-items: center; flex-wrap: wrap; row-gap: 6px; }
.chips .sep { padding: 0 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  padding: 1px 8px 2px 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--g2);
  transition: color var(--t), border-color var(--t);
}
.chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--g3); transition: background var(--t); }
.chip[data-state="pending"] i { animation: blink .9s steps(1) infinite; }
.chip[data-state="live"] { color: var(--g1); }
.chip[data-state="live"] i { background: var(--acc); }
.chip[data-state="down"] i { background: none; box-shadow: inset 0 0 0 1px var(--g3); }

/* ── contents ────────────────────────────── */

.toc {
  margin-top: 56px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 18px;
  font-family: var(--mono); font-size: 11px;
}
.toc .chain { color: var(--g1); }
.toc .chain a { color: var(--g1); white-space: nowrap; }
.toc .chain a:hover, .toc .chain a.is-active { color: var(--acc); }
.toc .sep { padding: 0 .55em; }

/* ── paper ───────────────────────────────── */

.sec { padding-top: 72px; }
.sec p + p, .sec p + pre, .sec pre + p, .sec dl + p, .sec .eq + p { margin-top: 1em; }

.sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.sec-h .n { font-family: var(--mono); font-size: 11px; color: var(--g2); }
.sec-h h2 { font-weight: 400; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.sec-h .rule { flex: 1; border-bottom: 1px solid var(--line); transform: translateY(-5px); }

.sec h3 { margin: 40px 0 12px; font-weight: 400; font-style: italic; font-size: 18px; scroll-margin-top: 60px; }
.sec h3 .n { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--g2); margin-right: 10px; }

.abstract { margin-top: 14px; }
.abstract p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.epigraph { margin-top: 28px; text-align: center; font-style: italic; color: var(--g1); }
.epigraph em { font-style: normal; }

em, i { font-style: italic; }
sub, sup { font-size: .68em; line-height: 0; }

sup { vertical-align: .55em; }
sup a {
  font-family: var(--mono); font-size: 9.5px; color: var(--acc);
  padding: 0 1px 0 1px;
}
sup a:hover { color: var(--fg); }

code {
  font-family: var(--mono); font-size: .8em; color: var(--fg);
  border: 1px solid var(--line); padding: 1px 4px;
  white-space: nowrap;
}

pre.code {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75; color: var(--g1);
  overflow-x: auto;
  tab-size: 2;
}
pre.code .k { color: var(--fg); }
pre.code .c { color: var(--g3); }

.eq {
  position: relative; text-align: center;
  margin: 22px 0 !important;
  font-size: 20px; font-style: normal; color: var(--fg);
}
.eq i { font-style: italic; }
.eqn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--g3); }

.params { margin: 22px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.params div { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.params dt { color: var(--g2); }
.params dd { color: var(--fg); }
.params dd.note { color: var(--g3); }

/* figures */

.fig { margin: 30px auto; }
.sec.col .fig { margin-left: 0; margin-right: 0; }
.fig-body { border: 1px solid var(--line); padding: 16px; overflow-x: auto; }
.fig figcaption { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--g2); }
.fig figcaption .label { margin-right: 10px; color: var(--g1); }

.diagram { display: block; width: 100%; min-width: 500px; height: auto; overflow: visible; }
.diagram text { font-family: var(--mono); font-size: 10.5px; fill: var(--g2); }
.diagram .t-fg { fill: var(--fg); font-size: 11px; }
.diagram .t-dim { fill: var(--g2); }
.diagram .t-mute { fill: var(--g3); }
.diagram .t-label { fill: var(--g2); font-size: 9.5px; letter-spacing: .16em; }
.diagram .t-acc { fill: var(--acc); }
.diagram .box { fill: none; stroke: var(--g2); stroke-width: 1; }
.diagram .edge path, .diagram .edge-line { fill: none; stroke: var(--g3); stroke-width: 1; }
.diagram .edge-fg { fill: none; stroke: var(--g1); stroke-width: 1; }
.diagram .edge-dash { fill: none; stroke: var(--g2); stroke-width: 1; stroke-dasharray: 3 3; }
.diagram .node rect { fill: var(--bg); stroke: var(--g1); stroke-width: 1; }
.diagram .leaf rect { fill: var(--g3); }
.diagram .accent { fill: var(--acc); }
.diagram .axis { stroke: var(--g3); stroke-width: 1; fill: none; }
.diagram .grid { stroke: var(--line); stroke-width: 1; fill: none; }
.diagram .curve { stroke: var(--fg); stroke-width: 1.25; fill: none; }
.diagram .guide { stroke: var(--g3); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.diagram .hatch-line { stroke: var(--g3); stroke-width: 1; }
.diagram .area { fill: url(#hatch); stroke: none; }

/* ascii field */

.field-wrap { position: relative; padding: 0; }
#field { display: block; width: 100%; height: 300px; }
.field-legend {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between;
  padding: 8px 12px;
  font-family: var(--mono); font-size: 10px; color: var(--g3);
  pointer-events: none;
}

/* log table */

.log { margin-top: 28px; }
.log-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#log { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
#log th {
  text-align: left; font-weight: 400;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--g2);
  padding: 0 0 8px; border-bottom: 1px solid var(--g3);
}
#log td {
  padding: 7px 0; border-bottom: 1px solid var(--line);
  color: var(--g1); white-space: nowrap;
  transition: color 900ms ease-out;
}
#log th.r, #log td.r { text-align: right; }
#log td.t { color: var(--g2); width: 22%; }
#log td.a { width: 24%; }
#log td.a .g { color: var(--g3); margin-right: 6px; }
#log td.d { color: var(--fg); }
#log td.h { color: var(--g2); }
#log td.h span { cursor: default; transition: color var(--t); }
#log tr:hover td.h span { color: var(--acc); }
#log tr.fresh td.d, #log tr.fresh td.a { color: var(--acc); transition: none; }

/* limits + notes */

.limits, .notes { list-style: none; margin-top: 18px; }
.limits li, .notes li { display: grid; grid-template-columns: 44px 1fr; gap: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.limits li:last-child, .notes li:last-child { border-bottom: 1px solid var(--line); }
.limits .k, .notes .k { font-family: var(--mono); font-size: 11px; color: var(--g2); padding-top: 3px; }
.limits em { color: var(--fg); }
.limits p { color: var(--g1); }
.notes { margin-top: 0; }
.notes li { font-size: 13.5px; }
.notes li:target .k { color: var(--acc); }
.notes p { color: var(--g1); }
.notes .back { font-family: var(--mono); font-size: 11px; color: var(--g3); margin-left: 4px; }
.notes .back:hover { color: var(--acc); }

.end { margin-top: 56px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--g3); letter-spacing: .2em; }

/* ── lab ─────────────────────────────────── */

.mono { font-family: var(--mono); }
a.inline { color: var(--fg); border-bottom: 1px solid var(--g3); }
a.inline:hover { color: var(--acc); border-color: var(--acc); }

.lab-hero h1 { font-size: 76px; line-height: .98; }
.lab-hero h1 em { font-style: italic; }
.lab-sub { display: block; margin-top: 18px; }

.rig { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--line); }
.controls { display: flex; flex-direction: column; gap: 20px; padding: 16px; border-right: 1px solid var(--line); }
.ctl-h { display: flex; justify-content: space-between; align-items: baseline; }
.ctl-v { font-family: var(--mono); font-size: 11px; color: var(--fg); font-variant-numeric: tabular-nums; }
.ctl-row { flex-direction: row; display: flex; gap: 8px; flex-wrap: wrap; }

.seg { display: flex; margin-top: 8px; }
.seg button {
  flex: 1; margin-left: -1px;
  font-family: var(--mono); font-size: 11px; color: var(--g1);
  border: 1px solid var(--line); padding: 6px 8px;
  transition: color var(--t), border-color var(--t);
}
.seg button:first-child { margin-left: 0; }
.seg button:hover { color: var(--fg); }
.seg button.is-on { color: var(--acc); border-color: var(--acc); position: relative; z-index: 1; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; margin-top: 6px;
  background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--g3); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 9px; height: 15px; margin-top: -7px;
  background: var(--acc); border: 0; border-radius: 0;
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--g3); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 15px; background: var(--acc); border: 0; border-radius: 0; }
input[type="range"]:focus-visible { outline: 1px solid var(--acc); outline-offset: 2px; }

.readings { display: flex; flex-direction: column; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid2 .stat { border-left: 0; }
.grid2 .stat:nth-child(2n) { border-left: 1px solid var(--line); }
.grid2 .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.grid2 .val { font-size: 26px; margin-top: 10px; }
.grid2 .subv sup { font-size: .8em; }
.verdict { padding: 18px 16px 6px; border-top: 1px solid var(--line); font-style: italic; font-size: 19px; line-height: 1.45; margin-top: auto; }
.rank { padding: 0 16px 16px; font-size: 10.5px; color: var(--g2); font-variant-numeric: tabular-nums; }

.timeline-wrap { padding: 14px 12px 10px; }
#timeline { display: block; width: 100%; height: 220px; cursor: crosshair; touch-action: pan-y; }
.hover-line { margin-top: 8px; font-size: 10.5px; color: var(--g2); min-height: 1.5em; font-variant-numeric: tabular-nums; }

/* ── footer ──────────────────────────────── */

.foot { margin-top: 96px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--g2); }
.foot-in { max-width: calc(var(--wide) + 32px); margin: 0 auto; padding: 20px 16px 32px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.foot-row + .foot-row { margin-top: 14px; }
.foot-links a { color: var(--g1); }
.foot-links a:hover { color: var(--acc); }
.foot-links .sep { padding: 0 .45em; }
.ca { display: flex; align-items: baseline; gap: 10px; min-width: 0; max-width: 100%; }
.addr { font-family: var(--mono); font-size: 11px; color: var(--fg); text-align: left; word-break: break-all; transition: color var(--t); }
.addr:hover { color: var(--acc); }
.disclaimer { margin-top: 18px; font-size: 10.5px; color: var(--g3); }

/* ── small screens ───────────────────────── */

@media (max-width: 720px) {
  .nav { gap: 13px; }
  .nav a .g { display: none; }
  .hero { padding-top: 52px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: 64px; }
  .def { font-size: 17px; }
  .grid3 { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .chips .sep { padding: 0 4px; }
  .chip { padding: 1px 6px 2px 5px; }
  #field { height: 230px; }
  .field-legend { font-size: 9px; padding: 6px 8px; }
  .sec-h h2 { font-size: 23px; }
  .abstract p { text-align: left; }
  .eq { font-size: 18px; }
  .params div { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .limits li, .notes li { grid-template-columns: 36px 1fr; }
  #log { font-size: 10.5px; }
  #log td.a .g { display: none; }
  .lab-hero h1 { font-size: 50px; }
  .rig { grid-template-columns: 1fr; }
  .controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid2 .val { font-size: 21px; }
  .verdict { font-size: 17px; }
}

@media (max-width: 380px) {
  .mark { font-size: 12px; }
  .nav { gap: 10px; }
  .btn { padding: 5px 7px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .chip[data-state="pending"] i { animation: none; }
  #log td { transition: none; }
}
