:root {
  --acid: #ccff00;
  --acid-hot: #d9ff35;
  --ink: #110e08;
  --paper: #f7f7f5;
  --white: #ffffff;
  --muted: #696960;
  --rule: #c8c8bf;
  --soft: #e9e9e3;
  --halt: #c92e29;
  --sans: "Hanken Grotesk", Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); color: var(--ink); }

body.qed-page {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(17, 14, 8, .06) calc(50% - .5px), rgba(17, 14, 8, .06) calc(50% + .5px), transparent calc(50% + .5px)),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

button, a { -webkit-tap-highlight-color: transparent; }

.qed-page main {
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
}

.qed-hero {
  position: relative;
  min-height: 570px;
  padding: 88px 0 70px;
  border-bottom: 1px solid var(--ink);
}

.hero-index {
  position: absolute;
  inset: 26px 0 auto;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: .08em;
}

.eyebrow,
.qed-hero h1,
.hero-deck { margin: 0; }

.eyebrow {
  margin-bottom: 32px;
  font: 650 11px/1 var(--mono);
  letter-spacing: .14em;
}

.qed-hero h1 {
  max-width: 1100px;
  font-size: clamp(78px, 12.4vw, 190px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .76;
  text-transform: uppercase;
}

.hero-deck {
  width: min(640px, 100%);
  margin: 54px 0 0 auto;
  font-size: clamp(19px, 2vw, 30px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.22;
}

.proof-console {
  margin-top: 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 10px 10px 0 rgba(17, 14, 8, .12);
}

.record-footer { display: none; }

.console-head {
  min-height: 92px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ink);
  background: var(--acid);
}

.console-head span,
.console-head h2,
.console-head p,
.console-head b { display: block; margin: 0; }

.console-head span {
  font: 650 9px/1 var(--mono);
  letter-spacing: .12em;
}

.console-head h2 {
  margin-top: 8px;
  font-size: clamp(20px, 2.1vw, 32px);
  font-weight: 900;
  letter-spacing: -.04em;
}

.console-head p {
  min-width: 220px;
  padding-left: 24px;
  border-left: 1px solid rgba(17, 14, 8, .35);
  text-align: right;
}

.console-head p b { font: 800 14px/1.2 var(--mono); }
.console-head p span { margin-top: 7px; }

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
}

.button-bay {
  position: relative;
  min-height: 570px;
  padding: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--ink);
  background:
    linear-gradient(rgba(17, 14, 8, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 14, 8, .07) 1px, transparent 1px),
    #efefe9;
  background-size: 40px 40px;
}

