/* BNB10 — design tokens (charcoal + BNB gold) */
:root,
[data-theme="dark"] {
  --bg: #0a0905;
  --bg-2: #12100a;
  --surface: rgba(255, 230, 160, 0.035);
  --surface-2: rgba(255, 230, 160, 0.07);
  --line: rgba(255, 220, 140, 0.1);
  --line-2: rgba(255, 220, 140, 0.2);
  --text: #f7f1e3;
  --muted: #a89e86;
  --faint: #6b6350;
  --accent: #f3ba2f;
  --accent-2: #ffd978;
  --accent-ink: #1a1304;
  --warm: #ff8a5c;
  --ok: #7be3b5;
  --glow-a: #c98a00;
  --glow-b: #ff6a00;
  --glow-c: #f3ba2f;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fbf7ec;
  --bg-2: #f1ead8;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-2: rgba(255, 255, 255, 0.9);
  --line: rgba(60, 45, 10, 0.1);
  --line-2: rgba(60, 45, 10, 0.2);
  --text: #1b1609;
  --muted: #6b6048;
  --faint: #9a8f78;
  --accent: #b7800a;
  --accent-2: #d99b1a;
  --accent-ink: #ffffff;
  --warm: #c2541f;
  --ok: #157a52;
  --glow-a: #ffd98a;
  --glow-b: #ffc3a0;
  --glow-c: #fff0b8;
  --shadow: 0 30px 70px -35px rgba(20, 24, 50, 0.35);
  color-scheme: light;
}

:root {
  --font-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2.1rem, 1.4rem + 3vw, 3.75rem);
  --text-hero: clamp(2.7rem, 1.2rem + 4.6vw, 5.2rem);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --max: 1200px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.38em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}

/* atmosphere */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.32;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) {
  background: var(--glow-a);
  top: -25vmax;
  left: -10vmax;
}
.aurora span:nth-child(2) {
  background: var(--glow-b);
  top: -15vmax;
  right: -25vmax;
  animation-delay: -9s;
  opacity: 0.24;
}
.aurora span:nth-child(3) {
  background: var(--glow-c);
  bottom: -40vmax;
  left: 20vmax;
  animation-delay: -16s;
  opacity: 0.14;
}
[data-theme="light"] .aurora span {
  opacity: 0.45;
}
@keyframes drift {
  to {
    transform: translate3d(6vmax, 5vmax, 0) scale(1.12);
  }
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem var(--pad);
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--line);
  max-width: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.mark {
  width: 32px;
  height: 32px;
  color: var(--text);
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.brand-word b {
  font-weight: 600;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.icon-btn:hover {
  border-color: var(--line-2);
  transform: rotate(-12deg);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* buttons */
.btn {
  --h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--h);
  padding: 0 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn-sm {
  --h: 38px;
  padding: 0 1rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-ghost {
  border-color: var(--line-2);
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}
.pill a {
  color: var(--text);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.2s infinite;
}
.pill.is-live .pulse {
  background: var(--ok);
  --accent: var(--ok);
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 1.4rem 0 1.4rem;
}
.display .ln {
  display: block;
  white-space: nowrap;
}
.grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 60%, var(--warm) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.55;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* wheel */
.wheel-wrap {
  margin: 0;
  position: relative;
}
.wheel {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: visible;
}
.wheel-orbit {
  fill: none;
  stroke: var(--line);
  stroke-dasharray: 2 6;
}
.wheel-seg {
  fill: none;
  stroke-width: 26;
  stroke: var(--surface-2);
  transition: stroke 0.6s var(--ease), stroke-width 0.6s var(--ease), filter 0.6s;
  cursor: pointer;
}
.wheel-seg.is-v3 {
  stroke: color-mix(in srgb, var(--warm) 16%, transparent);
}
.wheel-seg.is-v2 {
  stroke: color-mix(in srgb, var(--accent) 18%, transparent);
}
.wheel-seg.is-active {
  stroke: var(--accent);
  stroke-width: 34;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 70%, transparent));
}
.wheel-seg.is-v3.is-active {
  stroke: var(--warm);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--warm) 60%, transparent));
}
.wheel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--muted);
  letter-spacing: 0.04em;
  transition: fill 0.4s;
  pointer-events: none;
}
.wheel-label.is-active {
  fill: var(--text);
}
.wheel-core {
  fill: var(--bg-2);
  stroke: var(--line-2);
}
.wheel-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  fill: var(--faint);
}
.wheel-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  fill: var(--text);
}
.wheel-sub {
  font-family: var(--font-body);
  font-size: 12px;
  fill: var(--muted);
}
.wheel-cap {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--faint);
  margin-top: 0.75rem;
}

