/* Own Your Exit design tokens.
   The only file in the codebase allowed to contain raw colour values
   (scripts/check_templates.py enforces this). Every component reads semantic
   tokens, so both themes and every future brand variation come from here. */

:root {
  /* Raw palette: ink, stone, ivory, champagne gold, signal colours. */
  --ink-1000: #060708;
  --ink-950: #0a0b0d;
  --ink-900: #0f1114;
  --ink-850: #14171b;
  --ink-800: #1a1e23;
  --ink-750: #20252b;
  --ink-700: #2a3038;
  --ink-600: #3a414b;
  --stone-500: #6b717b;
  --stone-400: #8b919a;
  --stone-300: #a9aeb5;
  --stone-200: #c9ccd1;
  --ivory-200: #e8e3d8;
  --ivory-150: #efeae0;
  --ivory-100: #f5f2eb;
  --ivory-50: #faf8f4;
  --paper: #ffffff;

  --gold-700: #8a6c34;
  --gold-600: #a8874a;
  --gold-500: #c5a467;
  --gold-400: #d6bb85;
  --gold-300: #e5d2a9;
  --gold-200: #f1e6cd;

  --emerald-600: #2f8a64;
  --emerald-400: #5cc497;
  --amber-600: #b7791f;
  --amber-400: #e2a948;
  --crimson-600: #b2463f;
  --crimson-400: #e2766d;
  --steel-600: #4a6d94;
  --steel-400: #86a8cf;

  /* Contract review paper: a white page and solid highlight tints in both themes. */
  --cr-paper: #ffffff;
  --cr-ink: #1a1a1a;
  --cr-ink-soft: #44403c;
  --cr-rule: #d6d3d1;
  --cr-line: rgb(0 0 0 / 0.08);
  --cr-line-strong: rgb(0 0 0 / 0.18);
  --cr-crit: #fca5a5;
  --cr-high: #fdba74;
  --cr-mid: #fde68a;
  --cr-low: #bbf7d0;
  --cr-crit-line: #f87171;
  --cr-mid-line: #facc15;
  --cr-low-line: #86efac;
  --cr-crit-tint: #fef2f2;
  --cr-mid-tint: #fefce8;
  --cr-low-tint: #f0fdf4;
  --cr-dot-crit: #dc2626;
  --cr-dot-high: #f97316;
  --cr-dot-mid: #eab308;
  --cr-dot-low: #16a34a;
  --cr-spectrum-mid: #84cc16;
  --cr-done: #15803d;
  /* Negotiations: the snuck-in signal and who sent each version. */
  --ng-snuck: #ff6b00;
  --ng-snuck-soft: rgb(255 107 0 / 0.16);
  --ng-src-buyer: #dc2626;
  --ng-src-seller: #16a34a;
  --ng-src-attorney: #7c3aed;
  --ng-src-other: #78716c;

  /* Listing volume bands (low red, medium yellow, high orange, extreme green). */
  --band-low: #c8564e;
  --band-medium: #d9b23f;
  --band-high: #df8a3a;
  --band-extreme: #3fa577;

  /* Type */
  --font-display: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3.25rem;
  --text-hero: clamp(3.25rem, 8.2vw, 7.75rem);

  /* Space, radius, motion */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 520ms;
  --dur-reveal: 900ms;

  --backdrop: rgb(6 7 8 / 0.55);
  --sidebar-width: 264px;
  --content-max: 1180px;
}

/* Light ("ivory") theme */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--ivory-50);
  --bg-elevated: var(--paper);
  --bg-sunken: var(--ivory-150);
  --bg-inverse: var(--ink-950);
  --surface: var(--paper);
  --surface-hover: var(--ivory-100);
  --surface-glass: rgb(255 255 255 / 0.72);
  --border: rgb(20 23 27 / 0.09);
  --border-strong: rgb(20 23 27 / 0.18);
  --text: var(--ink-900);
  --text-muted: #555b64;
  --text-faint: #7a808a;
  --text-inverse: var(--ivory-50);
  --accent: var(--gold-700);
  --accent-strong: #6f5527;
  --accent-soft: rgb(197 164 103 / 0.16);
  --accent-line: rgb(168 135 74 / 0.45);
  --on-accent: var(--paper);
  --focus: var(--gold-600);
  --success: var(--emerald-600);
  --success-soft: rgb(47 138 100 / 0.12);
  --warning: var(--amber-600);
  --warning-soft: rgb(183 121 31 / 0.12);
  --danger: var(--crimson-600);
  --danger-soft: rgb(178 70 63 / 0.1);
  --info: var(--steel-600);
  --info-soft: rgb(74 109 148 / 0.1);
  --shadow-lift: 0 1px 1px rgb(15 17 20 / 0.04), 0 8px 24px -12px rgb(15 17 20 / 0.18);
  --shadow-float: 0 24px 64px -24px rgb(15 17 20 / 0.35);
  --spotlight: rgb(197 164 103 / 0.14);
  --grain-opacity: 0.035;
}

