:root {
  --bg: #07071c;
  --raise: #0e0e2a;
  --line: #22224e;
  --text: #eef0ff;
  --muted: #b0b3dd;      /* 9.9:1 on --bg */
  --faint: #8c8fc2;      /* 6.6:1 on --bg, 6.1:1 on --raise */
  --indigo: #4c5bff;
  --violet: #9d74ff;
  --link: #b9a2ff;
  --ok: #7ee0c3;
  --bad: #ff9bb1;

  --sans: "Lexend", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--text); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -.015em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  border-radius: 10px; text-decoration: none; font-weight: 400; font-size: 16px;
  background: var(--indigo); color: #fff; border: 1px solid var(--indigo);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #5f6cff; color: #fff; }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--text); }
.btn.quiet:hover { border-color: var(--faint); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 12px var(--gutter);
  background: rgba(7,7,28,.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(34,34,78,.6);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 400; font-size: 17px; }
.brand img { border-radius: 6px; }
.nav nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover { color: var(--text); }
.nav-x { display: grid; place-items: center; width: 40px; height: 40px; color: var(--muted); border-radius: 8px; }
.nav-x:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: center;
  padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(32px, 5vw, 64px);
}
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); line-height: 1.05; font-weight: 300; letter-spacing: -.03em; max-width: 13ch; }
.lede { margin: 24px 0 36px; font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 40ch; }
.hero-cube {
  width: 100%; max-width: 400px; justify-self: center;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
}

/* ---------- blocks ---------- */
.block { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(24px, 3vw, 32px); }
.block h2 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.15; font-weight: 300; }
.sub { margin-top: 10px; color: var(--muted); max-width: 60ch; }

/* ---------- examples ---------- */
.examples { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.examples li {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.examples img { width: 72px; height: 72px; mix-blend-mode: screen; }
.examples h3 { font-size: 19px; }
.examples p { color: var(--muted); margin-top: 2px; }
.try {
  background: none; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 0 18px;
  color: var(--text); cursor: pointer; font-size: 15px; font-weight: 400; transition: border-color .15s;
}
.try:hover { border-color: var(--violet); }

/* ---------- demo ---------- */
.insp { margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--raise); scroll-margin-top: 90px; }
.insp-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  background: none; border: 1px solid transparent; border-radius: 8px; min-height: 40px; padding: 0 14px;
  color: var(--muted); font-size: 15px; font-weight: 400; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--bg); border-color: var(--line); color: var(--text); }
.role { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.role select {
  font: 400 15px var(--sans); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; min-height: 40px; padding: 0 12px;
}

.insp-asset { display: flex; gap: 14px; align-items: center; padding: 16px 20px 0; }
.insp-asset img { width: 56px; height: 56px; mix-blend-mode: screen; flex: none; }
.asset-name { font-weight: 400; font-size: 18px; }
.asset-desc { color: var(--muted); font-size: 15px; }

.next {
  margin: 16px 20px 0; padding: 12px 14px; border-radius: 10px; font-size: 15px;
  background: rgba(76,91,255,.12); color: var(--text); border-left: 3px solid var(--indigo);
}
.next.refused { background: rgba(255,155,177,.1); border-left-color: var(--bad); }

.insp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); }
.panel { padding: 20px; min-width: 0; }
.ph { font-size: 14px; font-weight: 500; color: var(--faint); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; letter-spacing: 0; }
.tid { font-weight: 400; }

