@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── shadcn base tokens ── warm paper, ink text, clay accent ──── */
  --background: oklch(0.975 0.008 80);
  --foreground: oklch(0.22 0.015 60);
  --card: oklch(0.99 0.005 85);
  --card-foreground: oklch(0.22 0.015 60);
  --popover: oklch(0.99 0.005 85);
  --popover-foreground: oklch(0.22 0.015 60);
  --primary: oklch(0.48 0.11 40);
  --primary-foreground: oklch(0.985 0.006 85);
  --secondary: oklch(0.935 0.012 80);
  --secondary-foreground: oklch(0.25 0.015 60);
  --muted: oklch(0.945 0.01 80);
  --muted-foreground: oklch(0.46 0.018 65);
  --accent: oklch(0.935 0.014 75);
  --accent-foreground: oklch(0.25 0.015 60);
  --destructive: oklch(0.52 0.19 27);
  --destructive-foreground: oklch(0.985 0.006 85);
  --border: oklch(0.89 0.012 78);
  --input: oklch(0.87 0.012 78);
  --ring: oklch(0.6 0.09 40);
  --success: oklch(0.5 0.1 150);
  --warning: oklch(0.6 0.12 70);
  --warning-text: oklch(0.45 0.1 65);
  --chart-1: oklch(0.55 0.11 40);
  --chart-2: oklch(0.45 0.05 60);
  --chart-3: oklch(0.7 0.07 55);
  --chart-4: oklch(0.6 0.06 150);
  --chart-5: oklch(0.5 0.05 250);
  --sidebar: oklch(0.955 0.01 80);
  --sidebar-foreground: oklch(0.25 0.015 60);
  --sidebar-primary: oklch(0.48 0.11 40);
  --sidebar-primary-foreground: oklch(0.985 0.006 85);
  --sidebar-accent: oklch(0.915 0.014 78);
  --sidebar-accent-foreground: oklch(0.22 0.015 60);
  --sidebar-border: oklch(0.88 0.012 78);
  --sidebar-ring: oklch(0.6 0.09 40);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.955 0.01 80);
  --surface-hover:   color-mix(in srgb, var(--foreground) 5%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 9%, var(--background));
  --surface-elevated: oklch(0.995 0.004 85);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.935 0.01 80);
  --border-muted: oklch(0.91 0.011 79);
  --border-strong: oklch(0.78 0.015 75);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.38 0.016 62);

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, var(--foreground));
  --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) 5%,  var(--background));

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: oklch(0.6 0.09 40 / 0.35);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.52 0.19 27);
  --error-foreground: oklch(0.985 0.006 85);

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 0.375rem;
  --radius-none: 0rem;
  --radius-sm: 0.25rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 400;
  --line-height-display: 1.1;
  --tracking-display: -0.01em;
  --font-weight-body: 400;
  --line-height-body: 1.6;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.05);
  --shadow-md: 0 4px 12px rgba(60, 40, 20, 0.07);
  --shadow-lg: 0 12px 32px rgba(60, 40, 20, 0.1);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 340ms;
  --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 ── warm ink surfaces ──────────────────── */
  --background: oklch(0.19 0.01 60);
  --foreground: oklch(0.95 0.008 80);
  --card: oklch(0.23 0.011 60);
  --card-foreground: oklch(0.95 0.008 80);
  --popover: oklch(0.23 0.011 60);
  --popover-foreground: oklch(0.95 0.008 80);
  --primary: oklch(0.74 0.1 45);
  --primary-foreground: oklch(0.2 0.015 50);
  --secondary: oklch(0.29 0.012 60);
  --secondary-foreground: oklch(0.95 0.008 80);
  --muted: oklch(0.29 0.012 60);
  --muted-foreground: oklch(0.74 0.012 70);
  --accent: oklch(0.29 0.012 60);
  --accent-foreground: oklch(0.95 0.008 80);
  --destructive: oklch(0.68 0.17 25);
  --destructive-foreground: oklch(0.15 0.01 30);
  --border: oklch(1 0 0 / 11%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.7 0.09 45);
  --success: oklch(0.72 0.1 150);
  --warning: oklch(0.78 0.12 75);
  --warning-text: oklch(0.8 0.12 75);
  --chart-1: oklch(0.74 0.1 45);
  --chart-2: oklch(0.62 0.05 60);
  --chart-3: oklch(0.82 0.06 55);
  --chart-4: oklch(0.72 0.07 150);
  --chart-5: oklch(0.68 0.05 250);
  --sidebar: oklch(0.165 0.01 60);
  --sidebar-foreground: oklch(0.93 0.008 80);
  --sidebar-primary: oklch(0.74 0.1 45);
  --sidebar-primary-foreground: oklch(0.2 0.015 50);
  --sidebar-accent: oklch(0.25 0.012 60);
  --sidebar-accent-foreground: oklch(0.95 0.008 80);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.7 0.09 45);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.215 0.01 60);
  --surface-elevated: oklch(0.27 0.012 60);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(1 0 0 / 6%);
  --border-muted: oklch(1 0 0 / 8%);
  --border-strong: oklch(1 0 0 / 22%);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.8 0.01 75);

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

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: oklch(0.7 0.09 45 / 0.45);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.68 0.17 25);
  --error-foreground: oklch(0.15 0.01 30);
}
