/* ORBIQ design system
   ─────────────────────────────────────────────────────────────────────────
   Display: Urbanist (weight contrast is the voice: 200 + 700 in one line)
   UI/data: Inter with tabular numerals
   Customer surfaces: grain gradient field + glass controls + white content
   Installer surfaces: warm off-white canvas, hairlines, ink, one accent
*/

:root {
  /* Brand hue drives the customer gradient; tenants recolour via --h. */
  --h: 132;
  --field-0: hsl(var(--h) 72% 7%);
  --field-1: hsl(var(--h) 70% 16%);
  --field-2: hsl(var(--h) 66% 33%);
  --field-3: hsl(calc(var(--h) - 38) 72% 46%);
  --field-4: hsl(calc(var(--h) - 62) 78% 56%);
  --accent: hsl(calc(var(--h) - 52) 80% 58%);      /* lime highlight */
  --accent-ink: hsl(var(--h) 70% 16%);
  --brand-deep: hsl(var(--h) 66% 22%);

  --ink: #0b0f0c;
  --ink-2: #4f5751;
  --ink-3: #8b928c;
  --canvas: #f4f4ef;
  --surface: #ffffff;
  --hair: #e6e6df;
  --hair-2: #d7d8d0;

  --ok: #1f9d55;
  --warn: #c27c0e;
  --bad: #d23f31;
  --info: #2f6fde;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 28px;
  --pill: 999px;

  --display: "Urbanist", ui-sans-serif, system-ui, sans-serif;
  --ui: "Inter", ui-sans-serif, -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; }

/* ── Display type ─────────────────────────────────────────────────────── */
.display { font-family: var(--display); font-weight: 200; letter-spacing: -.035em; line-height: 1.02; margin: 0; }
.display b, .display strong { font-weight: 700; }
.eyebrow { font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* ── The orb (brand mark + AI presence) ───────────────────────────────── */
.orb {
  --s: 28px;
  width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 6%, transparent 32%),
    radial-gradient(circle at 70% 75%, var(--field-4), transparent 60%),
    radial-gradient(circle at 40% 40%, var(--field-3), var(--field-2) 55%, var(--field-1) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 6px 18px -6px hsl(var(--h) 70% 30% / .6);
}
.orb.live { animation: breathe 3.2s var(--ease) infinite; }
.orb.thinking { animation: breathe 1.4s var(--ease) infinite, spin 6s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); filter: saturate(1); } 50% { transform: scale(1.08); filter: saturate(1.3) brightness(1.08); } }
@keyframes spin { to { rotate: 360deg; } }

.wordmark { font-family: var(--display); font-weight: 300; font-size: 19px; letter-spacing: -.02em; }
.wordmark b { font-weight: 800; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--pill);
  font-family: var(--ui); font-size: 14px; font-weight: 600; letter-spacing: -.005em;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--hair-2) inset;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ink { background: var(--ink); color: #fff; box-shadow: none; }
.btn.ink:hover { background: #222823; }
.btn.lime { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn .arrow { width: 28px; height: 28px; margin-right: -10px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; }

/* ── Status: dot + label, not pills ───────────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.ok::before { background: var(--ok); }
.status.warn::before { background: var(--warn); }
.status.bad::before { background: var(--bad); }
.status.info::before { background: var(--info); }
.status.live::before { background: var(--accent); box-shadow: 0 0 0 3px hsl(calc(var(--h) - 52) 80% 58% / .25); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px hsl(calc(var(--h) - 52) 80% 58% / 0); } }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #efefe9; color: var(--ink-2); }
.tag.warn { background: #fbf0d9; color: #8a5a06; }
.tag.bad { background: #fbe4e1; color: #a1271b; }
.tag.ok { background: #e2f3e8; color: #17703f; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.input, input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-s);
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  box-shadow: 0 0 0 1px var(--hair-2) inset; transition: box-shadow .15s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 1.5px var(--ink) inset, 0 0 0 4px hsl(calc(var(--h) - 52) 80% 58% / .35); }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }

/* ── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(6, 10, 7, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .2s var(--ease); }
.lightbox img { max-width: min(1100px, 100%); max-height: 82vh; border-radius: 14px; }
.lightbox .cap { color: rgba(255,255,255,.8); margin-top: 10px; text-align: center; font-size: 13px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; opacity: .7; }

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