/* durable-sync — the log is the hero.
   Two states carry all the meaning: pending (amber) and acked (teal).
   Everything else stays quiet. */

:root {
  --ink: #0b1020;
  --surface: #111a2e;
  --raised: #16203a;
  --rule: #22304f;
  --rule-soft: #1a2440;
  --text: #ccd6ee;
  --bright: #f0f5ff;
  --dim: #7285a9;
  --dimmer: #4a5a7a;

  --pending: #e8a33d;
  --acked: #4fd1c5;
  --broken: #f2555a;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;
  --shell: 1160px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A faint ledger rule running the height of the page — the log, implied. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    var(--rule-soft) 31px,
    var(--rule-soft) 32px
  );
  opacity: 0.32;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}

.shell {
  width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ── type ─────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: var(--sans);
  color: var(--bright);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.05rem, 1.2rem + 2vw, 2.6rem);
  font-stretch: 118%;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

/* In the two-column hero the grid track is the constraint — a ch-based
   max-width here is wider than the track and wraps text straight over the log. */
.hero__pitch h1 {
  max-width: none;
}

h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.5rem);
  font-stretch: 110%;
  text-transform: uppercase;
}

h3 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

a {
  color: var(--acked);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--bright);
}

strong {
  color: var(--bright);
  font-weight: 600;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--acked);
  background: #0000004d;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 0.08em 0.34em;
}

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

/* The eyebrow speaks in the log's voice: mono, tight, stamped. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin: 0 0 1rem;
  max-width: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── header ───────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.5rem;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bright);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.wordmark span {
  color: var(--acked);
}

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.masthead nav a {
  color: var(--dim);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--bright);
}

@media (max-width: 640px) {
  .masthead nav .opt {
    display: none;
  }
}

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

.hero {
  padding: clamp(2.5rem, 5.5vw, 3.75rem) 0 clamp(3rem, 6vw, 4.5rem);
}

/* Only the landing hero pairs the pitch with the live log. */
.hero--split {
  display: grid;
  gap: 2.75rem;
  align-items: start;
}

/* Wide enough for the log to sit beside the pitch — which is the point. Both
   the claim and the proof, above the fold, at once. */
@media (min-width: 1040px) {
  .hero--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 3.5rem;
  }
}

.hero__demo .eyebrow {
  margin-bottom: 0.9rem;
}

.hero__lede {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.22rem);
  color: var(--dim);
  max-width: 44ch;
  margin: 1.4rem 0 1.75rem;
}

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

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.6rem 0.7rem 0.6rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--bright);
}

.install__prompt {
  color: var(--dimmer);
  user-select: none;
}

.install button {
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  background: #0000004d;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.install button:hover {
  color: var(--bright);
  border-color: var(--dim);
}

.install button[data-copied="true"] {
  color: var(--acked);
  border-color: var(--acked);
}

.ghost-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

.ghost-link:hover {
  color: var(--bright);
  border-color: var(--dim);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dimmer);
}

.facts li::before {
  content: "▪ ";
  color: var(--acked);
}

/* ── the journal: the signature ───────────────────────────────────── */

.journal {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface), var(--ink));
  overflow: hidden;
  box-shadow: 0 24px 60px -24px #00000099;
}

.journal__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: #0000004d;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.journal__controls {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.jbtn {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s var(--ease);
}

.jbtn:hover {
  border-color: var(--dim);
  color: var(--bright);
}

.jbtn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acked);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acked) 22%, transparent);
  transition: all 0.2s var(--ease);
}

.jbtn[data-online="false"] .jbtn__dot {
  background: var(--broken);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--broken) 22%, transparent);
}

.journal__pane {
  padding: 0.4rem 0;
  min-height: 8.5rem;
}

.journal__pane--log {
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.2rem);
  max-height: 11.4rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.journal__split {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem;
  border-block: 1px dashed var(--rule);
  background: #00000040;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.journal__split b {
  color: var(--pending);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.journal__pane--outbox {
  min-height: 5.2rem;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 9px,
    #ffffff05 9px 10px
  );
}

