:root {
  --rust: #8a3226;
  --rust-deep: #74291f;
  --rust-darker: #5e211a;
  --rust-mid: #a3432f;
  --brick: #c25b3d;
  --peach: #f7b38f;
  --cream: #fdf1e3;
  --muted: rgba(253, 241, 227, 0.72);
  --line: rgba(253, 241, 227, 0.14);
  --line-2: rgba(253, 241, 227, 0.26);
  --panel: rgba(70, 22, 16, 0.45);
  --radius: 14px;
  --sans: "Figtree", "Avenir Next", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--rust);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
.mono { font-family: var(--mono); }
.peach { color: var(--peach); }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(138, 50, 38, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.logo { width: 34px; height: 30px; }
.links { display: flex; gap: 30px; }
.links a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; transition: color .2s; }
.links a:hover { color: var(--cream); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px; border-radius: 10px;
  font: 700 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cream); color: var(--rust); }
.btn-primary:hover { background: var(--peach); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; }
.ico { width: 16px; height: 16px; flex: none; }
.ico-lg { width: 34px; height: 34px; color: var(--peach); }

/* HERO */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100svh - 69px);
  display: flex; align-items: center;
  padding: 72px clamp(16px, 5vw, 72px) 96px;
}
.tracks {
  position: absolute; right: 0; bottom: 0;
  width: min(62vw, 980px); height: 100%;
  pointer-events: none;
}
.tracks svg { position: absolute; right: 0; bottom: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
h1 {
  margin: 0;
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 1.0; font-weight: 800; letter-spacing: -.02em;
  color: var(--cream);
}
h1 span { color: var(--peach); }
.lede { margin: 26px 0 0; max-width: 540px; color: var(--muted); font-size: clamp(17px, 1.7vw, 20px); font-weight: 500; }
.lede strong { color: var(--cream); font-weight: 700; }

/* CA */
.ca {
  margin-top: 34px; width: 100%; max-width: 580px;
  border-radius: var(--radius);
  background: var(--rust-darker);
  border: 2px solid var(--rust-mid);
  padding: 14px; text-align: left;
  transition: border-color .3s, box-shadow .3s;
}
.ca[data-state="live"] { border-color: var(--peach); }
.ca-label { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--peach); margin: 2px 4px 10px; }
.ca-row { display: flex; gap: 10px; align-items: stretch; }
.ca-value {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  padding: 12px 14px; border-radius: 9px;
  background: rgba(0, 0, 0, .18);
  font: 500 15px/1.3 var(--mono); color: var(--cream);
  overflow-wrap: anywhere; word-break: break-all; cursor: pointer;
}
.ca[data-state="pending"] .ca-value, .ca[data-state="loading"] .ca-value { color: var(--muted); cursor: default; }
.ca-copy {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px; border-radius: 9px; cursor: pointer; border: 0;
  background: var(--cream); color: var(--rust);
  font: 700 15px/1 var(--sans); transition: background .2s;
}
.ca-copy:hover:not(:disabled) { background: var(--peach); }
.ca-copy:disabled { opacity: .4; cursor: not-allowed; }
.ca.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(247,179,143,.8); } 100% { box-shadow: 0 0 0 20px rgba(247,179,143,0); } }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* BANDS / SECTIONS */
.band { background: var(--rust); }
.band-deep { background: var(--rust-deep); }
.section { max-width: 1180px; margin: 0 auto; padding: clamp(72px, 10vw, 128px) clamp(16px, 5vw, 48px); }
.eyebrow { font: 600 13px/1 var(--mono); color: var(--peach); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; }
h2 { margin: 0; font-size: clamp(32px, 5vw, 60px); line-height: 1.04; letter-spacing: -.02em; font-weight: 800; max-width: 920px; }
h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.sub { color: var(--muted); font-size: clamp(17px, 2vw, 20px); font-weight: 500; max-width: 640px; margin: 20px 0 0; }

