/* Fonts are served from this site: no third-party requests. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/assets/fonts/Inter-400.ttf"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/assets/fonts/Inter-500.ttf"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Inter-600.ttf"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/assets/fonts/Inter-700.ttf"); }
@font-face { font-family: "Inter"; font-weight: 800; font-display: swap; src: url("/assets/fonts/Inter-800.ttf"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-display: swap; src: url("/assets/fonts/PlayfairDisplay-700.ttf"); }

/* ViH design system, shared with ViH Buddhi (used here by ViH Samvad).
   Tokens follow the existing Buddhi product (buddhi.vihresearchlabs.ai and its
   app): violet #7c3aed, the violet->pink accent gradient, the deep-purple
   "night" gradient, Inter for UI and Playfair Display for page titles.       */

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fafafa;
  --surface: #ffffff;
  --sunken: #f6f6f8;
  --line: #ececf0;
  --line-2: #f3f3f6;
  --line-strong: #e0e0e6;

  --ink: #111114;
  --ink-2: #3f3f46;
  --ink-3: #6b6b76;
  --ink-4: #a1a1aa;

  --brand: #7c3aed;
  --brand-700: #6d28d9;
  --brand-800: #5b21b6;
  --brand-400: #a78bfa;
  --brand-300: #c4b5fd;
  --brand-100: #ede9fe;
  --brand-50: #f5f3ff;
  --brand-25: #faf9ff;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --night: linear-gradient(135deg, #1a0b3d 0%, #3b1a7a 100%);

  --red: #dc2626;   --red-bg: #fef2f2;   --red-line: #fecaca;
  --amber: #b45309; --amber-bg: #fffbeb; --amber-line: #fde68a;
  --green: #047857; --green-bg: #ecfdf5; --green-line: #a7f3d0;
  --blue: #1d4ed8;  --blue-bg: #eff6ff;  --blue-line: #bfdbfe;
  --gray: #52525b;  --gray-bg: #f4f4f5;  --gray-line: #e4e4e7;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(17, 17, 20, .05);
  --shadow-sm: 0 1px 2px rgba(17, 17, 20, .04), 0 1px 3px rgba(17, 17, 20, .05);
  --shadow-md: 0 6px 18px -6px rgba(17, 17, 20, .10), 0 2px 4px -2px rgba(17, 17, 20, .05);
  --shadow-lg: 0 28px 56px -20px rgba(17, 17, 20, .22);
  --shadow-brand: 0 12px 30px -10px rgba(124, 58, 237, .45);
  --ring: 0 0 0 3px rgba(124, 58, 237, .20);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-100); color: var(--brand-800); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none;
      stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.xs { width: 13px; height: 13px; stroke-width: 2; }
.ic.lg { width: 22px; height: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease),
              box-shadow .22s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--shadow-xs); }
.btn-primary:hover { background: var(--brand-800); box-shadow: var(--shadow-brand); transform: translateY(-1px); }
.btn-dark { background: #18181b; color: #fff; }
.btn-dark:hover { background: #000; box-shadow: var(--shadow-md); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand-300); color: var(--brand-800); background: var(--brand-25); }
.btn-ghost { background: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 11px; }
.btn .ic { transition: transform .5s var(--ease-out); }
.btn.spinning .ic { animation: spin .9s linear infinite; }

/* ---------- pills & badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  border: 1px solid transparent;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-red    { color: var(--red);   background: var(--red-bg);   border-color: var(--red-line); }
.t-amber  { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.t-green  { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.t-blue   { color: var(--blue);  background: var(--blue-bg);  border-color: var(--blue-line); }
.t-violet { color: var(--brand-800); background: var(--brand-50); border-color: var(--brand-100); }
.t-gray   { color: var(--gray);  background: var(--gray-bg);  border-color: var(--gray-line); }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card.hover { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px;
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder { color: var(--ink-4); }
.input:hover { border-color: #d4d4dc; }
.input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--ring); }

.avatar {
  --h: 262;
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 650; letter-spacing: -.01em;
  color: hsl(var(--h) 55% 38%); background: hsl(var(--h) 85% 95%);
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.stack { display: flex; }
.stack .avatar + .avatar { margin-left: -6px; }
.stack .avatar.sm + .avatar.sm { margin-left: -4px; }

.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px;
       border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
       box-shadow: 0 1px 0 var(--line-strong); }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes flash-bg { 0% { background: var(--brand-50); } 100% { background: transparent; } }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.enter { animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
.skeleton {
  border-radius: 6px; background: linear-gradient(90deg, #f1f1f4 0%, #f8f8fa 50%, #f1f1f4 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex: 0 0 auto;
  animation: pulse-ring 2s var(--ease) infinite;
}
.live-dot.off { background: #f59e0b; animation: none; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.spinner {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--brand-100); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}

/* scroll reveal: elements start hidden and animate in when observed */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--d, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- dark theme (light is the default; the toggle sets data-theme="dark") ---------- */
:root { --pink-bg: #fdf2f8; --pink-ink: #be185d; color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0a14; --surface: #15121f; --sunken: #1b1828;
  --line: #262236; --line-2: #1f1c2d; --line-strong: #342f48;
  --ink: #f5f3fa; --ink-2: #d6d2e3; --ink-3: #a39fb8; --ink-4: #6f6b87;
  --brand: #8b5cf6; --brand-700: #a78bfa; --brand-800: #c4b5fd; --brand-400: #7c3aed; --brand-300: #6d28d9;
  --brand-100: rgba(139, 92, 246, .26); --brand-50: rgba(139, 92, 246, .15); --brand-25: rgba(139, 92, 246, .07);
  --red: #f87171;   --red-bg: rgba(239, 68, 68, .14);    --red-line: rgba(239, 68, 68, .32);
  --amber: #fbbf24; --amber-bg: rgba(245, 158, 11, .14); --amber-line: rgba(245, 158, 11, .32);
  --green: #34d399; --green-bg: rgba(16, 185, 129, .14); --green-line: rgba(16, 185, 129, .32);
  --blue: #60a5fa;  --blue-bg: rgba(59, 130, 246, .14);  --blue-line: rgba(59, 130, 246, .32);
  --gray: #a1a1aa;  --gray-bg: rgba(161, 161, 170, .13); --gray-line: rgba(161, 161, 170, .26);
  --pink-bg: rgba(236, 72, 153, .15); --pink-ink: #f9a8d4;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 56px -20px rgba(0, 0, 0, .8);
  --shadow-brand: 0 12px 30px -10px rgba(139, 92, 246, .55);
  --ring: 0 0 0 3px rgba(139, 92, 246, .32);
}
[data-theme="dark"] .btn-primary:hover { background: #7c3aed; }
[data-theme="dark"] .btn-dark { background: #f5f3fa; color: #15121f; }
[data-theme="dark"] .btn-dark:hover { background: #fff; }
[data-theme="dark"] .input:hover { border-color: #453f5f; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1b1828 0%, #262236 50%, #1b1828 100%); background-size: 200% 100%; }
[data-theme="dark"] .avatar { color: hsl(var(--h) 85% 82%); background: hsl(var(--h) 38% 24%); }
[data-theme="dark"] ::selection { background: rgba(139, 92, 246, .4); color: #fff; }
html.theming, html.theming * { transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease) !important; }

/* the ViH logo has a dark-ink and a light-ink version */
.logo-d { display: none; }
[data-theme="dark"] .logo-l { display: none; }
[data-theme="dark"] .logo-d { display: block; }

.theme-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s, transform .3s var(--spring); }
.theme-btn:hover { color: var(--brand); border-color: var(--brand-300); transform: rotate(-12deg); }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }
