:root {
  --ink: #161716;
  --muted: #5e665f;
  --line: #d9dfd8;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --soft: #eef4ed;
  --green: #176b43;
  --green-2: #0d4f35;
  --blue: #2b62b6;
  --amber: #c88422;
  --red: #b93f3a;
  --graphite: #26302b;
  --shadow: 0 18px 60px rgba(24, 29, 24, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(251, 252, 250, 0.92);
  border-bottom: 1px solid rgba(217, 223, 216, 0.85);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 107, 67, 0.22);
}

.mark.small {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.nav button,
.button,
.tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--graphite);
  padding: 10px 14px;
  cursor: pointer;
}

.nav a:hover,
.nav button:hover,
.tab:hover {
  background: var(--soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  line-height: 1;
}

.button.primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
}

.button.dark {
  color: #fff;
  background: var(--graphite);
  border-color: var(--graphite);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(86vh - 68px);
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 76px);
  isolation: isolate;
  overflow: hidden;
  background-image: linear-gradient(90deg, rgba(251, 252, 250, 0.96) 0%, rgba(251, 252, 250, 0.80) 38%, rgba(251, 252, 250, 0.08) 76%), url("./aether-hero.png");
  background-size: cover;
  background-position: center right;
  border-bottom: 1px solid var(--line);
}

.hero-content {
  max-width: 660px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
  margin-bottom: 16px;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  color: #343b35;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.35;
  margin-bottom: 28px;
}

.hero-actions,
.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 34px;
}

.metric {
  min-height: 94px;
  padding: 16px;
  border: 1px solid rgba(217, 223, 216, 0.9);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
}

.metric strong {
  display: block;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.band {
  padding: clamp(52px, 8vw, 88px) clamp(20px, 5vw, 76px);
}

.band.soft {
  background: var(--soft);
}

.section-head {
  max-width: 740px;
  margin-bottom: 28px;
}

.section-head p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.grid-3,
.grid-4,
.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.doc-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 10px 36px rgba(25, 33, 28, 0.05);
}

.card {
  min-height: 180px;
  padding: 22px;
}

.card p,
.panel p,
.doc-card p,
.doc-section p,
.app-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.token-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  color: #fff;
  background: var(--graphite);
  border-radius: 8px;
  font-weight: 800;
}

.token-symbol.green {
  background: var(--green);
}

.token-symbol.blue {
  background: var(--blue);
}

.token-symbol.amber {
  background: var(--amber);
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.flow-step {
  position: relative;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow .flow-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 18px;
  height: 2px;
  background: var(--amber);
}

.flow-step:last-child::after {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.status-green {
  color: #0b4a2e;
  background: #dff0e6;
}

.status-amber {
  color: #6b4108;
  background: #f7e9ce;
}

.status-red {
  color: #792621;
  background: #f5dcda;
}

.risk-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  color: #fff;
  background: var(--graphite);
  border-radius: 8px;
}

.risk-strip p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px clamp(20px, 5vw, 76px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
}

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.docs-nav {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  padding: 22px;
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.docs-nav strong {
  display: block;
  margin-bottom: 14px;
}

.docs-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  border-radius: 8px;
}

.docs-nav a.active,
.docs-nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.docs-main {
  padding: clamp(28px, 5vw, 64px);
}

.doc-section {
  max-width: 940px;
  padding-bottom: 50px;
  margin-bottom: 50px;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section ul,
.doc-section ol,
.app-panel ul {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.doc-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 940px;
  margin-top: 18px;
}

.pager-link {
  display: block;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.pager-link:hover {
  border-color: var(--green);
}

.pager-link span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pager-link strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.pager-link.next {
  text-align: right;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow-wrap: anywhere;
}

.spec-table th,
.spec-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.spec-table th {
  color: var(--graphite);
  background: var(--soft);
}

code {
  padding: 2px 5px;
  color: #0f3d2a;
  background: #e8f1eb;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.app-sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  padding: 18px;
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.tabs {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.tab {
  width: 100%;
  text-align: left;
}

.tab.active {
  color: #fff;
  background: var(--green);
}

.app-main {
  padding: clamp(20px, 4vw, 46px);
}

.app-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.app-head p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.5;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.app-panel {
  grid-column: span 4;
  min-height: 176px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.app-panel.wide {
  grid-column: span 8;
}

.app-panel.full {
  grid-column: 1 / -1;
}

.value {
  display: block;
  margin: 10px 0 4px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 850;
  line-height: 1;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.progress {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  background: #e5ebe3;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--graphite);
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 28px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #c8d1c8;
  border-radius: 999px;
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.feature-item {
  min-height: 120px;
  padding: 16px;
  border: 1px dashed #b9c3b8;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.feature-item.pulse {
  transform: translateY(-2px);
  border-color: var(--amber);
}

.gate-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 22, 19, 0.54);
}

.gate-modal[hidden] {
  display: none;
}

.gate-box {
  width: min(560px, 100%);
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.gate-box p {
  color: var(--muted);
  line-height: 1.55;
}

.fine-print {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .grid-4,
  .grid-3,
  .grid-2,
  .flow,
  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-layout,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .docs-nav,
  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-panel,
  .app-panel.wide {
    grid-column: span 6;
  }

  .flow-step::after {
    display: none;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 78vh;
    align-items: end;
    background-position: center;
    padding-top: 56px;
  }

  .hero-metrics,
  .grid-4,
  .grid-3,
  .grid-2,
  .flow,
  .feature-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
  }

  .metric {
    min-height: 74px;
    padding: 10px;
  }

  .metric strong {
    font-size: 25px;
  }

  .metric span {
    font-size: 12px;
  }

  .risk-strip {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-pager {
    grid-template-columns: 1fr;
  }

  .app-head {
    flex-direction: column;
  }

  .app-panel,
  .app-panel.wide,
  .app-panel.full {
    grid-column: 1 / -1;
  }

  .nav a,
  .nav button {
    flex: 0 0 auto;
    width: auto;
  }

  .landing-page .nav a[href="#mechanics"],
  .landing-page .nav a[href="#launch"] {
    display: none;
  }

  .hero-actions .button,
  .risk-strip .button {
    width: 100%;
  }
}
