/* Narvi design tokens — vendored from narvi/client/app.css.
 *
 * Per narvi/docs/auto/stack.md §Default Frontend. When narvi ships the
 * planned shared CSS pack (stack.md §Planned), replace this file with
 * a vendor reference. Until then, keep this in lockstep with narvi's
 * :root block when narvi updates its tokens.
 */

:root {
  /* Surface elevation palette (warm-neutral dark base) */
  --bg-base:           #15161c;
  --bg-gradient-peak:  #1a1b22;
  --bg-surface:        #1c1d24;
  --bg-surface-2:      #232530;
  --bg-elevated:       #2a2c38;

  /* Border tokens */
  --border-subtle:  #272830;
  --border-default: #32333e;

  /* Foreground tokens */
  --fg-primary:   #e0e1e8;
  --fg-secondary: #9fa0ad;
  --fg-muted:     #6b6c7a;

  /* Interaction tokens */
  --bg-hover: var(--bg-elevated);

  /* Color: grayscale (legacy aliases for backward compat) */
  --color-bg:        var(--bg-base);
  --color-surface:   var(--bg-surface);
  --color-border:    var(--border-default);
  --color-muted:     var(--fg-muted);
  --color-fg-dim:    var(--fg-secondary);
  --color-fg:        var(--fg-primary);
  --color-fg-strong: #f2f3fa;

  /* Color: accent (links, focus rings, active-phase bar, in-progress dot) */
  --accent:            #5b8def;
  --color-accent:      #5b8cff;
  --color-accent-dim:  #3a6ee0;
  --color-link:        var(--color-accent);

  /* Color: warning */
  --color-warning: #e0a050;

  /* Color: error/danger */
  --color-error:         #e05a5a;
  --color-error-dim:     #c04040;
  --color-error-surface: #fef2f2;
  --color-error-fg:      #990000;

  /* Color: status badges (desaturated) */
  --color-status-open:        #5a7a9e;
  --color-status-in-progress: #5e8a62;
  --color-status-notable:     #7a6e9a;
  --color-status-blocked:     #8a6a3e;
  --color-status-closed:      #4a4b56;
  --color-status-deferred:    #5a5b68;
  --color-status-deferred-bg: #4a4a4a;

  /* Status dot tokens (vivid; used by status dots, not badges) */
  --status-in-progress: #5b8def;
  --status-open:        #4ade80;
  --status-warn:        #f5a524;
  --status-blocked:     #ef4444;

  /* Narrative event glyph colors */
  --color-narrative-added:   #5cc8b5;
  --color-narrative-changed: #5b8cff;
  --color-narrative-fixed:   #a070e0;
  --color-narrative-blocked: #e05a5a;

  /* Contrast text (for colored/elevated surfaces) */
  --color-white:      #fff;
  --color-on-accent:  #111;

  /* Error severity: critical level for error backgrounds */
  --color-error-critical: #b91c1c;

  /* Color: data viz (sparklines, charts) */
  --color-chart-secondary: #fbbf24;

  /* Type scale */
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-lg:   18px;
  --text-xl:   22px;

  /* Semantic type scale */
  --text-title:       28px;
  --text-section:     17px;
  --text-subsection:  14px;
  --text-body:        14px;
  --text-meta:        12px;

  /* Font families */
  --font-sans: "Geist", "Inter Tight", "General Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Spacing: 4px multiples — canonical scale: 4 8 12 16 24 32 48 64 */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;

  /* Visualization palette (map tiles, dungeon overlays, quest graph). Kept
   * separate from the semantic palette above because these encode domain
   * meaning (chest, stairs, wall) rather than UI status. */
  --viz-bg:                 #0a0a0a;
  --viz-wall:               #555;
  --viz-edge:               #555;
  --viz-label:              #ccc;
  --viz-swatch-border:      #666;
  --viz-chest:              #f1c40f;
  --viz-stairs:             #2ecc71;
  --viz-damage:             #e67e22;
  --viz-blocker:            #e74c3c;
  --viz-path:               #e74c3c;
  --viz-marker:             #e67e22;
  --viz-tile-passable:      #2a6496;
  --viz-tile-impassable:    #555;
  --viz-quest-discovered:   #5d8aa8;
  --viz-quest-active:       #f1c40f;
  --viz-quest-completed:    #27ae60;
  --viz-quest-failed:       #e74c3c;
}

.hidden { display: none !important; }
.inline-form { display: inline; }

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg-primary);
  font-family: var(--font-sans);
}
