:root {
  --bg: #060806;
  --bg-soft: #0b0e0b;
  --panel: #10140f;
  --line: #212a1f;
  --text: #f2f6ee;
  --text-dim: #8d968a;
  --accent: #c8fb1c;
  --accent-bright: #e2ff6e;
  --accent-ink: #06110a;
  --danger: #ff5c4d;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', ui-sans-serif, sans-serif;
  --rail-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }
.icon-x { width: 16px; height: 16px; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.boot.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.boot__overlay { position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 45%, rgba(6,8,6,0.55) 0%, rgba(6,8,6,0.85) 70%, var(--bg) 100%); }
.boot__box { position: relative; z-index: 2; width: min(560px, 86vw); }
.boot__lines { font-size: 13px; line-height: 2; color: #9fd15a; min-height: 180px; }
.boot__lines .line-dim { color: var(--text-dim); }
.boot__lines .line-accent { color: var(--accent); }
.boot__enter {
  position: absolute; z-index: 2; bottom: 48px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(200,251,28,0.08); border: 1px solid var(--accent); color: var(--accent);
  padding: 12px 22px; border-radius: 999px; font-size: 13px; letter-spacing: 0.5px; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  animation: enterPulse 2s ease-in-out infinite;
}
.boot__enter:hover { background: var(--accent); color: var(--accent-ink); transform: translateX(-50%) translateY(-2px); }
.boot__enter-arrow { animation: arrowBounce 1.4s ease-in-out infinite; }
@keyframes enterPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(200,251,28,0.35); } 50% { box-shadow: 0 0 0 8px rgba(200,251,28,0); } }
@keyframes arrowBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  padding: 14px 24px;
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn--buy { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 26px -10px rgba(200,251,28,0.5); }
.btn--dark { background: var(--panel); color: #fff; border-color: var(--line); }
.btn:hover { transform: translateY(-2px); }
.btn--full { width: 100%; }

/* ---------- shell / rail ---------- */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 22px;
  z-index: 40;
}
.rail__brand { display: inline-block; margin-bottom: 8px; }
.rail__mark { height: 20px; width: auto; }

