:root {
  --blue:      #147ed3;
  --blue-dark: #086dbd;
  --navy:      #071827;
  --ink:       #0a1422;
  --text:      #16181d;
  --muted:     #5f6673;
  --line:      #e5e8ee;
  --hair:      #e6ebf2;
  --soft:      #f7fbff;
  --soft-blue: #eef8ff;
  --shadow:    0 18px 48px rgba(7,24,39,.08);
  --max:       1080px;
  --green:     #1a7f4b;
  --green-bg:  #e6f6ee;
  --red:       #b91c1c;
  --red-bg:    #fef2f2;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.container { width: min(100% - 48px, var(--max)); margin-inline: auto; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: var(--max); margin: 0 auto;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo img { height: 32px; }
.header-logo .logo-sep { width: 1px; height: 20px; background: var(--line); }
.header-logo span { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.header-links { display: flex; align-items: center; gap: 20px; }
.header-links a { font-size: 13.5px; color: var(--muted); font-weight: 500; transition: color .15s; }
.header-links a:hover { color: var(--blue); }
.btn-header {
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-header:hover { background: var(--blue-dark); }

/* ── Hero ── */
.hero {
  background: linear-gradient(180deg, #eaf4fd 0%, #f4f9ff 100%);
  border-bottom: 1px solid var(--hair);
  padding: clamp(48px, 7vw, 80px) 0 clamp(40px, 6vw, 64px);
  text-align: center;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 60px); line-height: .96;
  letter-spacing: -.05em; color: var(--ink); font-weight: 800;
  margin: 0 0 18px;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px); color: #41505f;
  max-width: 540px; margin: 0 auto 28px; line-height: 1.55;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1px solid rgba(20,126,211,.2); background: rgba(255,255,255,.8);
  border-radius: 999px; font-size: 12px; font-weight: 700; color: #3a5068;
}
.chip code { color: var(--blue); font-size: 11px; background: none; }

/* ── Hero actions ── */
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px;
}
.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  background: var(--blue); color: #fff; border: none;
  border-radius: 10px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background .15s;
  text-decoration: none;
}
.btn-hero:hover { background: var(--blue-dark); }
.btn-hero-outline {
  background: rgba(255,255,255,.85); color: var(--blue);
  border: 1.5px solid rgba(20,126,211,.3);
}
.btn-hero-outline:hover { background: #fff; }
.btn-hero .chevron { transition: transform .18s; }
.dropdown { position: relative; }
.dropdown.open .chevron { transform: rotate(180deg); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid var(--hair);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(7,24,39,.13);
  min-width: 200px; overflow: hidden; z-index: 200;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  color: var(--text); transition: background .12s;
}
.dropdown-item:hover { background: var(--soft-blue); color: var(--blue); }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-item + .dropdown-item { border-top: 1px solid var(--hair); }

/* ── Install section ── */
.install-section {
  background: var(--soft); border-bottom: 1px solid var(--hair);
  padding: clamp(40px, 5vw, 56px) 0;
}
.install-intro {
  font-size: 14px; color: var(--muted); text-align: center; margin: 0 0 28px;
}
.install-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 820px) { .install-grid { grid-template-columns: 1fr; } }
.install-block-label {
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
  display: flex; align-items: center; gap: 7px;
}
.install-block-label svg { width: 13px; height: 13px; }
.install-note {
  font-size: 11.5px; color: var(--muted); margin: 8px 0 0;
}

/* ── Section layout ── */
.demo-body { padding: clamp(48px, 6vw, 72px) 0; background: #fff; }
.demo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 820px) { .demo-grid { grid-template-columns: 1fr; } }
.section-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .15em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 18px;
}

/* ── Cards ── */
.card {
  border: 1px solid var(--hair); border-radius: 20px;
  padding: clamp(20px, 3vw, 28px); background: #fff;
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 18px; font-weight: 700; color: var(--ink);
  letter-spacing: -.02em; margin: 0 0 6px;
}
.card-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px; font-size: 14px;
  font-weight: 700; cursor: pointer; border: none; transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: #a5c9e8; cursor: not-allowed; }
.btn-outline {
  background: #fff; color: var(--blue);
  border: 1.5px solid rgba(20,126,211,.3);
}
.btn-outline:hover { background: var(--soft-blue); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 7px; }

/* ── Key display ── */
.key-block {
  background: var(--ink); border-radius: 12px;
  padding: 14px 16px; margin: 12px 0;
  display: flex; align-items: center; gap: 10px;
}
.key-block code {
  flex: 1; font-size: 11.5px; color: #c9d8e8;
  word-break: break-all; line-height: 1.5;
}
.key-block.secret code { filter: blur(5px); transition: filter .2s; user-select: none; }
.key-block.secret.revealed code { filter: none; user-select: text; }
.icon-btn {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: #7a9ab8; flex-shrink: 0; display: flex; transition: color .15s;
}
.icon-btn:hover { color: #a8c8e0; }
.icon-btn svg { width: 16px; height: 16px; display: block; }

.key-label {
  font-size: 10px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 16px 0 2px;
}
.key-label:first-child { margin-top: 0; }

/* ── QR code ── */
.qr-wrap {
  display: flex; justify-content: center; margin: 20px 0 8px;
}
.qr-frame {
  background: #fff; border: 1px solid var(--hair);
  border-radius: 16px; padding: 14px; display: inline-flex;
}
.qr-frame img, .qr-frame canvas { display: block; border-radius: 6px; }

/* ── Balance row ── */
.balance-section { margin-top: 20px; }
.balance-title {
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
.balance-list { display: flex; flex-direction: column; gap: 8px; }
.balance-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--soft); border: 1px solid var(--hair);
  border-radius: 12px; padding: 10px 14px;
}
.asset-logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--line); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--muted);
}
.asset-logo img { width: 100%; height: 100%; object-fit: cover; }
.asset-info { flex: 1; min-width: 0; }
.asset-code { font-size: 13px; font-weight: 700; color: var(--ink); }
.asset-name { font-size: 11px; color: var(--muted); }
.asset-balance { font-size: 15px; font-weight: 700; color: var(--ink); font-family: ui-monospace, Menlo, monospace; }

