/* public/style.css — shared across all pages */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:           #f5f4f1;
  --bg2:          #eceae5;
  --surface:      #ffffff;
  --surface2:     #f9f8f5;
  --border:       #e2e0d8;
  --border-s:     #c8c4b8;
  --accent:       #1d4ed8;
  --accent-l:     #eff4ff;
  --accent-m:     #93b4f8;
  --success:      #15803d;
  --success-l:    #f0fdf4;
  --warn:         #b45309;
  --warn-l:       #fffbeb;
  --danger:       #b91c1c;
  --danger-l:     #fef2f2;
  --text:         #1c1917;
  --text-mid:     #57534e;
  --text-dim:     #a8a29e;
  --shadow-s:     0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);
  --shadow-m:     0 4px 16px rgba(0,0,0,.07),0 2px 4px rgba(0,0,0,.04);
  --shadow-l:     0 12px 40px rgba(0,0,0,.09),0 4px 8px rgba(0,0,0,.04);
  --r:            10px;
  --r-s:          6px;
  --sans:         'DM Sans', sans-serif;
  --mono:         'DM Mono', monospace;
  --nav-h:        56px;
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(245,244,241,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 40px; gap: 28px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 28px; height: 28px;
  background: var(--text); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-mark svg { width: 14px; height: 14px; fill: var(--bg); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  padding: 5px 12px; border-radius: var(--r-s);
  text-decoration: none; font-size: 14px;
  color: var(--text-mid); transition: all .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--bg2);
}
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.token-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--text-mid);
  text-decoration: none; transition: all .15s;
}
.token-pill:hover { border-color: var(--border-s); }
.token-pill .count { font-weight: 600; color: var(--accent); }
.token-icon { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 2; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--r-s);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-dark  { background: var(--text); color: #fff; box-shadow: var(--shadow-s); }
.btn-dark:hover { background: #292524; box-shadow: var(--shadow-m); }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-s); background: var(--surface2); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-s); }
.btn-accent:hover { background: #1e40af; box-shadow: var(--shadow-m); }
.btn-ghost { background: transparent; color: var(--text-mid); }
.btn-ghost:hover { background: var(--bg2); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Form elements ──────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--text-mid); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-s); color: var(--text);
  font-family: var(--sans); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field textarea { resize: vertical; min-height: 80px; }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-s);
  overflow: hidden;
}

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 500; border: 1px solid;
}
.badge-blue    { color: var(--accent);  border-color: #bfdbfe; background: var(--accent-l); }
.badge-green   { color: var(--success); border-color: #bbf7d0; background: var(--success-l); }
.badge-yellow  { color: var(--warn);    border-color: #fde68a; background: var(--warn-l); }
.badge-red     { color: var(--danger);  border-color: #fecaca; background: var(--danger-l); }
.badge-neutral { color: var(--text-mid); border-color: var(--border); background: var(--bg2); }

/* ── Utilities ──────────────────────────────────── */
.container  { max-width: 1040px; margin: 0 auto; padding: 0 32px; }
.container-sm { max-width: 680px;  margin: 0 auto; padding: 0 32px; }
.section    { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .75s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.mono { font-family: var(--mono); }
.text-dim  { color: var(--text-dim); }
.text-mid  { color: var(--text-mid); }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 11px; }
.fw-600    { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* ── Footer ─────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
footer p { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
footer a  { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--text-mid); }

/* ── Toast ──────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  padding: 12px 18px; border-radius: var(--r-s);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-l);
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--success); color: #fff; }
#toast.error   { background: var(--danger);  color: #fff; }
#toast.info    { background: var(--text);    color: #fff; }

@media (max-width: 640px) {
  nav { padding: 0 16px; gap: 12px; }
  .nav-links { display: none; }
  .container, .container-sm { padding: 0 16px; }
  .section { padding: 48px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  footer { padding: 20px 16px; }
}