/* Dark ("ink") theme */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--ink-950);
  --bg-elevated: var(--ink-900);
  --bg-sunken: var(--ink-1000);
  --bg-inverse: var(--ivory-50);
  --surface: var(--ink-900);
  --surface-hover: var(--ink-850);
  --surface-glass: rgb(15 17 20 / 0.66);
  --border: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.14);
  --text: var(--ivory-100);
  --text-muted: var(--stone-300);
  --text-faint: var(--stone-400);
  --text-inverse: var(--ink-950);
  --accent: var(--gold-400);
  --accent-strong: var(--gold-300);
  --accent-soft: rgb(214 187 133 / 0.12);
  --accent-line: rgb(214 187 133 / 0.4);
  --on-accent: var(--ink-950);
  --focus: var(--gold-400);
  --success: var(--emerald-400);
  --success-soft: rgb(92 196 151 / 0.12);
  --warning: var(--amber-400);
  --warning-soft: rgb(226 169 72 / 0.12);
  --danger: var(--crimson-400);
  --danger-soft: rgb(226 118 109 / 0.12);
  --info: var(--steel-400);
  --info-soft: rgb(134 168 207 / 0.12);
  --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 12px 32px -16px rgb(0 0 0 / 0.7);
  --shadow-float: 0 32px 80px -24px rgb(0 0 0 / 0.8);
  --spotlight: rgb(214 187 133 / 0.1);
  --grain-opacity: 0.055;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--ink-950);
    --bg-elevated: var(--ink-900);
    --bg-sunken: var(--ink-1000);
    --bg-inverse: var(--ivory-50);
    --surface: var(--ink-900);
    --surface-hover: var(--ink-850);
    --surface-glass: rgb(15 17 20 / 0.66);
    --border: rgb(255 255 255 / 0.07);
    --border-strong: rgb(255 255 255 / 0.14);
    --text: var(--ivory-100);
    --text-muted: var(--stone-300);
    --text-faint: var(--stone-400);
    --text-inverse: var(--ink-950);
    --accent: var(--gold-400);
    --accent-strong: var(--gold-300);
    --accent-soft: rgb(214 187 133 / 0.12);
    --accent-line: rgb(214 187 133 / 0.4);
    --on-accent: var(--ink-950);
    --focus: var(--gold-400);
    --success: var(--emerald-400);
    --success-soft: rgb(92 196 151 / 0.12);
    --warning: var(--amber-400);
    --warning-soft: rgb(226 169 72 / 0.12);
    --danger: var(--crimson-400);
    --danger-soft: rgb(226 118 109 / 0.12);
    --info: var(--steel-400);
    --info-soft: rgb(134 168 207 / 0.12);
    --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 12px 32px -16px rgb(0 0 0 / 0.7);
    --shadow-float: 0 32px 80px -24px rgb(0 0 0 / 0.8);
    --spotlight: rgb(214 187 133 / 0.1);
    --grain-opacity: 0.055;
  }
}

/* Surfaces that are always dark regardless of theme (marketing hero, auth panel, sidebar). */
.theme-ink {
  color-scheme: dark;
  color: var(--text);
  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --surface-hover: var(--ink-850);
  --surface-glass: rgb(15 17 20 / 0.6);
  --border: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.14);
  --text: var(--ivory-100);
  --text-muted: var(--stone-300);
  --text-faint: var(--stone-400);
  --accent: var(--gold-400);
  --accent-strong: var(--gold-300);
  --accent-soft: rgb(214 187 133 / 0.12);
  --accent-line: rgb(214 187 133 / 0.4);
  --on-accent: var(--ink-950);
  --focus: var(--gold-400);
  --spotlight: rgb(214 187 133 / 0.12);
  --grain-opacity: 0.06;
  --aurora-1: rgb(197 164 103 / 0.32);
  --aurora-2: rgb(74 109 148 / 0.28);
  --aurora-3: rgb(47 138 100 / 0.16);
  --hairline: linear-gradient(90deg, transparent, rgb(214 187 133 / 0.55), transparent);
  --glow-gold: rgb(214 187 133 / 0.35);
  --net-node: rgb(233 223 200 / 0.75);
  --net-core: rgb(214 187 133 / 1);
  --net-line: rgb(214 187 133 / 0.16);
  --gradient-text: linear-gradient(100deg, var(--ivory-50) 0%, var(--gold-300) 45%, var(--gold-500) 70%, var(--ivory-100) 100%);
}
