:root {
  color-scheme: dark;
  --page: #080b0d;
  --surface: #0f1519;
  --surface-raised: #141c21;
  --surface-soft: #1a242a;
  --ink: #f3f6f5;
  --muted: #aab6bc;
  --line: #344149;
  --line-strong: #71808a;
  --silver: #d5dcdf;
  --blue: #9ed8f8;
  --blue-dark: #173442;
  --green: #9ce4c0;
  --green-dark: #16382a;
  --amber: #f0ca89;
  --amber-dark: #3a2c16;
  --red: #ffb6b6;
  --red-dark: #421f22;
  --focus: #f5de8d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 37rem), rgb(158 216 248 / 7%) calc(50% - 37rem), rgb(158 216 248 / 7%) calc(50% - 36.94rem), transparent calc(50% - 36.94rem)),
    var(--page);
  color: var(--ink);
}

button, summary, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; white-space: normal; overflow-wrap: anywhere; }
a { color: var(--blue); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: #d6effc; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.provider-proof {
  --provider-accent: var(--silver);
  display: grid;
  gap: 1.25rem;
  margin: 0 0 2.2rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: inset 3px 0 var(--provider-accent);
}

.provider-proof[data-state="loading"] { --provider-accent: var(--blue); }
.provider-proof[data-state="success"] { --provider-accent: var(--green); }
.provider-proof[data-state="error"] { --provider-accent: var(--red); }

.provider-proof__header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.provider-proof__header .step-label { margin-bottom: 0.65rem; }

.provider-proof h3 {
  max-width: 25ch;
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.provider-proof__state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--provider-accent);
  font: 760 0.68rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.09em;
}

.provider-proof__state-mark {
  width: 0.48rem;
  height: 0.48rem;
  background: currentColor;
}

.provider-proof__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr);
  gap: clamp(1.2rem, 4vw, 2.5rem);
  align-items: end;
}

.provider-proof__copy {
  max-width: 49ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.provider-proof__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.2rem;
}

