:root {
  --bg: #0a0c10;
  --bg-raised: #12151b;
  --bg-raised-2: #171b22;
  --border: rgba(244, 246, 245, 0.09);
  --border-strong: rgba(244, 246, 245, 0.16);
  --text: #f2f4f3;
  --text-dim: #96a3b8;
  --text-dimmer: #78869b;
  --accent: #2775ca;
  --accent-bright: #4d94e8;
  --accent-soft: rgba(39, 117, 202, 0.14);
  --accent-soft-strong: rgba(39, 117, 202, 0.28);
  --amber: #e8a33d;
  --font-display: "Familjen Grotesk", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
  --measure: 70ch;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 1;
}

::selection {
  background: var(--accent-soft-strong);
  color: var(--text);
}

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-color: var(--border-strong) var(--bg); scrollbar-width: thin; }

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

img, svg { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.font-numeric, .cite-date, .rail-field-value, .brand-word, .tk, .origin-kicker-mono, .rail-card-label, .rail-field-label, .translated-tag {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

h1, h2 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.02em; }

/* ---------- layout shells ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  margin-right: auto;
}
.brand-mark { color: var(--accent); flex-shrink: 0; }
.brand-word {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.nav-links a { transition: color 0.15s var(--ease-out-expo); }
.nav-links a:hover { color: var(--text); }

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 0.55rem 0;
}
.ticker-track {
  display: inline-flex;
  animation: ticker-scroll 42s linear infinite;
}
.ticker-set { display: inline-flex; align-items: center; }
.tk {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 0 1rem;
}
.tk b { color: var(--text); font-weight: 600; }
.tk em { color: var(--accent-bright); font-style: normal; }
.tk-sep { color: var(--text-dimmer); }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 1.5rem;
}

.hero-rails {
  position: absolute;
  inset: 0;
  opacity: 0.9;
}
.hero-rails svg { width: 100%; height: 100%; }

.rail-lines .rail {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 6 14;
  opacity: 0.55;
  animation: rail-flow 3.6s linear infinite;
}
.rail-lines .rail:nth-child(2n) { animation-duration: 4.4s; opacity: 0.4; }
.rail-lines .rail:nth-child(3n) { animation-duration: 5.1s; opacity: 0.32; }

@keyframes rail-flow {
  to { stroke-dashoffset: -80; }
}

.rail-nodes circle {
  fill: var(--accent-bright);
  opacity: 0.7;
  animation: node-pulse 2.6s var(--ease-out-expo) infinite;
}
.rail-nodes circle:nth-child(2n) { animation-delay: 0.5s; }
.rail-nodes circle:nth-child(3n) { animation-delay: 1s; }
.rail-nodes circle:nth-child(4n) { animation-delay: 1.5s; }

@keyframes node-pulse {
  0%, 100% { opacity: 0.35; r: 3.5; }
  50% { opacity: 0.95; r: 5; }
}

.rail-core-glow {
  fill: var(--accent);
  opacity: 0.16;
  filter: blur(18px);
  animation: core-breathe 3.2s ease-in-out infinite;
}
.rail-core { fill: var(--accent-bright); }

.rail-labels text {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  fill: var(--text-dimmer);
  opacity: 0.75;
}

@keyframes core-breathe {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.24; }
}

@media (prefers-reduced-motion: reduce) {
  .rail-lines .rail, .rail-nodes circle, .rail-core-glow { animation: none; opacity: 0.4; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.04;
  margin-bottom: 1.4rem;
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 0 2.2rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-address-chip {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.4rem;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s var(--ease-out-expo);
}
.hero-address-chip:hover { border-color: var(--border-strong); }
.hero-address-chip .placeholder-value {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: background 0.18s var(--ease-out-expo), border-color 0.18s var(--ease-out-expo), transform 0.18s var(--ease-out-expo);
}
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.86rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 24px -12px rgba(39,117,202,0.6);
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-1px); }
.btn-primary[aria-disabled="true"] {
  background: var(--bg-raised-2);
  color: var(--text-dimmer);
  box-shadow: none;
  cursor: not-allowed;
  border: 1px solid var(--border);
}
.btn-primary[aria-disabled="true"]:hover { transform: none; background: var(--bg-raised-2); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

/* ---------- rail panel (trade) ---------- */

.rail-panel {
  padding: 4rem 1.5rem 5rem;
  display: flex;
  justify-content: center;
}

.rail-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
}

.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  background: var(--accent-soft);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.rail-card-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dimmer);
}

