/* Layout: one centered column over a dark teal topographic field; glass panels, one glowing mint accent, lowercase display type. Dark-only by design. */
:root {
  --bg: #050d0c;
  --bg-deep: #020606;
  --surface: rgba(9, 24, 23, 0.72);
  --surface-solid: #0a1817;
  --line: rgba(0, 236, 151, 0.13);
  --line-strong: rgba(0, 236, 151, 0.32);
  --ink: #eafaf4;
  --muted: #86a39c;
  --accent: #00ec97;
  --accent-soft: rgba(0, 236, 151, 0.12);
  --glow: 0 0 22px rgba(0, 236, 151, 0.35), 0 0 2px rgba(0, 236, 151, 0.6);
  --contour: #2fd6a8;
  --warn: #ffbf69;
  --warn-soft: rgba(255, 191, 105, 0.12);
  --bad: #ff8b7f;
  --bad-soft: rgba(255, 139, 127, 0.12);

  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(120% 80% at 50% 0%, #0a1d1b 0%, var(--bg) 55%, var(--bg-deep) 100%);
}
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--muted); font-size: 0.875rem; }
.eyebrow { color: var(--accent); font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.01em; }

.contours { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; color: var(--contour); }
.topbar, main, .footer { position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Badge: the kat mark in a black disc with a mint ring and glow */
.badge {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: #000; color: var(--accent);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow), inset 0 0 18px rgba(0, 236, 151, 0.08);
}
.badge svg { width: 62%; height: 62%; filter: drop-shadow(0 0 6px rgba(0, 236, 151, 0.45)); }
.badge-sm { width: 34px; height: 34px; }
.badge-lg { width: clamp(76px, 11vw, 112px); height: clamp(76px, 11vw, 112px); }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); background: rgba(5, 13, 12, 0.6); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-sub { font-weight: 500; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 500; padding: 6px 12px; border: 1px solid var(--line); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* Controls */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: 700 0.95rem/1 var(--font-display); padding: 14px 22px; white-space: nowrap;
  transition: box-shadow 0.2s, background-color 0.2s, opacity 0.2s;
}
.btn:focus-visible, input:focus-visible, a:focus-visible, .filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: #02130d; }
.btn-primary:hover { box-shadow: var(--glow); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); padding: 11px 16px; font-size: 0.85rem; }
.btn-ghost:hover { background: var(--accent-soft); }

/* Hero */
main { display: grid; gap: 28px; padding-block: clamp(36px, 8vw, 88px) 40px; }
.hero { display: grid; gap: 22px; }
.hero-title { display: flex; align-items: center; gap: clamp(18px, 3vw, 32px); }
.hero-title h1 { max-width: 15ch; }
.lede { color: var(--muted); font-size: 1.075rem; max-width: 60ch; }
.check-card {
  display: flex; gap: 8px; padding: 7px; max-width: 720px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  backdrop-filter: blur(10px);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.check-card:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.check-card input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  padding: 12px 18px; font-size: 1rem;
}
.check-card input:focus-visible { outline: none; }
input::placeholder { color: var(--muted); }
.form-error { color: var(--bad); font-size: 0.9rem; max-width: 70ch; }
.facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 900px; }
.facts li { color: var(--muted); font-size: 0.875rem; padding-top: 12px; border-top: 1px solid var(--line-strong); }
.facts strong { color: var(--ink); font-weight: 600; }

/* Panels */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 16px; min-width: 0; backdrop-filter: blur(10px);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.panel-head .mono { font-weight: 500; color: var(--accent); }

/* Progress */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.steps li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.steps li[data-state="active"] { color: var(--ink); font-weight: 600; }
.steps li[data-state="active"]::before { border-color: var(--accent); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.steps li[data-state="done"] { color: var(--ink); }
.steps li[data-state="done"]::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(0, 236, 151, 0.5); }
.steps .count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.bar { height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width 0.3s; }
.pool-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.85rem; }
.pool-log li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .steps li[data-state="active"]::before { animation: none; border-top-color: var(--accent); }
  .bar span, .btn, .check-card { transition: none; }
}

/* Results */
#results { display: grid; gap: 20px; }
.earned {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: clamp(22px, 4vw, 32px); border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(0, 236, 151, 0.14), rgba(9, 24, 23, 0.85) 55%);
  border: 1px solid var(--line-strong); box-shadow: 0 0 40px rgba(0, 236, 151, 0.12);
  backdrop-filter: blur(10px);
}
.earned-main { display: grid; gap: 8px; min-width: 0; }
.earned-amount {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  text-shadow: 0 0 28px rgba(0, 236, 151, 0.25);
}
.earned-unit { font-size: 0.38em; font-weight: 700; color: var(--accent); letter-spacing: 0; }
.earned-usd { font-size: 1.15rem; font-weight: 600; }
.earned-side { display: flex; flex-wrap: wrap; gap: 8px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; backdrop-filter: blur(10px); }
.stat dt { color: var(--muted); font-size: 0.8rem; }
.stat dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .hint { font-size: 0.8rem; }

.warnings { display: grid; gap: 10px; }
.warning { border-radius: var(--radius-sm); padding: 12px 16px; background: var(--warn-soft); color: var(--warn); font-size: 0.9rem; border: 1px solid rgba(255, 191, 105, 0.25); }
.warning strong { font-weight: 600; }
.warning.bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 139, 127, 0.25); }

.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.chip.good { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

.table-scroll { overflow-x: auto; margin-inline: -20px; padding-inline: 20px; }
.table-tall { max-height: 520px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.78rem; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-solid); }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.amount-in { color: var(--accent); font-weight: 600; }
.addr { text-decoration: none; border-bottom: 1px dotted var(--muted); }
.addr:hover { color: var(--accent); border-bottom-color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { appearance: none; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 12px; font: 600 0.8rem var(--font-body); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--accent); color: #02130d; border-color: var(--accent); }

.footer { display: grid; gap: 6px; padding-block: 28px 48px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .hero-title { flex-direction: column; align-items: flex-start; }
  .check-card { flex-direction: column; border-radius: var(--radius); }
  .check-card .btn { width: 100%; }
  .pill { display: none; }
}
