/* The Chasm brand type: TC Volume (display serif, italic) + TC Volume Sans (body/UI). */
@font-face {
  font-family: "TC Volume";
  src: url("/assets/fonts/TCVolume-Regular.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TC Volume";
  src: url("/assets/fonts/TCVolume-Italic.otf") format("opentype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "TC Volume Sans";
  src: url("/assets/fonts/TCVolumeSans-Regular.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Palette — The Chasm: dust #dfd7cc · sand #a6998b · stone #5b5449 · walnut #382518 · forest #21221c · black #161615.
   Same family as the Capacity Mapper; The Ledger leans walnut where the Mapper leans forest. */
:root {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: #dbd4c9;
  --foreground: #21221c;
  --card: #e5dfd6;
  --card-foreground: #21221c;
  --popover: #e8e3db;
  --popover-foreground: #21221c;
  --primary: #382518;
  --primary-foreground: #ece6dc;
  --secondary: #d0c8bc;
  --secondary-foreground: #21221c;
  --muted: #d3cbbf;
  --muted-foreground: #6f675b;
  --accent: #d2cabe;
  --accent-foreground: #21221c;
  --destructive: #8a3324;
  --destructive-foreground: #ece6dc;
  --border: #a89d8f;
  --input: #8f8578;
  --ring: #5b5449;
  --success: #4f5a3a;
  --warning: #7a5a2a;
  --chart-1: #382518;
  --chart-2: #5b5449;
  --chart-3: #a6998b;
  --chart-4: #21221c;
  --chart-5: #c4baad;
  --sidebar: #d6cfc3;
  --sidebar-foreground: #21221c;
  --sidebar-primary: #382518;
  --sidebar-primary-foreground: #ece6dc;
  --sidebar-accent: #cfc7bb;
  --sidebar-accent-foreground: #21221c;
  --sidebar-border: #a89d8f;
  --sidebar-ring: #5b5449;

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #d4ccc0;
  --surface-hover:   color-mix(in srgb, var(--foreground) 5%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 9%, var(--background));
  --surface-elevated: #ebe6de;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: #cbc2b5;
  --border-muted: #bdb3a6;
  --border-strong: #6f675b;

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

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: #21221c;
  --primary-muted: color-mix(in srgb, var(--primary) 14%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 8%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 4%,  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: #8a3324;
  --error-foreground: #ece6dc;

  /* ── radius: square corners everywhere, like the Mapper ────── */
  --radius: 0rem;
  --radius-none: 0rem;
  --radius-sm: 0rem;
  --radius-lg: 0rem;
  --radius-xl: 0rem;
  --radius-full: 9999px;

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

  /* ── shadows: none — hairlines carry the structure ────────────── */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 10px 30px rgba(33, 34, 28, 0.12);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 360ms;
  --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: #1d1e19;
  --foreground: #e3dcd0;
  --card: #25261f;
  --card-foreground: #e3dcd0;
  --popover: #2a2b24;
  --popover-foreground: #e3dcd0;
  --primary: #dfd7cc;
  --primary-foreground: #21221c;
  --secondary: #2e2f28;
  --secondary-foreground: #e3dcd0;
  --muted: #2b2c25;
  --muted-foreground: #a6998b;
  --accent: #303129;
  --accent-foreground: #e3dcd0;
  --destructive: #c7735f;
  --destructive-foreground: #1d1e19;
  --border: #4a473e;
  --input: #5b5449;
  --ring: #a6998b;
  --success: #a3ad86;
  --warning: #c9a86a;
  --chart-1: #dfd7cc;
  --chart-2: #a6998b;
  --chart-3: #7a7062;
  --chart-4: #b88e6d;
  --chart-5: #4a473e;
  --sidebar: #191a16;
  --sidebar-foreground: #e3dcd0;
  --sidebar-primary: #dfd7cc;
  --sidebar-primary-foreground: #21221c;
  --sidebar-accent: #2b2c25;
  --sidebar-accent-foreground: #e3dcd0;
  --sidebar-border: #4a473e;
  --sidebar-ring: #a6998b;

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #22231d;
  --surface-elevated: #2e2f28;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: #303129;
  --border-muted: #3b3a33;
  --border-strong: #7a7062;

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

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-hover: #ece6dc;
  --primary-tint: color-mix(in srgb, var(--primary) 6%, var(--background));

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

  /* ── error ────────────────────────────────────────────────────── */
  --error: #c7735f;
  --error-foreground: #1d1e19;
}
