/* Sumanth Design System: drop-in tokens + base components.
   Source: "Presentations.AI Redesign" artifact (claude.ai/artifact/W5qtcQj3JLqB2FwDTqFPj8).
   Colors are space-separated RGB channels so alpha works: rgb(var(--line) / .7) */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --brand-50: 236 235 255;  --brand-100: 220 217 255;
  --brand-500: 53 102 254;  --brand-600: 52 39 255;  --brand-700: 42 31 214;
  --brand-fg: 52 39 255;
  --cream: 254 247 239;  --canvas: 248 248 251;  --surface: 255 255 255;
  --sunken: 243 243 247; --line: 228 228 236;
  --ink: 20 20 31;  --ink-2: 78 78 94;  --ink-3: 108 108 124;  --ink-off: 163 163 176;
  --warn: 180 83 9;   --warn-bg: 254 243 199;
  --good: 21 128 61;  --good-bg: 220 252 231;
  --bad: 185 28 28;   --bad-bg: 254 226 226;
  --scrim: 16 12 60;
  --series-1: #3427ff; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;

  --r-control: 6px; --r-card: 12px; --r-dialog: 16px; --r-pill: 9999px;
  --sh-hairline: 0 1px 2px rgb(16 12 60 / .06);
  --sh-menu: 0 1px 2px rgb(16 12 60 / .06), 0 8px 24px -6px rgb(16 12 60 / .16);
  --sh-dialog: 0 2px 6px rgb(16 12 60 / .08), 0 24px 64px -12px rgb(16 12 60 / .28);
  --sh-btn: 0 1px 0 rgb(255 255 255 / .15) inset, 0 1px 2px rgb(16 12 60 / .2);
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand-50: 30 27 75;  --brand-100: 45 40 110;
  --brand-500: 110 140 255;  --brand-600: 99 88 255;  --brand-700: 82 70 240;
  --brand-fg: 150 165 255;
  --cream: 26 24 36;  --canvas: 12 12 20;  --surface: 20 20 30;
  --sunken: 27 27 40; --line: 44 44 62;
  --ink: 240 240 247;  --ink-2: 190 190 205;  --ink-3: 150 150 168;  --ink-off: 95 95 112;
  --warn: 251 191 36;  --warn-bg: 50 38 10;
  --good: 74 222 128;  --good-bg: 15 45 28;
  --bad: 248 113 113;  --bad-bg: 60 18 18;
  --scrim: 0 0 0;
  --series-1: #6358ff; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-50: 30 27 75;  --brand-100: 45 40 110;
    --brand-500: 110 140 255;  --brand-600: 99 88 255;  --brand-700: 82 70 240;
    --brand-fg: 150 165 255;
    --cream: 26 24 36;  --canvas: 12 12 20;  --surface: 20 20 30;
    --sunken: 27 27 40; --line: 44 44 62;
    --ink: 240 240 247;  --ink-2: 190 190 205;  --ink-3: 150 150 168;  --ink-off: 95 95 112;
    --warn: 251 191 36;  --warn-bg: 50 38 10;
    --good: 74 222 128;  --good-bg: 15 45 28;
    --bad: 248 113 113;  --bad-bg: 60 18 18;
    --scrim: 0 0 0;
    --series-1: #6358ff; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: rgb(var(--canvas)); color: rgb(var(--ink));
  font-family: Geist, ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
code, kbd, .mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgb(var(--brand-100)); }
.tabular { font-variant-numeric: tabular-nums; }