.button-bay::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(74%, 640px);
  aspect-ratio: 1;
  border: 1px solid rgba(17, 14, 8, .18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.bay-label {
  position: absolute;
  z-index: 2;
  inset: 22px 22px auto;
  display: flex;
  justify-content: space-between;
  font: 650 9px/1 var(--mono);
  letter-spacing: .1em;
}

.bay-label b { color: var(--muted); }

.qed-button-object {
  --qed-key-travel: clamp(7px, 1vw, 12px);
  position: relative;
  z-index: 3;
  width: min(90%, 700px);
  aspect-ratio: 1707 / 921;
  filter: drop-shadow(0 28px 24px rgba(17, 14, 8, .22));
  transition: filter 180ms ease;
}

.qed-button-housing {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.qed-button {
  position: absolute;
  z-index: 2;
  top: 29.1%;
  right: 14%;
  bottom: 32.57%;
  left: 13.94%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #020301 0%, #111608 45%, #010200 100%);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, .92) inset,
    0 -2px 3px rgba(204, 255, 0, .12) inset;
  cursor: pointer;
  touch-action: manipulation;
}

.qed-button-keycap {
  position: absolute;
  z-index: 1;
  top: -75.92%;
  left: -19.35%;
  display: block;
  width: 138.77%;
  max-width: none;
  height: auto;
  user-select: none;
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 57%;
  filter:
    brightness(1.012)
    saturate(1.025)
    drop-shadow(0 9px 4px rgba(0, 0, 0, .52))
    drop-shadow(0 0 11px rgba(204, 255, 0, .18));
  will-change: transform, filter;
  transition:
    transform 176ms cubic-bezier(.18, .82, .24, 1),
    filter 150ms ease;
}

.qed-key-depth {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    0 0 0 rgba(0, 0, 0, 0) inset,
    0 0 18px rgba(204, 255, 0, .16) inset;
  opacity: .16;
  transition: opacity 120ms ease, box-shadow 150ms ease;
}

.qed-button-object:hover { filter: drop-shadow(0 32px 28px rgba(17, 14, 8, .29)); }
.qed-button-object:hover .qed-button-keycap {
  filter:
    brightness(1.035)
    saturate(1.045)
    drop-shadow(0 9px 4px rgba(0, 0, 0, .52))
    drop-shadow(0 0 16px rgba(204, 255, 0, .3));
}
.qed-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 8px; }
.qed-button:active .qed-button-keycap,
.qed-button.is-pressed .qed-button-keycap {
  transform: translate3d(0, var(--qed-key-travel), 0) scaleY(.965);
  filter:
    brightness(.84)
    saturate(.96)
    drop-shadow(0 1px 1px rgba(0, 0, 0, .48))
    drop-shadow(0 0 10px rgba(204, 255, 0, .22));
  transition: transform 90ms cubic-bezier(.28, 0, .55, 1), filter 90ms ease;
}

.qed-button:active .qed-key-depth,
.qed-button.is-pressed .qed-key-depth {
  opacity: 1;
  box-shadow:
    0 15px 18px rgba(0, 0, 0, .82) inset,
    0 -1px 0 rgba(204, 255, 0, .16) inset;
}

.qed-button.is-rebounding .qed-button-keycap {
  animation: qed-keycap-rebound 220ms cubic-bezier(.18, .82, .24, 1) both;
}

@keyframes qed-keycap-rebound {
  0% {
    transform: translate3d(0, var(--qed-key-travel), 0) scaleY(.965);
    filter: brightness(.84) saturate(.96) drop-shadow(0 1px 1px rgba(0, 0, 0, .48));
  }
  58% { transform: translate3d(0, -1.5px, 0) scaleY(1.008); }
  78% { transform: translate3d(0, .5px, 0) scaleY(.997); }
  100% { transform: translate3d(0, 0, 0) scaleY(1); }
}

.qed-button:disabled { cursor: wait; }

.qed-glow {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  opacity: 0;
  pointer-events: none;
  color: var(--acid);
  font: 900 clamp(44px, 7vw, 106px)/1 var(--sans);
  letter-spacing: -.07em;
  text-shadow: 0 0 18px rgba(204, 255, 0, .88), 0 0 48px rgba(204, 255, 0, .66);
  transform: translate(-50%, -50%) scale(.82);
  transition: opacity 200ms ease, transform 320ms cubic-bezier(.2, .8, .2, 1);
}

[data-proof-state="qed"] .qed-button .qed-button-keycap { filter: brightness(.32) saturate(.65); }
[data-proof-state="qed"] .qed-glow { opacity: 1; transform: translate(-50%, -50%) scale(1); }
[data-proof-state="refused"] .qed-button .qed-button-keycap { filter: grayscale(.9) brightness(.62); }

#buttonInstruction {
  position: absolute;
  z-index: 2;
  inset: auto 24px 22px;
  margin: 0;
  color: var(--muted);
  font: 600 9px/1.4 var(--mono);
  letter-spacing: .08em;
  text-align: center;
}

.check-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.check-row {
  min-height: 122px;
  padding: 24px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  transition: background 180ms ease, color 180ms ease;
}

.check-number {
  color: var(--muted);
  font: 500 11px/1 var(--mono);
}

.check-row small,
.check-row strong { display: block; }
.check-row small { color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: .1em; }
.check-row strong { margin-top: 9px; font-size: 18px; font-weight: 850; letter-spacing: -.025em; }
.check-state { font: 700 10px/1 var(--mono); letter-spacing: .08em; }

.check-row.is-running { background: #f3f3ee; }
.check-row.is-verified { background: var(--acid); }
.check-row.is-verified small,
.check-row.is-verified .check-number { color: rgba(17, 14, 8, .66); }
.check-row.is-refused { background: var(--halt); color: var(--white); }
.check-row.is-refused small,
.check-row.is-refused .check-number { color: rgba(255, 255, 255, .72); }

.verdict {
  min-height: 204px;
  padding: 26px 24px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--ink);
  color: var(--white);
}

.verdict span { color: rgba(255, 255, 255, .58); font: 650 9px/1 var(--mono); letter-spacing: .12em; }
.verdict strong { margin-top: 18px; font-size: clamp(34px, 4vw, 64px); font-weight: 900; letter-spacing: -.055em; line-height: .88; }
.verdict small { margin-top: 18px; color: rgba(255, 255, 255, .72); font: 500 10px/1.45 var(--mono); }
[data-proof-state="qed"] .verdict { background: var(--acid); color: var(--ink); }
[data-proof-state="qed"] .verdict span,
[data-proof-state="qed"] .verdict small { color: rgba(17, 14, 8, .65); }
[data-proof-state="refused"] .verdict { background: var(--halt); }

