/* Raftra landing page: "flight recorder". Dark only. */

:root {
  --bg: #101315;          /* slate graphite */
  --panel: #161a1d;
  --panel-2: #1b2024;
  --deep: #0b0e10;        /* terminal well */
  --rule: #283036;
  --rule-2: #353e45;
  --bone: #e9e4d8;
  --bone-2: #c9c4b8;
  --dim: #8e979d;
  --orange: #ff7a1a;      /* recorder orange: the leader */
  --orange-ink: #1a0d03;
  --red: #f0473b;         /* dead node */
  --teal: #55cfab;        /* committed */
  --amber: #e8c547;       /* candidate */

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: 24px;
  --track-label: 280px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules must not un-hide */
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
}
/* Faint scanlines over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

a { color: var(--bone); text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
code { font: 500 0.88em var(--mono); color: var(--bone); }
h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .footer, .topbar { position: relative; z-index: 1; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--orange); color: var(--orange-ink); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(16, 19, 21, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.wordmark {
  display: flex; align-items: center; gap: 10px;
  font: 800 27px/1 var(--display); letter-spacing: 0.01em;
  text-decoration: none; color: var(--bone);
}
.wordmark svg { width: 22px; height: 22px; fill: var(--bone); }
.wordmark .wm-lead { fill: var(--orange); }
.nav { display: flex; gap: 22px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--dim); text-decoration: none; font-size: 14.5px; white-space: nowrap; padding: 4px 0; }
.nav a:hover { color: var(--bone); }
.nav a.is-here { color: var(--bone); box-shadow: inset 0 -2px 0 var(--orange); }

.pill {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  padding: 6px 12px; border: 1px solid var(--rule-2);
  font: 500 13px/1 var(--mono); color: var(--bone-2); text-decoration: none; white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill[data-state="leader"] i { background: var(--orange); box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.6); animation: beat 2s infinite; }
.pill[data-state="noleader"] i { background: var(--amber); }
.pill[data-state="reset"] i, .pill[data-state="offline"] i { background: var(--red); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(255, 122, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0); } }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 56px; }
.badge { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--rule-2); padding: 5px 12px 5px 5px; font-size: 13.5px; color: var(--bone-2); background: var(--panel); }
.badge a { background: var(--orange); color: var(--orange-ink); font: 600 12px var(--mono); padding: 2px 7px; text-decoration: none; }
.brand {
  display: flex; align-items: flex-end; gap: 0.12em;
  font: 900 clamp(104px, 19vw, 280px)/0.78 var(--display);
  letter-spacing: -0.012em;
  margin: 28px 0 0 -0.04em;
}
/* The live mark: one bar per real server, coloured by role. */
.brand-mark { display: inline-flex; align-items: flex-end; gap: 0.04em; height: 0.66em; margin-bottom: 0.035em; }
.brand-mark i { width: 0.1em; height: 62%; background: var(--rule-2); transition: height 0.6s, background-color 0.6s; }
.brand-mark i.is-leader { height: 100%; background: var(--orange); }
.brand-mark i.is-follower { background: var(--bone); }
.brand-mark i.is-candidate { height: 80%; background: var(--amber); }
.brand-mark i.is-down { height: 22%; background: var(--red); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; margin-top: 36px; }
.hero .clock { margin-top: 6px; }
.tagline { font: 800 clamp(34px, 4.4vw, 60px)/1 var(--display); letter-spacing: 0.005em; }
.tagline-2 { font: 600 clamp(24px, 2.7vw, 36px)/1.1 var(--display); color: var(--bone-2); margin-top: 10px; }
.lede { margin-top: 24px; max-width: 60ch; color: var(--bone-2); font-size: 18px; }
.hero .cmd { margin-top: 28px; max-width: 760px; }
.hero-actions { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn { text-decoration: none; }
.hero-link { color: var(--dim); font-size: 15px; margin-left: 6px; }
.hero-link:hover { color: var(--bone); }

.btn-star { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-star .star { width: 15px; height: 15px; fill: var(--amber); transition: transform 0.25s; }
.btn-star:hover .star { transform: rotate(72deg) scale(1.15); }
.star-count { font: 500 12.5px var(--mono); color: var(--bone); background: var(--deep); border: 1px solid var(--rule-2); padding: 1px 7px; margin-left: 2px; }
.star-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 5px 10px; border: 1px solid var(--rule-2); font: 500 13px var(--sans); text-decoration: none; color: var(--bone); }
.star-btn:hover { border-color: var(--bone-2); }
.star-btn .gh { width: 15px; height: 15px; fill: currentColor; }
.star-btn .star-count { padding: 0 6px; }

.cmd { display: flex; align-items: stretch; border: 1px solid var(--rule-2); background: var(--deep); }
.cmd code {
  flex: 1; min-width: 0; padding: 14px 16px; overflow-x: auto; white-space: nowrap;
  font-size: 14px; color: var(--bone); scrollbar-width: thin;
}
.cmd code::before { content: "$ "; color: var(--orange); }
.copy {
  flex: none; border: 0; border-left: 1px solid var(--rule-2); background: var(--panel-2);
  color: var(--bone); font: 500 13px var(--mono); padding: 0 18px; cursor: pointer;
}
.copy:hover { background: var(--rule); }
.copy[data-done] { color: var(--teal); }

.clock { border-left: 1px solid var(--rule); padding-left: 28px; display: grid; gap: 18px; }
.clock-row { display: grid; gap: 2px; }
.clock-label { color: var(--dim); font-size: 14px; }
.clock-val { font: 800 68px/0.95 var(--display); color: var(--orange); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.clock-val.dim { color: var(--bone-2); font-size: 44px; }
.clock-note { color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.clock-note code { font-size: 12.5px; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; border-top: 1px solid var(--rule); }
.sec-head { max-width: 760px; margin-bottom: 36px; }
.sec-head h2 { font: 800 clamp(40px, 5vw, 64px)/0.95 var(--display); letter-spacing: 0.002em; }
.sec-head p { margin-top: 16px; color: var(--bone-2); max-width: 64ch; }
h3 { font: 600 17px/1.3 var(--sans); }
.fine { color: var(--dim); font-size: 14px; line-height: 1.55; }

.banner { border: 1px solid var(--rule-2); border-left: 3px solid var(--red); background: var(--panel); padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.banner-dim { border-left-color: var(--dim); color: var(--bone-2); }

/* ---------- Recorder (live tape) ---------- */
.recorder { border-top: 0; padding-top: 24px; }
.tape {
  border: 1px solid var(--rule-2);
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 22px,
    var(--panel);
  background-blend-mode: normal;
  position: relative;
}
.tape::before { /* soften the grid */
  content: ""; position: absolute; inset: 0; background: rgba(22, 26, 29, 0.72); pointer-events: none;
}
.track {
  position: relative;
  display: grid; grid-template-columns: var(--track-label) minmax(0, 1fr);
  border-bottom: 1px solid var(--rule-2);
  min-height: 104px;
}
.track::after { /* leader stripe */
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: transparent;
}
.track.is-leader::after { background: var(--orange); }
.track.is-down::after { background: var(--red); }

.readout { padding: 16px 20px 14px 24px; border-right: 1px solid var(--rule-2); display: grid; gap: 6px; align-content: center; }
.readout-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.readout .name { font: 500 13.5px var(--mono); color: var(--dim); }
.readout .lat { font: 400 12px var(--mono); color: var(--dim); }
.readout .role { font: 800 34px/1 var(--display); letter-spacing: 0.01em; color: var(--bone); }
.track.is-leader .role { color: var(--orange); }
.track.is-down .role { color: var(--red); }
.track.is-candidate .role { color: var(--amber); }
.readout dl { display: flex; gap: 18px; margin: 2px 0 0; font: 400 12.5px var(--mono); }
.readout dl div { display: flex; gap: 6px; }
.readout dt { color: var(--dim); }
.readout dd { margin: 0; color: var(--bone); font-variant-numeric: tabular-nums; }

.trace { display: flex; align-items: center; gap: 2px; padding: 0 16px; min-width: 0; overflow: hidden; }
.trace i { flex: 1 1 0; min-width: 1px; height: 4px; background: var(--rule-2); border-radius: 1px; }
.trace i.t-leader { height: 58px; background: var(--orange); }
.trace i.t-follower { height: 26px; background: var(--bone); opacity: 0.55; }
.trace i.t-candidate { height: 40px; background: transparent; box-shadow: inset 0 0 0 1px var(--amber); }
.trace i.t-down { height: 58px; background: repeating-linear-gradient(to bottom, var(--red) 0 2px, transparent 2px 5px); opacity: 0.8; }
.trace i:last-child.t-leader { box-shadow: 0 0 10px rgba(255, 122, 26, 0.45); }

.scrub { position: absolute; top: 0; bottom: 30px; width: 1px; background: var(--bone); pointer-events: none; z-index: 2; }
.scrub-tip { position: absolute; top: 8px; left: 10px; width: max-content; max-width: 240px; background: var(--deep); border: 1px solid var(--rule-2); padding: 8px 10px; font: 400 12.5px/1.5 var(--mono); color: var(--bone-2); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.scrub-tip.flip { left: auto; right: 10px; }
.scrub-tip b { color: var(--bone); font-weight: 500; display: block; margin-bottom: 2px; }
.scrub-tip .r-leader { color: var(--orange); }
.scrub-tip .r-down { color: var(--red); }
.scrub-tip .r-candidate { color: var(--amber); }
.trace { cursor: crosshair; }
.axis { display: flex; justify-content: space-between; padding: 8px 16px 9px calc(var(--track-label) + 16px); font: 400 11.5px var(--mono); color: var(--dim); position: relative; }

.recorder-foot { margin-top: 28px; }
.feed-wrap h3 { margin-bottom: 10px; color: var(--bone-2); }
.feed { list-style: none; margin: 0; padding: 0; max-height: 264px; overflow-y: auto; border-top: 1px solid var(--rule); font: 400 13.5px/1.45 var(--mono); }
.feed li { display: grid; grid-template-columns: 82px 14px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule); color: var(--bone-2); }
.feed li time { color: var(--dim); }
.feed li::before { content: ""; grid-column: 2; grid-row: 1; width: 8px; height: 8px; margin-top: 6px; background: var(--dim); }
.feed li time { grid-column: 1; grid-row: 1; }
.feed li span { grid-column: 3; grid-row: 1; }
.feed .k-down::before, .feed .k-reset::before, .feed .k-offline::before { background: var(--red); }
.feed .k-leader::before { background: var(--orange); }
.feed .k-up::before { background: var(--teal); }
.feed .k-warn::before { background: var(--amber); }
.feed .k-leader span { color: var(--bone); }
.feed-empty { color: var(--dim); font: 400 13.5px var(--mono); padding: 8px 0; }

/* ---------- Simulator ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.sim-stage { border: 1px solid var(--rule-2); background: radial-gradient(circle at 50% 48%, var(--panel-2), var(--panel) 70%); }
#sim-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sim-side { display: grid; gap: 20px; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  border: 1px solid var(--rule-2); background: var(--panel); color: var(--bone);
  font: 500 15px var(--sans); padding: 10px 16px; cursor: pointer;
}
.btn:hover { border-color: var(--bone-2); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); font-weight: 600; }
.btn-primary:hover { background: #ff8d3a; border-color: #ff8d3a; }
.btn[aria-pressed="true"] { border-color: var(--red); color: var(--red); }
.btn-quiet { color: var(--dim); }
.btn.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.speed { display: inline-flex; border: 1px solid var(--rule-2); }
.speed button { border: 0; background: var(--panel); color: var(--dim); font: 500 14px var(--mono); padding: 0 13px; cursor: pointer; min-height: 42px; }
.speed button + button { border-left: 1px solid var(--rule-2); }
.speed button[aria-pressed="true"] { background: var(--bone); color: var(--bg); }

.sim-caption { font: 600 20px/1.35 var(--sans); min-height: 2.7em; }
.sim-log { list-style: none; margin: 0; padding: 0; font: 400 13px/1.5 var(--mono); color: var(--dim); border-top: 1px solid var(--rule); }
.sim-log li { white-space: pre-wrap; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.sim-log li:first-child { color: var(--bone); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--bone-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.lg { display: inline-block; width: 10px; height: 10px; }
.lg-rv { border-radius: 50%; border: 2px solid var(--orange); }
.lg-ae { border-radius: 50%; background: var(--teal); }
.lg-reply { border-radius: 50%; background: var(--bone-2); width: 6px; height: 6px; }
.lg-commit { background: #6f9bd6; }
.lg-pending { border: 1.5px solid #6f9bd6; }

/* SVG pieces (drawn by sim-view.js) */
.s-ring { fill: none; stroke: var(--rule-2); stroke-dasharray: 2 6; }
.s-split { stroke: var(--red); stroke-width: 2; stroke-dasharray: 8 6; }
.s-split-label { fill: var(--red); font: 500 13px var(--mono); }
.s-node { cursor: pointer; }
.s-node:focus { outline: none; }
.s-node:hover .s-body { stroke: var(--bone-2); }
.s-node.leader:hover .s-body { stroke: #ffa060; }
.s-node.dead:hover .s-body { stroke: #ff7a70; }
.s-node:focus-visible .s-body { stroke: var(--orange); stroke-width: 3; }
.s-body { fill: var(--panel-2); stroke: var(--rule-2); stroke-width: 2; }
.s-timer { fill: none; stroke: var(--bone-2); stroke-width: 3; stroke-linecap: round; opacity: 0.55; }
.s-name { fill: var(--bone); font: 800 26px var(--display); text-anchor: middle; }
.s-term { fill: var(--dim); font: 500 12px var(--mono); text-anchor: middle; }
.s-node.leader .s-body { stroke: var(--orange); stroke-width: 4; fill: #2a1a0e; }
.s-node.leader .s-name { fill: var(--orange); }
.s-node.candidate .s-body { stroke: var(--amber); stroke-dasharray: 6 5; }
.s-node.dead .s-body { stroke: var(--red); fill: #1d1213; }
.s-node.dead .s-name { fill: var(--red); opacity: 0.7; }
.s-x { stroke: var(--red); stroke-width: 3; opacity: 0.35; }
.s-crown { fill: var(--orange); }
.s-blk { stroke-width: 1.5; }
.s-msg-rv { fill: var(--bg); stroke: var(--orange); stroke-width: 2.5; }
.s-msg-ae { fill: var(--teal); }
.s-msg-reply { fill: var(--bone-2); }

/* ---------- Install ---------- */
.install-primary { border: 1px solid var(--rule-2); border-left: 3px solid var(--orange); background: var(--panel); padding: 22px 24px; display: grid; gap: 14px; max-width: 900px; }
.install-primary > * { min-width: 0; }
.install-primary .detect { font: 600 18px var(--sans); }
.install-primary .detect small { display: block; color: var(--dim); font: 400 14px var(--sans); margin-top: 2px; }
.install-primary .btn { justify-self: start; text-decoration: none; }
.os-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule-2); }
.os-tabs button { border: 0; background: none; color: var(--dim); font: 600 15px var(--sans); padding: 10px 16px 11px; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.os-tabs button:hover { color: var(--bone); }
.os-tabs button[aria-selected="true"] { color: var(--bone); box-shadow: inset 0 -2px 0 var(--orange); }
.os-panel { display: grid; gap: 10px; min-width: 0; }
.os-panel > * { min-width: 0; }
.os-shell { color: var(--dim); font: 500 12.5px var(--mono); margin-bottom: -4px; }
.cmd-ps code::before { content: "PS> "; }
.cmd-win code::before { content: "C:\\> "; }
.matrix-wrap { margin-top: 32px; max-width: 900px; overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; }
.matrix caption { text-align: left; color: var(--dim); font-size: 14px; padding-bottom: 10px; }
.matrix th, .matrix td { border: 1px solid var(--rule-2); text-align: left; }
.matrix thead th { font: 500 13px var(--mono); color: var(--dim); padding: 10px 14px; background: var(--panel); }
.matrix tbody th { font: 800 24px var(--display); padding: 0 16px; width: 22%; background: var(--panel); }
.matrix td a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px; text-decoration: none; font-weight: 500; position: relative; }
.matrix td a small { font: 400 12.5px var(--mono); color: var(--dim); }
.matrix td a:hover { background: var(--panel-2); }
.matrix td a.is-you { background: rgba(255, 122, 26, 0.09); box-shadow: inset 0 0 0 2px var(--orange); }
.matrix td a.is-you::after { content: "your system"; position: absolute; top: -9px; right: 10px; background: var(--orange); color: var(--orange-ink); font: 600 11px var(--mono); padding: 1px 6px; }
.install-notes { margin-top: 24px; display: grid; gap: 10px; max-width: 900px; color: var(--bone-2); font-size: 15px; }
.install-notes strong { color: var(--bone); font-weight: 600; }

/* ---------- Try it ---------- */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.rules-h { margin-bottom: 10px; }
.rules { margin: 0; padding: 0 0 0 18px; color: var(--bone-2); display: grid; gap: 6px; font-size: 15.5px; }
.rules li::marker { color: var(--orange); }
.term { margin: 0; border: 1px solid var(--rule-2); background: var(--deep); }
.term-bar { display: flex; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-2); }
.term pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 400 13.5px/1.55 var(--mono); color: var(--bone); }
.term .p { color: var(--orange); }
.term .ok { color: var(--teal); }
.term .warn { color: var(--amber); }
.term .b-or { color: var(--orange); }
.term pre b { font-weight: 600; color: var(--bone); }
.term .o { color: var(--dim); }
.term figcaption { padding: 10px 20px; border-top: 1px solid var(--rule); color: var(--dim); font-size: 13px; }

/* ---------- Internals ---------- */
.diagram-wrap { border: 1px solid var(--rule-2); background: var(--panel); overflow-x: auto; }
.diagram { display: block; width: 100%; min-width: 760px; height: auto; padding: 12px; }
.dg-client { fill: var(--deep); stroke: var(--bone-2); }
.dg-node rect { fill: var(--panel-2); stroke: var(--rule-2); stroke-width: 1.5; }
.dg-leader rect { stroke: var(--orange); stroke-width: 2.5; }
.dg-name { fill: var(--bone); font: 800 22px var(--display); }
.dg-role { fill: var(--dim); font: 500 12px var(--mono); text-anchor: end; }
.dg-leader .dg-role { fill: var(--orange); }
.dg-layers rect { fill: var(--deep); stroke: var(--rule-2); }
.dg-layers rect.dg-hot { stroke: var(--orange); }
.dg-lt text { fill: var(--bone-2); font: 400 13px var(--sans); text-anchor: middle; }
.dg-t { fill: var(--bone); font: 500 14px var(--sans); }
.dg-c { text-anchor: middle; }
.dg-a { fill: none; stroke: var(--bone-2); stroke-width: 1.6; }
.dg-a.dg-o { stroke: var(--orange); stroke-width: 2; }
.dg-dash { stroke-dasharray: 5 4; }
.dg-head { fill: var(--bone-2); }
.dg-head-o { fill: var(--orange); }
.dg-s { fill: var(--bone-2); font: 500 12.5px var(--mono); }
.dg-so { fill: var(--orange); }

.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.steps li { counter-increment: step; color: var(--bone-2); font-size: 14.5px; line-height: 1.5; border-top: 1px solid var(--rule-2); padding-top: 12px; }
.steps li { transition: border-color 0.3s, color 0.3s; }
.steps li.is-active { border-top-color: var(--orange); color: var(--bone); }
.steps li.is-active::before { text-shadow: 0 0 18px rgba(255, 122, 26, 0.6); }
.dg-flash { fill: rgba(255, 122, 26, 0.22); stroke: var(--orange); stroke-width: 1.5; }
.pk-req circle { fill: var(--orange); }
.pk-reply circle { fill: var(--bone); }
.pk-ok circle { fill: var(--teal); }
.dg-ok { fill: var(--teal); font: 600 13px var(--mono); }
.steps li::before { content: counter(step); display: block; font: 800 34px/1 var(--display); color: var(--orange); margin-bottom: 8px; }
.steps b { color: var(--bone); font-weight: 600; display: block; margin-bottom: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 56px; }
.two-col h3 { margin-bottom: 12px; }
.ticks, .crosses { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; color: var(--bone-2); font-size: 15.5px; }
.ticks li, .crosses li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 2px; background: var(--teal); }
.crosses li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 2px; background: var(--dim); }

/* ---------- Numbers ---------- */
.num-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.num-card { margin: 0; border: 1px solid var(--rule-2); background: var(--panel); padding: 24px; display: grid; gap: 18px; align-content: start; }
.num-wide { grid-column: 1 / -1; }
.num-card figcaption p { color: var(--dim); font-size: 14px; margin-top: 2px; }
.bars { display: grid; gap: 22px; }
.bar-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; color: var(--bone-2); font-size: 15px; }
.bar-label b { font: 800 46px/1 var(--display); color: var(--bone); font-variant-numeric: tabular-nums; }
.bar-label span { color: var(--dim); font-size: 14px; }
.bar { height: 16px; background: var(--deep); border: 1px solid var(--rule); margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--bone); }
.bar-slow i { background: var(--orange); min-width: 3px; }
.bar-meta { color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.why { border-top: 1px solid var(--rule); padding-top: 14px; color: var(--bone-2); font-size: 15px; max-width: 90ch; }
.failover .big { color: var(--bone-2); font-size: 15px; }
.failover .big b { font: 800 56px/1 var(--display); color: var(--bone); margin-right: 6px; }
.strip { display: block; width: 100%; height: auto; margin-top: 10px; }
.strip .st-axis { stroke: var(--rule-2); }
.strip .st-tick { fill: var(--dim); font: 400 10.5px var(--mono); text-anchor: middle; }
.strip .st-dot { fill: var(--bone); opacity: 0.85; }
.strip .st-avg { stroke: var(--orange); stroke-width: 2; }
.strip .st-avg-l { fill: var(--orange); font: 500 10.5px var(--mono); }
.bench { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.bench th { text-align: left; font-weight: 400; color: var(--bone-2); padding: 9px 0; border-bottom: 1px solid var(--rule); }
.bench td { text-align: right; font: 500 14px var(--mono); padding: 9px 0 9px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }

/* ---------- Build log ---------- */
.phases { list-style: none; counter-reset: ph; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--rule-2); border-top: 1px solid var(--rule-2); }
.phases li { counter-increment: ph; padding: 18px 18px 22px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); display: grid; gap: 6px; align-content: start; }
.phases li::before { content: counter(ph); font: 800 30px/1 var(--display); color: var(--dim); }
.phases b { font-weight: 600; }
.phases span { color: var(--bone-2); font-size: 14.5px; line-height: 1.5; }
.phases .phase-public { grid-column: 1 / -1; background: rgba(255, 122, 26, 0.06); grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline; }
.phases .phase-public::before { content: "9"; color: var(--orange); grid-row: span 2; }
.incidents { margin-top: 48px; max-width: 860px; }
.incidents h3 { margin-bottom: 12px; }
details { border-top: 1px solid var(--rule-2); }
details:last-child { border-bottom: 1px solid var(--rule-2); }
summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font: 400 26px var(--mono); color: var(--orange); }
details[open] summary::after { content: "−"; }
details p { color: var(--bone-2); font-size: 15.5px; margin-bottom: 12px; max-width: 72ch; }
details p:last-child { margin-bottom: 20px; }
details p b { color: var(--bone); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); padding: 40px 0 56px; }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: baseline; }
.footer-brand { font-weight: 500; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--dim); }
.footer-egg { grid-column: 1 / -1; color: var(--dim); font-size: 14px; max-width: 70ch; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .clock { border-left: 0; padding-left: 0; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); padding-top: 24px; }
  .clock-note { grid-column: 1 / -1; }
  .clock-val.dim { font-size: 68px; }
  .sim { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .num-grid { grid-template-columns: 1fr 1fr; }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --track-label: 0px; }
  body { font-size: 16px; }
  .topbar-in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 10px; }
  .pill { padding: 5px 9px; font-size: 12px; gap: 7px; }
  .star-btn { padding: 5px 8px; }
  .badge { font-size: 12.5px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; gap: 18px; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .pill { margin-left: auto; }
  .star-btn .star-label { display: none; }
  .brand { margin-top: 20px; }
  .hero-link { margin-left: 0; }
  .hero { padding: 28px 0 36px; }
  .clock-val, .clock-val.dim { font-size: 48px; }
  .section { padding: 64px 0; }
  .track { grid-template-columns: 1fr; min-height: 0; }
  .readout { border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px 14px; }
  .readout .role { font-size: 28px; }
  .readout dl { flex-wrap: wrap; gap: 4px 14px; }
  .trace { height: 56px; padding: 0 10px; gap: 1px; }
  .trace i.t-leader, .trace i.t-down { height: 40px; }
  .trace i.t-follower { height: 18px; }
  .trace i.t-candidate { height: 28px; }
  .axis { padding-left: 10px; padding-right: 10px; }
  .try-grid, .two-col { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps { grid-template-columns: 1fr; }
  .num-grid { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .phases .phase-public { grid-template-columns: 1fr; }
  .phases .phase-public::before { grid-row: auto; }
  .matrix tbody th { font-size: 20px; padding: 0 10px; }
  .matrix td a { padding: 14px 10px; flex-direction: column; gap: 2px; }
  .footer-in { grid-template-columns: 1fr; }
  /* The simulator SVG is drawn at 640 wide; keep its labels legible when it shrinks. */
  .s-name { font-size: 32px; }
  .s-term { font-size: 17px; }
  .s-split-label { font-size: 20px; }
}

@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; }
}