/* Type scale */
.t-micro   { font-size: 12px; line-height: 16px; letter-spacing: .01em; }
.t-caption { font-size: 13px; line-height: 18px; }
.t-body    { font-size: 14px; line-height: 20px; }
.t-body-lg { font-size: 16px; line-height: 24px; }
.t-heading { font-size: 18px; line-height: 26px; letter-spacing: -.005em; font-weight: 600; }
.t-title   { font-size: 24px; line-height: 32px; letter-spacing: -.015em; font-weight: 600; }
.t-display { font-size: 32px; line-height: 40px; letter-spacing: -.02em; font-weight: 600; }
.eyebrow   { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgb(var(--ink-3)); }
.ink-2 { color: rgb(var(--ink-2)); } .ink-3 { color: rgb(var(--ink-3)); } .brand-fg { color: rgb(var(--brand-fg)); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-control); border: 1px solid transparent;
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { cursor: not-allowed; background: rgb(var(--sunken)); color: rgb(var(--ink-off)); box-shadow: none; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { height: 44px; padding: 0 20px; }
.btn-primary   { background: rgb(var(--brand-600)); color: #fff; box-shadow: var(--sh-btn); }
.btn-primary:hover { background: rgb(var(--brand-700)); }
.btn-secondary { background: rgb(var(--surface)); color: rgb(var(--ink)); border-color: rgb(var(--line)); }
.btn-secondary:hover { border-color: rgb(var(--ink-3) / .4); background: rgb(var(--sunken)); }
.btn-ghost     { background: transparent; color: rgb(var(--ink-2)); }
.btn-ghost:hover { color: rgb(var(--ink)); background: rgb(var(--sunken)); }
.btn-subtle    { background: rgb(var(--brand-50)); color: rgb(var(--brand-fg)); }
.btn-subtle:hover { background: rgb(var(--brand-100)); }
.btn-danger    { background: rgb(var(--bad)); color: #fff; }
.btn-danger:hover { opacity: .9; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-control); color: rgb(var(--ink-2)); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: rgb(var(--sunken)); color: rgb(var(--ink)); }

/* Input */
.input {
  height: 36px; width: 100%; padding: 0 12px; border-radius: var(--r-control);
  border: 1px solid rgb(var(--line)); background: rgb(var(--canvas)); color: rgb(var(--ink));
  font: inherit; outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: rgb(var(--ink-3)); }
.input:hover { border-color: rgb(var(--ink-3) / .4); }
.input:focus { border-color: rgb(var(--brand-600)); box-shadow: 0 0 0 2px rgb(var(--brand-600) / .2); }
.label { display: block; margin-bottom: 6px; font-size: 13px; line-height: 18px; font-weight: 500; color: rgb(var(--ink-2)); }

/* Surfaces */
.card    { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: var(--r-card); padding: 16px; }
.card-hover { transition: box-shadow .2s var(--ease); } .card-hover:hover { box-shadow: var(--sh-menu); }
.card-sunken { background: rgb(var(--sunken)); border-radius: var(--r-card); padding: 16px; }
.card-cream  { background: rgb(var(--cream)); border-radius: var(--r-card); padding: 24px; position: relative; overflow: hidden; }
.dropzone { display: flex; align-items: center; justify-content: center; min-height: 80px; padding: 16px; border: 1px dashed rgb(var(--line)); border-radius: var(--r-card); background: rgb(var(--canvas)); color: rgb(var(--ink-3)); font-size: 13px; text-align: center; }
.dropzone:hover { border-color: rgb(var(--ink-3) / .5); }
.menu   { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: var(--r-card); padding: 6px; box-shadow: var(--sh-menu); animation: menuIn .16s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-control); font-size: 13px; color: rgb(var(--ink-2)); cursor: pointer; }
.menu-item:hover { background: rgb(var(--sunken)); color: rgb(var(--ink)); }
.scrim  { position: fixed; inset: 0; background: rgb(var(--scrim) / .45); }
.dialog { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: var(--r-dialog); box-shadow: var(--sh-dialog); padding: 20px; }
.tooltip { background: rgb(var(--ink)); color: rgb(var(--canvas)); font-size: 12px; line-height: 16px; font-weight: 500; padding: 4px 8px; border-radius: var(--r-control); box-shadow: var(--sh-menu); }
.toast  { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: var(--r-card); box-shadow: var(--sh-menu); }

/* Badges + small bits */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 12px; line-height: 16px; font-weight: 600; }
.badge-brand { background: rgb(var(--brand-50)); color: rgb(var(--brand-fg)); }
.badge-good  { background: rgb(var(--good-bg)); color: rgb(var(--good)); }
.badge-warn  { background: rgb(var(--warn-bg)); color: rgb(var(--warn)); }
.badge-bad   { background: rgb(var(--bad-bg)); color: rgb(var(--bad)); }
.badge-neutral { background: rgb(var(--sunken)); color: rgb(var(--ink-2)); }
.kbd { font-family: "Geist Mono", monospace; font-size: 12px; padding: 0 6px; border: 1px solid rgb(var(--line)); border-radius: 4px; color: rgb(var(--ink-3)); }
.segmented { display: inline-flex; padding: 2px; background: rgb(var(--sunken)); border-radius: var(--r-control); }
.segmented button { height: 32px; padding: 0 12px; border: 0; background: transparent; border-radius: 5px; font: inherit; font-size: 13px; font-weight: 500; color: rgb(var(--ink-2)); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: rgb(var(--surface)); color: rgb(var(--ink)); box-shadow: 0 1px 2px rgb(16 12 60 / .12); }
.progress { height: 6px; border-radius: var(--r-pill); background: rgb(var(--line)); overflow: hidden; }
.progress > span { display: block; height: 100%; background: rgb(var(--brand-600)); border-radius: inherit; }
.divider { height: 1px; background: rgb(var(--line)); border: 0; }
.brand-gradient { background-image: linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-500))); }
.shimmer { background: linear-gradient(100deg, rgb(var(--sunken)) 30%, rgb(var(--line)), rgb(var(--sunken)) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-control); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(var(--brand-600)); border-top-color: transparent; animation: spin .7s linear infinite; }

/* App shell */
.topbar  { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 24px; border-bottom: 1px solid rgb(var(--line)); background: rgb(var(--surface) / .85); backdrop-filter: blur(8px); }
.sidebar { width: 256px; flex-shrink: 0; padding: 12px; border-right: 1px solid rgb(var(--line)); background: rgb(var(--surface)); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-control); font-size: 14px; color: rgb(var(--ink-2)); text-decoration: none; }
.nav-item:hover { background: rgb(var(--sunken)); }
.nav-item[aria-current="page"] { background: rgb(var(--sunken)); color: rgb(var(--ink)); font-weight: 500; }
@media (max-width: 640px) { .topbar { padding: 0 16px; } }

@keyframes menuIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