.witness-panel {
  margin-top: 64px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.witness-panel > header {
  min-height: 118px;
  padding: 26px 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.witness-panel header span,
.witness-panel h2 { display: block; margin: 0; }
.witness-panel header > div > span { color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: .12em; }
.witness-panel h2 { margin-top: 10px; font-size: clamp(28px, 4vw, 58px); font-weight: 900; letter-spacing: -.055em; }
.receipt-chip { padding: 9px 11px; border: 1px solid var(--ink); font: 650 9px/1 var(--mono); letter-spacing: .08em; }

.witness-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
}

.witness-grid article {
  min-width: 0;
  min-height: 156px;
  padding: 24px 20px;
  border-right: 1px solid var(--rule);
}

.witness-grid article:last-child { border-right: 0; }
.witness-grid span,
.witness-grid strong,
.witness-grid small { display: block; }
.witness-grid span { color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: .09em; }
.witness-grid strong { margin-top: 20px; overflow-wrap: anywhere; font: 750 clamp(15px, 1.6vw, 22px)/1.15 var(--mono); letter-spacing: -.04em; }
.witness-grid small { margin-top: 12px; color: var(--muted); font: 500 9px/1.4 var(--mono); }

.receipt-line {
  min-height: 68px;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--rule);
}

.receipt-line > span { font: 600 9px/1 var(--mono); letter-spacing: .1em; }
.receipt-line code { overflow: hidden; color: var(--muted); font: 500 10px/1.3 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.receipt-line button {
  align-self: stretch;
  min-width: 88px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 700 9px/1 var(--mono);
  cursor: pointer;
}
.receipt-line button:not(:disabled):hover { background: var(--acid); }
.receipt-line button:disabled { color: var(--rule); cursor: not-allowed; }

.method-grid {
  margin-top: 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}

.method-grid article {
  min-height: 300px;
  padding: 26px;
  border-right: 1px solid var(--ink);
}
.method-grid article:last-child { border-right: 0; }
.method-grid span { font: 600 9px/1 var(--mono); letter-spacing: .1em; }
.method-grid h2 { margin: 72px 0 16px; font-size: 28px; font-weight: 900; letter-spacing: -.045em; }
.method-grid p { margin: 0; color: var(--muted); font: 500 12px/1.55 var(--mono); }

.proof-files {
  margin: 80px 0;
  padding: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: 80px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.proof-files > div > span { color: rgba(255, 255, 255, .56); font: 600 9px/1 var(--mono); letter-spacing: .12em; }
.proof-files h2 { margin: 24px 0 20px; font-size: clamp(36px, 5vw, 72px); font-weight: 900; letter-spacing: -.06em; line-height: .94; }
.proof-files p { max-width: 640px; margin: 0; color: rgba(255, 255, 255, .68); font: 500 11px/1.55 var(--mono); }
.proof-files nav { display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .24); }
.proof-files a {
  min-height: 62px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .24);
  color: var(--white);
  font: 650 10px/1 var(--mono);
  letter-spacing: .08em;
  text-decoration: none;
}
.proof-files a:hover { color: var(--acid); }

