/* ---- tokens ---------------------------------------------------- */
:root {
  --bg: #f6f1e9;
  --surface: #ffffff;
  --surface-2: #fbf6ee;
  --ink: #241e15;
  --ink-dim: #6e6455;
  --ink-faint: #a89d89;
  --border: #e6ddcc;
  --border-soft: #efe8da;
  --accent: #c1633f;
  --accent-deep: #a1502f;
  --accent-ink: #fff8f1;
  --accent-wash: #f4e3d8;
  --good: #4c7a57;
  --good-bg: #e6efe3;
  --bad: #b14a38;
  --bad-bg: #f6e5df;
  --focus: #c1633f;
  --shadow: 0 1px 2px rgba(36, 30, 21, 0.04), 0 8px 24px -12px rgba(36, 30, 21, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #19160f;
    --surface: #221d15;
    --surface-2: #292219;
    --ink: #f1e9db;
    --ink-dim: #a99d87;
    --ink-faint: #6f6553;
    --border: #372f22;
    --border-soft: #2c2519;
    --accent: #e28a5f;
    --accent-deep: #eda07c;
    --accent-ink: #201509;
    --accent-wash: #3a2a1d;
    --good: #8ebb92;
    --good-bg: #21301f;
    --bad: #e0836f;
    --bad-bg: #362019;
    --focus: #e28a5f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px -14px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #19160f;
  --surface: #221d15;
  --surface-2: #292219;
  --ink: #f1e9db;
}

/* ---- agent stats ---------------------------------------------------- */
.agent-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-dim);
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
}

.stat-good {
  color: var(--good);
}

.stat-bad {
  color: var(--bad);
}

.stat-dim {
  color: var(--ink-dim);
}

.hero-badge {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.hero-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
}

.hero-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-dim);
  font-weight: 600;
}

/* ---- problem/solution boxes ---------------------------------------- */
.problem-box, .solution-box {
  padding: 14px 16px;
  border-radius: 10px;
  margin: 14px 0;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.problem-title, .solution-title {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 10.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.problem-text, .solution-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}



/* ---- base -------------------------------------------------------- */
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
h1, h2 {
  font-family: "Fraunces", Georgia, serif;
  text-wrap: balance;
  margin: 0;
}
code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- topbar -------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 550;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.wordmark-mark { color: var(--accent); display: inline-flex; }
.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  color: var(--ink-dim);
}
.topbar-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.topbar-links a:hover { color: var(--accent); }
.topbar-gh { display: inline-flex; }
@media (max-width: 640px) {
  .topbar-links a:not(.topbar-gh) { display: none; }
}
.net-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px 6px 10px;
}
.net-chip-id { color: var(--ink-faint); }
.net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.net-dot.live {
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-bg);
}

/* ---- topbar launch button -------------------------------------------------------- */
.topbar-launch {
  padding: 8px 16px;
  font-size: 13px;
  text-decoration: none;
}

/* ---- landing page -------------------------------------------------------- */
.landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  position: relative;
  z-index: 1;
}
.landing-hero { text-align: center; margin-bottom: 56px; }
.landing-hero .hero-badge { margin-bottom: 20px; }
.landing-hero h1 {
  font-size: clamp(34px, 6vw, 50px);
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.landing-hero .hero-sub {
  font-size: 17px;
  max-width: 46ch;
  margin: 20px auto 0;
}
.landing-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.btn-lg { padding: 14px 26px; font-size: 15.5px; text-decoration: none; display: inline-flex; align-items: center; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); filter: none; }

.hero-stats {
  max-width: 460px;
  margin: 40px auto 0;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}

.landing-section { margin-bottom: 48px; }
.landing-steps { max-width: 60ch; }

.landing-final-cta {
  text-align: center;
  padding-top: 8px;
}

.hero-sub {
  color: var(--ink-dim);
  font-size: 13.5px;
  margin: 14px 0 24px;
  line-height: 1.6;
}

/* ---- ledger card -------------------------------------------------------- */
.ledger-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  font-family: "IBM Plex Mono", monospace;
  animation: card-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: 0.1s;
  margin-bottom: 28px;
}
.ledger-card::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%);
  filter: blur(8px);
  z-index: -1;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.ledger-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.ledger-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}
.ledger-label { color: var(--ink-faint); }
.ledger-value { color: var(--ink); font-weight: 500; }
.ledger-redacted {
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--ink-faint) 0%, var(--accent) 50%, var(--ink-faint) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 2.8s linear infinite;
}
@keyframes shimmer {
  to { background-position: -200% center; }
}
.ledger-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }
.ledger-result .ledger-value { font-weight: 400; }
.ledger-pass { color: var(--good); }

/* ---- about steps -------------------------------------------------------- */
.explainer-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 12px;
}
.about-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-steps-list li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-dim);
  padding-left: 17px;
  position: relative;
}
.about-steps-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.about-steps-list li strong { color: var(--ink); font-weight: 600; }