.rail-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.rail-field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border);
}
.rail-field:last-child { border-bottom: none; padding-bottom: 0; }

.rail-field-label { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--text-dimmer); }

.rail-field-value {
  font-size: 0.88rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

.placeholder-value {
  color: var(--text-dim);
  font-style: normal;
  border: 1px dashed var(--border-strong);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.copy-btn {
  color: var(--text-dimmer);
  cursor: not-allowed;
  display: inline-flex;
}

.dot-pending {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
  margin-right: 0.3rem;
  animation: node-pulse 2.6s var(--ease-out-expo) infinite;
}

.rail-card-actions { padding: 0 1.25rem 1.25rem; }

.rail-card-note {
  margin: 0;
  padding: 0.85rem 1.25rem 1.15rem;
  font-size: 0.78rem;
  color: var(--text-dimmer);
  border-top: 1px solid var(--border);
}

/* ---------- origin pull-quote ---------- */

.origin { padding: 2rem 1.5rem 5rem; }

.origin-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.origin-kicker-mono {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-dimmer);
  margin-bottom: 1.1rem;
}

.origin-quote {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.42;
  font-weight: 500;
  color: var(--text);
}
.origin-quote strong { color: var(--accent-bright); font-weight: 700; }

.origin-source {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s var(--ease-out-expo);
}
.origin-source:hover { border-color: var(--accent); }
.origin-source:hover .view-source { color: var(--accent-bright); }

.avatar-mono {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  flex-shrink: 0;
}

.origin-name { display: block; font-size: 0.86rem; font-weight: 600; text-align: left; }
.origin-handle { display: block; font-size: 0.74rem; color: var(--text-dimmer); font-family: var(--font-mono); text-align: left; }

.view-source { font-size: 0.76rem; color: var(--text-dimmer); margin-left: 0.4rem; transition: color 0.15s; }

/* ---------- proof sections ---------- */

.proof, .chorus { padding: 5rem 0; border-top: 1px solid var(--border); }

.proof-head {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 2.4rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.proof-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin-bottom: 0.6rem;
}

.proof-sub {
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0;
  line-height: 1.55;
}

.rail-thread {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.rail-thread::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--border-strong);
}

.carousel {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem 1.5rem 1rem;
  max-width: 1180px;
  margin: 0 auto;
  scroll-padding-left: 1.5rem;
  cursor: grab;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.carousel.is-dragging .cite-card { pointer-events: none; }

.cite-card {
  scroll-snap-align: start;
  flex: 0 0 320px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem 1.3rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.18s var(--ease-out-expo), transform 0.18s var(--ease-out-expo);
}
.cite-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.cite-card-latest { border-color: var(--accent-soft-strong); background: var(--accent-soft); }

.cite-date {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
}

.cite-quote {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text);
  flex: 1;
}

.cite-link {
  font-size: 0.78rem;
  color: var(--text-dimmer);
  align-self: flex-start;
  text-underline-offset: 3px;
}
.cite-link:hover { color: var(--accent-bright); text-decoration: underline; }

.translated-tag {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ---------- chorus grid ---------- */

.chorus-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 1.1rem;
}

.grid-card { flex: none; }
.size-lg { grid-column: span 2; }
.size-sm { grid-column: span 1; }

.cite-attrib {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
}

@media (max-width: 980px) {
  .chorus-grid { grid-template-columns: repeat(2, 1fr); }
  .size-lg { grid-column: span 2; }
}

@media (max-width: 620px) {
  .chorus-grid { grid-template-columns: 1fr; }
  .size-lg, .size-sm { grid-column: span 1; }
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-bottom: 2.4rem;
}

.footer-brand { max-width: 320px; }
.footer-brand .brand-word { font-size: 1.2rem; }
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; margin: 0.6rem 0 0; }

.footer-links { display: flex; flex-direction: column; gap: 0.65rem; font-size: 0.88rem; }
.footer-heading { font-size: 0.68rem; letter-spacing: 0.1em; color: var(--text-dimmer); margin-bottom: 0.2rem; }
.footer-links a { color: var(--text-dim); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
a[aria-disabled="true"] { color: var(--text-dimmer); cursor: not-allowed; }
a[aria-disabled="true"]:hover { color: var(--text-dimmer); }

.disclaimer {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-dimmer);
  max-width: 80ch;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero { min-height: 80vh; padding: 3rem 1.25rem; }
  .rail-field { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .rail-field-value { text-align: left; }
  .proof-head { flex-direction: column; align-items: flex-start; }
  .cite-card { flex-basis: 82vw; }
}
