/* Meridian — shared design tokens & primitives */
:root {
  --bg: #05070a;
  --bg-2: #090c11;
  --panel: #0c1016;
  --panel-2: #10151d;
  --panel-3: #151b25;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.11);
  --text: #eef1f6;
  --text-2: #b9c1cf;
  --muted: #7d8798;
  --dim: #545d6d;

  --gold: #e2c07d;
  --gold-2: #f3dcaa;
  --gold-ink: #1a1408;
  --gold-glow: rgba(226, 192, 125, 0.18);

  --up: #2fd49c;
  --up-bg: rgba(47, 212, 156, 0.12);
  --down: #ff5d6e;
  --down-bg: rgba(255, 93, 110, 0.12);
  --warn: #f5b447;
  --info: #6fa8ff;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --f-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--f-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }

/* Logo */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.brand-mark { width: 28px; height: 28px; flex: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 10px 30px -10px var(--gold-glow);
}
.btn-gold:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset, 0 14px 40px -10px rgba(226, 192, 125, .45); }
.btn-ghost { background: rgba(255, 255, 255, .03); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Form fields */
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: .01em; }
.field .hint { font-size: 12px; color: var(--muted); }
.input {
  height: 44px; width: 100%; padding: 0 14px; border-radius: var(--r);
  background: var(--panel-2); border: 1px solid var(--line-2); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--dim); }
.input:hover { border-color: rgba(255, 255, 255, .17); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); background: var(--panel-3); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--line-2); color: var(--text-2);
  background: rgba(255, 255, 255, .03);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.live { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); animation: pulse 2s infinite; }
.dot.warn { background: var(--warn); }
.dot.off { background: var(--down); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(47, 212, 156, 0); } }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--r);
  background: rgba(20, 26, 36, .92); backdrop-filter: blur(14px); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 13px; animation: toastIn .35s var(--ease);
}
.toast b { display: block; font-weight: 600; margin-bottom: 2px; }
.toast .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; margin-top: 1px; }
.toast.ok .ic { background: var(--up-bg); color: var(--up); }
.toast.err .ic { background: var(--down-bg); color: var(--down); }
.toast.info .ic { background: rgba(111, 168, 255, .14); color: var(--info); }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
