:root {
  color-scheme: dark;
  --bg: #030606;
  --bg-2: #050a0a;
  --card: rgba(5, 18, 18, 0.72);
  --card-strong: rgba(8, 28, 27, 0.9);
  --border: rgba(120, 255, 210, 0.22);
  --border-hot: rgba(25, 230, 255, 0.5);
  --text: #f0fff9;
  --muted: #9fbcb5;
  --cyan: #19e6ff;
  --lime: #b7ff2a;
  --green: #55ff8a;
  --danger: #ff5175;
  --amber: #ffd36b;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(25, 230, 255, 0.12), transparent 31rem),
    radial-gradient(circle at 86% 14%, rgba(183, 255, 42, 0.1), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 52%, #020404 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(120, 255, 210, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 255, 210, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

#mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.hero-section,
.section,
.site-footer {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  backdrop-filter: blur(18px);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.site-header.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 16px));
}

.brand,
.header-actions,
.main-nav {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-hot);
  object-fit: cover;
  box-shadow: 0 0 28px rgba(25, 230, 255, 0.26);
}

.main-nav {
  justify-self: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  background: rgba(3, 6, 6, 0.76);
}

.main-nav a,
.button,
.connect-button,
.lang-toggle,
.wallet-card button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.main-nav a:hover,
.button.secondary:hover,
.wallet-card button:hover,
.lang-toggle:hover {
  color: var(--cyan);
  border-color: var(--border-hot);
  background: rgba(25, 230, 255, 0.08);
}

.header-actions {
  justify-self: end;
  gap: 8px;
}

.social-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  color: var(--green);
  background: rgba(5, 18, 18, 0.7);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.social-link:hover {
  color: #02100c;
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.lang-toggle,
.wallet-card button {
  color: var(--text);
  border-color: var(--border);
  background: rgba(5, 18, 18, 0.75);
}

.lang-toggle {
  width: 50px;
  padding: 0;
  color: var(--cyan);
}

.connect-button,
.button.primary {
  color: #02100c;
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 36px rgba(25, 230, 255, 0.22);
}

.button.secondary {
  border-color: var(--border);
  background: rgba(5, 18, 18, 0.72);
}

.button.full {
  width: 100%;
  margin-top: 12px;
}

.hero-section {
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 54px;
  align-items: center;
  padding: 48px 0 36px;
}

.label {
  margin: 0 0 14px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  max-width: 900px;
  margin-bottom: 20px;
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 6.5vw, 6.3rem);
}

h2 {
  font-size: clamp(2.25rem, 4vw, 4.45rem);
}

h3 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.hero-lead,
.section-title p,
.copy-terminal p,
.feature-grid p,
.action-copy,
.paper-preview-grid,
.paper p,
.paper li {
  color: var(--muted);
  line-height: 1.82;
}

.hero-lead {
  max-width: 820px;
  font-size: 1.08rem;
}

.slogan {
  color: var(--green);
  font-size: 1.25rem;
  font-weight: 900;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.mother-resolver {
  max-width: 780px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  background: rgba(5, 18, 18, 0.58);
}

.mother-resolver label {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 900;
}

.mother-resolver > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.mother-resolver input {
  margin: 0;
}

.mother-resolver button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border-hot);
  color: #02100c;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font: 900 0.9rem var(--sans);
  cursor: pointer;
}

.mother-resolver p {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.mother-resolver p[data-state="ok"] {
  color: var(--green);
}

.mother-resolver p[data-state="error"] {
  color: var(--danger);
}

.protocol-flow,
.dashboard-shell,
.wallet-card,
.data-panel,
.metric-card,
.feature-grid article,
.copy-terminal,
.tech-flow,
.curve-chart,
.curve-side,
.curve-table,
.paper-preview-grid a,
.paper-card,
.toc,
.paper-section {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(5, 18, 18, 0.86), rgba(2, 8, 8, 0.78)),
    radial-gradient(circle at 20% 0%, rgba(25, 230, 255, 0.08), transparent 22rem);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.22);
}

