/* ==========================================================================
   routr/ — design tokens
   ========================================================================== */
:root {
  --bg: #07090a;
  --surface: #0d1110;
  --surface-2: #121815;
  --surface-3: #18201c;
  --border: #1d2722;
  --border-strong: #2b3731;
  --text: #e8efe9;
  --text-soft: #b5c1b8;
  --muted: #7d8a82;
  --accent: #b3d98a;
  --accent-hover: #c8e6a6;
  --accent-ink: #07090a;
  --accent-soft: rgba(179, 217, 138, 0.12);
  --warn: #e0bd8a;
  --holders: #7fa368;
  --danger: #e08a7a;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --container: 1180px;
  --gutter: 20px;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::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-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl { margin: 0; }
dd { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; text-decoration: none; }

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}
.container.narrow { width: min(100% - var(--gutter) * 2, 820px); }

.section { padding: 112px 0; }
.section-alt {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-block: 1px solid var(--border);
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.muted-small { color: var(--muted); font-size: 0.875rem; }
.accent-text { color: var(--accent); }

.section-head {
  max-width: 680px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  margin-bottom: 16px;
}
.lead {
  color: var(--text-soft);
  font-size: 1.0625rem;
  max-width: 60ch;
}

.fine {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 18px;
}

/* ==========================================================================
   Buttons, badges, pills
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.875rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(179, 217, 138, 0.3);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}
.badge-pending { color: var(--muted); border-color: var(--border-strong); }
.badge-external { color: var(--accent); }
.badge-external:hover { text-decoration: none; background: var(--accent-soft); }
.badge-example { color: var(--warn); border-color: rgba(224, 189, 138, 0.4); }

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 10, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.wordmark {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.slash { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.9375rem;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
  background: var(--surface-3);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 80% 30%, rgba(179, 217, 138, 0.09), transparent 70%),
    radial-gradient(50% 40% at 10% 0%, rgba(127, 163, 104, 0.07), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: 0.35;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 500;
  max-width: 14ch;
}

.lede {
  margin-top: 26px;
  color: var(--text-soft);
  font-size: 1.125rem;
  max-width: 52ch;
}
.lede a { color: var(--accent); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 0.9;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(70% 70% at 50% 50%, var(--surface-2), var(--surface));
  overflow: hidden;
}
.hero-visual canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(13, 17, 16, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
.stats > div {
  padding: 28px 28px 26px;
  border-left: 1px solid var(--border);
}
.stats > div:first-child { border-left: 0; }
.stats dt {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.stats dd {
  margin: 8px 0 6px;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.stats p {
  color: var(--text-soft);
  font-size: 0.875rem;
}

/* ==========================================================================
   Research cards
   ========================================================================== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.area-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background-color 0.25s;
}
.area-card:hover {
  border-color: rgba(179, 217, 138, 0.45);
  background: var(--surface-2);
  transform: translateY(-3px);
}

.face {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.area-card h3 { font-size: 1.1875rem; }
.area-card p {
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Pipeline
   ========================================================================== */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  counter-reset: none;
}
.flow::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 15%, var(--border-strong) 85%, transparent);
}

.flow-step {
  position: relative;
  padding-right: 8px;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin-bottom: 22px;
  position: relative;
}

.flow-step h3 {
  font-size: 1.125rem;
  margin-bottom: 10px;
}
.flow-step p {
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.job-card {
  margin-top: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}
.job-head .eyebrow { margin-bottom: 8px; }
.job-head h3 {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
}

.job-body {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  padding: 28px 32px;
}

.job-meta {
  display: grid;
  gap: 18px;
}
.job-meta dt {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-bottom: 4px;
}
.job-meta dd {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.criteria-title {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-bottom: 10px;
}
.job-criteria li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}
.job-criteria li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  opacity: 0.8;
}

