:root {
  --bg: #000000;
  --bg-alt: #050308;
  --surface: #0c0914;
  --surface-2: #17102b;
  --line: #29252f;
  --text: #f1f0f6;
  --muted: #9c9aa8;
  --violet: #9945ff;
  --mint: #14f195;
  --danger: #ff6b8b;
  --radius: 6px;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; max-width: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
  min-width: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 460px at 85% -5%, rgba(153, 69, 255, 0.24), transparent 62%),
    radial-gradient(600px 380px at 0% 10%, rgba(20, 241, 149, 0.07), transparent 60%);
  pointer-events: none;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
dl, dd { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 32px)); }
.mono { font-family: var(--font-mono); font-size: 0.875em; }
.small { font-size: 0.875rem; color: var(--muted); }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; background: #000; border-radius: 6px; border: 1px solid var(--line); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-uk { color: var(--mint); }

.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.pill-net .dot, .dot-live { background: var(--mint); box-shadow: 0 0 0 4px rgba(20, 241, 149, 0.15); }

.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }

h1 { font-size: clamp(2.1rem, 5.2vw, 4.1rem); font-weight: 700; max-width: 14ch; overflow-wrap: anywhere; }
.lede { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.trust { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 44px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.trust dt { font-size: 0.8rem; color: var(--muted); }
.trust dd { font-weight: 600; margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  font: 600 0.98rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  color: #000;
  background: linear-gradient(120deg, var(--mint), var(--mint));
  box-shadow: 0 8px 28px rgba(153, 69, 255, 0.28);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(20, 241, 149, 0.22); }
.btn-ghost { color: var(--text); border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.validator {
  background: linear-gradient(160deg, var(--surface-2), #000 62%);
  border: 1px solid #33294f;
  border-radius: 8px;
  padding: 28px;
  min-width: 0;
  box-shadow: 0 30px 80px rgba(153, 69, 255, 0.12);
}

.validator-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center;
  font: 700 1.3rem var(--font-display); color: #0d0b1f;
  background: linear-gradient(135deg, var(--violet), var(--mint));
}
.validator h2 { font-size: 1.25rem; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.875rem; margin-top: 4px; }

.pool { margin: 26px 0; padding: 20px 0; border-block: 1px solid var(--line); }
.pool-label { color: var(--muted); font-size: 0.9rem; }
.pool-value {
  margin-top: 6px;
  font: 700 clamp(2.2rem, 4.6vw, 3.1rem) var(--font-display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pool-unit { font-size: 1rem; color: var(--mint); font-weight: 600; letter-spacing: 0; }

.validator-body { display: flex; align-items: center; gap: 24px; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--line); }
.ring-progress { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-epoch { font: 700 1.2rem var(--font-display); font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 0.75rem; color: var(--muted); }

.facts { display: grid; gap: 12px; flex: 1; min-width: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: right; }

.copy {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 3px; padding: 2px 8px; font: 500 0.75rem var(--font-body); cursor: pointer;
}
.copy:hover { color: var(--text); border-color: var(--muted); }

.section { padding: 88px 0; }
.section-alt { background: #000; border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; max-width: 62ch; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.section-head p { margin-top: 14px; color: var(--muted); }

.stake-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: start; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-width: 0; }

.field { margin-bottom: 26px; }
label, .file-link { font-weight: 600; font-size: 0.95rem; }
.field > label { display: block; margin-bottom: 10px; }

.input-row {
  display: flex; align-items: center;
  background: #000; border: 1px solid var(--line); border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-row:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(153, 69, 255, 0.18); }
.input-row input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font: 500 1rem var(--font-mono); padding: 14px 16px;
}
.input-row input::placeholder { color: #5f5b92; font-family: var(--font-body); }
.icon-btn, .suffix { padding: 0 16px; color: var(--muted); font: 600 0.85rem var(--font-body); }
.icon-btn { background: transparent; border: 0; cursor: pointer; align-self: stretch; display: inline-flex; align-items: center; }
.icon-btn:hover { color: var(--text); }

.field-foot { margin-top: 10px; }
.file-link { color: var(--mint); cursor: pointer; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; }

.info {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 12px 14px; border-radius: 4px; font-size: 0.9rem; font-weight: 500;
  background: rgba(20, 241, 149, 0.07); border: 1px solid rgba(20, 241, 149, 0.28); color: #b9ffe3;
}
.info svg { width: 20px; height: 20px; flex: none; color: var(--mint); }

.hint { margin-top: 8px; color: var(--muted); font-size: 0.85rem; }
.hint.error { color: var(--danger); }

.form-error {
  margin-top: 16px; padding: 12px 14px; border-radius: 4px; font-size: 0.92rem;
  background: rgba(255, 107, 139, 0.1); border: 1px solid rgba(255, 107, 139, 0.4); color: #ffd0da;
}

.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.3); border-top-color: #000; animation: spin 0.7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary h3 { font-size: 1.1rem; margin-bottom: 18px; }
.summary-list { display: grid; gap: 14px; }
.summary-list div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.95rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.summary-list .total { padding-top: 14px; border-top: 1px solid var(--line); }
.summary .small { margin-top: 20px; }

.result { margin-top: 24px; border-color: rgba(20, 241, 149, 0.4); }
.result-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.result-head h3 { font-size: 1.25rem; }
.badge {
  padding: 4px 10px; border-radius: 3px; font-size: 0.8rem; font-weight: 600;
  color: #0d0b1f; background: var(--mint);
}
.badge.inactive { background: var(--muted); }
.result-list { display: grid; gap: 14px; }
.result-list div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; }
.result-list dt { color: var(--muted); font-size: 0.9rem; }
.result-list dd { min-width: 0; overflow-wrap: anywhere; }
.result-list a { color: var(--mint); text-underline-offset: 3px; }
.result .small { margin-top: 20px; }

.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { position: relative; padding-top: 28px; border-top: 2px solid var(--line); counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; top: -15px; left: 0;
  width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center;
  background: #000; border: 2px solid var(--violet); font: 600 0.8rem var(--font-display);
}
.steps h3 { font-size: 1.02rem; margin-bottom: 10px; }
.steps p { color: var(--muted); font-size: 0.92rem; }

details { border-bottom: 1px solid var(--line); padding: 20px 0; }
summary { cursor: pointer; font: 600 1.05rem var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--mint); font-size: 1.4rem; line-height: 1; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 12px; color: var(--muted); max-width: 62ch; }

.footer { background: #000; border-top: 1px solid var(--line); padding: 36px 0 48px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer .small { margin-top: 6px; max-width: 52ch; }

@media (max-width: 980px) {
  .hero-grid, .stake-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 48px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps li { padding: 0 0 0 44px; border-top: 0; border-left: 2px solid var(--line); }
  .steps li::before { top: 0; left: -15px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; gap: 12px; }
  .hero-actions .btn { width: 100%; }
  .trust { gap: 14px 24px; }
  .validator { padding: 22px; }
  .validator-body { flex-direction: column; align-items: stretch; }
  .ring { align-self: center; }
  .card { padding: 22px; }
  .result-list div { grid-template-columns: 1fr; gap: 2px; }
  .section { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