.protocol-flow {
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.flow-grid {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: space-between;
}

.flow-grid span {
  width: max-content;
  max-width: 80%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(2, 8, 8, 0.82);
  font-family: var(--mono);
  font-weight: 900;
}

.flow-grid span:nth-of-type(even) {
  justify-self: end;
}

.flow-grid i {
  width: 1px;
  min-height: 22px;
  margin-left: 26px;
  background: linear-gradient(var(--cyan), transparent);
}

.flow-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.flow-core::before {
  content: "";
  position: absolute;
  inset: 50%;
  width: 285px;
  height: 285px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(25, 230, 255, 0.25);
  box-shadow: inset 0 0 50px rgba(25, 230, 255, 0.08), 0 0 90px rgba(25, 230, 255, 0.14);
  rotate: 45deg;
}

.flow-core img {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border: 1px solid var(--border-hot);
  object-fit: cover;
}

.flow-core strong,
.flow-core small {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--mono);
}

.flow-core strong {
  color: var(--cyan);
}

pre {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 18px;
  border-top: 1px solid var(--border);
  color: var(--green);
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.parameter-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  width: 100%;
  border-block: 1px solid var(--border);
  background: rgba(120, 255, 210, 0.12);
  overflow-x: auto;
}

.parameter-strip article {
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  background: rgba(3, 6, 6, 0.86);
}

.parameter-strip span,
small,
.data-list dt {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.parameter-strip strong,
.metric-card strong,
.data-list dd,
.mint-box strong {
  font-family: var(--mono);
  font-weight: 950;
}

.parameter-strip strong {
  display: block;
  margin-top: 10px;
  color: var(--cyan);
}

.section {
  padding: 104px 0;
}

.section-title {
  max-width: 880px;
  margin-bottom: 34px;
}

.mechanism-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 16px;
}

.copy-terminal {
  padding: 28px;
}

.copy-terminal p {
  margin-bottom: 18px;
}

.tech-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 28px;
}

.tech-flow span {
  min-height: 86px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid rgba(25, 230, 255, 0.22);
  color: var(--text);
  background: rgba(3, 6, 6, 0.58);
  font-family: var(--mono);
  font-weight: 900;
  text-align: center;
}

.tech-flow span:last-child {
  grid-column: 1 / -1;
  color: var(--lime);
}

.curve-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
}

.curve-chart {
  min-width: 0;
  padding: 22px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-family: var(--mono);
}

.chart-head b {
  color: var(--lime);
}

.chart-head strong {
  color: #ff4f80;
}

.chart-scroll {
  overflow-x: auto;
}

.chart-scroll svg {
  min-width: 760px;
  width: 100%;
  height: auto;
}

.chart-axis,
.chart-grid {
  fill: none;
  stroke: rgba(120, 255, 210, 0.22);
}

.chart-grid {
  stroke-width: 0.8;
}

.supply-fill {
  fill: url(#curveFill);
}

.supply-line {
  fill: none;
  stroke: #5fffea;
  stroke-width: 4;
}

.price-line {
  fill: none;
  stroke: #ffd400;
  stroke-width: 4;
}

.curve-node circle {
  fill: #030606;
  stroke: var(--lime);
  stroke-width: 4;
}

.curve-node.hot circle {
  stroke: var(--cyan);
}

.curve-node text,
.chart-scroll text {
  fill: #dffff8;
  font-family: var(--mono);
  font-size: 17px;
}

.curve-side {
  padding: 20px;
}

.mint-box {
  padding: 18px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: rgba(2, 8, 8, 0.55);
}

.mint-box strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 1.35rem;
}

.curve-stats,
.data-list {
  margin: 0;
}

.curve-stats div,
.data-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(120, 255, 210, 0.14);
}

.curve-stats dd,
.data-list dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.curve-table {
  margin-top: 16px;
  padding: 18px;
}

.curve-table summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 900;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-family: var(--mono);
}

th,
td {
  padding: 14px;
  border: 1px solid rgba(120, 255, 210, 0.16);
  text-align: left;
}

th {
  color: var(--lime);
}

.feature-grid,
.dashboard-main,
.dashboard-columns,
.wallet-grid,
.paper-preview-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid article {
  min-height: 260px;
  padding: 24px;
}

.feature-grid span {
  display: inline-block;
  margin-bottom: 44px;
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 950;
}

.dashboard-title {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: end;
}