.job-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.job-track li {
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.job-track li:last-child { border-right: 0; }
.job-track .done { color: var(--text-soft); }
.job-track .current {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   Tokenomics
   ========================================================================== */
.fee-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.card-title {
  font-size: 1.25rem;
  margin-bottom: 24px;
}

.field { margin-bottom: 22px; }
.field label,
.field legend {
  display: block;
  color: var(--text-soft);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.field input[type="number"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  transition: border-color 0.2s;
}
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.segmented {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.segmented input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.split-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  margin: 6px 0 24px;
}
.split-bar span {
  height: 100%;
  transition: width 0.35s var(--ease);
}
.split-vault { background: var(--accent); width: 66.6%; }
.split-holders { background: var(--holders); width: 33.4%; }

.results {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.results > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.results dt { color: var(--text-soft); font-size: 0.9375rem; }
.results dd {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.results .result-net dt { color: var(--text); font-weight: 500; }
.results .result-net dd {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 500;
}

.fee-side {
  display: grid;
  gap: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
th, td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  vertical-align: top;
}
thead th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
tbody th {
  font-weight: 500;
  color: var(--text);
}
td { color: var(--text-soft); font-family: var(--font-mono); font-size: 0.9rem; }
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

.guarantees {
  display: grid;
  gap: 14px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.guarantees li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}
.check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  position: relative;
}
.check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 4px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ==========================================================================
   Transparency and roadmap
   ========================================================================== */
.status-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}
.status-list li:last-child { border-bottom: 0; }

.roadmap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.milestone {
  position: relative;
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.milestone-stage {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.milestone h3 {
  font-size: 1.0625rem;
  margin-bottom: 10px;
}
.milestone p:last-child {
  color: var(--text-soft);
  font-size: 0.9rem;
}
.milestone.is-done .milestone-stage { color: var(--text-soft); }
.milestone.is-done { border-color: var(--border-strong); }
.milestone.is-current {
  border-color: rgba(179, 217, 138, 0.5);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%);
}
.milestone.is-current .milestone-stage { color: var(--accent); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq {
  display: grid;
  gap: 12px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq details p {
  padding: 0 24px 22px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--border);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-links {
  display: flex;
  gap: 22px;
  font-size: 0.9375rem;
}
.footer-links a { color: var(--text-soft); }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.disclaimer {
  margin-top: 32px;
  max-width: 96ch;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.copyright {
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Reveal on scroll (only when JS runs)
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { aspect-ratio: 16 / 10; }
  .hero h1 { max-width: 18ch; }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .flow::before { display: none; }
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .fee-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 12px var(--gutter) 20px;
    background: rgba(7, 9, 10, 0.97);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 12px; font-size: 1rem; }
  .topbar-actions .btn { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .job-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; }
  .hero { padding: 56px 0 56px; }
  .cta-row .btn { flex: 1 1 100%; }
  .area-grid,
  .flow,
  .roadmap { grid-template-columns: 1fr; }
  .job-track { grid-template-columns: repeat(2, 1fr); row-gap: 0; }
  .job-track li:nth-child(even) { border-right: 0; }
  .job-track li { border-bottom: 1px solid var(--border); }
  .job-track li:nth-last-child(-n + 2) { border-bottom: 0; }
  .card { padding: 24px; }
  .job-head,
  .job-body { padding: 22px; }
  .guarantees { padding: 22px; }
  .stats > div { padding: 22px 20px; }
  th, td { padding: 14px 14px; }
  .fee-side table th:nth-child(2),
  .fee-side table td:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Swarm snapshot
   ========================================================================== */
.swarm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.swarm-stats > div {
  padding: 26px 26px 24px;
  border-left: 1px solid var(--border);
}
.swarm-stats > div:first-child { border-left: 0; }
.swarm-stats dt {
  color: var(--muted);
  font-size: 0.8125rem;
}
.swarm-stats dd {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.swarm-owners {
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.directory {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dir-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.dir-search,
.dir-sort {
  height: 42px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}
.dir-search { width: 200px; font-family: var(--font-mono); }
.dir-search:focus,
.dir-sort:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dir-filter { margin: 0; padding: 0; border: 0; min-width: 0; }
.dir-filter .segmented { width: max-content; }
.dir-filter .segmented label { padding: 0 12px; min-height: 34px; font-size: 0.875rem; }

.dir-toolbar .dir-sort { margin-left: auto; }

.dir-table td.agent-id {
  font-family: var(--font-mono);
  color: var(--text);
}
.dir-table td { white-space: nowrap; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}
.status-dot.is-online { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-dot.is-offline { background: var(--border-strong); }

.rate-bar {
  display: inline-block;
  vertical-align: middle;
  width: 90px;
  height: 6px;
  margin-left: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.rate-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.dir-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.dir-count {
  color: var(--muted);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}
.pager { display: flex; gap: 8px; }
.pager .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 860px) {
  .swarm-stats { grid-template-columns: repeat(2, 1fr); }
  .swarm-stats > div:nth-child(3) { border-left: 0; }
  .swarm-stats > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .dir-toolbar .dir-sort { margin-left: 0; }
}

@media (max-width: 640px) {
  .dir-search { width: 100%; }
  .dir-toolbar > * { flex: 1 1 100%; }
  .dir-filter .segmented { width: 100%; }
  .dir-filter .segmented label { flex: 1; }
  .rate-bar { display: none; }
  .dir-table th:nth-child(4),
  .dir-table td:nth-child(4) { display: none; }
}

/* ==========================================================================
   Vision
   ========================================================================== */
.vision {
  position: relative;
  margin-bottom: 56px;
  padding: 56px;
  border: 1px solid rgba(179, 217, 138, 0.28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 90% at 0% 0%, rgba(179, 217, 138, 0.10), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.vision h3 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-bottom: 32px;
}
.vision-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
  max-width: 1040px;
}
.vision-body p {
  color: var(--text-soft);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.vision-body .vision-honest {
  grid-column: 1 / -1;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border-strong);
}
.pillars h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 8px;
}
.pillars p {
  color: var(--text-soft);
  font-size: 0.9375rem;
}

/* ==========================================================================
   Research area dialog
   ========================================================================== */
.area-card { cursor: pointer; }
.area-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.area-card::after {
  content: "→";
  position: absolute;
  top: 26px;
  right: 26px;
  color: var(--muted);
  font-family: var(--font-mono);
  transition: color 0.2s, transform 0.25s var(--ease);
}
.area-card:hover::after { color: var(--accent); transform: translateX(3px); }

.area-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.area-dialog::backdrop {
  background: rgba(3, 5, 4, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.area-dialog[open] { animation: dialog-in 0.25s var(--ease); }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.area-dialog-body { padding: 32px; text-align: left; }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dialog-head .eyebrow { margin-bottom: 8px; }
.dialog-title {
  font-size: 1.6rem;
  font-weight: 500;
}
.dialog-close { flex-shrink: 0; }

.dialog-summary {
  color: var(--text-soft);
  font-size: 1.0625rem;
  margin-bottom: 24px;
}

.dialog-section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.dialog-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.dialog-section p,
.dialog-list li {
  color: var(--text-soft);
  font-size: 0.9375rem;
}
.dialog-list { display: grid; gap: 8px; }
.dialog-list li {
  position: relative;
  padding-left: 20px;
}
.dialog-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.dialog-note {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (max-width: 860px) {
  .vision { padding: 40px 28px; }
  .vision-body { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .vision { padding: 32px 22px; }
  .pillars { grid-template-columns: 1fr; }
  .area-dialog-body { padding: 24px 20px; }
  .dialog-head { flex-direction: column; }
}
