/* ==========================================================================
   somehow.work Design Tokens
   Reference Implementation: Aushadh
   ========================================================================== */

/* Typography: Self-hosted Geist & Geist Mono */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Geist-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Geist-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Geist-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/GeistMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/GeistMono-Medium.woff2') format('woff2');
}

:root {
  /* Fonts */
  --font-sans: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Typography 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.625rem;  /* 26px */

  /* 4px Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout */
  --content-max-width: 1000px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;   /* inputs, chips, buttons */
  --radius-lg: 12px;  /* cards, notice, tables */
  --radius-full: 9999px;

  /* Brand Accent (shared across somehow.work apps) */
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-accent-tint: rgba(59, 130, 246, 0.1);
  --color-focus-ring: rgba(59, 130, 246, 0.35);

  /* Light Theme (Default) */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-subtle: #edf2f7;
  --color-text: #0f172a;
  --color-text-muted: #64748b; /* WCAG AA: 4.6:1 on #fff */

  /* Notice / Warning Tokens (Muted Amber) */
  --color-notice-bg: #fffbeb;
  --color-notice-border: #fde68a;
  --color-notice-text: #92400e;
  --color-notice-lead: #78350f;

  /* Demo Notice Tokens (Muted Slate / Info) */
  --color-notice-demo-bg: #f1f5f9;
  --color-notice-demo-border: #cbd5e1;
  --color-notice-demo-text: #334155;

  /* Table Tokens */
  --color-table-header-bg: #f8fafc;
  --color-table-row-hover: #f8fafc;
  --color-table-border: #e2e8f0;

  /* Status Tokens */
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1120;
    --color-surface: #131c31;
    --color-surface-hover: #1a2744;
    --color-border: #24324f;
    --color-border-subtle: #1c2840;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8; /* WCAG AA: 5.5:1 on #131c31 */

    --color-accent: #3b82f6;
    --color-accent-hover: #60a5fa;
    --color-accent-tint: rgba(59, 130, 246, 0.15);
    --color-focus-ring: rgba(59, 130, 246, 0.45);

    /* Dark Notice Tokens */
    --color-notice-bg: rgba(245, 158, 11, 0.08);
    --color-notice-border: rgba(245, 158, 11, 0.25);
    --color-notice-text: #fbbf24;
    --color-notice-lead: #fde68a;

    --color-notice-demo-bg: rgba(148, 163, 184, 0.08);
    --color-notice-demo-border: rgba(148, 163, 184, 0.2);
    --color-notice-demo-text: #cbd5e1;

    --color-table-header-bg: #0f172a;
    --color-table-row-hover: #1a2744;
    --color-table-border: #24324f;

    --color-error: #f87171;
    --color-error-bg: rgba(239, 68, 68, 0.1);
    --color-error-border: rgba(239, 68, 68, 0.3);
  }
}
