/* =========================================================================
 * MUKESH.OS — base.css
 * Design tokens (light + dark), reset, and shared components.
 * System font stack only: the OS runs fully offline, no CDN assets.
 * ========================================================================= */

:root {
  /* ---- palette · light ---- */
  --canvas: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #EEF0F4;
  --ink: #171B21;
  --muted: #5C6470;
  --line: rgba(23, 27, 33, .09);
  --line-strong: rgba(23, 27, 33, .16);
  --accent: #2456C4;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(36, 86, 196, .09);
  --gold: #C9A227;               /* favorites only */
  --ok: #2E7D4F;
  --danger: #B3402E;
  --scrim: rgba(15, 18, 22, .40);

  --shadow-1: 0 1px 2px rgba(23,27,33,.05), 0 4px 14px -8px rgba(23,27,33,.18);
  --shadow-2: 0 2px 4px rgba(23,27,33,.06), 0 16px 40px -20px rgba(23,27,33,.35);

  /* ---- type ---- */
  --font-ui: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont,
             "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system,
                  BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  /* ---- geometry ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sidebar-w: 232px;
  --sidebar-rail: 64px;
  --topbar-h: 56px;

  --t-fast: 140ms cubic-bezier(.2, .7, .3, 1);
  --t-med: 220ms cubic-bezier(.2, .7, .3, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --canvas: #0F1216;
  --surface: #161B22;
  --surface-2: #1D242E;
  --ink: #E8EBF0;
  --muted: #8B95A3;
  --line: rgba(232, 235, 240, .08);
  --line-strong: rgba(232, 235, 240, .16);
  --accent: #6E96F5;
  --accent-ink: #0F1216;
  --accent-soft: rgba(110, 150, 245, .12);
  --gold: #D9B44A;
  --scrim: rgba(2, 4, 8, .55);
  --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px -8px rgba(0,0,0,.6);
  --shadow-2: 0 2px 4px rgba(0,0,0,.4), 0 16px 40px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-med), color var(--t-med);
}
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- shared: brand mark ---- */
.brand-tile {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7A3CE8));
  color: #fff; font: 600 13px/1 var(--font-display); letter-spacing: .5px;
  box-shadow: var(--shadow-1);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .brand-tile { background: var(--accent); }
}

/* ---- shared: eyebrow label ---- */
.eyebrow {
  font: 600 10.5px var(--font-ui);
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* ---- shared: buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13.5px;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 6px 18px -8px var(--accent); filter: brightness(1.05); }
.btn-primary[disabled] { opacity: .55; cursor: default; box-shadow: none; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

/* ---- shared: icon button ---- */
.icon-btn {
  position: relative;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--canvas);
}

/* ---- shared: inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* ---- shared: kbd hint ---- */
kbd.kbd {
  font: 600 10.5px var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 6px; background: var(--surface);
}

/* ---- shared: version chip ---- */
.ver {
  font: 600 10.5px var(--font-mono);
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 5px; padding: 2px 7px;
}

/* ---- shared: theme toggle ---- */
.theme-toggle svg { transition: transform var(--t-med); }
.theme-toggle:hover svg { transform: rotate(18deg); }

/* ---- shared: scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
