/* Kairo shared foundation: tokens, background glow, buttons, toast. Every page loads this first. */
:root {
  color-scheme: dark;
  --bg: #07070d;
  --bg-2: #0c0c16;
  --bg-3: #12121f;
  --panel: rgba(17, 16, 30, 0.72);
  --panel-solid: #12111f;
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f2ff;
  --muted: #a6a3bd;
  --dim: #716e8a;
  --accent: #ffb547;      /* solar amber */
  --accent-ink: #1d1203;
  --accent-2: #8f7cff;    /* electric violet */
  --accent-3: #3fd6c6;    /* teal */
  --ok: #4be3a0;
  --warn: #ffcf5c;
  --danger: #ff6b81;
  --up: #4be3a0;
  --down: #ff6b81;
  --grad: linear-gradient(120deg, #ffb547 0%, #ff8a5c 45%, #8f7cff 100%);
  --grad-soft: linear-gradient(120deg, rgba(255, 181, 71, 0.16), rgba(143, 124, 255, 0.16));
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
img { max-width: 100%; }
::selection { background: rgba(255, 181, 71, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* Icons from /icons/sprite.svg */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 14px; height: 14px; }
.i.lg { width: 22px; height: 22px; }

/* Background glow: a slow canvas field (js/aurora.js) over soft CSS blobs (fallback when canvas is off). */
.glow-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow-bg::before, .glow-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 26s ease-in-out infinite alternate;
}
.glow-bg::before { width: 60vw; height: 60vw; left: -18vw; top: -26vw; background: radial-gradient(circle, rgba(255, 160, 60, 0.42), transparent 65%); }
.glow-bg::after { width: 55vw; height: 55vw; right: -20vw; top: -10vw; background: radial-gradient(circle, rgba(143, 124, 255, 0.45), transparent 65%); animation-delay: -9s; }
.glow-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.glow-bg .grain {
  position: absolute; inset: -50%; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6vw, 4vw, 0) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .glow-bg::before, .glow-bg::after { animation: none; } }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -0.02em; color: var(--text); }
.brand img { width: 32px; height: 32px; display: block; filter: drop-shadow(0 0 14px rgba(255, 181, 71, 0.28)); }
.brand small { font: 500 12px var(--font); color: var(--muted); letter-spacing: 0; margin-left: -2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none;
  font: 600 14px/1 var(--font); white-space: nowrap; transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -12px rgba(255, 181, 71, 0.7); }
.btn.solid:hover { background: #ffc46b; border-color: #ffc46b; }
.btn.light { background: #fff; border-color: #fff; color: #0b0a14; }
.btn.light:hover { background: #ecebf6; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 129, 0.35); }
.btn.danger:hover { background: rgba(255, 107, 129, 0.1); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 20px);
  max-width: min(92vw, 460px); padding: 11px 18px; border-radius: 14px;
  background: rgba(24, 22, 40, 0.96); border: 1px solid var(--line-2); color: var(--text);
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Small shared bits */
.kbd, kbd { font: 500 11px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.social { display: flex; gap: 8px; }
.social a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); transition: color 0.2s, border-color 0.2s, transform 0.2s; }
.social a:hover { color: var(--accent); border-color: rgba(255, 181, 71, 0.45); transform: translateY(-2px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }

/* Wallet picker (js/wallet.js) */
.wpick { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(4, 4, 10, 0.66); backdrop-filter: blur(6px); animation: wfade 0.18s ease; }
.wpick-box { width: min(400px, 100%); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.wpick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 17px var(--display); }
.wpick-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.wpick-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.wpick-note { margin: 4px 0 14px; color: var(--muted); font-size: 13.5px; }
.wpick-list { display: grid; gap: 8px; }
.wpick-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); text-align: left; font-weight: 600; transition: border-color 0.2s, background 0.2s; }
.wpick-item:hover, .wpick-item:focus-visible { border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.07); }
.wpick-item span { flex: 1; }
.wpick-item img { border-radius: 8px; }
.wpick-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--grad-soft); color: var(--accent); }
.wpick-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 8px 4px 4px; }
.wpick-empty p { margin: 0; font-size: 14px; }
@keyframes wfade { from { opacity: 0; } to { opacity: 1; } }
