/* =========================================================================
   Quin — Colors & Type
   Foundations for the financial Single Source of Truth.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Fonts
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "Copperplate Gothic Std";
  src: url("fonts/Copperplate-Gothic-Std-32-AB.ttf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Copperplate Gothic Std";
  src: url("fonts/Copperplate-Gothic-Std-32-BC.ttf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Jost and JetBrains Mono — self-hosted variable fonts (latin subset) */
@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------------
   2. Colors — shadcn Slate scale + Quin semantic layer
   Source: https://ui.shadcn.com/colors  (Slate)
   ------------------------------------------------------------------------- */

:root {
  /* Slate raw scale — keep these primitive, never use for "background" etc. */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Financial accents — sparing, high-conviction. */
  --emerald-500: #10b981;   /* gains / inflow */
  --emerald-600: #059669;
  --rose-500:    #f43f5e;   /* losses / outflow */
  --rose-600:    #e11d48;
  --amber-500:   #f59e0b;   /* warnings, pending */
  --sky-500:     #0ea5e9;   /* informational */

  /* ---- Semantic — Light theme (default) ---- */
  --bg-canvas:    var(--slate-50);
  --bg-surface:   #ffffff;
  --bg-sunken:    var(--slate-100);
  --bg-inverse:   var(--slate-900);

  --fg-1:         var(--slate-900);   /* primary text */
  --fg-2:         var(--slate-600);   /* secondary text */
  --fg-3:         var(--slate-400);   /* tertiary / hints */
  --fg-on-inverse:#ffffff;

  --border-1:     var(--slate-200);   /* hairlines */
  --border-2:     var(--slate-300);   /* stronger dividers */
  --border-focus: var(--slate-900);

  --accent:       var(--slate-900);   /* primary action */
  --accent-fg:    #ffffff;
  --accent-hover: var(--slate-800);

  --positive:     var(--emerald-600);
  --negative:     var(--rose-600);
  --pending:      var(--amber-500);
  --info:         var(--sky-500);

  /* Shadows — calm, never glowing. */
  --shadow-xs: 0 1px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -8px rgba(15, 23, 42, 0.12), 0 4px 8px -4px rgba(15, 23, 42, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(15,23,42,0.04);

  /* Radii — restrained. Quin feels like a ledger, not a toy. */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Spacing — 4pt baseline */
  --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;
  --space-16: 64px;
  --space-20: 80px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;
}

/* ---- Dark theme — reserved for future development ----
     Not yet wired up. Enable by setting data-theme="dark" on <html>
     and adding a toggle mechanism. Design intentionally when the
     authenticated app is built.

[data-theme="dark"] {
  --bg-canvas:   var(--slate-950);
  --bg-surface:  var(--slate-900);
  --bg-sunken:   #0a1222;
  --bg-inverse:  var(--slate-50);

  --fg-1:        var(--slate-50);
  --fg-2:        var(--slate-400);
  --fg-3:        var(--slate-500);
  --fg-on-inverse: var(--slate-900);

  --border-1:    rgba(226, 232, 240, 0.08);
  --border-2:    rgba(226, 232, 240, 0.14);
  --border-focus: var(--slate-50);

  --accent:      var(--slate-50);
  --accent-fg:   var(--slate-900);
  --accent-hover: var(--slate-200);

  --shadow-xs: 0 1px 0 rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 1px 1px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 32px -8px rgba(0,0,0,0.6), 0 4px 8px -4px rgba(0,0,0,0.4);
}
---- */

/* -------------------------------------------------------------------------
   3. Typography — primitives
   ------------------------------------------------------------------------- */

:root {
  --font-display: "Copperplate Gothic Std", "Trajan Pro", "Optima", "Palatino", serif;
  --font-serif:   "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --font-sans:    "Jost", "Futura", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* tabular-figures helper for monetary values */
  --num: "tnum" 1, "lnum" 1;
}

/* -------------------------------------------------------------------------
   4. Typography — semantic styles
   Use these classes (or @apply equivalents) instead of raw font sizes.
   ------------------------------------------------------------------------- */

.q-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-feature-settings: "liga" 0;
}

.q-eyebrow {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.q-display {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--fg-1);
}

.q-h1 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--fg-1);
}

.q-h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--fg-1);
}

.q-h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}

.q-h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--fg-1);
}

.q-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-1);
}

.q-body-sm {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-2);
}

.q-caption {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fg-2);
  letter-spacing: 0.01em;
}

.q-mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-1);
}

/* The headline numeric — for balances, totals, big-money moments. */
.q-numeric-xl {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  font-feature-settings: var(--num);
  font-variant-numeric: tabular-nums lining-nums;
}

.q-numeric-lg {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-feature-settings: var(--num);
  font-variant-numeric: tabular-nums lining-nums;
}

.q-numeric-md {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  color: var(--fg-1);
  font-feature-settings: var(--num);
  font-variant-numeric: tabular-nums lining-nums;
}

/* -------------------------------------------------------------------------
   5. Base resets — opt-in. Add `.q-scope` to a wrapper to inherit.
   ------------------------------------------------------------------------- */

.q-scope {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.q-scope ::selection {
  background: var(--slate-900);
  color: #ffffff;
}
