/* Capacity Over Currency — The Chasm brand kit.
   Typefaces: TC Volume (display serif) + TC Volume Sans (interface), self-hosted.
   Palette: bone #dfd7cc · sand #a6998b · forest #5b5449 · walnut #382518 · cave #21221c · black #161615 */

@font-face {
  font-family: 'TC Volume';
  src: url('/assets/fonts/TCVolume-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TC Volume';
  src: url('/assets/fonts/TCVolume-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'TC Volume Sans';
  src: url('/assets/fonts/TCVolumeSans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── brand swatches ───────────────────────────────────────────── */
  --brand-bone: #dfd7cc;
  --brand-sand: #a6998b;
  --brand-forest: #5b5449;
  --brand-walnut: #382518;
  --brand-cave: #21221c;
  --brand-black: #161615;

  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: #dfd7cc;
  --foreground: #21221c;
  --card: #e8e2d9;
  --card-foreground: #21221c;
  --popover: #ece7e0;
  --popover-foreground: #21221c;
  --primary: #382518;
  --primary-foreground: #dfd7cc;
  --secondary: #d2c8bb;
  --secondary-foreground: #21221c;
  --muted: #d5ccc0;
  --muted-foreground: #645a4e;
  --accent: #d5ccc0;
  --accent-foreground: #21221c;
  --destructive: oklch(0.44 0.1 32);
  --destructive-foreground: #dfd7cc;
  --border: #bfb3a5;
  --input: #b3a698;
  --ring: #382518;
  --success: oklch(0.44 0.05 125);
  --warning: oklch(0.55 0.09 70);
  --chart-1: #382518;
  --chart-2: #a6998b;
  --chart-3: #5b5449;
  --chart-4: oklch(0.5 0.04 115);
  --chart-5: #8a7766;
  --sidebar: #d8d0c4;
  --sidebar-foreground: #21221c;
  --sidebar-primary: #382518;
  --sidebar-primary-foreground: #dfd7cc;
  --sidebar-accent: #d2c8bb;
  --sidebar-accent-foreground: #21221c;
  --sidebar-border: #bfb3a5;
  --sidebar-ring: #382518;

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #d5ccc0;
  --surface-hover:   color-mix(in srgb, var(--brand-walnut) 6%,  var(--card));
  --surface-active:  color-mix(in srgb, var(--brand-walnut) 11%, var(--card));
  --surface-elevated: #efebe5;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: #cfc5b8;
  --border-muted: #c7bcae;
  --border-strong: #a6998b;

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: #5b5449;

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 86%, var(--brand-black));
  --primary-muted: color-mix(in srgb, var(--primary) 16%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 9%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 5%,  var(--background));

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: rgb(56 37 24 / 0.3);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.44 0.1 32);
  --error-foreground: #dfd7cc;

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 0.125rem;
  --radius-none: 0rem;
  --radius-sm: 0.0625rem;
  --radius-lg: 0.125rem;
  --radius-xl: 0.1875rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: 'TC Volume', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'TC Volume Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'TC Volume Sans', ui-sans-serif, system-ui, sans-serif;
  --font-weight-display: 400;
  --line-height-display: 1.05;
  --tracking-display: 0em;
  --font-weight-body: 400;
  --line-height-body: 1.55;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows (brand: none — kept as hairline outlines) ────────── */
  --shadow-sm: 0 0 0 1px rgb(166 153 139 / 0.5);
  --shadow-md: 0 0 0 1px rgb(166 153 139 / 0.8);
  --shadow-lg: 0 0 0 1px #a6998b;

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 320ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

.dark {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: #161615;
  --foreground: #dfd7cc;
  --card: #1d1e19;
  --card-foreground: #dfd7cc;
  --popover: #24251f;
  --popover-foreground: #dfd7cc;
  --primary: #dfd7cc;
  --primary-foreground: #21221c;
  --secondary: #2c2c26;
  --secondary-foreground: #dfd7cc;
  --muted: #26261f;
  --muted-foreground: #988b7c;
  --accent: #2a2a24;
  --accent-foreground: #dfd7cc;
  --destructive: oklch(0.64 0.11 32);
  --destructive-foreground: #161615;
  --border: rgb(223 215 204 / 0.14);
  --input: rgb(223 215 204 / 0.2);
  --ring: #dfd7cc;
  --success: oklch(0.68 0.06 125);
  --warning: oklch(0.74 0.09 75);
  --chart-1: #dfd7cc;
  --chart-2: #a6998b;
  --chart-3: #7b7266;
  --chart-4: oklch(0.62 0.05 115);
  --chart-5: #8a7766;
  --sidebar: #1a1a18;
  --sidebar-foreground: #dfd7cc;
  --sidebar-primary: #dfd7cc;
  --sidebar-primary-foreground: #21221c;
  --sidebar-accent: #26261f;
  --sidebar-accent-foreground: #dfd7cc;
  --sidebar-border: rgb(223 215 204 / 0.14);
  --sidebar-ring: #dfd7cc;

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #1b1b19;
  --surface-hover:   color-mix(in srgb, var(--brand-bone) 6%,  var(--card));
  --surface-active:  color-mix(in srgb, var(--brand-bone) 11%, var(--card));
  --surface-elevated: #2a2a24;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: rgb(223 215 204 / 0.07);
  --border-muted: rgb(223 215 204 / 0.1);
  --border-strong: rgb(223 215 204 / 0.26);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: #b3a798;

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-tint: color-mix(in srgb, var(--primary) 8%, var(--background));

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: rgb(223 215 204 / 0.4);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.64 0.11 32);
  --error-foreground: #161615;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 0 0 1px rgb(223 215 204 / 0.08);
  --shadow-md: 0 0 0 1px rgb(223 215 204 / 0.12);
  --shadow-lg: 0 0 0 1px rgb(223 215 204 / 0.2);
}
