@font-face { font-family: DM Sans; src: url('./assets/dm-sans.ttf') format('truetype'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: Space Grotesk; src: url('./assets/space-grotesk.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: dark;
  font-family: "DM Sans", system-ui, "Microsoft YaHei", sans-serif;
  color: #f3f7ff;
  background: #060b18;
  --ink: #f3f7ff;
  --muted: #b3bfd8;
  --line: #263652;
  --surface: #111a2c;
  --primary: #a6f2ff;
  --bright: #dcfbff;
  --cyan: #65ddff;
  --violet: #b691ff;
  --heading: "Space Grotesk", system-ui, "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }

.frame { width: min(100% - 96px, 1250px); margin-inline: auto; }
.topbar { border-bottom: 1px solid #a4caff23; background: #080f1f; }
.nav, .wallet, .navlinks, .wordmark, .hero-actions, .network-label, .flow-toolbar, .flow-heading { display: flex; align-items: center; }
.nav { height: 74px; justify-content: space-between; gap: 20px; }
.wordmark { gap: 10px; font: 700 23px/1 var(--heading); letter-spacing: -.045em; white-space: nowrap; }
.wordmark img { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #6486b85e; }
.navlinks { gap: 30px; color: var(--muted); font-size: 15px; font-weight: 620; }
.navlinks a:hover, .text-link:hover, footer a:hover { color: var(--bright); text-decoration: underline; text-underline-offset: 5px; }
.wallet { gap: 11px; }
.language { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; white-space: nowrap; }

button, .action {
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 44px;
  padding: 9px 16px;
  background: var(--primary);
  color: #071426;
  font-weight: 780;
  cursor: pointer;
  line-height: 1.2;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}

button:hover, .action:hover { background: var(--bright); box-shadow: 0 0 22px #69dbff30; }
button:disabled { opacity: .64; cursor: default; }
.language button { font-size: 13px; min-height: 31px; border-radius: 999px; padding: 3px 9px; background: transparent; color: var(--muted); }
.language button:hover { color: var(--ink); box-shadow: none; }
.language [aria-pressed=true] { background: #253751; color: var(--ink); }
#connect { border-radius: 999px; min-height: 42px; white-space: nowrap; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 76% 53%, #14253e 0, #080f1f 63%, #060b18 100%);
  border-bottom: 1px solid #34436581;
}

.hero-layout { min-height: clamp(565px, 49vw, 730px); display: grid; align-items: center; }
.hero-copy { position: relative; z-index: 2; width: min(54%, 630px); padding: 54px 0 69px; }
.eyebrow, .kicker { font-size: 13px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; color: #9eeaff; margin: 0 0 17px; }
h1, .display { font: 700 clamp(38px, 4.9vw, 66px)/1.02 var(--heading); letter-spacing: -.065em; margin: 0; }
h1 { font-size: clamp(62px, 6.2vw, 102px); }
h1 em { font-style: normal; color: var(--primary); background: linear-gradient(95deg, #d9f9ff 0%, #90dbff 39%, #c6adff 100%); background-clip: text; -webkit-text-fill-color: transparent; }
.lead { max-width: 43ch; color: #c3cfe4; font-size: clamp(16px, 1.38vw, 20px); line-height: 1.6; margin: 22px 0 26px; }
.hero-actions { gap: 18px; flex-wrap: wrap; }
.action { display: inline-grid; place-items: center; padding-inline: 20px; min-height: 48px; }
.text-link { font-weight: 720; color: #d0def6; font-size: 15px; }

.hero-art { position: absolute; z-index: -1; inset: 0 0 0 31%; perspective: 1700px; }
.hero-scene {
  position: absolute;
  inset: 50% 0 auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  transform: translateY(-50%) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .28s ease-out;
  mask-image: linear-gradient(90deg, transparent 0, #000 24%), linear-gradient(0deg, transparent 0, #000 13% 90%, transparent 100%);
  mask-composite: intersect;
}

.hero-scene img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.orbit-beams { position: absolute; inset: 0; pointer-events: none; --core-x: 65.75%; --core-y: 45.7%; }
.orbit-core, .orbit-pulse { position: absolute; border-radius: 50%; }
.orbit-core {
  left: var(--core-x);
  top: var(--core-y);
  width: min(13vw, 159px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, #cbf9ff85, #76aaff37 37%, transparent 100%);
  mix-blend-mode: screen;
  animation: orbit-core-glow 5.6s ease-in-out infinite;
  transform: translate(-50%, -50%);
}

.orbit-pulse {
  top: var(--core-y, 51%);
  width: clamp(18px, 3.5vw, 64px);
  height: 8px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, #ffffffee 0, var(--pulse) 34%, transparent 70%);
  filter: drop-shadow(0 0 7px var(--pulse));
  mix-blend-mode: screen;
  opacity: 0;
  animation: orbit-travel 5.6s ease-in-out infinite;
}

.orbit-pulse-match { --pulse: #51deff; --entry: 27%; left: var(--entry); }
.orbit-pulse-pool { --pulse: #bf8aff; --entry: 96%; left: var(--entry); animation-delay: .18s; }
.hero[data-route=direct] .orbit-pulse-pool, .hero[data-route=pool] .orbit-pulse-match { visibility: hidden; }
@keyframes orbit-travel {
  0%, 14% { left: var(--entry); opacity: 0; }
  23% { opacity: .93; }
  57% { left: var(--core-x); opacity: .86; }
  65%, 100% { left: var(--core-x); opacity: 0; }
}
@keyframes orbit-core-glow {
  0%, 44%, 100% { opacity: .16; }
  62% { opacity: .88; }
  77% { opacity: .39; }
}

.content { padding-top: 34px; }
.flow-demo { border: 1px solid var(--line); background: linear-gradient(142deg, #101a2e, #0a1224 78%); border-radius: 18px; padding: clamp(19px, 3.25vw, 39px); scroll-margin-top: 16px; }
.flow-heading { justify-content: space-between; gap: 16px; align-items: flex-start; }
.flow-heading .kicker { margin-bottom: 10px; }
.flow-heading .display { font-size: clamp(38px, 4.75vw, 62px); }
.flow-intro, .route-note { color: var(--muted); font-size: 15px; line-height: 1.55; }
.flow-intro { margin: 12px 0 11px; }
.route-note { margin: 13px 0 0; min-height: 1.55em; }
.motion-control { display: inline-flex; gap: 8px; align-items: center; justify-content: center; white-space: nowrap; font-size: 13px; min-height: 38px; margin-top: 2px; padding: 6px 11px; }
.motion-icon { display: block; width: 11px; height: 11px; border-inline: 3px solid currentColor; }
.motion-control[aria-pressed=true] .motion-icon { border: 0; clip-path: polygon(0 0,100% 50%,0 100%); background: currentColor; width: 9px; }

.flow-toolbar { gap: 7px; margin: 10px 0 14px; flex-wrap: wrap; }
.flow-toolbar button { font-size: 14px; min-height: 38px; background: #101c31; color: #c7d6ee; border-color: #334766; padding: 6px 12px; }
.flow-toolbar [aria-pressed=true] { background: #abedff; color: #081526; border-color: #b8f4ff; box-shadow: 0 0 18px #7bd8ff26; }
.route-field {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr 1fr;
  gap: 20px clamp(40px, 6.8vw, 100px);
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 220px;
  padding: 20px clamp(18px, 4vw, 60px);
  background: radial-gradient(ellipse at 48% 45%, #192947, #0a1123 75%);
  border: 1px solid #2b405f;
  border-radius: 12px;
}

.route-field::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(#9baaff57 .7px, transparent .7px); background-size: 12px 12px; pointer-events: none; }
#route-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.route-node { position: relative; padding: 11px 13px; border-radius: 9px; min-width: 0; min-height: 70px; background: #101c32ef; border: 1px solid #5876ab8c; box-shadow: 0 5px 16px #050a16a0; font-size: 14px; font-weight: 690; color: #dbe8ff; overflow-wrap: anywhere; transition: opacity .25s, border-color .25s; }
.route-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #69ddff; box-shadow: 0 0 10px #5cdeff; margin-right: 7px; }
.route-node strong { font: 700 28px/1.12 var(--heading); letter-spacing: -.045em; font-variant-numeric: tabular-nums; color: var(--ink); display: block; margin-top: 3px; }
.route-node small { font-weight: 540; color: #bdcde7; font-size: 12px; }
.input-node { grid-column: 1; grid-row: 1 / 3; }
.match-node { grid-column: 2; grid-row: 1; border-color: #58c0ed77; }
.pool-node { grid-column: 2; grid-row: 2; border-color: #aa85f780; }
.result-node { grid-column: 3; grid-row: 1 / 3; border-color: #81b9e7; background: #152640; }
.pool-node .route-dot { background: var(--violet); box-shadow: 0 0 10px #bb8bff; }
.result-node .route-dot { background: #f2faff; box-shadow: 0 0 11px #9dedff; }
.route-field[data-route=direct] .pool-node, .route-field[data-route=pool] .match-node { opacity: .58; border-style: dashed; }

.mechanism { padding: 57px 0 64px; scroll-margin-top: 18px; }
.section-intro .kicker, .market-copy .kicker { margin-bottom: 11px; }
.explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.explain article { background: #0d1628; border: 1px solid var(--line); border-radius: 13px; padding: 22px; min-width: 0; }
.symbol { display: inline-grid; place-items: center; width: 36px; height: 36px; background: #172841; border: 1px solid #315776; border-radius: 9px; color: #a0eaff; font-size: 22px; }
.explain h3, .panel h3 { font-size: 20px; margin: 14px 0 7px; letter-spacing: -.025em; }
.explain p, .small { font-size: 15px; line-height: 1.62; color: var(--muted); margin: 0; }

.market-workspace { scroll-margin-top: 22px; }
.market-intro { display: grid; grid-template-columns: 1.6fr 1fr; position: relative; background: #101a2c; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.market-copy { padding: clamp(22px, 4.7vw, 56px); }
.market-copy .small { margin: 15px 0 20px; }
.market-intro > img { object-fit: cover; object-position: center; width: 100%; height: 100%; min-height: 300px; max-height: 440px; }
.find label, .panel label, .network-label { font-size: 14px; color: #c6d2e9; font-weight: 640; }
.find label { display: block; margin-bottom: 8px; }
.search-input { display: flex; gap: 8px; }
.search-input input { min-width: 0; flex: 1; }
.search-input button { white-space: nowrap; }
.network-label { gap: 10px; margin-top: 12px; }
input, select { border: 1px solid #3c5272; border-radius: 8px; min-height: 44px; padding: 8px 10px; background: #080f21; color: var(--ink); }
input::placeholder { color: #9ba9c5; }
.network-label select { min-height: 38px; padding: 4px 8px; }
#status { min-height: 1.4em; font-size: 14px; color: var(--primary); margin: 10px 0 0; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-top: 13px; }
.panel { border: 1px solid var(--line); border-radius: 13px; padding: 20px; background: var(--surface); min-width: 0; }
.panel h3 { margin: 0 0 14px; }
.panel label { display: block; margin-bottom: 11px; }
.panel label > span { display: block; margin-bottom: 5px; }
.panel input, .panel select { width: 100%; }
.projects { display: grid; gap: 7px; }
.project, .secondary { color: #d6e9fd; background: #172640; border-color: #3b567a; }
.project { width: 100%; text-align: left; }
.project:hover, .secondary:hover { background: #263c58; color: var(--bright); }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.panel .check { display: flex; align-items: center; gap: 9px; }
.panel .check input { width: auto; min-height: 0; margin: 0; accent-color: var(--cyan); }
.panel .check span { margin: 0; }
#quotes p, #launch-confirm { margin: 8px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#my-orders button { margin: 5px 4px 8px 0; }
footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 24px 0 35px; margin-top: 55px; color: var(--muted); font-size: 14px; }

html[lang=zh-CN] h1 { font-size: clamp(49px, 6.65vw, 100px); line-height: 1.12; letter-spacing: -.05em; }
html[lang=zh-CN] .display { line-height: 1.14; letter-spacing: -.044em; }
html[data-motion=paused] .orbit-pulse, .hero-art[data-onscreen=false] .orbit-pulse { animation-play-state: paused; visibility: hidden; }
html[data-motion=paused] .orbit-core, .hero-art[data-onscreen=false] .orbit-core { animation-play-state: paused; }
html[data-motion=paused] .hero-scene { transform: translateY(-50%); }

@media (max-width: 980px) {
  .frame { width: calc(100% - 56px); }
  .hero-layout { min-height: 525px; }
  h1 { font-size: clamp(52px, 7.1vw, 83px); }
  .hero-art { left: 27%; }
}

@media (max-width: 710px) {
  .frame { width: calc(100% - 32px); }
  .nav { height: 66px; gap: 7px; }
  .navlinks { display: none; }
  .wordmark { font-size: 17px; gap: 5px; }
  .wordmark img { width: 28px; height: 28px; }
  .wallet { gap: 5px; }
  .language button { padding: 3px 6px; font-size: 11px; min-height: 26px; }
  #connect { font-size: 12px; min-height: 37px; padding: 6px 9px; }
  .hero-layout { min-height: 0; width: 100%; gap: 0; }
  .hero-copy { width: calc(100% - 32px); margin: auto; padding: 38px 0 0; }
  h1 { font-size: clamp(44px, 13.6vw, 83px); }
  .lead { margin: 16px 0 20px; }
  .hero-actions { gap: 13px 17px; }
  .hero-art { position: relative; inset: auto; min-height: min(83vw, 470px); margin-top: -5px; }
  .hero-scene { left: -28%; right: auto; width: 128%; mask-image: linear-gradient(0deg, transparent 0, #000 13% 83%, transparent 100%); transform: translateY(-50%); }
  .orbit-core { width: 26%; }
  .content { padding-top: 18px; }
  .flow-heading { flex-wrap: wrap; gap: 2px; }
  .flow-heading .motion-control { margin: 3px 0; }
  .route-field { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(3, auto); gap: 18px 11px; padding: 12px; }
  .route-node { padding: 8px 9px; min-height: 65px; font-size: 13px; }
  .route-node strong { font-size: 23px; }
  .input-node { grid-area: 1/1/2/3; }
  .match-node { grid-area: 2/1/3/2; }
  .pool-node { grid-area: 2/2/3/3; }
  .result-node { grid-area: 3/1/4/3; }
  .mechanism { padding: 42px 0; }
  .market-intro, .split, .explain { grid-template-columns: 1fr; }
  .explain { margin-top: 19px; gap: 8px; }
  .explain article { padding: 17px; }
  .market-intro > img { min-height: 156px; height: 156px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields label:last-child { grid-column: 1 / -1; }
  .panel { padding: 15px; }
  footer { margin-top: 36px; }
}

@media (max-width: 370px) {
  .wordmark { font-size: 15px; }
  .wordmark img { width: 22px; height: 22px; }
  .wallet { gap: 3px; }
  #connect { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-pulse, .orbit-core { animation: none; }
  .hero-scene { transform: translateY(-50%); }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
