/* ── Wing Design Tokens ──────────────────────────────────────────── */

/* Dark theme (default) */
:root,
[data-theme='dark'] {
  --wing-bg: #020617;
  --wing-surface: #0f172a;
  --wing-card: #1e293b;
  --wing-border: #1e3a5f;
  --wing-text: #e2e8f0;
  --wing-muted: #64748b;
  --wing-accent: #3b82f6;
  --wing-danger: #ef4444;
  --wing-warning: #f59e0b;
  --wing-success: #22c55e;
  --wing-glass: rgba(15, 23, 42, 0.92);
  --wing-glass-dense: rgba(15, 23, 42, 0.95);
  --wing-overlay: rgba(2, 6, 23, 0.42);
  --wing-card-alpha: rgba(30, 41, 59, 0.55);
  --wing-subtle: rgba(255, 255, 255, 0.03);
  --wing-select-bg: rgba(14, 234, 255, 0.16);
  --wing-select-border: rgba(14, 234, 255, 0.55);
  --wing-highlight-bg: rgba(245, 158, 11, 0.16);
  --wing-highlight-border: rgba(245, 158, 11, 0.4);

  /* Legacy aliases (backward compatibility) */
  --bg: var(--wing-bg);
  --panel: var(--wing-surface);
  --card: var(--wing-card);
  --border: var(--wing-border);
  --text: var(--wing-text);
  --muted: var(--wing-muted);
  --accent: var(--wing-accent);
  --crit: var(--wing-danger);
  --high: var(--wing-warning);
}

/* Light theme */
[data-theme='light'] {
  --wing-bg: #e2e8f0;
  --wing-surface: #ffffff;
  --wing-card: #f1f5f9;
  --wing-border: #94a3b8;
  --wing-text: #0f172a;
  --wing-muted: #64748b;
  --wing-accent: #2563eb;
  --wing-danger: #dc2626;
  --wing-warning: #d97706;
  --wing-success: #16a34a;
  --wing-glass: rgba(255, 255, 255, 0.92);
  --wing-glass-dense: rgba(255, 255, 255, 0.95);
  --wing-overlay: rgba(0, 0, 0, 0.25);
  --wing-card-alpha: rgba(226, 232, 240, 0.6);
  --wing-subtle: rgba(0, 0, 0, 0.03);
  --wing-select-bg: rgba(14, 182, 210, 0.14);
  --wing-select-border: rgba(14, 182, 210, 0.5);
  --wing-highlight-bg: rgba(217, 119, 6, 0.14);
  --wing-highlight-border: rgba(217, 119, 6, 0.4);

  --bg: var(--wing-bg);
  --panel: var(--wing-surface);
  --card: var(--wing-card);
  --border: var(--wing-border);
  --text: var(--wing-text);
  --muted: var(--wing-muted);
  --accent: var(--wing-accent);
  --crit: var(--wing-danger);
  --high: var(--wing-warning);
}

/* ── Tailwind Theme Mapping ──────────────────────────────────────── */

@theme {
  --color-wing-bg: var(--wing-bg);
  --color-wing-surface: var(--wing-surface);
  --color-wing-card: var(--wing-card);
  --color-wing-border: var(--wing-border);
  --color-wing-text: var(--wing-text);
  --color-wing-muted: var(--wing-muted);
  --color-wing-accent: var(--wing-accent);
  --color-wing-danger: var(--wing-danger);
  --color-wing-warning: var(--wing-warning);
  --color-wing-success: var(--wing-success);
  --color-wing-glass: var(--wing-glass);

  --font-sans: 'Noto Sans KR', sans-serif;
}
