/*
 * theme.css — AI Visibility Tracker.
 *
 * Mood: dense, precise analytics, like Plausible's dashboard crossed with
 * Linear's density. Cool paper ground, near-black ink, one burnt-orange
 * "beacon" accent that marks YOUR brand everywhere it appears (chart-1),
 * with competitors in navy, teal, ochre, violet and slate. Figures are set
 * in IBM Plex Mono so columns of percentages line up; headings in Bricolage
 * Grotesque. Dark mode is its own palette: blue-black ground, the beacon
 * lifted to a lighter orange that reads as a fill with dark ink on it.
 */

:root {
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --border: #dde0e6;
  --border-strong: #b3b9c4;
  --ink: #111827;
  --muted: #5b6472;
  --accent: #c2410c;
  --accent-hover: #a8380a;
  --accent-ink: #ffffff;
  --accent-text: #b13b0a;
  --accent-strong: #9a3412;
  --accent-soft: #fdeee6;
  --accent-border: #f3c3a8;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #e3f2e8;
  --success-strong: #166534;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #fbefdc;
  --warning-strong: #92400e;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #fbe5e5;
  --danger-strong: #991b1b;
  --chart-1: #c2410c;
  --chart-2: #1e3a8a;
  --chart-3: #0f766e;
  --chart-4: #a16207;
  --chart-5: #7c3aed;
  --chart-6: #64748b;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.025em;
  --eyebrow-tracking: 0.06em;

  --radius-btn: 0.5rem;
  --radius-card: 0.875rem;
  --radius-input: 0.5rem;
  --card-pad: 1.25rem;
  --btn-weight: 600;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-btn: none;
}

html[data-theme="dark"] {
  --canvas: #0e1117;
  --surface: #161a22;
  --surface-2: #1e2430;
  --border: #2a313d;
  --border-strong: #444d5c;
  --ink: #eef1f5;
  --muted: #9aa3b2;
  --accent: #fb923c;
  --accent-hover: #fdba74;
  --accent-ink: #1a0d05;
  --accent-text: #fdba74;
  --accent-strong: #fed7aa;
  --accent-soft: #3a1f10;
  --accent-border: #7c3a16;
  --success: #22c55e;
  --success-ink: #052e14;
  --success-soft: #10291a;
  --success-strong: #86efac;
  --warning: #f59e0b;
  --warning-ink: #1f1300;
  --warning-soft: #2e2210;
  --warning-strong: #fcd34d;
  --danger: #ef4444;
  --danger-ink: #1f0505;
  --danger-soft: #3a1416;
  --danger-strong: #fca5a5;
  --chart-1: #fb923c;
  --chart-2: #93c5fd;
  --chart-3: #5eead4;
  --chart-4: #fcd34d;
  --chart-5: #c4b5fd;
  --chart-6: #94a3b8;
}

/*
 * app.css — AI Visibility Tracker's own pieces: the brand mark, the bar's
 * links, the big mono figures, the share-of-voice bars, the heat cells of
 * the prompt grid, the live dot and the highlighted answer text.
 *
 * The ONE moment that moves: share-of-voice bars grow from their left edge
 * when a leaderboard renders. Everything rests visible; nothing moves under
 * html.reduced-motion.
 */

.app-ground { font-family: var(--font-body); }

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.1;
}

.figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.brand-glyph {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.auth-ground {
  background:
    radial-gradient(48rem 28rem at 12% -8%, var(--accent-soft), transparent 62%),
    var(--canvas);
}

/* ---- The bar's links ---- */
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 150ms, color 150ms;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* ---- Key figures ---- */
.kpi-figure {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 64rem) { .kpi-figure { font-size: 2.75rem; } }

/* ---- Share of voice ---- */
.sov {
  height: 0.5rem;
  min-width: 6rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.sov-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--x-bar, var(--chart-1));
  transform-origin: left center;
  animation: sov-grow 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sov-bar.b1 { --x-bar: var(--chart-1); }
.sov-bar.b2 { --x-bar: var(--chart-2); }
.sov-bar.b3 { --x-bar: var(--chart-3); }
.sov-bar.b4 { --x-bar: var(--chart-4); }
.sov-bar.b5 { --x-bar: var(--chart-5); }
.sov-bar.b6 { --x-bar: var(--chart-6); }
@keyframes sov-grow { from { transform: scaleX(0.06); } to { transform: none; } }
html.reduced-motion .sov-bar { animation: none; }

/* ---- Heat cells: how often your brand shows up for one prompt on one engine ---- */
.heat {
  display: inline-block;
  min-width: 3.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) var(--x-heat, 0%), var(--surface-2));
}
.heat.is-empty { background: transparent; color: var(--muted); }

/* ---- A brand named in an answer ---- */
.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  font-size: 0.8125rem;
}
.mention-chip .pos { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; }

.prompt-cell { display: block; min-width: 14rem; max-width: 34rem; white-space: normal; }

/* ---- The answer, with mentions marked ---- */
.answer-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
  font-size: 0.9375rem;
}
.answer-text mark {
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 0.25rem;
  padding: 0 0.15rem;
  box-shadow: inset 0 -2px 0 var(--border-strong);
}
.answer-text mark.is-you {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 -2px 0 var(--accent-border);
  font-weight: 600;
}

/* ---- Live work ---- */
.live-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
html.reduced-motion .live-dot { animation: none; }

.add-rival > summary { list-style: none; width: fit-content; }
.add-rival > summary::-webkit-details-marker { display: none; }
