/* Token Risk Scanner — modern, trustworthy UI.
   Blue brand-led (from the logo) with soft depth and real token imagery, while
   keeping the credibility signals. Muted verdict colors stay the status chroma. */

/* Self-hosted Inter (variable) — no external font dependency */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: #e5e9f0;
  --border-strong: #d3dae6;
  --ink: #131722;
  --muted: #59616f;
  --dim: #98a1b1;

  /* brand blue (from logo) — the hero accent */
  --brand: #2456d6;
  --brand-strong: #1c46bd;
  --brand-tint: #eaf0ff;

  /* verdict scale — muted, report-grade; AA on white */
  --red: #c0362c;
  --orange: #b1550c;
  --gold: #8a6d15;
  --green: #16794a;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Consolas, monospace;

  --r-card: 18px;
  --r-ctrl: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(19, 23, 34, 0.05);
  --shadow-md: 0 4px 14px -6px rgba(19, 23, 34, 0.12);
  --shadow-lg: 0 24px 60px -28px rgba(19, 23, 34, 0.28);
  --shadow-brand: 0 8px 20px -8px rgba(36, 86, 214, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1100px 520px at 50% -12%, #dfe8ff 0%, rgba(223, 232, 255, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}

.wrap { max-width: 640px; margin: 0 auto; padding: clamp(40px, 7vw, 84px) 20px 88px; }

/* ── header ─────────────────────────────────────────── */
.brand { display: flex; justify-content: center; margin-bottom: 18px; }
.brand a { display: block; text-decoration: none; }
.brand img.lockup { height: 36px; width: auto; display: block; }
.tagline { text-align: center; color: var(--muted); font-size: 16px; max-width: 46ch; margin: 0 auto 30px; line-height: 1.55; }

/* ── search ─────────────────────────────────────────── */
form.scan { display: flex; gap: 10px; }
form.scan .field { flex: 1; }
form.scan input {
  width: 100%; padding: 16px 16px; font-size: 15px; font-family: var(--mono);
  color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-ctrl); box-shadow: var(--shadow-sm);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
form.scan input::placeholder { color: var(--dim); }
form.scan input:focus-visible {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(36, 86, 214, 0.14);
}
form.scan button {
  flex-shrink: 0; padding: 0 26px; font-family: var(--font); font-size: 15px; font-weight: 600;
  color: #fff; background: var(--brand); border: none; border-radius: var(--r-ctrl);
  cursor: pointer; box-shadow: var(--shadow-brand);
  transition: background 140ms var(--ease), transform 120ms var(--ease), box-shadow 140ms var(--ease);
}
form.scan button:hover { background: var(--brand-strong); box-shadow: 0 10px 24px -8px rgba(36, 86, 214, 0.6); }
form.scan button:active { transform: translateY(1px); }
form.scan button:disabled { opacity: 0.55; cursor: wait; box-shadow: none; }
form.scan button:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(36, 86, 214, 0.3); }

/* ── example chips (with token logos) ───────────────── */
.examples { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.examples .lbl { color: var(--dim); font-size: 13px; margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font); font-size: 13px;
  font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px 6px 7px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 120ms var(--ease);
}
.chip img { width: 18px; height: 18px; border-radius: 50%; display: block; }
.chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(36, 86, 214, 0.16); }

/* ── status / error ─────────────────────────────────── */
.status { color: var(--muted); text-align: center; padding: 26px 0; font-size: 15px; }
.error {
  margin-top: 22px; padding: 16px 18px; border-radius: var(--r-ctrl);
  background: #fdf2f1; border: 1px solid #f2d0cc; color: #9a2b22; font-size: 14px; text-align: center;
}

/* ── result card ────────────────────────────────────── */
.result {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--verdict);
  animation: rise 260ms var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.result .head { padding: 26px 26px 22px; display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.score-block { display: flex; align-items: baseline; gap: 6px; }
.score { font-size: 72px; font-weight: 800; line-height: 0.9; letter-spacing: -2px; }
.score-max { font-size: 21px; font-weight: 600; color: var(--dim); }
.head .meta { flex: 1; min-width: 190px; padding-top: 3px; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 5px 11px; border-radius: 999px; text-transform: uppercase;
}
.head .token { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; margin-top: 11px; line-height: 1.4; }
.head .token .tk { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.head .token .name { color: var(--ink); font-weight: 600; }
.head .token .addr { font-family: var(--mono); color: var(--dim); font-size: 12px; word-break: break-all; }

/* trust row */
.trust { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 11px; font-size: 12px; color: var(--muted); }
.trust svg { width: 13px; height: 13px; color: var(--green); }
.trust .sep { color: var(--dim); }
.trust .time { color: var(--dim); }
.partial { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 12px; margin-top: 9px; }

/* verdict tint */
.v-high-risk { --verdict: var(--red); }
.v-risky { --verdict: var(--orange); }
.v-caution { --verdict: var(--gold); }
.v-no-red-flags { --verdict: var(--green); }
.result .score, .result .pill-txt { color: var(--verdict); }
.result .pill { background: color-mix(in srgb, var(--verdict) 12%, #fff); color: var(--verdict); }
.result .meter .fill { background: var(--verdict); }

/* score meter */
.meter { height: 5px; background: var(--surface-2); }
.meter .fill { height: 100%; transform-origin: left; transform: scaleX(var(--pct, 0)); transition: transform 700ms var(--ease); }

/* ── explanation ────────────────────────────────────── */
.explanation { padding: 20px 26px; border-top: 1px solid var(--border); }
.explanation .lbl { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 10px; }
.explanation p { font-size: 15px; line-height: 1.7; color: var(--ink); white-space: pre-line; }

/* ── findings ───────────────────────────────────────── */
.findings { border-top: 1px solid var(--border); }
.finding { display: flex; gap: 14px; align-items: flex-start; padding: 14px 26px; }
.finding + .finding { border-top: 1px solid var(--surface-2); }
.sev { flex-shrink: 0; width: 66px; padding-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.sev-critical { color: var(--red); }
.sev-high { color: var(--orange); }
.sev-medium { color: var(--gold); }
.sev-low { color: var(--muted); }
.sev-info { color: var(--dim); }
.finding .body { flex: 1; }
.finding .title { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.finding .title .ded { color: var(--dim); font-variant-numeric: tabular-nums; flex-shrink: 0; font-weight: 500; }
.finding .evidence { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.55; font-weight: 400; }

/* ── actions ────────────────────────────────────────── */
.actions { display: flex; gap: 8px; padding: 18px 26px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.actions button, .actions a {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font); font-size: 13px;
  font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.actions button:hover, .actions a:hover { color: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 86, 214, 0.08); }
.actions button:focus-visible, .actions a:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(36, 86, 214, 0.16); }
.actions svg { width: 15px; height: 15px; }

/* ── skeleton ───────────────────────────────────────── */
.skeleton { margin-top: 28px; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-md); }
.skeleton .sk-head { padding: 26px; display: flex; gap: 22px; align-items: center; }
.sk-bar { background: linear-gradient(90deg, var(--surface-2) 25%, #e9edf4 50%, var(--surface-2) 75%); background-size: 200% 100%; border-radius: 8px; animation: shimmer 1.3s linear infinite; }
.sk-score { width: 92px; height: 62px; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sk-line { height: 13px; }
.sk-line.short { width: 55%; }
.sk-row { height: 44px; border-top: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── methodology + footer ───────────────────────────── */
.method { text-align: center; color: var(--muted); font-size: 13px; margin-top: 38px; line-height: 1.7; max-width: 52ch; margin-inline: auto; }
.method strong { color: var(--ink); font-weight: 600; }
.api-cta {
  display: block; width: fit-content; margin: 22px auto 0;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.1px;
  color: var(--brand-strong); background: var(--brand-tint);
  border: 1px solid var(--border-strong); text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.api-cta:hover { background: #dfe8ff; border-color: var(--brand); transform: translateY(-1px); }
footer.site { text-align: center; color: var(--dim); font-size: 12px; margin-top: 14px; line-height: 1.7; max-width: 54ch; margin-inline: auto; }
footer.site a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer.site a:hover { color: var(--brand); }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 520px) {
  form.scan { flex-direction: column; }
  form.scan button { padding: 14px; }
  .score { font-size: 60px; }
  .finding, .explanation, .actions, .result .head { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .meter .fill { transition: none; }
}
