:root {
  --ink: #10221f;
  --muted: #5b6f6b;
  --paper: #fffdf8;
  --soft: #f4f7f2;
  --line: #d9e1d7;
  --green: #1f8a5b;
  --green-dark: #0d5f49;
  --blue: #123c5c;
  --cyan: #4bb7bd;
  --gold: #d9a441;
  --coral: #e8735f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--soft); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.68; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(16, 34, 31, 0.1);
  background: rgba(244, 247, 242, 0.86);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
}
.brand-mark svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 10px 12px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.topbar nav a:hover { color: var(--ink); background: rgba(31, 138, 91, 0.1); }

.wallet-button,
.primary-action,
.secondary-action,
.filters button,
.tier-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.wallet-button,
.primary-action {
  gap: 8px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  box-shadow: 0 16px 34px rgba(13, 95, 73, 0.22);
}
.wallet-button.wrong-network { background: linear-gradient(135deg, #9b2c2c, var(--coral)); }

.secondary-action {
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.compact { min-height: 38px; padding-inline: 13px; }

.hero {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 116px 28px 28px;
  color: #fff;
  isolation: isolate;
}
.hero > img, .hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero > img { z-index: -3; object-fit: cover; }
.hero-overlay {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(4, 18, 21, 0.86), rgba(4, 18, 21, 0.52) 48%, rgba(4, 18, 21, 0.14)),
    linear-gradient(0deg, rgba(4, 18, 21, 0.78), transparent 42%);
}
.hero-copy { max-width: 760px; padding-bottom: 110px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(42px, 6vw, 76px); line-height: 0.98; letter-spacing: 0; }
.hero p { max-width: 650px; color: rgba(255, 255, 255, 0.84); font-size: 20px; line-height: 1.5; }
.actions, .card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .secondary-action { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.13); }

.hero-metrics {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  width: min(680px, calc(100% - 56px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}
.hero-metrics div { padding: 18px; }
.hero-metrics strong, .hero-metrics span { display: block; }
.hero-metrics strong { font-size: 24px; }
.hero-metrics span { color: rgba(255, 255, 255, 0.75); font-size: 13px; }

.section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section-heading h2, .capture h2 { margin: 0; font-size: 34px; line-height: 1.08; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: min(380px, 100%);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.search span { color: var(--muted); font-size: 13px; font-weight: 900; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.filters button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--paper);
}
.filters button.active { color: #fff; border-color: var(--blue); background: var(--blue); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card, .panel, .stat-card, .support-row, .evidence-row, .capture form, .capture > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(16, 34, 31, 0.08);
}
.project-card { overflow: hidden; }
.project-media { position: relative; aspect-ratio: 1.25; overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 900;
}
.project-media .status { position: absolute; top: 12px; left: 12px; }
.project-body { padding: 18px; }
.title-row { display: flex; justify-content: space-between; gap: 12px; }
.title-row h3 { margin: 0; font-size: 20px; }
.title-row span { align-self: start; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: rgba(31, 138, 91, 0.1); font-size: 12px; font-weight: 900; }
.location { color: var(--muted); }
.project-body p, .panel p, .stat-card p, .capture p, .evidence-row p, .support-row p { color: var(--muted); line-height: 1.5; }
.impact { display: block; margin-top: 14px; padding: 12px; border-left: 3px solid var(--coral); background: rgba(232, 115, 95, 0.1); }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 13px; font-weight: 900; }
.progress { height: 10px; overflow: hidden; margin: 8px 0 18px; border-radius: 999px; background: #e4eadf; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan), var(--gold)); }

.detail-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: stretch; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.detail-hero img { width: 100%; height: 100%; min-height: 360px; border-radius: 8px; object-fit: cover; }
.detail-hero h2 { margin: 0; font-size: 42px; line-height: 1.06; }
.risk { padding: 14px; border-radius: 8px; background: rgba(217, 164, 65, 0.14); }
.detail-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 22px; }
.panel h3, .stat-card h3, .evidence-row h3, .support-row h3 { margin: 0; }
.milestone { display: flex; gap: 10px; margin-top: 14px; }
.milestone span { width: 12px; height: 12px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--cyan); }
.milestone span.completed { background: var(--green); }
.milestone span.active { background: var(--gold); }

.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tier-grid button { display: grid; align-content: start; justify-content: stretch; min-height: 130px; padding: 16px; border: 1px solid var(--line); text-align: left; background: #fff; }
.tier-grid span { margin-top: 10px; color: var(--green-dark); font-size: 24px; font-weight: 900; }
.tier-grid small { margin-top: 4px; color: var(--muted); }

.registry-layout { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 18px; }
.map-panel { position: relative; display: grid; min-height: 420px; place-items: center; overflow: hidden; border-radius: 8px; background: linear-gradient(135deg, var(--blue), var(--green-dark)); }
.map-orbit, .map-panel::before, .map-panel::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 50%; }
.map-orbit { inset: 32px; }
.map-panel::before { inset: 80px 44px; }
.map-panel::after { inset: 130px 80px; }
.pin { position: absolute; width: 17px; height: 17px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); }
.pin-a { top: 34%; left: 48%; }
.pin-b { top: 49%; left: 38%; }
.pin-c { top: 59%; left: 64%; }
.evidence-list, .support-list { display: grid; gap: 12px; }
.evidence-row, .support-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px; }
.evidence-row code { color: var(--blue); font-size: 12px; }
.status.approved { color: var(--green-dark); background: rgba(31, 138, 91, 0.13); }
.status.pending { color: #825f08; background: rgba(217, 164, 65, 0.18); }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat-card { min-height: 160px; padding: 22px; }
.support-list { margin-top: 18px; }
.support-row { display: block; }
.empty { padding: 22px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }

.capture { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; padding-bottom: 80px; }
.capture > div, .capture form { padding: 24px; }
.capture form { display: grid; gap: 16px; }
.capture label { display: grid; gap: 8px; font-weight: 900; }
.capture input, .capture select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.text-link { color: var(--green-dark); font-weight: 900; }
.form-status { min-height: 22px; margin: 0; color: var(--blue); font-size: 14px; font-weight: 800; line-height: 1.45; }

.support-dialog { width: min(720px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; background: transparent; }
.wallet-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; background: transparent; }
.support-dialog::backdrop, .wallet-dialog::backdrop { background: rgba(3, 16, 15, 0.62); backdrop-filter: blur(4px); }
.dialog-panel { position: relative; padding: 26px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; background: var(--paper); box-shadow: 0 24px 70px rgba(13, 40, 34, 0.18); }
.dialog-panel h2 { margin: 0; font-size: 30px; }
.wallet-notice { color: var(--muted); line-height: 1.45; }
.close-dialog { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 24px; }
.tier-options { display: grid; gap: 10px; margin: 22px 0; }
.tier-option { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.tier-option.selected { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.12); }
.tier-option small { display: block; margin-top: 5px; color: var(--muted); }
.tier-option em { color: var(--green-dark); font-style: normal; font-weight: 900; }
.risk-check { display: flex; gap: 10px; align-items: start; color: var(--muted); line-height: 1.45; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin: 22px 0 0; padding: 0; }
.wallet-list { display: grid; gap: 10px; margin: 20px 0 12px; }
.wallet-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.wallet-option:hover:not(:disabled) { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.12); }
.wallet-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green-dark));
  font-size: 11px;
  font-weight: 900;
}
.wallet-icon img { width: 100%; height: 100%; object-fit: cover; }
.wallet-option strong, .wallet-option small { display: block; }
.wallet-option small { margin-top: 4px; color: var(--muted); }
.wallet-option em { color: var(--green-dark); font-style: normal; font-size: 12px; font-weight: 900; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .hero-copy { padding-bottom: 150px; }
  .project-grid, .detail-hero, .detail-grid, .registry-layout, .dashboard-grid, .capture { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand small { display: none; }
  .wallet-button { min-width: 46px; padding-inline: 12px; font-size: 0; }
  .wallet-button::before { content: "Wallet"; font-size: 14px; }
  .hero { min-height: 640px; padding: 92px 18px 18px; }
  .hero p { font-size: 17px; }
  .hero-metrics { right: 18px; bottom: 18px; grid-template-columns: 1fr; width: calc(100% - 36px); }
  .section { width: calc(100% - 28px); padding-top: 54px; }
  .section-heading { display: grid; align-items: start; }
  .card-actions, .actions, .dialog-actions { display: grid; }
}