.sync-state {
  justify-self: end;
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(3, 6, 6, 0.78);
  font-family: var(--mono);
}

.sync-state span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 211, 107, 0.6);
}

.sync-state.is-live span {
  background: var(--green);
}

.sync-state.is-error span {
  background: var(--danger);
}

.dashboard-main {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.metric-card {
  min-height: 160px;
  padding: 20px;
}

.metric-card strong {
  display: block;
  margin: 18px 0 10px;
  color: var(--cyan);
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.metric-card.accent strong {
  color: var(--lime);
}

.dashboard-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
}

.data-panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--cyan);
  font-family: var(--mono);
}

.panel-head b {
  color: var(--text);
  text-align: right;
}

.panel-head.small {
  margin-top: 18px;
}

.dashboard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 16px;
}

.dashboard-links a,
.paper-preview-grid a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  color: var(--cyan);
  background: rgba(2, 8, 8, 0.64);
  font-weight: 900;
}

.wallet-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
}

.wallet-card {
  padding: 22px;
}

.action-copy {
  min-height: 56px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(120, 255, 210, 0.2);
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  padding: 0 13px;
  font: 900 1rem var(--mono);
}

input:focus {
  outline: 1px solid var(--cyan);
}

.trade-estimate,
.form-status {
  min-height: 42px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(120, 255, 210, 0.16);
  color: var(--green);
  background: rgba(85, 255, 138, 0.06);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.form-status[data-state="error"] {
  color: var(--danger);
  border-color: rgba(255, 81, 117, 0.35);
  background: rgba(255, 81, 117, 0.08);
}

.form-status[data-state="ok"] {
  color: var(--green);
}

hr {
  border: 0;
  border-top: 1px solid rgba(120, 255, 210, 0.16);
  margin: 20px 0;
}

.whitepaper-preview {
  padding-bottom: 132px;
}

.paper-preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.paper-preview-grid a {
  min-height: 92px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.footer-links a:hover {
  color: var(--cyan);
}

.mobile-cta {
  display: none;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 96px;
}

.paper-hero {
  padding: 90px 0 54px;
}

.paper-hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
}

.paper-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.toc a {
  display: block;
  padding: 10px 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(120, 255, 210, 0.12);
}

.toc a:hover {
  color: var(--cyan);
}

.paper-section {
  padding: 28px;
  margin-bottom: 16px;
}

.paper-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.paper-section ul,
.paper-section ol {
  padding-left: 22px;
}

.paper-section code {
  font-family: var(--mono);
  color: var(--lime);
}

@media (max-width: 1060px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
  }

  .hero-section,
  .mechanism-grid,
  .curve-console,
  .paper-layout {
    grid-template-columns: 1fr;
  }

  .protocol-flow {
    min-height: 470px;
  }

  .feature-grid,
  .dashboard-main,
  .dashboard-columns,
  .wallet-grid,
  .paper-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header,
  .hero-section,
  .section,
  .site-footer,
  .page-shell {
    width: min(100% - 24px, 1220px);
  }

  .site-header {
    gap: 12px;
  }

  .brand span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 6px;
    max-width: 210px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .social-link {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .connect-button {
    padding: 0 10px;
  }

  .hero-section {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(2.55rem, 15vw, 4.1rem);
  }

  h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mother-resolver > div {
    grid-template-columns: 1fr;
  }

  .parameter-strip {
    grid-template-columns: repeat(6, 220px);
  }

  .feature-grid,
  .dashboard-main,
  .dashboard-columns,
  .wallet-grid,
  .paper-preview-grid,
  .dashboard-title,
  .tech-flow,
  .action-row {
    grid-template-columns: 1fr;
  }

  .sync-state {
    justify-self: stretch;
  }

  .curve-stats div,
  .data-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .curve-stats dd,
  .data-list dd {
    text-align: left;
  }

  .protocol-flow {
    min-height: 520px;
  }

  .flow-grid span {
    max-width: 92%;
  }

  .toc {
    position: static;
  }

  .mobile-cta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-cta a {
    min-height: 48px;
    display: grid;
    place-items: center;
    color: #02100c;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    font-weight: 950;
  }

  .site-footer {
    padding-bottom: 84px;
  }
}