/* ROUTE DIAGRAM */
.route {
  margin-top: 56px;
  display: grid; grid-template-columns: 1fr minmax(40px, 1fr) 1.2fr minmax(40px, 1fr) 1fr;
  align-items: center;
}
.node-card {
  border-radius: var(--radius);
  background: var(--rust-darker);
  padding: 26px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.node-card.hub { background: var(--rust-mid); }
.hub-logo { width: 56px; height: 50px; }
.node-title { font-weight: 800; font-size: 19px; margin-top: 8px; }
.node-sub { color: var(--muted); font-size: 12px; }

.wire { position: relative; height: 10px; background: var(--rust-darker); }
.wire span { position: absolute; top: 0; left: 0; width: 26px; height: 10px; background: var(--peach); animation: travel 2.4s linear infinite; }
.wire span:nth-child(2) { animation-delay: .8s; background: var(--brick); } .wire span:nth-child(3) { animation-delay: 1.6s; }
@keyframes travel { from { left: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { left: calc(100% - 26px); opacity: 0; } }

/* STEPS */
.steps { margin-top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  border-radius: var(--radius);
  background: var(--rust-deep);
  padding: 30px; position: relative; overflow: hidden;
  transition: transform .25s, background .25s;
}
.step::before { content: ""; position: absolute; left: 0; top: 0; height: 6px; width: 64px; background: var(--peach); }
.step:nth-child(2)::before { background: var(--brick); width: 96px; }
.step:nth-child(3)::before { background: var(--cream); width: 40px; }
.step:hover { transform: translateY(-3px); background: var(--rust-darker); }
.step p { margin: 0; color: var(--muted); font-size: 16px; font-weight: 500; }
.step-n { color: var(--peach); font-size: 13px; margin: 8px 0 30px; }

/* TOKEN */
.token { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.ledger { border-radius: var(--radius); background: var(--rust-darker); font-size: 13px; overflow: hidden; }
.ledger-head, .ledger-row { display: grid; grid-template-columns: 1.6fr 1fr .8fr; gap: 10px; padding: 11px 18px; }
.ledger-head { color: var(--peach); text-transform: uppercase; font-size: 11px; letter-spacing: .1em; border-bottom: 1px solid var(--line); }
.ledger-head span:last-child { text-align: right; }
.ledger-body { height: 270px; overflow: hidden; display: flex; flex-direction: column-reverse; }
.ledger-row { border-top: 1px solid rgba(253,241,227,.06); animation: rowIn .5s ease-out; white-space: nowrap; color: var(--muted); }
.ledger-row span { overflow: hidden; text-overflow: ellipsis; }
.ledger-row .ok { color: var(--peach); }
.ledger-row .amt { text-align: right; color: var(--cream); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); background: rgba(247,179,143,.15); } to { opacity: 1; transform: none; } }

/* FAQ */
.faq { margin-top: 44px; display: grid; gap: 10px; max-width: 860px; }
details { border-radius: 12px; background: var(--rust-deep); padding: 0 24px; }
summary {
  cursor: pointer; list-style: none; padding: 22px 0;
  font-weight: 800; font-size: 19px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 500 26px/1 var(--mono); color: var(--peach); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 22px; color: var(--muted); font-weight: 500; }
details a { color: var(--peach); }

/* FOOTER */
.footer {
  background: var(--rust-darker);
  padding: 48px clamp(16px, 4vw, 40px) 60px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.fine a { color: var(--muted); }

/* TOAST */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 10px;
  background: var(--cream); color: var(--rust); font-weight: 800; font-size: 14px;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .token { grid-template-columns: 1fr; gap: 32px; }
  .route { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
  .wire { width: 10px; height: 52px; margin: 0 auto; }
  .wire span { width: 10px; height: 18px; animation-name: travelY; }
  @keyframes travelY { from { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { top: calc(100% - 18px); opacity: 0; } }
  .hero { align-items: flex-start; }
  .tracks { width: 100%; height: 46%; opacity: .55; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hide-sm { display: none; }
  .ca-row { flex-direction: column; }
  .ca-copy { height: 46px; justify-content: center; }
  .cta .btn { flex: 1 1 100%; }
  .ledger-head, .ledger-row { grid-template-columns: 1.4fr 1fr .8fr; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* NETWORK */
.net-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 999px; background: var(--rust-darker);
  font: 600 13px/1 var(--mono); color: var(--muted); letter-spacing: .04em;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status[data-state="live"] { color: var(--cream); }
.status[data-state="live"] .status-dot { background: #8fe07a; box-shadow: 0 0 10px #8fe07a; animation: blinkDot 1.6s infinite; }
@keyframes blinkDot { 50% { opacity: .35; } }
.tiles { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--rust-deep); border-radius: var(--radius); padding: 24px; }
.tile-v { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; color: var(--cream); line-height: 1.1; }
.tile-l { margin-top: 6px; color: var(--peach); font-weight: 600; font-size: 14px; }
.use { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.use-card { background: var(--rust-deep); border-radius: var(--radius); padding: 30px; min-width: 0; }
.use-card > p { margin: 0; color: var(--muted); font-weight: 500; }
.use-tag { color: var(--peach); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.code { position: relative; margin: 18px 0 14px; background: var(--rust-darker); border-radius: 10px; }
.code pre { margin: 0; padding: 16px 16px 16px 16px; padding-right: 76px; overflow-x: auto; }
.code code { font: 500 13px/1.6 var(--mono); color: var(--cream); white-space: pre; }
.code .gw, .code .site, .code .apikey { color: var(--peach); }
.code-copy {
  position: absolute; top: 10px; right: 10px;
  border: 0; border-radius: 7px; padding: 7px 11px; cursor: pointer;
  background: var(--cream); color: var(--rust); font: 700 12px/1 var(--sans);
}
.code-copy:hover { background: var(--peach); }
.hint { margin: 0 !important; font-size: 14px; }
.hint code, details code { font-family: var(--mono); font-size: .9em; background: rgba(0,0,0,.18); padding: 1px 6px; border-radius: 5px; color: var(--cream); }
.hint a { color: var(--peach); }

/* LIVE PLAYGROUND */
.try-card {
  margin-top: 16px;
  background: var(--rust-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.try-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.try-head h3 { margin: 0; }
.try-key-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.try-bal { font-size: 13px; color: var(--peach); background: var(--rust-darker); padding: 9px 13px; border-radius: 9px; }
.try-form { margin-top: 18px; display: flex; gap: 10px; }
.try-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--rust-darker); color: var(--cream);
  font-size: 14px; outline: none; transition: border-color .2s;
}
.try-input:focus { border-color: var(--peach); }
.try-go { height: 44px; padding: 0 20px; flex: none; }
.try-go:disabled, #trialBtn:disabled { opacity: .5; cursor: not-allowed; }
.try-presets { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.preset {
  border: 1px solid var(--line); background: transparent; color: var(--cream);
  padding: 5px 10px; border-radius: 7px; cursor: pointer; font: 500 12px/1 var(--mono);
  transition: border-color .2s, color .2s;
}
.preset:hover { border-color: var(--peach); color: var(--peach); }
.try-out { margin-top: 16px; background: var(--rust-darker); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.try-meta {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px;
  font-size: 12px; color: var(--peach); border-bottom: 1px solid var(--line);
}
.try-meta .ok { color: #8fe07a; }
.try-meta .err { color: #ff8e8e; }
.try-body {
  margin: 0; padding: 14px; font-size: 13px; line-height: 1.5;
  color: var(--cream); max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .use { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .try-form { flex-direction: column; }
  .try-go { width: 100%; }
}
