/* ==========================================================================
   Arychi Design System Tokens
   Author: Hachiiro
   Shared token contract for Landing & Console Dashboard (light default / dark)
   Import before page CSS: /static/css/tokens.css?v=20261115-3
   ========================================================================== */

:root {
  /* Typography Families */
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.8125rem;    /* 13px */
  --text-base: 0.875rem;   /* 14px */
  --text-md: 1rem;         /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.375rem;     /* 22px */
  --text-2xl: 1.75rem;     /* 28px */
  --text-3xl: 2.5rem;      /* 40px */

  --leading-tight: 1.25;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* Strict 4px Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  /* Tight Radii */
  --radius-xs: 4px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --trans-fast: 0.15s var(--ease-standard);
  --trans-smooth: 0.22s var(--ease-out);

  /* Transitional Compatibility Aliases (Non-theme) */
  --ease: var(--ease-standard);
  --radius-xl: var(--radius-lg);
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Neutral Surfaces */
  --bg-primary: #111827;
  --bg-secondary: #182234;
  --bg-tertiary: #202e44;
  --bg-elevated: #26354d;
  --bg-hover: #30425c;
  --bg-input: #141d2c;
  --bg-scrim: rgba(10, 10, 10, 0.74);

  /* Text Hierarchy */
  --text-primary: #f4f6fb;
  --text-secondary: #b9c5d8;
  --text-muted: #9aaac2;

  /* Hairlines & Borders */
  --border-subtle: #2b3a51;
  --border-primary: #3b4c65;
  --border-strong: #62738b;

  /* Brand controls */
  --accent: #a8bcff;
  --accent-hover: #c2d0ff;
  --accent-active: #8ca7ff;
  --accent-ink: #101d40;
  --accent-subtle: rgba(127, 158, 255, 0.12);
  --accent-border: rgba(150, 178, 255, 0.4);
  --border-focus: var(--accent);

  /* Semantic Status Tokens */
  --status-success: #75d7a6;
  --status-success-bg: rgba(168, 168, 168, 0.12);
  --status-success-border: rgba(168, 168, 168, 0.30);

  --status-warning: #efc478;
  --status-warning-bg: rgba(185, 185, 185, 0.12);
  --status-warning-border: rgba(185, 185, 185, 0.30);

  --status-error: #ffa1a9;
  --status-error-bg: rgba(141, 141, 141, 0.12);
  --status-error-border: rgba(141, 141, 141, 0.32);
  --status-error-solid: #595959;
  --status-error-ink: #ffffff;

  --status-info: #93c9f5;
  --status-info-bg: rgba(171, 171, 171, 0.12);
  --status-info-border: rgba(171, 171, 171, 0.30);

  /* Restrained Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.44);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.52);

  /* Shared Preview & Scrollbar Surfaces */
  --discord-bubble: #202e44;
  --scrollbar-thumb: #435470;

  /* Transitional Compatibility Aliases (Adopt canonical tokens above) */
  --bg: var(--bg-primary);
  --bg-base: var(--bg-primary);
  --bg-surface: var(--bg-secondary);
  --bg-card: var(--bg-secondary);
  --bg-surface-elevated: var(--bg-elevated);
  --bg-surface-hover: var(--bg-hover);
  --surface: var(--bg-tertiary);
  --surface-hover: var(--bg-hover);
  --line: var(--border-subtle);
  --line-strong: var(--border-strong);
  --border-medium: var(--border-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --dim: var(--text-muted);
  --text-dim: var(--text-muted);
  --ink: var(--accent-ink);
  --blurple: var(--accent);
  --blurple-hover: var(--accent-hover);
  --blurple-active: var(--accent-active);
  --blurple-subtle: var(--accent-subtle);
  --blurple-border: var(--accent-border);
}

/* ==========================================================================
   Light Theme
   ========================================================================== */
:root[data-theme="light"],
[data-theme="light"] {
  color-scheme: light;

  /* Neutral Surfaces */
  --bg-primary: #f5f3ee;
  --bg-secondary: #ffffff;
  --bg-tertiary: #efeee8;
  --bg-elevated: #ffffff;
  --bg-hover: #e9edf6;
  --bg-input: #ffffff;
  --bg-scrim: rgba(19, 19, 19, 0.48);

  /* Text Hierarchy */
  --text-primary: #262623;
  --text-secondary: #62625c;
  --text-muted: #73736b;

  /* Hairlines & Borders */
  --border-subtle: #deddd5;
  --border-primary: #cdd3df;
  --border-strong: #9aa7bd;

  /* Brand controls */
  --accent: #b74c2b;
  --accent-hover: #963c20;
  --accent-active: #7c321b;
  --accent-ink: #ffffff;
  --accent-subtle: rgba(183, 76, 43, 0.08);
  --accent-border: rgba(183, 76, 43, 0.28);
  --border-focus: var(--accent);

  /* Semantic Status Tokens */
  --status-success: #18734e;
  --status-success-bg: rgba(91, 91, 91, 0.09);
  --status-success-border: rgba(91, 91, 91, 0.26);

  --status-warning: #8a590d;
  --status-warning-bg: rgba(95, 95, 95, 0.09);
  --status-warning-border: rgba(95, 95, 95, 0.26);

  --status-error: #bc3549;
  --status-error-bg: rgba(76, 76, 76, 0.09);
  --status-error-border: rgba(76, 76, 76, 0.26);
  --status-error-solid: #4c4c4c;
  --status-error-ink: #ffffff;

  --status-info: #266b9d;
  --status-info-bg: rgba(87, 87, 87, 0.09);
  --status-info-border: rgba(87, 87, 87, 0.26);

  /* Restrained Elevation */
  --shadow-sm: 0 2px 4px rgba(31, 49, 84, 0.04);
  --shadow-md: 0 12px 32px rgba(31, 49, 84, 0.07);
  --shadow-lg: 0 24px 64px rgba(31, 49, 84, 0.12);

  /* Shared Preview & Scrollbar Surfaces */
  --discord-bubble: #eef1f7;
  --scrollbar-thumb: #bec6d5;

  /* Transitional Compatibility Aliases */
  --bg: var(--bg-primary);
  --bg-base: var(--bg-primary);
  --bg-surface: var(--bg-secondary);
  --bg-card: var(--bg-secondary);
  --bg-surface-elevated: var(--bg-elevated);
  --bg-surface-hover: var(--bg-hover);
  --surface: var(--bg-tertiary);
  --surface-hover: var(--bg-hover);
  --line: var(--border-subtle);
  --line-strong: var(--border-strong);
  --border-medium: var(--border-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --dim: var(--text-muted);
  --text-dim: var(--text-muted);
  --ink: var(--accent-ink);
  --blurple: var(--accent);
  --blurple-hover: var(--accent-hover);
  --blurple-active: var(--accent-active);
  --blurple-subtle: var(--accent-subtle);
  --blurple-border: var(--accent-border);
}

/* ==========================================================================
   Shared Accessibility & Numeric Utilities
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}