.op {
  display: grid;
  grid-template-columns: 3.4rem 9.5rem 1fr auto;
  grid-template-areas: "seq kind body state";
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.3rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.op__seq {
  grid-area: seq;
}
.op__kind {
  grid-area: kind;
}
.op__body {
  grid-area: body;
}
.op__state {
  grid-area: state;
}

/* Four columns need ~280px of fixed track and gap before the payload gets a
   pixel — on a phone that leaves the op itself unreadable. Drop the payload to
   its own line and let the seq column span both. */
@media (max-width: 620px) {
  .op {
    grid-template-columns: 2.5rem 1fr auto;
    grid-template-areas:
      "seq kind  state"
      "seq body  body";
    gap: 0.15rem 0.7rem;
    padding-block: 0.45rem;
  }
}

.op__seq {
  color: var(--dimmer);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.op__kind {
  color: var(--dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op__body {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op__state {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.op--acked .op__seq {
  color: var(--acked);
}

.op--acked .op__state {
  color: var(--acked);
}

.op--pending .op__state {
  color: var(--pending);
}

.op--pending .op__body {
  color: var(--pending);
}

.op--pending .op__seq {
  color: var(--dimmer);
}

.op--enter {
  animation: op-in 0.32s var(--ease) both;
}

.op--flush {
  animation: op-flush 0.34s var(--ease) both;
}

@keyframes op-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes op-flush {
  0% {
    background: color-mix(in srgb, var(--acked) 16%, transparent);
  }
  100% {
    background: transparent;
  }
}

.journal__empty {
  padding: 1.4rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dimmer);
}

.journal__note {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dimmer);
  max-width: none;
  line-height: 1.6;
}

/* ── sections ─────────────────────────────────────────────────────── */

section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--rule-soft);
}

.hero {
  border-top: 0;
}

.section__head {
  margin-bottom: 2.5rem;
}

.section__head p {
  color: var(--dim);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ── why ──────────────────────────────────────────────────────────── */

.claims {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
}

.claims li {
  background: var(--ink);
  padding: 1.15rem 1.3rem;
}

.claims h3 {
  margin-bottom: 0.4rem;
}

.claims p {
  margin: 0;
  color: var(--dim);
  font-size: 0.95rem;
}

@media (min-width: 720px) {
  .claims {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── code ─────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
  }
}

.step__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acked);
  margin: 0 0 0.6rem;
}

.step > p {
  color: var(--dim);
  font-size: 0.95rem;
}

pre {
  margin: 1rem 0 0;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.tok-c {
  color: var(--dimmer);
  font-style: italic;
}

.tok-k {
  color: #9d8cff;
}

.tok-s {
  color: var(--acked);
}

.tok-f {
  color: var(--pending);
}

/* ── incidents ────────────────────────────────────────────────────── */

.incidents {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 860px) {
  .incidents {
    grid-template-columns: 1fr 1fr;
  }
}

.incident {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.incident__tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--broken);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.incident__tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--broken);
  border-radius: 50%;
  flex: none;
}

.incident h3 {
  font-size: 1.2rem;
  font-stretch: 105%;
}

.incident p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--dim);
  max-width: none;
}

.incident__fix {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--acked);
  line-height: 1.6;
}

.incident__fix b {
  color: var(--dimmer);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.65rem;
  display: block;
  margin-bottom: 0.25rem;
}

/* ── limits ───────────────────────────────────────────────────────── */

.limits {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 780px) {
  .limits {
    grid-template-columns: 1fr 1fr;
  }
}

.limits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: baseline;
  font-size: 0.94rem;
  color: var(--dim);
  border-left: 2px solid var(--rule);
  padding-left: 0.9rem;
}

.limits li::before {
  content: "no";
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--broken);
  border: 1px solid color-mix(in srgb, var(--broken) 40%, transparent);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  line-height: 1;
}

.limits b {
  color: var(--bright);
  font-weight: 600;
}

.escape {
  margin-top: 2rem;
  padding: 1.1rem 1.3rem;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  background: #0000004d;
  color: var(--dim);
  font-size: 0.94rem;
}

.escape p {
  margin: 0;
  max-width: none;
}

/* ── prior art ────────────────────────────────────────────────────── */

.art {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 2rem;
}

.art__row {
  background: var(--ink);
  padding: 1.05rem 1.3rem;
  display: grid;
  gap: 0.3rem 1.5rem;
  align-items: baseline;
}

@media (min-width: 720px) {
  .art__row {
    grid-template-columns: 11rem 1fr;
  }
}

.art__name {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.art__note {
  color: var(--dim);
  font-size: 0.92rem;
}

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

.foot-wrap {
  border-top: 1px solid var(--rule-soft);
  margin-top: 2rem;
}

.foot {
  padding: 2.5rem 0 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dimmer);
}

.foot nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}

.foot a {
  color: var(--dim);
  text-decoration: none;
}

.foot a:hover {
  color: var(--bright);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── comparison table (vs.html) ───────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-top: 2rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 44rem;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

thead th {
  background: #0000004d;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  white-space: nowrap;
}

tbody th {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bright);
  white-space: nowrap;
}

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

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.yes {
  color: var(--acked);
}

.no {
  color: var(--broken);
}

.prose h2 {
  margin-top: 3rem;
}

.prose h2 + p {
  margin-top: 1rem;
}

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