/* ═══════════════════════════════════════════════════════════════════════
   Ares design system — tokens + primitives.
   One accent (Ares red), border-first depth, 4px grid, Inter + JetBrains Mono.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  /* neutrals — near-black with a faint warm/red bias */
  --bg0: #080708;
  --bg1: #0e0d0f;
  --bg2: #151317;
  --bg3: #1c1a1f;
  --line: rgba(255, 245, 245, .08);
  --line2: rgba(255, 245, 245, .14);
  --tx: #f2eff1;
  --tx2: #a49fa6;
  --tx3: #6f6a72;
  --tx4: #4a464e;

  /* the accent — scarce by design */
  --ac: #ff2b44;
  --ac-hover: #ff4459;
  --ac-dim: rgba(255, 43, 68, .12);
  --ac-line: rgba(255, 43, 68, .35);

  /* semantics (separate system from the accent) */
  --ok: #3ecf8e;
  --ok-dim: rgba(62, 207, 142, .12);
  --warn: #e6a93c;
  --warn-dim: rgba(230, 169, 60, .12);
  --danger: #ff6369;
  --danger-dim: rgba(255, 99, 105, .1);
  --info: #6aa9ff;

  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace;

  --r1: 6px; --r2: 8px; --r3: 10px; --r4: 13px;
  --shadow-float: 0 4px 10px rgba(0, 0, 0, .35), 0 16px 44px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg0); color: var(--tx);
  font: 400 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: rgba(255, 43, 68, .28); }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -0.02em; }

/* ── the Ares mark ── */
.mark {
  width: 28px; height: 28px; border-radius: var(--r2); flex: none;
  display: grid; place-items: center; font: 700 12.5px var(--mono); color: #fff;
  background: linear-gradient(150deg, #ff4459, #d81b32);
  box-shadow: 0 0 18px rgba(255, 43, 68, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.brandline { display: flex; align-items: center; gap: 10px; font-weight: 640; letter-spacing: -0.02em; }
.brandline .mark { text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* ── eyebrow / micro labels ── */
.eyebrow {
  font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--tx3);
}
.eyebrow.accent { color: var(--ac); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 36px; border-radius: var(--r2); border: 1px solid var(--line2);
  background: var(--bg2); color: var(--tx); font: 550 13px/1 var(--sans);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .13s, border-color .13s, transform .06s, box-shadow .13s;
}
.btn:hover { background: var(--bg3); border-color: rgba(255, 245, 245, .22); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ac-dim), 0 0 0 1px var(--ac-line); }
.btn.primary {
  background: var(--ac); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 20px rgba(255, 43, 68, .22);
}
.btn.primary:hover { background: var(--ac-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--tx2); }
.btn.ghost:hover { background: var(--bg2); color: var(--tx); }
.btn.danger { color: var(--danger); border-color: rgba(255, 99, 105, .3); background: transparent; }
.btn.danger:hover { background: var(--danger-dim); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r1); }
.btn.lg { height: 44px; padding: 0 24px; font-size: 14px; border-radius: var(--r3); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── inputs ── */
.input, .select, textarea.input {
  width: 100%; background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--r2);
  color: var(--tx); padding: 9px 12px; font: 400 13px/1.4 var(--sans); outline: none;
  transition: border-color .13s, box-shadow .13s;
}
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--ac-line); box-shadow: 0 0 0 3px var(--ac-dim);
}
.input::placeholder { color: var(--tx4); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236f6a72' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font: 550 12px/1 var(--sans); color: var(--tx2); }
.field .hint { font-size: 11.5px; color: var(--tx3); }

/* ── cards / surfaces ── */
.card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r4); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 14px; margin-bottom: 4px; }
.card .sub { color: var(--tx3); font-size: 12.5px; margin-bottom: 16px; }

/* ── stat tiles ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3); padding: 14px 16px; }
.stat .k { font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); }
.stat .v { font: 640 22px/1.2 var(--sans); letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11.5px; color: var(--tx3); margin-top: 2px; }
.stat .v .unit { font-size: 13px; color: var(--tx3); font-weight: 500; }

/* ── tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx3); padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: rgba(255, 245, 245, .02); }
.table .num { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.table .dim { color: var(--tx3); }

/* ── badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 20px; font: 600 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line2); color: var(--tx2); background: var(--bg2);
}
.badge.owner { color: var(--ac); border-color: var(--ac-line); background: var(--ac-dim); }
.badge.admin { color: var(--warn); border-color: rgba(230, 169, 60, .35); background: var(--warn-dim); }
.badge.ok { color: var(--ok); border-color: rgba(62, 207, 142, .35); background: var(--ok-dim); }
.badge.danger { color: var(--danger); border-color: rgba(255, 99, 105, .35); background: var(--danger-dim); }
.badge.dim { color: var(--tx3); }

/* ── nav pills / tabs ── */
.tabs { display: flex; gap: 2px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r2); padding: 2px; width: max-content; }
.tabs button {
  border: 0; background: transparent; color: var(--tx2); font: 550 12px/1 var(--sans);
  padding: 7px 12px; border-radius: var(--r1); cursor: pointer; transition: all .12s;
}
.tabs button:hover { color: var(--tx); }
.tabs button.on { background: var(--bg3); color: var(--tx); box-shadow: inset 0 0 0 1px var(--line2); }

/* ── toast ── */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r3);
  padding: 11px 16px; font-size: 13px; max-width: 380px; box-shadow: var(--shadow-float);
  animation: toast-in .18s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.ok { border-color: rgba(62, 207, 142, .4); }
.toast.err { border-color: rgba(255, 99, 105, .4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── modal ── */
.modal-veil {
  position: fixed; inset: 0; background: rgba(5, 4, 6, .72); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200; animation: veil-in .15s ease;
}
@keyframes veil-in { from { opacity: 0; } }
.modal {
  width: min(460px, calc(100vw - 32px)); background: var(--bg1); border: 1px solid var(--line2);
  border-radius: var(--r4); padding: 24px; box-shadow: var(--shadow-float);
  animation: modal-in .18s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal h3 { font-size: 15px; margin-bottom: 4px; }
.modal .sub { color: var(--tx3); font-size: 12.5px; margin-bottom: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── code blocks ── */
.code {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3);
  padding: 14px 16px; font: 400 12px/1.7 var(--mono); overflow-x: auto; color: var(--tx2);
  position: relative;
}
.code .c-k { color: #ff7d8e; } /* keys / flags */
.code .c-s { color: #9ece8c; } /* strings */
.code .c-c { color: var(--tx4); } /* comments */
code.inline { font: 500 12px var(--mono); background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 1.5px 6px; color: var(--tx2); white-space: nowrap; }

/* ── skeleton / empty states ── */
.skeleton { border-radius: var(--r1); background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 48px 24px; color: var(--tx3); }
.empty .glyph { font-size: 26px; margin-bottom: 10px; opacity: .5; }
.empty b { display: block; color: var(--tx2); font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 360px; margin: 0 auto 16px; }

/* ── misc ── */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--tx3); }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }
.kbd { font: 550 10.5px var(--mono); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--tx2); background: var(--bg2); }

/* meters */
.meter { height: 6px; border-radius: 4px; background: var(--bg3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--ac); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.meter.ok > i { background: var(--ok); }
.meter.warn > i { background: var(--warn); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 6px; border: 2px solid var(--bg0); }
::-webkit-scrollbar-thumb:hover { background: var(--tx4); }
::-webkit-scrollbar-track { background: transparent; }

/* reveal-on-scroll (marketing) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.16,.84,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