.provider-proof__actions button {
  min-height: 2.85rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.2rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

.provider-proof__actions button:hover { background: var(--surface-soft); }
.provider-proof__actions button:disabled { cursor: wait; opacity: 0.6; }
.provider-proof__actions a { font-size: 0.84rem; font-weight: 680; }

.provider-proof__facts {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.provider-proof__facts > div {
  min-width: 0;
  padding: 0.8rem;
}

.provider-proof__facts > div:nth-child(even) { border-left: 1px solid var(--line); }

.provider-proof__facts dt {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provider-proof__facts dd {
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 50rem) {
  .provider-proof__content { grid-template-columns: 1fr; }
}

@media (max-width: 38rem) {
  .provider-proof__header { display: grid; }
  .provider-proof__state { justify-self: start; }
  .provider-proof__facts { grid-template-columns: 1fr; }
  .provider-proof__facts > div:nth-child(even) { border-left: 0; }
  .provider-proof__facts > div + div { border-top: 1px solid var(--line); }
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 0.95rem;
  border: 2px solid var(--focus);
  border-radius: 0.2rem;
  background: var(--page);
  color: var(--ink);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header,
.hero,
main,
body > footer {
  width: min(74rem, calc(100% - clamp(1.4rem, 5vw, 4rem)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 5.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.18rem;
  padding: 0.18rem;
  border: 1px solid var(--line-strong);
}
.brand-mark i { display: block; background: var(--silver); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--blue); }
.brand-mark i:nth-child(4) { background: var(--green); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.site-nav a {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--ink); }

.hero {
  position: relative;
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  position: absolute;
  top: clamp(4.5rem, 10vw, 8rem);
  left: -1.2rem;
  width: 2px;
  height: clamp(6rem, 15vw, 10rem);
  background: linear-gradient(var(--blue), var(--green));
  content: "";
}

.eyebrow, .step-label, .step-kicker {
  margin: 0 0 0.9rem;
  color: var(--blue);
  font-size: 0.71rem;
  font-weight: 780;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.35rem);
  font-weight: 690;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.lede {
  max-width: 47rem;
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }
.button-primary, .button-secondary {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.2rem;
  font-size: 0.84rem;
  font-weight: 720;
  text-decoration: none;
}
.button-primary { border-color: var(--silver); background: var(--silver); color: var(--page); }
.button-primary:hover { border-color: #fff; background: #fff; color: var(--page); }
.button-secondary { color: var(--ink); }
.button-secondary:hover { border-color: var(--blue); background: var(--surface); color: var(--ink); }

.hero-facts {
  display: grid;
  max-width: 48rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 3.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-facts p { margin: 0; padding: 1rem 1.25rem 1rem 0; }
.hero-facts p + p { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts strong {
  color: var(--silver);
  font: 720 clamp(1.3rem, 3vw, 1.9rem)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hero-facts span { margin-top: 0.42rem; color: var(--muted); font-size: 0.79rem; }

main { padding-bottom: 5rem; }
section { min-width: 0; padding: clamp(3.6rem, 8vw, 6.4rem) 0; border-bottom: 1px solid var(--line); }
.judge-path { scroll-margin-top: 1.5rem; }

.section-heading {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}
.section-heading > * { min-width: 0; }
h2 {
  max-width: 27ch;
  margin: 0;
  font-size: clamp(1.85rem, 4.6vw, 3.45rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.05;
}
.section-note {
  max-width: 24rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: right;
}

.act-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line-strong);
}
.act-nav button, .presenter-controls button, .load-error button {
  min-width: 0;
  min-height: 2.85rem;
  padding: 0.75rem 0.95rem;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.act-nav button + button { border-left: 1px solid var(--line); }
.act-nav button:hover, .presenter-controls button:hover, .load-error button:hover { background: var(--surface-soft); }
.act-nav button[aria-pressed="true"] { background: var(--green-dark); box-shadow: inset 0 -2px var(--green); }
.act-nav button span {
  display: block;
  margin-bottom: 0.27rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
button:disabled { cursor: not-allowed; opacity: 0.46; }

.step-stage {
  min-width: 0;
  min-height: 31rem;
  margin-top: 0.8rem;
  padding: clamp(1.25rem, 4vw, 2.7rem);
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  box-shadow: inset 4px 0 var(--blue);
}
.step-stage:focus-visible { outline-offset: -6px; }
.loading-state, .load-error { display: grid; min-height: 23rem; align-content: center; justify-items: start; }
.step-header { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.step-labels { display: flex; min-width: 0; flex-wrap: wrap; gap: 0.45rem; }

.proof-state, .domain-state, .act-label, .check-passed, .check-failed {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 0.32rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 0.15rem;
  font-size: 0.64rem;
  font-weight: 780;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.act-label { color: var(--silver); background: #263037; }
.domain-state { flex: 0 1 auto; color: var(--blue); background: var(--blue-dark); text-align: right; }
.proof-state.local, .check-passed { color: var(--green); background: var(--green-dark); }
.proof-state.recorded { color: var(--blue); background: var(--blue-dark); }
.proof-state.pending { color: var(--amber); background: var(--amber-dark); }
.check-failed { color: var(--red); background: var(--red-dark); }

.step-stage > h3 {
  max-width: 24ch;
  margin: clamp(2rem, 5vw, 3.6rem) 0 0;
  font-size: clamp(1.75rem, 4.5vw, 3.6rem);
  font-weight: 640;
  letter-spacing: -0.042em;
  line-height: 1.04;
}
.step-claim { max-width: 57rem; margin: 1rem 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.58; }
.step-summary, .step-detail {
  min-width: 0;
  margin-top: 2rem;
  padding: clamp(0.95rem, 2.5vw, 1.35rem);
  border: 1px solid var(--line);
  background: var(--page);
}
.step-summary { border-color: var(--line-strong); background: var(--surface); }
.step-detail { margin-top: 0.75rem; }
.step-detail > summary { color: var(--blue); font-weight: 720; cursor: pointer; }
.step-detail-body { min-width: 0; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.detail-grid { display: grid; min-width: 0; gap: 0.65rem; margin: 0; }
.detail-grid > div {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(8rem, 0.32fr) minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.detail-grid > div:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-grid dt, .detail-grid dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.detail-grid dt { color: var(--muted); font-size: 0.76rem; font-weight: 720; letter-spacing: 0.04em; }
.detail-grid dd { line-height: 1.45; }
.detail-list { min-width: 0; margin: 0; padding-left: 1.1rem; }
.detail-list + .detail-list { margin-top: 0.5rem; }
.detail-list li { min-width: 0; padding: 0.2rem 0; overflow-wrap: anywhere; }

.step-proof {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.76rem;
}
.step-proof p { min-width: 0; margin: 0; }
.step-proof p span { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.65rem; font-weight: 780; letter-spacing: 0.08em; text-transform: uppercase; }
.step-proof strong, .step-proof code { color: var(--ink); font-weight: 650; }
.step-evidence-link { grid-column: 1 / -1; justify-self: start; }

.presenter-controls {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 0.8rem;
  border: 1px solid var(--line-strong);
  background: var(--line);
}
.presenter-controls button[aria-pressed="true"] { background: var(--amber-dark); }
#step-progress { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0.6rem 0.8rem; background: var(--page); color: var(--muted); font: 700 0.76rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }

.evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); }
.evidence-grid article { min-width: 0; padding: 1.6rem 1.5rem 1.8rem 0; border-bottom: 1px solid var(--line-strong); }
.evidence-grid article + article { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.evidence-index { color: var(--green); font: 720 0.74rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.evidence-grid h3 { margin: 1.3rem 0 0; font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.18; }
.evidence-grid p { color: var(--muted); line-height: 1.58; }
.evidence-grid a { font-size: 0.84rem; font-weight: 680; }
.text-link { flex: 0 1 auto; font-size: 0.86rem; }

.architecture-shell { max-width: 100%; padding: clamp(0.7rem, 2vw, 1.3rem); border: 1px solid var(--line-strong); overflow-x: auto; background: var(--surface); scrollbar-color: var(--line-strong) var(--surface); }
.architecture-shell img { display: block; width: 100%; height: auto; min-width: 48rem; }

.verification-details { border: 1px solid var(--line-strong); background: var(--surface); }
.verification-details summary { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; color: var(--ink); cursor: pointer; }
.verification-details summary span { min-width: 0; overflow-wrap: anywhere; }
.verification-details summary span:last-child { color: var(--blue); font-size: 0.83rem; }
.invariant-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: 1px; margin: 0; padding: 1px; background: var(--line); list-style: none; }
.invariant-list li { display: grid; min-width: 0; align-content: start; justify-items: start; gap: 0.65rem; padding: 1rem; background: var(--page); }
.invariant-list strong { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }

.proof-notes { max-width: 60rem; }
.proof-notes > p:not(.step-label, .evidence-links) { max-width: 53rem; color: var(--muted); font-size: 1.02rem; line-height: 1.65; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 0.65rem 1.2rem; margin-top: 1.5rem; }

body > footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem 0 3.5rem; color: var(--muted); font-size: 0.76rem; }
body > footer p { margin: 0; }
.load-error { color: var(--red); }
.load-error h3 { margin: 0; color: var(--ink); font-size: clamp(1.6rem, 4vw, 2.6rem); }
.load-error p:not(.step-kicker) { max-width: 40rem; color: var(--muted); line-height: 1.5; }
.load-error button { margin-top: 0.7rem; border: 1px solid var(--line-strong); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 50rem) {
  .section-heading { display: block; }
  .section-note { margin-top: 0.8rem; text-align: left; }
  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-grid article { padding: 1.35rem 0; }
  .evidence-grid article + article { padding-left: 0; border-left: 0; }
  .step-header { display: grid; }
  .domain-state { justify-self: start; text-align: left; }
}

@media (max-width: 38rem) {
  .site-header { min-height: 4.5rem; align-items: flex-start; flex-direction: column; justify-content: center; gap: 0.65rem; padding: 0.8rem 0; }
  .site-nav { gap: 0.4rem 1rem; }
  .hero::before { left: -0.7rem; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts p, .hero-facts p + p { padding: 0.8rem 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero-facts p:first-child { border-top: 0; }
  .act-nav { grid-template-columns: 1fr; }
  .act-nav button + button { border-left: 0; border-top: 1px solid var(--line); }
  .presenter-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid > div, .step-proof { grid-template-columns: minmax(0, 1fr); }
  #step-progress { text-align: left; }
  .verification-details summary { display: grid; }
  body > footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
