:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #13201d;
  --muted: #63716d;
  --line: #dce5df;
  --green: #167a55;
  --blue: #305caa;
  --amber: #9a650c;
  --red: #b42318;
  --teal: #087f8c;
  --shadow: 0 18px 42px rgba(25, 45, 38, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

body,
button,
input,
select {
  font: inherit;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}

.site-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 241, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #35b987;
  color: #06110e;
  font-weight: 850;
}

.brand strong,
.brand em {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 17px;
}

.brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.site-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.active {
  color: var(--ink);
  background: #e6eee8;
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  gap: 20px;
  padding: 28px 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2 {
  line-height: 1.06;
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 27px;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.lede {
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.button-primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.button-primary:hover,
.button-primary:focus,
.button-secondary:hover,
.button-secondary:focus {
  outline: 2px solid rgba(48, 92, 170, 0.24);
  outline-offset: 2px;
}

.hero-note,
.small-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hero-note {
  margin-top: 12px;
}

.text-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus {
  text-decoration: underline;
}

.signal-visual {
  display: grid;
  gap: 10px;
  max-width: 880px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf7;
  box-shadow: var(--shadow);
}

.signal-preview-card,
.metric-strip span,
.ledger-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.signal-preview-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.preview-top,
.preview-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preview-top strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.preview-top em,
.preview-foot span,
.metric-strip em,
.ledger-strip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border: 1px solid #b8dfcf;
  border-radius: 999px;
  background: #effaf5;
  color: #0f6b4d;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.metric-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 19px;
  line-height: 1.1;
}

.ledger-strip {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 4px solid var(--green);
}

.page-section {
  padding: 28px 16px;
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
  margin-bottom: 16px;
}

.section-head p,
.body-copy p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.55;
}

.system-map-section {
  background: var(--surface-soft);
}

.system-illustration {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.35fr) minmax(220px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.source-cloud,
.learning-loop,
.system-flow li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 45, 38, 0.06);
}

.source-cloud,
.learning-loop {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.source-cloud strong,
.learning-loop strong,
.system-flow strong {
  color: var(--ink);
}

.source-cloud span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid #cfe1d7;
  border-radius: 999px;
  background: #f4faf6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.system-flow {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.system-flow::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 23px;
  width: 2px;
  background: #cfe1d7;
}

.system-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px 10px;
  min-height: 94px;
  padding: 12px;
}

.system-flow em {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #effaf5;
  color: #0f6b4d;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.system-flow strong {
  align-self: center;
  line-height: 1.2;
}

.system-flow span {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.learning-loop {
  border-color: #cfe1d7;
  background: #fbfdfb;
}

.learning-loop span,
.learning-loop small {
  color: var(--muted);
  line-height: 1.45;
}

.learning-loop small {
  font-size: 12px;
}

.card-grid,
.value-grid,
.metric-grid,
.disclosure-grid {
  display: grid;
  gap: 10px;
}

.info-card,
.value-card,
.term-card,
.disclosure-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 45, 38, 0.06);
}

.info-card p,
.value-card p,
.term-card p,
.disclosure-card p {
  color: var(--muted);
  line-height: 1.45;
}

.term-card em,
.disclosure-card em {
  color: var(--teal);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.method-list,
.boundary-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.method-list li,
.boundary-list li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.method-list strong,
.boundary-list strong {
  color: var(--ink);
}

.method-list span,
.boundary-list span {
  color: var(--muted);
  line-height: 1.45;
}

.waitlist-band {
  display: grid;
  gap: 16px;
  padding: 28px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.waitlist-form {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.waitlist-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.waitlist-row {
  display: grid;
  gap: 8px;
}

.waitlist-row input,
.waitlist-row button,
.waitlist-form select {
  min-height: 44px;
  border-radius: 8px;
}

.waitlist-row input,
.waitlist-form select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
}

.waitlist-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 34px;
}

.waitlist-row button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
  padding: 0 14px;
  font-weight: 850;
  cursor: pointer;
}

.waitlist-form.has-error input {
  border-color: var(--red);
}

.waitlist-form.is-joined input {
  border-color: #b8dfcf;
  background: #effaf5;
}

.waitlist-note {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.site-footer {
  display: grid;
  gap: 8px;
  padding: 22px 16px 30px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--ink);
}

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

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.admin-hero h1 {
  font-size: 38px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-panel > section {
  min-width: 0;
}

.admin-auth,
.admin-summary-grid,
.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 45, 38, 0.05);
}

.admin-auth {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.admin-auth label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-token-row,
.admin-actions {
  display: grid;
  gap: 8px;
}

.admin-token-row input,
.admin-token-row button,
.admin-actions button {
  min-height: 44px;
  border-radius: 8px;
}

.admin-token-row input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-soft);
}

.admin-token-row button,
.admin-actions button {
  border: 1px solid var(--green);
  padding: 0 14px;
  background: var(--green);
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.admin-actions button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.admin-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tabs button.is-active {
  border-color: #b8dfcf;
  background: #effaf5;
  color: var(--ink);
}

[data-admin-panel][hidden] {
  display: none;
}

.admin-note {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.admin-note.is-error {
  color: var(--red);
}

.admin-invite-builder {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 45, 38, 0.05);
}

.admin-builder-copy {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.admin-builder-copy h2 {
  font-size: 24px;
}

.admin-builder-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.admin-invite-form {
  display: grid;
  gap: 10px;
}

.admin-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-field input,
.admin-field select,
.admin-invite-form button {
  min-height: 44px;
  border-radius: 8px;
}

.admin-field input,
.admin-field select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-transform: none;
}

.admin-invite-form button,
.admin-result-actions button {
  border: 1px solid var(--green);
  padding: 0 14px;
  background: var(--green);
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.admin-invite-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.admin-invite-result {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #b8dfcf;
  border-radius: 8px;
  background: #effaf5;
}

.admin-invite-result[hidden] {
  display: none;
}

.admin-invite-result > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-invite-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-invite-result strong,
.admin-invite-result code {
  overflow-wrap: anywhere;
}

.admin-invite-result code {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #b8dfcf;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 850;
}

.admin-result-actions {
  display: grid;
  gap: 8px;
}

.admin-result-actions button {
  min-height: 40px;
  border-radius: 8px;
}

.admin-result-actions button:nth-child(n + 2) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.admin-summary-grid {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.admin-metric {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-metric:last-child {
  border-bottom: 0;
}

.admin-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-metric strong {
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.admin-table-stack {
  display: grid;
  gap: 12px;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table caption {
  padding: 12px;
  color: var(--ink);
  text-align: left;
  font-size: 16px;
  font-weight: 850;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.35;
}

.admin-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-table td {
  overflow-wrap: anywhere;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 720px) {
  .site-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero {
    padding: 42px 18px 30px;
  }

  h1 {
    font-size: 50px;
  }

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

  .waitlist-band {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.58fr);
    align-items: start;
    padding-left: 18px;
    padding-right: 18px;
  }

  .waitlist-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-hero,
  .admin-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .admin-token-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-actions {
    grid-template-columns: repeat(3, max-content);
  }

  .admin-invite-form {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.4fr) minmax(140px, 0.25fr) auto;
    align-items: end;
  }

  .admin-result-actions {
    grid-template-columns: repeat(3, max-content);
  }

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

  .admin-metric {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .admin-metric:last-child {
    border-right: 0;
  }
}

@media (max-width: 860px) {
  .system-illustration {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

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

  .preview-top,
  .preview-foot {
    flex-direction: column;
  }
}
