:root {
  --ink: #08080c;
  --panel: #0e0c12;
  --paper: #f1ece5;
  --muted: #aaa3a7;
  --line: rgba(241, 236, 229, 0.16);
  --line-soft: rgba(241, 236, 229, 0.07);
  --violet: #806083;
  --copper: #c27652;
  --green: #a9c0a7;
  --red: #d19487;
}

* { box-sizing: border-box; }
html { background: var(--ink); color: var(--paper); }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(241,236,229,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241,236,229,.024) 1px, transparent 1px),
    radial-gradient(circle at 83% 8%, rgba(128,96,131,.22), transparent 29%),
    var(--ink);
  background-size: 96px 96px, 96px 96px, auto, auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line-soft);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .22em;
}
.brand span { color: var(--muted); }
.local-mark { display: flex; align-items: center; gap: 10px; color: var(--green); }
.local-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 15px rgba(169,192,167,.6); }

main { width: min(1260px, calc(100% - 48px)); margin: 0 auto; }
.hero { min-height: 550px; display: flex; flex-direction: column; justify-content: center; padding: 100px 0 82px; position: relative; }
.hero::after {
  content: "LOCAL";
  position: absolute;
  z-index: -1;
  right: -1vw;
  bottom: 24px;
  color: rgba(241,236,229,.025);
  font-size: clamp(120px, 21vw, 300px);
  font-weight: 650;
  letter-spacing: -.08em;
}
.eyebrow, .section-label {
  margin: 0;
  color: var(--copper);
  font: 600 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .2em;
}
.hero h1, h2 { letter-spacing: -.045em; }
.hero h1 { max-width: 950px; margin: 24px 0 30px; font-size: clamp(54px, 7.2vw, 102px); line-height: .92; font-weight: 420; text-transform: uppercase; }
.hero h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: #ded3cf; }
.lead { max-width: 720px; margin: 0 0 0 min(24vw, 300px); color: #c2bbba; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.6; }

.status-panel, .experiment, .progress-section, .results-section, .boundary { border-top: 1px solid var(--line); padding: 86px 0 96px; }
h2 { margin: 18px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 66px); font-weight: 400; line-height: 1; }
.status-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 58px 8vw; }
.status-card { min-height: 108px; display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.status-card .status-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #8e888c; }
.status-card strong { font-size: 15px; }
.status-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status-card.ready { border-color: rgba(169,192,167,.42); background: rgba(169,192,167,.055); }
.status-card.ready .status-dot { background: var(--green); box-shadow: 0 0 15px rgba(169,192,167,.55); }
.status-card.error { border-color: rgba(209,148,135,.45); background: rgba(209,148,135,.055); }
.status-card.error .status-dot { background: var(--red); }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-block: 1px solid var(--line); }
.facts div { padding: 23px 20px 24px 0; }
.facts div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.facts dt { color: var(--muted); font: 600 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; }
.facts dd { margin: 10px 0 0; font-size: 13px; line-height: 1.45; }

.section-heading { display: grid; grid-template-columns: 1.3fr .8fr; gap: 7vw; align-items: end; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.arm-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 62px; border: 1px solid var(--line); }
.arm-card { min-height: 194px; display: flex; flex-direction: column; position: relative; padding: 26px 24px; cursor: pointer; background: rgba(255,255,255,.018); transition: background .16s ease, border-color .16s ease; }
.arm-card + .arm-card { border-left: 1px solid var(--line); }
.arm-card:hover { background: rgba(255,255,255,.035); }
.arm-card:has(input:checked) { background: rgba(128,96,131,.095); box-shadow: inset 0 -2px var(--violet); }
.arm-card.pars-card:has(input:checked) { background: rgba(194,118,82,.085); box-shadow: inset 0 -2px var(--copper); }
.arm-card input { position: absolute; top: 24px; right: 24px; accent-color: var(--copper); }
.arm-letter { color: var(--muted); font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.arm-card strong { margin-top: auto; font-size: 17px; }
.arm-card small { margin-top: 9px; color: var(--muted); font-size: 12px; }
.manifest { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--line); }
.manifest div { min-width: 0; padding: 20px 22px 21px 0; }
.manifest div + div { border-left: 1px solid var(--line); padding-left: 22px; }
.manifest span { display: block; margin-bottom: 8px; color: var(--muted); font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; }
.manifest code { display: block; overflow: hidden; text-overflow: ellipsis; color: #c6bebc; font: 500 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.acknowledge { display: grid; grid-template-columns: auto 1fr; gap: 14px; max-width: 810px; margin: 38px 0 0; color: #c4bdbb; font-size: 13px; line-height: 1.55; cursor: pointer; }
.acknowledge input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--copper); }
.actions { display: flex; gap: 12px; margin-top: 30px; }
button { min-height: 48px; padding: 0 19px; border: 1px solid var(--line); border-radius: 0; color: var(--paper); background: transparent; cursor: pointer; font: 650 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
button.primary { border-color: rgba(194,118,82,.7); background: rgba(194,118,82,.13); }
button.secondary { color: var(--muted); }
button:hover:not(:disabled) { border-color: var(--paper); }
button:disabled { opacity: .38; cursor: not-allowed; }
.form-error { min-height: 20px; margin: 16px 0 0; color: var(--red); font-size: 13px; }

.progress-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.progress-heading strong { color: var(--green); font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
.progress-track { height: 2px; margin-top: 46px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--violet), var(--copper)); transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font: 500 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.table-wrap { margin-top: 54px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
td { padding: 20px 16px; border-bottom: 1px solid var(--line-soft); }
td:first-child { color: var(--copper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.receipt-row { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 30px; }
.receipt-row p { margin: 0; max-width: 700px; color: var(--muted); font: 500 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }

.boundary { display: grid; grid-template-columns: .35fr 1fr; gap: 5vw; }
.boundary p:last-child { max-width: 820px; margin: 0; color: #bcb5b5; font-family: Georgia, "Times New Roman", serif; font-size: clamp(23px, 3vw, 36px); line-height: 1.35; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 34px clamp(24px, 5vw, 76px); border-top: 1px solid var(--line-soft); color: var(--muted); font: 600 8px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }

@media (max-width: 860px) {
  main { width: min(100% - 34px, 720px); }
  .hero { min-height: 500px; }
  .lead { margin-left: 0; }
  .status-panel, .section-heading { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .facts div:nth-child(4) { border-top: 1px solid var(--line); }
  .arm-grid { grid-template-columns: 1fr 1fr; }
  .arm-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .arm-card:nth-child(4) { border-top: 1px solid var(--line); }
  .manifest { grid-template-columns: 1fr; }
  .manifest div + div { border-left: 0; border-top: 1px solid var(--line-soft); padding-left: 0; }
  .boundary { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { padding-inline: 17px; }
  .brand span { display: none; }
  .hero h1 { font-size: 48px; }
  .facts, .arm-grid { grid-template-columns: 1fr; }
  .facts div + div, .arm-card + .arm-card { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .arm-card { min-height: 150px; }
  .progress-heading, .progress-meta, .receipt-row, footer { align-items: flex-start; flex-direction: column; }
  .actions { flex-direction: column; }
  button { width: 100%; }
}