.actions { display: flex; flex-direction: column; gap: 8px; }
.act {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  min-height: 44px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 400;
  transition: border-color .15s, background .15s;
}
.act:hover { border-color: var(--violet); }
.act small { font-size: 13px; color: var(--faint); white-space: nowrap; }
.act.sim { background: transparent; border-style: dashed; }
.act.blocked { color: var(--muted); }
.act.blocked small { color: var(--bad); }
.act.suggest { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo); }
.act-row { display: flex; gap: 8px; }
.act-row .act { flex: 1; min-width: 0; }
.field {
  display: flex; align-items: center; gap: 6px; width: 132px; flex: none; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.field:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.field input { width: 100%; min-width: 0; background: none; border: 0; color: var(--text); font: 400 14px var(--mono); outline: none; }
.unit { font-size: 13px; color: var(--faint); }

dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
dt { color: var(--faint); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
dd.changed { color: var(--ok); }

.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 400; }
thead th { color: var(--faint); font-size: 13px; vertical-align: bottom; }
tbody th { text-align: left; white-space: nowrap; }
tr.me th { color: var(--text); }
tr.me { background: rgba(76,91,255,.1); }
.you { color: var(--faint); }
.yes { color: var(--ok); }
.no { color: var(--faint); }

.log-panel { border-top: 1px solid var(--line); }
#log { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; font-size: 14px; }
#log li { padding: 6px 0; border-bottom: 1px solid rgba(34,34,78,.6); color: var(--muted); overflow-wrap: anywhere; }
#log li.ok { color: var(--ok); }
#log li.err { color: var(--bad); }
.link { background: none; border: 0; padding: 4px 0; color: var(--link); cursor: pointer; font-size: 14px; font-weight: 400; }
.link:hover { text-decoration: underline; }

.studio { margin-top: 18px; color: var(--muted); }

/* ---------- developers ---------- */
.code-card { position: relative; margin-top: 24px; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
pre { margin: 0; overflow-x: auto; }
pre code { font: 400 13.5px/1.75 var(--mono); color: var(--muted); }
.c { color: var(--faint); }
.k { color: #b89cff; }
.t { color: #8fb0ff; }
.copy {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; min-height: 36px; padding: 0 12px;
  color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 400;
}
.copy:hover { color: var(--text); }

/* ---------- roadmap ---------- */
.road { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.road li { border-top: 2px solid var(--line); padding-top: 14px; }
.road li.done { border-top-color: var(--ok); }
.road li.now { border-top-color: var(--indigo); }
.road h3 { font-size: 17px; }
.road p { margin-top: 4px; font-size: 15px; color: var(--faint); }
.road .done p { color: var(--ok); }
.road .now p { color: var(--link); }

/* ---------- footer ---------- */
.foot { margin-top: clamp(72px, 10vw, 120px); padding-bottom: 48px; }
.foot-row { border-top: 1px solid var(--line); padding-top: 32px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.fine { margin-top: 24px; font-size: 14px; color: var(--faint); max-width: 70ch; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav-x { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero-cube { grid-row: 1; max-width: 200px; justify-self: start; margin-left: -16px; }
  .insp-grid { grid-template-columns: minmax(0, 1fr); }
  .insp-grid .panel + .panel { border-top: 1px solid var(--line); }
  .road { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .nav { gap: 8px; }
  .examples li { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; }
  .examples img { width: 56px; height: 56px; grid-row: span 2; }
  .examples .try { justify-self: start; grid-column: 2; min-height: 40px; }
  .insp-bar { padding: 12px; }
  .seg { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg button { padding: 4px 6px; font-size: 14px; line-height: 1.2; min-height: 44px; }
  .role { width: 100%; }
  .role select { flex: 1; min-width: 0; }
  .insp-asset { padding: 14px 14px 0; }
  .next { margin: 14px 14px 0; }
  .panel { padding: 16px 14px; }
  .field { width: 118px; }
  .code-card { padding: 52px 14px 16px; }
  .road { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .foot-row .ctas { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* contract addresses */
.ca { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--muted); }
.ca code, .contracts code { font-family: var(--mono); font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.copy-addr {
  background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; min-height: 32px;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.copy-addr:hover { color: var(--text); border-color: var(--faint); }
.contracts { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.contracts li {
  display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) auto; gap: 8px 24px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.contracts h3 { font-size: 17px; }
.contracts p { font-size: 14px; color: var(--faint); margin-top: 2px; }
.c-acts { display: flex; gap: 12px; align-items: center; font-size: 14px; }
@media (max-width: 720px) {
  .contracts li { grid-template-columns: minmax(0, 1fr); }
}
