/* ================================================================
   CACHE FLOW CAPITAL — Design Tokens
   colors_and_type.css
   Full CSS variable system: colors, type, spacing, radii, shadows
   Palette: Cache Gold / Cache Silver / Cache Onyx
   Typeface: Montserrat (+ IBM Plex Mono for tabular data)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ----------------------------------------------------------------
   COLOR PRIMITIVES
   ---------------------------------------------------------------- */
:root {
  /* Background layers — Cache Onyx base */
  --bg-base:       #121212;   /* CACHE ONYX */
  --bg-surface-1:  #1A1A1A;
  --bg-surface-2:  #222222;
  --bg-surface-3:  #2C2C2C;

  /* Borders */
  --border-subtle:  #1E1E1E;
  --border-default: #2A2A2A;
  --border-strong:  #3A3A3A;
  --border-accent:  rgba(197, 160, 89, 0.30);

  /* Gold — Primary Accent (Cache Gold) */
  --gold-700:  #6E5A2E;
  --gold-600:  #8C7339;
  --gold-500:  #AB8A48;
  --gold-400:  #C5A059;   /* CACHE GOLD — PRIMARY */
  --gold-300:  #D4B677;
  --gold-200:  #E3CD9E;
  --gold-100:  #F0E2C4;

  /* Silver — Neutral Metal (Cache Silver) */
  --silver-700: #4A4A4A;
  --silver-600: #6B6B6B;
  --silver-500: #888888;
  --silver-400: #A3A3A3;  /* CACHE SILVER — PRIMARY */
  --silver-300: #BFBFBF;
  --silver-200: #D8D8D8;
  --silver-100: #EDEDED;

  /* Green — Positive / Gain */
  --green-700:  #1C5238;
  --green-600:  #277A52;
  --green-500:  #2E8B5E;
  --green-400:  #46B883;
  --green-300:  #6FD3A4;

  /* Red — Negative / Loss */
  --red-700:   #6E1F27;
  --red-600:   #9A2C38;
  --red-500:   #C23B49;
  --red-400:   #E0556A;
  --red-300:   #F0808F;

  /* Text scale — on dark Onyx backgrounds */
  --text-100:    #F2F1EE;  /* Primary text (warm near-white) */
  --text-200:    #C2C2BF;  /* Secondary text */
  --text-300:    #8A8A87;  /* Muted / placeholder (silver) */
  --text-400:    #5C5C59;  /* Disabled */
  --text-inverse: #121212; /* Text on light / metal surfaces */
}

/* ----------------------------------------------------------------
   METALLIC GRADIENTS — brand treatments (use sparingly)
   ---------------------------------------------------------------- */