/* ---- wallet picker -------------------------------------------------------- */
.wallet-picker-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.wallet-picker-overlay:not([hidden]) { display: flex; }
.wallet-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow);
}
.wallet-picker h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 550;
  margin: 0 0 16px;
}
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-family: "Public Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}
.wallet-option:hover { border-color: var(--accent); }
.wallet-option img { width: 22px; height: 22px; border-radius: 5px; }
.wallet-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 14px;
  flex-shrink: 0;
}
.wallet-picker-cancel {
  width: 100%;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-family: "Public Sans", sans-serif;
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
}
.wallet-picker-cancel:hover { color: var(--ink-dim); }

/* ---- app page (the console itself, standalone page) -------------------------------------------------------- */
.app-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 60px;
  position: relative;
  z-index: 1;
}
.app-page-head { text-align: center; margin-bottom: 32px; }
.app-page-head h1 {
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 550;
  letter-spacing: -0.015em;
}
.app-page-head .hero-sub { max-width: 50ch; margin: 14px auto 0; }

.console-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.console-step {
  padding: 28px 34px;
  transition: background 0.2s ease;
}
.console-step:first-child { border-radius: 18px 18px 0 0; }
.console-step:last-child { border-radius: 0 0 18px 18px; }
.console-step[data-state="active"] { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.console-divider { height: 1px; background: var(--border-soft); margin: 0 34px; }

.console-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-faint);
  flex-shrink: 0;
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.console-step[data-state="active"] .step-badge,
.console-step[data-state="done"] .step-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.console-step[data-state="active"] .step-badge::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.5;
  animation: ring-pulse 1.8s ease-out infinite;
}
@keyframes ring-pulse {
  from { transform: scale(0.85); opacity: 0.6; }
  to { transform: scale(1.25); opacity: 0; }
}
.console-step h2 { font-size: 17.5px; font-weight: 550; flex: 1; }

.pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.console-step[data-state="active"] .pill { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.console-step[data-state="done"] .pill { color: var(--good); border-color: var(--good); background: var(--good-bg); }

.console-step-body { padding-left: 38px; margin-top: 12px; }

.stage-hint {
  color: var(--ink-dim);
  font-size: 13.5px;
  margin: 0 0 16px;
  line-height: 1.55;
}

.limit-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.limit-input-row label {
  font-size: 12.5px;
  color: var(--ink-dim);
  font-weight: 500;
}
.limit-input {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  width: 140px;
  transition: border-color 0.15s ease;
}
.limit-input:focus { outline: none; border-color: var(--accent); }
.limit-input:disabled { opacity: 0.6; cursor: not-allowed; }

.stage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.contract-info { margin-top: 12px; }
.account-addr { color: var(--ink-dim); font-size: 13px; }

/* ---- buttons -------------------------------------------------------- */
.btn {
  font-family: "Public Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 9px;
  padding: 11px 18px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-good { background: var(--good-bg); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.btn-bad { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }

/* ---- console log -------------------------------------------------------- */
.console {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-dim);
  min-height: 0;
  max-height: 260px;
  overflow-y: auto;
}
.console[data-empty="true"] { display: none; }
.console > div { animation: line-in 0.25s ease backwards; }
@keyframes line-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
.console .line-tx { color: var(--accent); }
.console .line-tx a { color: inherit; }
.console .line-pass { color: var(--good); font-weight: 600; }
.console .line-block { color: var(--bad); font-weight: 600; }
.console .line-dim { color: var(--ink-faint); }
.console a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.console a:hover { text-decoration-color: currentColor; }

/* ---- footer -------------------------------------------------------- */
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
  color: var(--ink-faint);
  font-size: 12.5px;
}
.foot a { color: var(--ink-dim); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot-links { display: flex; align-items: center; gap: 16px; }

@media (max-width: 640px) {
  .landing, .app-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .landing-grid { grid-template-columns: 1fr; }

  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; }

  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar-links { gap: 16px; }
  .topbar-links a:not(.topbar-gh) { font-size: 12px; }

  .net-chip {
    font-size: 11px;
    padding: 5px 10px 5px 8px;
  }

  .landing-hero h1 { font-size: 28px; }
  .app-page-head h1 { font-size: 24px; }

  .problem-box, .solution-box { padding: 14px; }

  .console-step { padding: 20px 16px; }
  .console-divider { margin: 0 16px; }
  .console-step-body { padding-left: 0; }

  .stage-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; text-align: center; justify-content: center; }
  .landing-cta .btn, .landing-final-cta .btn { width: auto; }

  .agent-stats { flex-wrap: wrap; gap: 12px; }
  .stat-item { flex: 1 1 calc(50% - 6px); }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
  }
}