/* stats */
.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: clamp(1rem, 3vw, 2rem) 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.stats > div {
  padding: 1.35rem 1.4rem;
  border-left: 1px solid var(--line);
}
.stats > div:first-child {
  border-left: 0;
}
.stats dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 500;
}
.stats dd {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.1;
}
.stats dd small {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}
.stats span {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* live */
.live {
  max-width: var(--max);
  margin: 0 auto 1rem;
  padding: 0 var(--pad);
}
.live-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.live-note {
  font-size: var(--text-xs);
  color: var(--faint);
}
.live-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.live-card {
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.live-card span {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted);
}
.live-card strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
}

/* marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 1rem 0;
  margin: clamp(1.5rem, 4vw, 3rem) 0 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-xl);
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 3rem;
}
.marquee-track span::after {
  content: "";
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--accent);
  opacity: 0.6;
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--pad) 0;
}
.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.sub {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: var(--text-lg);
  max-width: 38rem;
}

/* steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.step {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.step:hover {
  border-color: var(--line-2);
  transform: translateY(-4px);
}
.step-n {
  position: absolute;
  top: 1.5rem;
  right: 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--faint);
}
.step-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.step-icon svg {
  width: 30px;
  height: 30px;
}
.step h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.step p {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* pipe */
.pipe {
  margin: 1rem 0 0;
  display: flex;
  align-items: stretch;
  padding: 1.25rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.pipe-node {
  flex: 1;
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pipe-node b {
  font-weight: 700;
}
.pipe-node span {
  font-size: var(--text-xs);
  color: var(--muted);
}
.pipe-end {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent-2) 18%, transparent));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.pipe-edge {
  flex: 0 0 auto;
  width: clamp(56px, 8vw, 110px);
  position: relative;
  display: grid;
  place-items: center;
}
.pipe-edge i {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--line-2) 50%, transparent 50%) 0 0 / 10px 2px repeat-x;
  animation: flow 0.9s linear infinite;
}
.pipe-edge span {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--bg-2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
@keyframes flow {
  to {
    background-position: 10px 0;
  }
}

/* basket */
.filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.chip {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover {
  color: var(--text);
}
.chip.is-on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.basket {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}
.asset {
  position: relative;
  padding: 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.3s, transform 0.4s var(--ease), opacity 0.3s;
  overflow: hidden;
}
.asset::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--tone) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.asset:hover::before,
.asset.is-active::before {
  opacity: 1;
}
.asset:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
}
.asset.is-active {
  border-color: color-mix(in srgb, var(--tone) 60%, transparent);
}
.asset.is-hidden {
  display: none;
}
.asset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.glyph {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
}
[data-theme="light"] .glyph {
  color: color-mix(in srgb, var(--tone) 50%, #11131c);
  background: color-mix(in srgb, var(--tone) 22%, transparent);
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.tag.auto {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.tag.manual,
.tag.v3 {
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 40%, transparent);
}
.tag.v2 {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.asset-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--faint);
}
.asset-meta b {
  color: var(--muted);
  font-weight: 500;
}
.asset-top-r {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.asset-rank {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--faint);
}
/* CJK symbols need a smaller display size in the wheel core */
.wheel-big.is-cjk {
  font-size: 26px;
}
.asset h3 {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1;
}
.asset .asset-name {
  position: relative;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 0.3rem;
}
.copy {
  position: relative;
  margin-top: auto;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.copy svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.callout {
  margin-top: 1rem;
  padding: 1.6rem 1.75rem;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--warm) 30%, transparent);
  background: color-mix(in srgb, var(--warm) 6%, transparent);
  display: grid;
  grid-template-columns: 0.9fr 2fr;
  gap: 1.5rem;
}
.callout h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}
.callout p {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* spec */
.spec-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: start;
}
.spec {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.spec-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--line);
}
.spec-row:first-child {
  border-top: 0;
}
.spec-row span {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-weight: 500;
  padding-top: 0.2rem;
}
.spec-row p {
  font-size: var(--text-sm);
}
.terminal {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #05060a;
  color: #d8dcea;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: 96px;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a2e3b;
}
.term-bar span {
  margin-left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6c7387;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal pre {
  margin: 0;
  padding: 1.2rem 1.25rem 1.4rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
}
.terminal code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.t-ok {
  color: #7be3b5;
}
.t-num {
  color: #9fb0ff;
}
.t-dim {
  color: #6c7387;
}

/* contracts */
.contracts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.contract {
  padding: 1.6rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contract-role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contract h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}
.contract p {
  color: var(--muted);
  font-size: var(--text-sm);
}
.contract .addr-row {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}
.contract .copy {
  flex: 1;
  min-width: 0;
}
.contract .copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scan {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.scan:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.scan svg {
  width: 14px;
  height: 14px;
}
.pending {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

/* risks */
.risks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.risk {
  padding: 1.6rem;
  background: var(--bg);
}
.risk h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.risk p {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* footer */
.footer {
  max-width: var(--max);
  margin: clamp(4rem, 10vw, 8rem) auto 0;
  padding: 2.5rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-top p {
  color: var(--muted);
  font-size: var(--text-sm);
}
.fine {
  margin-top: 1.5rem;
  font-size: var(--text-xs);
  color: var(--faint);
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  transition: all 0.35s var(--ease);
  z-index: 80;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* responsive */
@media (max-width: 1080px) {
  .basket {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats > div:nth-child(4) {
    border-left: 0;
  }
  .stats > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .wheel {
    max-width: 380px;
  }
  .nav-links {
    display: none;
  }
  .nav-actions {
    margin-left: auto;
  }
  .steps,
  .contracts,
  .risks {
    grid-template-columns: 1fr;
  }
  .spec-layout {
    grid-template-columns: 1fr;
  }
  .terminal {
    position: static;
  }
  .live-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .callout {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .pipe {
    flex-direction: column;
  }
  .pipe-edge {
    width: auto;
    height: 44px;
  }
  .pipe-edge i {
    left: 50%;
    right: auto;
    top: 4px;
    bottom: 4px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--line-2) 50%, transparent 50%) 0 0 / 2px 10px repeat-y;
    animation: flowy 0.9s linear infinite;
  }
}
@keyframes flowy {
  to {
    background-position: 0 10px;
  }
}
@media (max-width: 620px) {
  .basket {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats > div {
    padding: 1.1rem;
  }
  .stats > div:nth-child(odd) {
    border-left: 0;
  }
  .stats > div:nth-child(4) {
    border-left: 1px solid var(--line);
  }
  .stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .stats > div:last-child {
    grid-column: 1 / -1;
  }
  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  #navBuy {
    display: none;
  }
  .live-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}


/* emergency sweep */
.sweep {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}
.sweep-card {
  position: relative;
  padding: 1.8rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--warm) 10%, transparent), var(--surface));
  overflow: hidden;
}
.sweep-card::before {
  content: "";
  position: absolute;
  inset: -40% 50% auto -20%;
  height: 140%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--warm) 22%, transparent), transparent);
  pointer-events: none;
}
.sweep-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.sweep-card p {
  color: var(--muted);
  max-width: 54ch;
}
.sweep-list {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.sweep-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.8rem;
  align-items: start;
  font-size: var(--text-sm);
  color: var(--muted);
}
.sweep-list li b {
  color: var(--text);
  font-weight: 600;
}
.sweep-list i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warm) 18%, transparent);
  color: var(--warm);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12px;
}
.sweep-flow {
  display: grid;
  gap: 0.6rem;
}
.sweep-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-sm);
}
.sweep-node b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
}
.sweep-node code {
  white-space: nowrap;
}
.sweep-node.is-safe {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}
.sweep-arrow {
  justify-self: center;
  width: 2px;
  height: 22px;
  background: linear-gradient(var(--line-2), var(--warm));
  position: relative;
}
.sweep-arrow::after {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -2px;
  border: 5px solid transparent;
  border-top: 7px solid var(--warm);
}
@media (max-width: 900px) {
  .sweep {
    grid-template-columns: 1fr;
  }
}

/* contracts: second grid (infrastructure) + long address overflow */
.contracts + .contracts {
  margin-top: 1rem;
}
.contract {
  min-width: 0;
}