.qed-footer {
  min-height: 72px;
  padding: 0 max(32px, calc((100vw - 1480px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--ink);
  background: var(--acid);
  font: 650 9px/1.4 var(--mono);
  letter-spacing: .08em;
}

@media (max-width: 940px) {
  .qed-page main { width: min(100% - 32px, 760px); }
  .qed-hero { min-height: 500px; padding-top: 78px; }
  .console-grid { grid-template-columns: 1fr; }
  .button-bay { min-height: 500px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .witness-grid { grid-template-columns: repeat(2, 1fr); }
  .witness-grid article:nth-child(2) { border-right: 0; }
  .witness-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .method-grid article:last-child { border-bottom: 0; }
  .method-grid h2 { margin-top: 44px; }
  .proof-files { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 620px) {
  .qed-page main { width: 100%; padding: 0 14px; }
  .qed-hero { min-height: 430px; padding: 76px 0 48px; }
  .qed-hero h1 { font-size: clamp(64px, 25vw, 104px); }
  .hero-deck { margin-top: 42px; font-size: 18px; }
  .console-head { align-items: flex-start; flex-direction: column; }
  .console-head p { min-width: 0; padding: 12px 0 0; border-top: 1px solid rgba(17, 14, 8, .35); border-left: 0; text-align: left; }
  .button-bay { min-height: 390px; padding: 18px; }
  .qed-button-object { width: 100%; }
  .check-row { min-height: 108px; padding: 20px 16px; grid-template-columns: 32px 1fr; }
  .check-state { grid-column: 2; }
  .verdict { min-height: 180px; }
  .witness-panel > header { align-items: flex-start; flex-direction: column; }
  .witness-grid { grid-template-columns: 1fr; }
  .witness-grid article { min-height: 132px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .witness-grid article:last-child { border-bottom: 0; }
  .receipt-line { padding: 16px 0; grid-template-columns: 1fr auto; }
  .receipt-line code { grid-row: 2; grid-column: 1 / -1; }
  .receipt-line button { grid-row: 1; grid-column: 2; min-height: 34px; border: 1px solid var(--rule); }
  .method-grid { margin-top: 54px; }
  .proof-files { margin: 54px 0; padding: 28px 20px; }
  .qed-footer { min-height: 94px; padding: 18px 14px; align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .qed-button-keycap,
  .qed-key-depth,
  .qed-glow,
  .check-row { transition: none; }

  .qed-button.is-rebounding .qed-button-keycap { animation: none; }
}

html[data-record-mode="true"] {
  background: var(--paper);
}

html[data-record-mode="true"] body.qed-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(17, 14, 8, .08) calc(50% - .5px), rgba(17, 14, 8, .08) calc(50% + .5px), transparent calc(50% + .5px)),
    var(--paper);
}

html[data-record-mode="true"] .bb-site-header,
html[data-record-mode="true"] .witness-panel,
html[data-record-mode="true"] .method-grid,
html[data-record-mode="true"] .proof-files,
html[data-record-mode="true"] .qed-footer {
  display: none !important;
}

html[data-record-mode="true"] .qed-page main {
  width: 100%;
  max-width: none;
  padding: 38px 44px 34px;
}

html[data-record-mode="true"] .qed-hero {
  min-height: 240px;
  padding: 44px 0 28px;
  border-bottom: 0;
}

html[data-record-mode="true"] .hero-index {
  inset: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
}

html[data-record-mode="true"] .eyebrow {
  margin-bottom: 20px;
  font-size: 13px;
}

html[data-record-mode="true"] .qed-hero h1 {
  max-width: none;
  font-size: clamp(84px, 11vw, 132px);
  line-height: .78;
}

html[data-record-mode="true"] .hero-deck {
  width: 100%;
  max-width: none;
  margin: 26px 0 0;
  font-size: clamp(21px, 2.5vw, 29px);
  line-height: 1.08;
}

html[data-record-mode="true"] .proof-console {
  margin-top: 14px;
  box-shadow: 9px 9px 0 rgba(17, 14, 8, .14);
}

html[data-record-mode="true"] .console-head {
  min-height: 96px;
  padding: 19px 22px;
}

html[data-record-mode="true"] .console-head h2 {
  font-size: 27px;
}

html[data-record-mode="true"] .console-head p b {
  font-size: 16px;
}

html[data-record-mode="true"] .console-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
}

html[data-record-mode="true"] .button-bay {
  min-height: 690px;
}

html[data-record-mode="true"] .qed-button-object {
  width: min(96%, 660px);
}

html[data-record-mode="true"] .qed-glow {
  font-size: clamp(64px, 8vw, 96px);
}

html[data-record-mode="true"] .check-row {
  min-height: 126px;
  padding: 22px 20px;
  grid-template-columns: 36px 1fr;
  gap: 12px 14px;
}

html[data-record-mode="true"] .check-row strong {
  font-size: 18px;
}

html[data-record-mode="true"] .check-state {
  grid-column: 2;
  font-size: 11px;
}

html[data-record-mode="true"] .verdict {
  min-height: 312px;
  padding: 28px 22px;
}

html[data-record-mode="true"] .verdict strong {
  font-size: clamp(48px, 5.5vw, 72px);
}

html[data-record-mode="true"] .verdict small {
  font-size: 11px;
}

html[data-record-mode="true"] .record-footer {
  min-height: 86px;
  margin-top: 22px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

html[data-record-mode="true"] .record-footer span {
  color: rgba(255, 255, 255, .62);
  font: 650 10px/1 var(--mono);
  letter-spacing: .12em;
}

html[data-record-mode="true"] .record-footer strong {
  min-width: 0;
  overflow: hidden;
  font: 750 13px/1.25 var(--mono);
  letter-spacing: .02em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-record-mode="true"] body[data-proof-state="qed"] .record-footer {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

html[data-record-mode="true"] body[data-proof-state="qed"] .record-footer span {
  color: rgba(17, 14, 8, .64);
}

html[data-record-mode="true"] body[data-proof-state="refused"] .record-footer {
  border-color: var(--halt);
  background: var(--halt);
}

@media (max-width: 820px) {
  html[data-record-mode="true"] .qed-page main { padding: 24px; }
  html[data-record-mode="true"] .qed-hero { min-height: 220px; }
  html[data-record-mode="true"] .qed-hero h1 { font-size: clamp(72px, 18vw, 112px); }
  html[data-record-mode="true"] .console-grid { grid-template-columns: 1fr; }
  html[data-record-mode="true"] .button-bay { min-height: 520px; border-right: 0; border-bottom: 1px solid var(--ink); }
  html[data-record-mode="true"] .verdict { min-height: 210px; }
}