:root {
  --gradient-gold:   linear-gradient(135deg, #E3CD9E 0%, #C5A059 46%, #8C7339 100%);
  --gradient-silver: linear-gradient(135deg, #D8D8D8 0%, #A3A3A3 46%, #6B6B6B 100%);
  --gradient-onyx:   linear-gradient(160deg, #222222 0%, #161616 60%, #0E0E0E 100%);
}

/* ----------------------------------------------------------------
   SEMANTIC COLOR ALIASES
   ---------------------------------------------------------------- */
:root {
  --color-bg:              var(--bg-base);
  --color-surface:         var(--bg-surface-1);
  --color-surface-raised:  var(--bg-surface-2);
  --color-surface-float:   var(--bg-surface-3);

  --color-border:          var(--border-default);
  --color-border-subtle:   var(--border-subtle);
  --color-border-strong:   var(--border-strong);
  --color-border-accent:   var(--border-accent);

  --color-text:            var(--text-100);
  --color-text-muted:      var(--text-200);
  --color-text-subtle:     var(--text-300);
  --color-text-disabled:   var(--text-400);
  --color-text-inverse:    var(--text-inverse);

  /* Accent system — Gold is the primary interactive/highlight color */
  --color-accent:          var(--gold-400);
  --color-accent-dark:     var(--gold-500);
  --color-accent-dim:      var(--gold-600);
  --color-accent-light:    var(--gold-300);
  --color-accent-glow:     rgba(197, 160, 89, 0.28);

  /* Secondary — Silver as neutral metal accent */
  --color-secondary:       var(--silver-400);
  --color-secondary-dark:  var(--silver-600);
  --color-secondary-light: var(--silver-200);

  /* Premium / featured high-value signal */
  --color-premium:         var(--gold-300);
  --color-premium-dark:    var(--gold-500);
  --color-premium-light:   var(--gold-200);

  /* Status */
  --color-positive:        var(--green-400);
  --color-positive-bg:     rgba(70, 184, 131, 0.12);
  --color-negative:        var(--red-400);
  --color-negative-bg:     rgba(224, 85, 106, 0.12);
  --color-warning:         var(--gold-300);
  --color-warning-bg:      rgba(212, 182, 119, 0.12);
  --color-neutral:         var(--silver-400);
  --color-neutral-bg:      rgba(163, 163, 163, 0.12);
}

/* ----------------------------------------------------------------
   SPACING SCALE  (base unit: 4px)
   ---------------------------------------------------------------- */
:root {
  --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;
  --space-24: 96px;
  --space-32: 128px;
}

/* ----------------------------------------------------------------
   BORDER RADIUS
   ---------------------------------------------------------------- */
:root {
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;
}

/* ----------------------------------------------------------------
   SHADOWS & ELEVATION
   ---------------------------------------------------------------- */
:root {
  --shadow-1: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.5);
  --shadow-4: 0 24px 64px rgba(0,0,0,0.8), 0 8px 24px rgba(0,0,0,0.6);

  --shadow-glow:        0 0 24px rgba(197, 160, 89, 0.28);
  --shadow-glow-strong: 0 0 48px rgba(197, 160, 89, 0.42), 0 0 16px rgba(197, 160, 89, 0.28);
  --shadow-glow-silver: 0 0 24px rgba(163, 163, 163, 0.22);
}

/* ----------------------------------------------------------------
   TRANSITIONS
   ---------------------------------------------------------------- */
:root {
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --ease-inout: cubic-bezier(0.87, 0, 0.13, 1);

  --duration-fast:   150ms;
  --duration-base:   200ms;
  --duration-slow:   350ms;
  --duration-enter:  600ms;
}

/* ----------------------------------------------------------------
   TYPOGRAPHY — Font Families
   Montserrat is the brand typeface. IBM Plex Mono is retained for
   tabular financial data (tickers, prices, metrics).
   ---------------------------------------------------------------- */
:root {
  --font-display: 'Montserrat', 'Helvetica Neue', system-ui, sans-serif;
  --font-body:    'Montserrat', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
}

/* ----------------------------------------------------------------
   TYPOGRAPHY — Size Scale
   ---------------------------------------------------------------- */
:root {
  --text-2xs: 10px;
  --text-xs:  11px;
  --text-sm:  13px;
  --text-base: 15px;
  --text-md:  17px;
  --text-lg:  20px;
  --text-xl:  24px;
  --text-2xl: 32px;
  --text-3xl: 44px;
  --text-4xl: 60px;
  --text-5xl: 80px;
  --text-6xl: 108px;
}

/* ----------------------------------------------------------------
   TYPOGRAPHY — Semantic Text Styles
   Headings: Montserrat SemiBold (600), tracked tight.
   Display / hero subtext: Montserrat Light (300).
   ---------------------------------------------------------------- */

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--color-text);
  text-wrap: balance;
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-wrap: balance;
}

h4, .h4 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--color-text);
}

h5, .h5 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h6, .h6 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
}

/* Light display lead — for hero subtext / taglines (Montserrat Light) */
.display-light {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--color-text-muted);
}

p, .body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.body-lg {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.body-sm {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.label-sm {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.caption {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-subtle);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--color-accent);
  font-weight: 400;
}

/* Financial Data Typography */
.data-xl {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.data-lg {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.data-md {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.data-sm {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.data-positive {
  color: var(--color-positive);
}

.data-negative {
  color: var(--color-negative);
}

/* ----------------------------------------------------------------
   BRAND HELPERS — metallic text fills (background-clip)
   ---------------------------------------------------------------- */
.metal-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.metal-silver {
  background: var(--gradient-silver);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Wordmark — Montserrat SemiBold, tracked wide like the logotype */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------
   BASE RESET / GLOBAL DEFAULTS
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

a:hover {
  color: var(--color-accent-light);
}
