:root {
  color-scheme: dark;
  --ink: #f4f1e8;
  --muted: #9ea7a0;
  --line: #2b3732;
  --panel: #111814;
  --panel-soft: #162019;
  --canvas: #0a0f0c;
  --green: #81f5a9;
  --green-dark: #0f3b24;
  --amber: #f2bd64;
  --danger: #ff8f7c;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a.button {
  min-height: 44px;
}

.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--mono);
}

.crumb {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
}

.crumb:hover,
.crumb:focus-visible {
  color: var(--green);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr);
  gap: 48px;
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: clamp(2.65rem, 7vw, 6rem);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3vw, 2.9rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 700px;
  margin-bottom: 0;
  color: #c2c9c4;
  font-size: 1.1rem;
}

.scope-note {
  align-self: end;
  padding: 20px 0 4px 24px;
  border-left: 2px solid var(--green);
}

.scope-note strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scope-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lab {
  padding: 56px 0;
}

.lab-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.lab-heading p,
.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(10, 15, 12, 0.92);
  box-shadow: 12px 12px 0 #0e2a1a;
}

.controls {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.panel-label {
  margin-bottom: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field {
  margin-bottom: 24px;
}

.field-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.field label,
.field-row label {
  color: #dce1dd;
  font-size: 0.88rem;
  font-weight: 650;
}

.value {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
}

input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #3b4a42;
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: #0c120e;
  font-family: var(--mono);
  font-size: 0.85rem;
}

input[type="text"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(129, 245, 169, 0.12);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin: 14px 0;
  color: #c7cec9;
  font-size: 0.83rem;
}

.check-row input {
  margin: 3px 0 0;
  accent-color: var(--green);
}

.check-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.primary,
.secondary,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--green);
  border-radius: 0;
  padding: 11px 16px;
  cursor: pointer;
  color: #07110a;
  background: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.primary {
  width: 100%;
  margin-top: 10px;
}

.secondary {
  color: var(--green);
  background: transparent;
}

.primary:hover,
.primary:focus-visible,
.button:hover,
.button:focus-visible {
  background: #a7ffc4;
}

.secondary:hover,
.secondary:focus-visible {
  color: #07110a;
  background: var(--green);
}

.output {
  min-width: 0;
}

.output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #0d1410;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(129, 245, 169, 0.08);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.25rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.preview-tabs {
  display: flex;
  gap: 0;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.tab[aria-selected="true"] {
  border-color: var(--green);
  color: var(--green);
}

.preview-panel {
  min-height: 390px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.73rem;
  white-space: nowrap;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #1f2b25;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: #0b110d;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td.kind-post {
  color: var(--amber);
}

td.kind-comment {
  color: var(--green);
}

.cell-body {
  max-width: 330px;
  overflow: hidden;
  color: #c7cec9;
  text-overflow: ellipsis;
}

.csv-preview {
  margin: 0;
  padding: 22px;
  overflow: auto;
  color: #b8e9c7;
  background: #080d0a;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  white-space: pre;
}

.hidden {
  display: none;
}

.console {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #0d1410;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.console span {
  color: var(--green);
}

.proof {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

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

.proof-item {
  min-height: 190px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 24, 20, 0.72);
}

.proof-number {
  display: block;
  margin-bottom: 30px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.proof-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.boundary {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.boundary-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.boundary-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: #c7cec9;
}

.boundary-list li::before {
  content: "✓";
  color: var(--green);
  font-family: var(--mono);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 48px 0 80px;
}

.showcase-card {
  display: block;
  min-height: 260px;
  padding: 28px;
  border: 1px solid var(--line);
  color: inherit;
  background: var(--panel);
  text-decoration: none;
}

.showcase-card:hover,
.showcase-card:focus-visible {
  border-color: var(--green);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--green-dark);
}

.showcase-card .tag {
  display: inline-block;
  margin-bottom: 56px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.showcase-card p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .boundary {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 60px;
  }

  .hero {
    gap: 30px;
    padding: 54px 0 42px;
  }

  h1 {
    font-size: clamp(2.45rem, 16vw, 4.2rem);
  }

  .lab-heading,
  .section-heading,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .proof-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .output-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