.rail__nav { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.rail__link {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13.5px; color: var(--text-dim);
  padding: 10px 10px; border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.rail__idx { color: #454f42; font-size: 11px; }
.rail__link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.rail__link.is-active { color: var(--accent); background: rgba(200,251,28,0.08); }
.rail__link.is-active .rail__idx { color: var(--accent); }

.rail__foot { display: flex; flex-direction: column; gap: 12px; }
.rail__x { display: flex; align-items: center; gap: 8px; justify-content: center; font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); padding: 10px; border: 1px solid var(--line); border-radius: 10px; transition: color 0.15s ease, border-color 0.15s ease; }
.rail__x:hover { color: var(--text); border-color: var(--accent); }

@media (max-width: 860px) {
  .shell { display: block; }
  .rail {
    position: sticky; top: 0; width: 100%; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 14px 18px; gap: 14px;
  }
  .rail__nav { display: none; }
  .rail__foot { flex-direction: row; }
  .rail__x { display: none; }
}

/* ---------- feed / prompt ---------- */
.feed { flex: 1; min-width: 0; }

.prompt { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.prompt__user { color: var(--accent); }
.cmd { color: var(--text); }
.cursor { display: inline-block; color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.feed__hero { position: relative; min-height: 78vh; display: flex; align-items: flex-end; overflow: hidden; padding: 0 clamp(20px, 4vw, 64px) 56px; }
.feed__hero-media { position: absolute; inset: 0; z-index: 0; }
.feed__hero-img, .feed__hero-grain { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed__hero-grain { mix-blend-mode: screen; opacity: 0.32; }
.feed__hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6,8,6,0.1) 0%, rgba(6,8,6,0.3) 50%, var(--bg) 97%),
    linear-gradient(90deg, rgba(6,8,6,0.55) 0%, rgba(6,8,6,0.05) 42%);
}
.feed__hero-copy { position: relative; z-index: 2; max-width: 600px; }
.feed__hero-title { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 6px 0 16px; }
.feed__hero-title em { color: var(--accent); font-style: normal; }
.feed__hero-tagline { color: #d4d9d0; font-size: 15.5px; max-width: 520px; }

/* ---------- ticker ---------- */
.ticker { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; padding: 13px 0; }
.ticker__track { display: inline-flex; gap: 44px; animation: tickerScroll 32s linear infinite; font-family: var(--mono); font-size: 12.5px; }
.ticker__item { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); }
.ticker__item b { color: var(--text); font-weight: 600; }
.ticker__item .up { color: var(--accent); }
.ticker__item .down { color: var(--danger); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- blocks ---------- */
.block { padding: 84px clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.block.is-visible { opacity: 1; transform: translateY(0); }
.block__title { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 18px; max-width: 700px; }
.block__lede { color: var(--text-dim); font-size: 16px; max-width: 620px; margin-bottom: 36px; }

.block__list { display: flex; flex-direction: column; gap: 14px; max-width: 680px; margin-top: 32px; }
.block__list li { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; padding-left: 18px; position: relative; }
.block__list li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }
.block__list b { color: var(--text); }

.pool-diagram { width: 100%; max-width: 560px; height: auto; display: block; }
.pool-diagram__label { fill: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; }

/* ---------- protocol split ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 8px; }
.route-card, .log-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.route-card__head, .log-card__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 20px; }
.badge { background: rgba(200,251,28,0.12); color: var(--accent); padding: 4px 10px; border-radius: 6px; font-size: 10.5px; }
.route-card__pair { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.route-card__arrow { color: var(--text-dim); }
.route-card__path { font-size: 12.5px; color: var(--text-dim); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; }
.route-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.route-stat { text-align: center; }
.route-stat span { display: block; font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.route-stat b { font-family: var(--mono); font-size: 14px; }
.route-card__receive { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; color: var(--text-dim); }
.route-card__receive b { font-size: 17px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dot--live { animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 8px rgba(200,251,28,0.7); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.log-card__body { font-size: 12px; line-height: 2; color: #9fd15a; min-height: 200px; white-space: pre-wrap; }
.log-card__body .line-dim { color: var(--text-dim); }
.log-card__body .line-accent { color: var(--accent); }

/* ---------- timeline ---------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 8px; }
.timeline::before { content: ''; position: absolute; top: 13px; left: 6%; right: 6%; height: 1px; background: var(--line); }
.timeline__item { position: relative; padding-top: 34px; }
.timeline__num { position: absolute; top: 0; left: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); color: var(--accent); font-family: var(--mono); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.timeline__item h3 { font-size: 16px; margin-bottom: 8px; }
.timeline__item p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; gap: 28px; }
  .timeline::before { display: none; }
}

/* ---------- json view ---------- */
.jsonview { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; font-size: 13.5px; line-height: 2; max-width: 520px; }
.jsonview__row { color: var(--text-dim); }

/* ---------- docs prose ---------- */
.block__prose { display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.block__prose p { color: var(--text-dim); font-size: 15px; line-height: 1.7; }

/* ---------- howto ---------- */
.howto-list { display: flex; flex-direction: column; gap: 14px; max-width: 620px; margin-bottom: 36px; counter-reset: step; }
.howto-list li { list-style: none; color: var(--text-dim); font-size: 14.5px; line-height: 1.6; padding-left: 30px; position: relative; }
.howto-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); color: var(--accent); font-family: var(--mono); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.howto-list b { color: var(--text); }

/* ---------- footer ---------- */
.feed__end { padding: 90px clamp(20px, 4vw, 64px) 70px; text-align: center; background: radial-gradient(ellipse at 50% 0%, #131a0c 0%, var(--bg) 65%); }
.feed__end-title { font-size: clamp(28px, 4.2vw, 42px); font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.feed__end-title em { color: var(--accent); font-style: normal; }
.feed__end-quote { color: var(--text-dim); font-size: 13px; margin-bottom: 28px; }
.feed__end-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.legal { font-size: 11.5px; color: #5c645a; line-height: 1.7; max-width: 560px; margin: 0 auto; }
