:root {
  --bg: #05060a;
  --panel: #111318;
  --panel-2: #171a21;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f6fb;
  --muted: #8d93a1;
  --accent: #7eb6ff;
  --accent-2: #2563eb;
  --good: #3dd68c;
  --danger: #f07178;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Geist, "Segoe UI", sans-serif;
  background:
    radial-gradient(760px 460px at 108% -14%, rgba(37, 99, 235, 0.5), transparent 62%),
    radial-gradient(circle at 14% 28%, rgba(255, 255, 255, 0.28) 1px, transparent 1.6px),
    radial-gradient(circle at 28% 78%, rgba(255, 255, 255, 0.16) 1px, transparent 1.6px),
    radial-gradient(circle at 72% 36%, rgba(126, 182, 255, 0.7) 1.2px, transparent 2px),
    radial-gradient(circle at 86% 72%, rgba(255, 255, 255, 0.18) 1px, transparent 1.6px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 72%);
}
::selection { background: #22d3ee; color: #05060a; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 68px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(16px);
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.16em;
  font-size: 14px;
}
.brand img { display: block; height: 42px; width: auto; }
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tabs button:hover { color: var(--text); }
.ticker {
  position: sticky;
  top: 68px;
  z-index: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 48s linear infinite;
}
.ticker-track span {
  padding: 9px 22px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.ticker-track b { color: var(--text); font-weight: 500; margin-left: 8px; }
.ticker-track span::before { content: "◆"; color: #3b82f6; margin-right: 12px; font-size: 8px; vertical-align: 2px; }
@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tabs button.on {
  background: #1c212c;
  color: var(--text);
}
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.icon-btn, .btn {
  border: 1px solid var(--line);
  background: #15181f;
  border-radius: 999px;
  text-decoration: none;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.btn {
  padding: 8px 14px;
  background: linear-gradient(180deg, #93c5fd, var(--accent-2));
  color: #07101c;
  border-color: transparent;
  font-weight: 600;
}
.btn.ghost {
  background: #15181f;
  color: var(--text);
  border-color: var(--line);
}
.btn.wide { width: 100%; border-radius: 14px; padding: 12px 14px; display: inline-block; text-align: center; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.main { width: min(1080px, calc(100% - 32px)); margin: 28px auto 40px; flex: 1; }
body[data-view="home"] .main { width: min(1120px, calc(100% - 40px)); margin-top: 18px; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  min-height: 520px;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}
.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(46px, 6.4vw, 78px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.05em;
}
h1 em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  padding-right: 0.06em;
  background: linear-gradient(90deg, #ffffff, #93c5fd 45%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lab-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lab-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.6);
  animation: ping 2s ease-out infinite;
}
.lab-status span:first-of-type { color: var(--text); }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(61, 214, 140, 0); }
}
.hero-copy > p {
  margin: 0 0 22px;
  max-width: 460px;
  color: var(--muted);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-metrics {
  display: flex;
  gap: 28px;
  margin: 28px 0 0;
}
.hero-metrics div { min-width: 0; }
.hero-metrics { padding-top: 18px; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.hero-metrics dt { color: var(--muted); font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-metrics dd { margin: 8px 0 0; font-family: "Geist Mono", ui-monospace, monospace; font-size: 22px; letter-spacing: -0.02em; }

.stage {
  position: relative;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    rgba(8, 10, 15, 0.6);
  overflow: hidden;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.glow {
  position: absolute;
  width: 280px;
  height: 280px;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.45), transparent 68%);
  filter: blur(8px);
  animation: pulse 7s ease-in-out infinite;
  pointer-events: none;
}
@property --spread {
  syntax: "<length>";
  inherits: true;
  initial-value: 30px;
}
.slabs {
  position: absolute;
  left: 38%;
  top: 60%;
  width: 0;
  height: 0;
  --spread: 30px;
  transform: translate(var(--px, 0px), var(--py, 0px));
  transition: --spread 520ms cubic-bezier(0.2, 0.9, 0.2, 1.2), transform 240ms ease-out;
  animation: breathe 5.5s ease-in-out infinite;
}
.stage.open .slabs { --spread: 66px; animation: none; }
@keyframes breathe {
  0%, 100% { --spread: 26px; }
  50% { --spread: 38px; }
}
.slab {
  position: absolute;
  left: -110px;
  top: calc(-110px - var(--i) * var(--spread));
  width: 220px;
  height: 220px;
  transform: scaleY(0.58);
  z-index: calc(var(--i) + 1);
}
.face {
  position: absolute;
  inset: 32px;
  border-radius: 24px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--hi), var(--face) 55%);
  box-shadow:
    3px 3px 0 var(--side),
    6px 6px 0 var(--side),
    9px 9px 0 var(--side),
    12px 12px 0 var(--side),
    15px 15px 0 var(--side),
    30px 30px 40px rgba(0, 0, 0, 0.55);
}
.slab-tag {
  position: absolute;
  left: 150px;
  top: calc(-20px - var(--i) * var(--spread));
  margin: 0;
  white-space: nowrap;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 320ms ease, transform 320ms ease;
  transition-delay: calc(var(--i) * 50ms);
}
.slab-tag::before {
  content: "";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  width: 46px;
  border-top: 1px dashed rgba(255, 255, 255, 0.35);
}
.slab-tag b { color: var(--accent); font-weight: 500; margin-right: 6px; }
.slab-tag span { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.stage.open .slab-tag { opacity: 1; transform: none; }
.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  margin: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 240ms ease;
}
.stage.open .stage-hint { opacity: 0; }
@keyframes pulse {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -46%) scale(1.08); }
}
.routes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.route {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.8);
  border-radius: 6px;
  padding: 16px 16px 20px;
  transition: transform 220ms ease, border-color 220ms ease;
}
.route::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--c);
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 320ms ease;
}
.route::after {
  content: "";
  position: absolute;
  inset: auto -40% -70% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c), transparent 70%);
  opacity: 0;
  transition: opacity 320ms ease;
}
.route span {
  display: block;
  font-family: "Geist Mono", ui-monospace, monospace;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-bottom: 26px;
}
.route strong { display: flex; justify-content: space-between; font-size: 20px; margin-bottom: 6px; letter-spacing: -0.02em; }
.route em { display: block; position: relative; z-index: 1; color: var(--muted); font-style: normal; font-size: 13px; line-height: 1.45; }
.arrow { display: inline-block; font-style: normal; transition: transform 220ms ease; }
.route .arrow { color: var(--c); }
.route:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.18); }
.route:hover::before { transform: scaleX(1); }
.route:hover::after { opacity: 0.14; }
.route:hover .arrow, .btn:hover .arrow { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .slabs, .glow, .ticker-track { animation: none; }
  .slabs, .slab-tag { transition: none; }
}
.intro h1 { margin: 0 0 10px; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.045em; }
.intro p { margin: 0 0 18px; max-width: 720px; color: var(--muted); line-height: 1.5; }
.how {
  margin: 28px 0 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.how .intro { margin-bottom: 4px; }
.how .intro h1 { font-size: 36px; }
.how .intro em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat, .panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.stat::after, .panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  --m: rgba(126, 182, 255, 0.7);
  background:
    linear-gradient(var(--m), var(--m)) top left / 10px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top left / 1px 10px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 1px 10px no-repeat;
}
.code {
  margin: 0 0 10px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.stat { padding: 16px 16px 14px; }
.stat span, .stat em { display: block; color: var(--muted); font-style: normal; }
.stat span { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.stat strong { display: block; margin: 10px 0 6px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.stat em { font-size: 12px; }

.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; margin-top: 14px; }
.panel { padding: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.lead { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.rows { margin: 0; }
.rows div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.rows div:first-child { border-top: 0; padding-top: 0; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; text-align: right; }
.form-panel { background: var(--panel-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: #0d0f14; margin-bottom: 16px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; padding: 8px; }
.seg button.on { background: #242a36; color: var(--text); }
.field-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #0d0f14;
  border-radius: 14px;
  padding: 12px 14px;
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 22px;
}
.unit { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; margin: 10px 0 14px; }
.chips button {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 0;
}
.chips button:hover { color: var(--text); }
.receive { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); }
.receive strong { color: var(--text); }
.status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.status.bad { color: var(--danger); }
.status.ok { color: var(--good); }
.balance-line { color: var(--muted); }
.steps { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.55; }
.steps li { margin: 0 0 10px; }
.steps strong { color: var(--text); }
.text-link { display: inline-block; margin-top: 12px; color: var(--accent); }
.empty-panel { display: flex; flex-direction: column; justify-content: center; }
.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; height: auto; padding: 12px; }
  .tabs { grid-column: 1 / -1; order: 3; justify-content: space-between; overflow-x: auto; }
  .stats, .split, .hero, .routes { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .stage { height: 380px; }
  .slabs { left: 36%; transform: scale(0.8); }
  .ticker { top: 0; position: relative; }
  .routes { grid-template-columns: 1fr 1fr; }
}