.unfunded-msg {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 12px; padding: 12px 16px;
  font-size: 13px; color: #92400e; display: flex; align-items: center; gap: 10px;
}
.status-msg {
  font-size: 12.5px; color: var(--muted); text-align: center; padding: 12px 0;
}

/* ── Live wallet ── */
.wallet-key-input-wrap { display: flex; gap: 8px; margin-bottom: 18px; }
.wallet-key-input {
  flex: 1; font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; padding: 10px 14px; border: 1px solid var(--hair);
  border-radius: 10px; background: var(--soft); color: var(--ink);
  outline: none; transition: border-color .15s;
}
.wallet-key-input:focus { border-color: var(--blue); }

.last-updated {
  font-size: 11.5px; color: var(--muted); text-align: right;
  margin-top: 10px;
}

/* ── Asset cards (wallet) ── */
.wallet-assets { display: flex; flex-direction: column; gap: 10px; }
.wallet-asset-card {
  background: var(--soft); border: 1px solid var(--hair);
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.wallet-asset-card .asset-logo { width: 40px; height: 40px; }
.asset-amounts { text-align: right; }
.wallet-asset-card .asset-balance { font-size: 18px; }
.asset-value { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: ui-monospace, Menlo, monospace; }

.wallet-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-top: 12px;
  background: var(--soft-blue); border: 1px solid rgba(20,126,211,.15);
  border-radius: 14px;
}
.wallet-total-label {
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.wallet-total-value {
  font-size: 22px; font-weight: 800; color: var(--ink);
  font-family: ui-monospace, Menlo, monospace; letter-spacing: -.02em;
}

/* ── Divider ── */
.demo-divider { border: none; border-top: 1px solid var(--hair); margin: 40px 0; }

/* ── Path Finder ── */
.path-form {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px;
  align-items: end; margin-bottom: 16px;
}
@media (max-width: 640px) { .path-form { grid-template-columns: 1fr; } }
.path-arrow {
  font-size: 20px; color: var(--blue); padding-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.form-select, .form-input {
  font-family: inherit; font-size: 13.5px; padding: 10px 13px;
  border: 1px solid var(--hair); border-radius: 10px;
  background: var(--soft); color: var(--ink); outline: none;
  transition: border-color .15s; width: 100%;
}
.form-select:focus, .form-input:focus { border-color: var(--blue); }
.amount-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.amount-row .form-group { flex: 1; }

.path-results { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.path-card {
  border: 1px solid var(--hair); border-radius: 14px; overflow: hidden;
  transition: border-color .18s;
}
.path-card.best { border-color: rgba(20,126,211,.4); background: var(--soft-blue); }
.path-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
}
.path-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.badge-best { background: var(--blue); color: #fff; }
.badge-alt  { background: var(--hair); color: var(--muted); }
.path-rate  { font-size: 15px; font-weight: 800; color: var(--ink); font-family: ui-monospace, Menlo, monospace; }
.path-rate span { font-size: 11px; color: var(--muted); font-weight: 500; font-family: inherit; }
.path-hops {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--hair);
  background: rgba(255,255,255,.6); font-size: 12.5px;
}
.hop-asset {
  background: var(--soft); border: 1px solid var(--hair);
  border-radius: 7px; padding: 3px 10px; font-weight: 700; color: var(--ink);
  font-size: 12px;
}
.hop-arrow { color: var(--blue); font-size: 14px; font-weight: 700; }

.issuer-input {
  margin-top: 5px; font-size: 10.5px !important;
  font-family: ui-monospace, Menlo, monospace; color: var(--muted);
}

/* ── Orderbook ── */
.ob-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.ob-pair-wrap { display: flex; align-items: flex-start; gap: 8px; flex: 1; flex-wrap: wrap; }
.ob-pair-side { display: flex; flex-direction: column; flex: 1; min-width: 100px; }
.ob-code-input { font-weight: 700; }
.ob-pair-slash { font-size: 20px; color: var(--blue); font-weight: 700; padding-top: 9px; }
.ob-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 560px) { .ob-grid { grid-template-columns: 1fr; } }
.ob-side-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase; margin: 0 0 8px; display: flex; align-items: center; gap: 7px;
}
.ob-side-label.bids { color: var(--green); }
.ob-side-label.asks { color: var(--red); }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; }
.ob-dot.green { background: var(--green); }
.ob-dot.red   { background: var(--red); }

.ob-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ob-table th {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--hair);
}
.ob-table th:first-child { text-align: left; }
.ob-table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--hair); font-family: ui-monospace, Menlo, monospace; }
.ob-table td:first-child { text-align: left; }
.ob-table tr:last-child td { border-bottom: none; }
.ob-table .price-bid { color: var(--green); font-weight: 700; }
.ob-table .price-ask { color: var(--red);   font-weight: 700; }
.ob-table .col-amount { color: var(--ink); }
.ob-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 18px 0; }

.ob-spread {
  text-align: center; font-size: 12px; color: var(--muted);
  padding: 10px 0; border-top: 1px solid var(--hair); margin-top: 4px;
}
.ob-spread strong { color: var(--ink); }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px; text-align: center;
  font-size: 13px; color: var(--muted);
}
.site-footer a { color: var(--blue); }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 540px) {
  .header-links { display: none; }
  .key-block code { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse-dot { animation: none; }
}
