/* =========================================================================
   InstaCount — app.css
   Design language: a quiet "live control room". Near-black canvas, one
   electric violet accent, and a monospaced odometer counter as the hero.
   Tailwind (Play CDN) handles utilities; this file owns tokens + signature.
   ========================================================================= */

:root {
  --accent: #6d5ef7;
  --accent-2: #ff6b6b;          /* the "live" pulse only */
  --bg: #0a0b10;
  --bg-elev: #12131b;
  --card: #14151f;
  --card-2: #181a26;
  --border: #232539;
  --text: #f4f5fb;
  --text-dim: #9aa0b5;
  --text-faint: #6a6f86;
  --radius: 20px;
  --shadow: 0 1px 0 0 rgba(255,255,255,.03) inset, 0 24px 60px -24px rgba(0,0,0,.7);
  --ring: 0 0 0 1px var(--border);
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #f3f4f9;
  --border: #e6e8f0;
  --text: #14151f;
  --text-dim: #565b73;
  --text-faint: #8b90a6;
  --shadow: 0 1px 2px rgba(16,18,40,.04), 0 24px 50px -28px rgba(16,18,40,.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -.02em; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

a { color: inherit; }

/* ---- Surfaces ---------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.soft {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; border-radius: 14px; padding: .8rem 1.3rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .08s ease, filter .15s ease, background .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff 8%), var(--accent));
  color: #fff; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--card-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: color-mix(in srgb, var(--card-2) 80%, var(--accent) 8%); }

/* ---- Inputs ------------------------------------------------------------ */
.field {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  border-radius: 14px; padding: .9rem 1rem; width: 100%; font-size: 1rem; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---- Live badge -------------------------------------------------------- */
.live-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- THE SIGNATURE: live odometer counter ----------------------------- */
.counter {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
}
.counter-hero {
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 55%, var(--accent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 22%, transparent);
}
.tick { animation: tickflash .4s ease; }
@keyframes tickflash {
  0% { color: var(--accent); transform: translateY(-2px); }
  100% { color: inherit; transform: none; }
}

/* ---- Stat tiles -------------------------------------------------------- */
.stat { padding: 1.1rem 1.2rem; }
.stat .num { font-size: 1.8rem; }
.stat .label { color: var(--text-dim); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---- Misc -------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 999px;
  font-size: .85rem; color: var(--text-dim); text-decoration: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.ad-slot { margin: 1rem 0; text-align: center; }
.muted { color: var(--text-dim); }
.divider { height: 1px; background: var(--border); border: 0; }

.avatar-fallback {
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #ff6b6b));
  font-family: 'Space Grotesk', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .live-dot, .tick { animation: none; }
  html { scroll-behavior: auto; }
}

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
