:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --panel: #fbfaf6;
  --ink: #161815;
  --muted: #62675f;
  --line: #cfd1c8;
  --green: #176b4c;
  --green-soft: #dceadf;
  --orange: #d36b32;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 24, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 24, 21, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 233, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 12px;
}

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

.hero {
  padding: 92px 0 70px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-number {
  margin: 0 0 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 1060px;
  margin-bottom: 28px;
  font-size: clamp(54px, 8vw, 104px);
  line-height: 0.94;
  font-weight: 760;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 800px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 19px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions a,
.copy-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}

.actions .primary-action,
.copy-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.status > div {
  padding: 24px 26px;
  background: rgba(251, 250, 246, 0.78);
}

.status > div + div {
  border-left: 1px solid var(--line);
}

.status p {
  margin: 5px 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--orange);
}

.status-dot.is-live {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section-intro,
.section-head {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.section-intro > .section-number,
.section-head .section-number {
  padding-top: 6px;
}

.section-intro p:last-child,
.section-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.deploy-steps {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: deploy;
}

.deploy-steps li {
  display: grid;
  grid-template-columns: 60px 210px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: deploy;
}

.deploy-steps li::before {
  color: var(--green);
  content: counter(deploy, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
}

.deploy-steps span {
  color: var(--muted);
}

code {
  padding: 0.08em 0.28em;
  border-radius: 3px;
  background: #e6e5df;
  font-family: var(--mono);
  font-size: 0.88em;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.contract-grid article {
  min-height: 320px;
  padding: 42px 30px;
  background: rgba(251, 250, 246, 0.72);
}

.contract-grid article + article {
  border-left: 1px solid var(--line);
}

.contract-grid article > p:not(.section-number) {
  color: var(--muted);
}

.contract-grid article > a {
  display: inline-block;
  margin-top: 18px;
  color: var(--green);
  font-weight: 700;
}

.resource-tree,
.resource-tree ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-group {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.tree-group:last-child {
  border-bottom: 1px solid var(--line);
}

.tree-group-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 25px 24px 25px 0;
}

.tree-index {
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
}

.tree-group-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.tree-group > ol {
  border-left: 1px solid var(--line);
}

.tree-group > ol li + li {
  border-top: 1px solid var(--line);
}

.tree-group > ol a {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 0 16px 24px;
  text-decoration: none;
  transition: background 140ms ease, padding 140ms ease;
}

.tree-group > ol a:hover {
  padding-left: 30px;
  background: rgba(220, 234, 223, 0.45);
}

.tree-group > ol strong,
.tree-group > ol small {
  display: block;
}

.tree-group > ol small {
  margin-top: 3px;
  color: var(--muted);
}

.tree-group > ol em {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  text-transform: uppercase;
}

.copy-panel .section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.copy-panel textarea {
  display: block;
  width: 100%;
  min-height: 640px;
  resize: vertical;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  background: #161815;
  color: #e7e9e2;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

.boundary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}

.boundary-columns > div {
  padding: 28px;
  background: var(--panel);
}

.boundary-columns p {
  margin-bottom: 0;
  color: var(--muted);
}

.security-note {
  margin: 22px 0 0;
  padding: 20px 24px;
  border-left: 4px solid var(--orange);
  background: #f5e6db;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 60px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .page {
    width: min(100% - 24px, 720px);
  }

  .topbar {
    padding: 0 14px;
  }

  .hero {
    padding: 64px 0 52px;
  }

  .status,
  .contract-grid,
  .boundary-columns {
    grid-template-columns: 1fr;
  }

  .status > div + div,
  .contract-grid article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .contract-grid article {
    min-height: auto;
  }

  .deploy-steps li {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .deploy-steps span {
    grid-column: 2;
  }

  .tree-group {
    grid-template-columns: 1fr;
  }

  .tree-group > ol {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .tree-group-head {
    padding-right: 0;
  }

  .tree-group > ol a {
    padding-right: 10px;
  }

  .copy-panel .section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .copy-button {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .topbar nav a:nth-child(2) {
    display: none;
  }

  h1 {
    font-size: 38px;
    line-height: 0.98;
    word-spacing: 0.08em;
  }

  .section-intro,
  .section-head {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .deploy-steps li {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .tree-group > ol a {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .copy-panel textarea {
    min-height: 520px;
    padding: 14px;
    font-size: 11px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
