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

:root {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.975 0.008 85);
  --foreground: oklch(0.21 0.012 60);
  --card: oklch(0.985 0.006 85);
  --card-foreground: oklch(0.21 0.012 60);
  --popover: oklch(0.985 0.006 85);
  --popover-foreground: oklch(0.21 0.012 60);
  --primary: oklch(0.46 0.055 205);
  --primary-foreground: oklch(0.985 0.006 85);
  --secondary: oklch(0.94 0.01 85);
  --secondary-foreground: oklch(0.24 0.012 60);
  --muted: oklch(0.945 0.01 85);
  --muted-foreground: oklch(0.45 0.015 70);
  --accent: oklch(0.93 0.012 85);
  --accent-foreground: oklch(0.21 0.012 60);
  --destructive: oklch(0.52 0.17 28);
  --destructive-foreground: oklch(0.985 0.006 85);
  --border: oklch(0.87 0.012 80);
  --input: oklch(0.87 0.012 80);
  --ring: oklch(0.46 0.055 205);
  --success: oklch(0.5 0.1 150);
  --warning: oklch(0.6 0.12 70);
  --chart-1: oklch(0.46 0.055 205);
  --chart-2: oklch(0.6 0.05 205);
  --chart-3: oklch(0.72 0.04 205);
  --chart-4: oklch(0.55 0.04 70);
  --chart-5: oklch(0.35 0.012 60);
  --sidebar: oklch(0.96 0.01 85);
  --sidebar-foreground: oklch(0.21 0.012 60);
  --sidebar-primary: oklch(0.46 0.055 205);
  --sidebar-primary-foreground: oklch(0.985 0.006 85);
  --sidebar-accent: oklch(0.92 0.012 85);
  --sidebar-accent-foreground: oklch(0.21 0.012 60);
  --sidebar-border: oklch(0.87 0.012 80);
  --sidebar-ring: oklch(0.46 0.055 205);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.955 0.01 85);
  --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.99 0.005 85);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.93 0.01 80);
  --border-muted: oklch(0.9 0.012 80);
  --border-strong: oklch(0.72 0.014 75);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.36 0.012 65);

  /* ── 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));
  /* brand colour used as text (labels, links) — lifted in dark mode for contrast */
  --primary-text: var(--primary);

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: oklch(0.46 0.055 205 / 0.35);

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

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

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: "Instrument Serif", "Cormorant Garamond", 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 (brand: no shadows — kept at hairline strength) ─── */
  --shadow-sm: 0 0 0 1px rgba(40, 32, 20, 0.04);
  --shadow-md: 0 0 0 1px rgba(40, 32, 20, 0.06);
  --shadow-lg: 0 0 0 1px rgba(40, 32, 20, 0.08);

  /* ── 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 {
  /* Night palette: the same sage studio after dark.
     bg #0F1714 · surface #1B2420 · raised #273530 · accent #5C8070
     accent text #A8C4B8 · body #EDF4F1 · muted #7A9E8E · border #2F3F3A */

  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.195 0.013 170);
  --foreground: oklch(0.961 0.008 169);
  --card: oklch(0.25 0.015 166);
  --card-foreground: oklch(0.961 0.008 169);
  --popover: oklch(0.315 0.021 171);
  --popover-foreground: oklch(0.961 0.008 169);
  --primary: oklch(0.568 0.048 166);
  --primary-foreground: oklch(0.961 0.008 169);
  --secondary: oklch(0.25 0.015 166);
  --secondary-foreground: oklch(0.961 0.008 169);
  --muted: oklch(0.25 0.015 166);
  --muted-foreground: oklch(0.668 0.046 166);
  --accent: oklch(0.315 0.021 171);
  --accent-foreground: oklch(0.961 0.008 169);
  --destructive: oklch(0.68 0.17 28);
  --destructive-foreground: oklch(0.15 0.012 60);
  --border: oklch(0.352 0.022 174);
  --input: oklch(0.352 0.022 174);
  --ring: oklch(0.796 0.035 168);
  --success: oklch(0.72 0.11 150);
  --warning: oklch(0.78 0.12 75);
  --chart-1: oklch(0.796 0.035 168);
  --chart-2: oklch(0.568 0.048 166);
  --chart-3: oklch(0.45 0.035 168);
  --chart-4: oklch(0.72 0.05 70);
  --chart-5: oklch(0.668 0.046 166);
  --sidebar: oklch(0.195 0.013 170);
  --sidebar-foreground: oklch(0.961 0.008 169);
  --sidebar-primary: oklch(0.568 0.048 166);
  --sidebar-primary-foreground: oklch(0.961 0.008 169);
  --sidebar-accent: oklch(0.315 0.021 171);
  --sidebar-accent-foreground: oklch(0.961 0.008 169);
  --sidebar-border: oklch(0.352 0.022 174);
  --sidebar-ring: oklch(0.796 0.035 168);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.222 0.014 168);
  --surface-elevated: oklch(0.315 0.021 171);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.27 0.017 172);
  --border-muted: oklch(0.31 0.02 173);
  --border-strong: oklch(0.44 0.026 172);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.82 0.022 168);

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-text: oklch(0.796 0.035 168);
  --primary-hover: color-mix(in srgb, var(--primary) 85%, var(--foreground));
  --primary-tint: color-mix(in srgb, var(--primary) 7%, var(--background));

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: oklch(0.796 0.035 168 / 0.45);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.68 0.17 28);
  --error-foreground: oklch(0.15 0.012 60);

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 0 0 1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
}
