/*
 * Design tokens. Change the look of the whole site here; components only use these variables.
 * Light is the default; dark follows the OS unless the visitor picks a theme (data-theme).
 */
:root {
  color-scheme: light;

  /* Surfaces: warm paper, so white-background figures sit on a gentle frame. */
  --bg: #f5f2ec;
  --bg-glow: #ebe4d6;
  --surface: #fffdf9;
  --surface-2: #f0ece4;
  --surface-3: #e7e1d6;
  --figure-bg: #ffffff;
  --line: #e3ddd1;
  --line-strong: #cfc6b6;

  /* Ink */
  --ink: #1b2528;
  --ink-2: #485659;
  --ink-3: #788487;
  --ink-inverse: #fbfaf7;

  /* Accents: teal and terracotta, borrowed from the forest-plot demo. */
  --accent: #1f766f;
  --accent-ink: #145a54;
  --accent-soft: #dcefeb;
  --accent-2: #b4573f;
  --accent-2-soft: #f6e3dc;
  --focus: #2b8cff;

  /* Status of an entry (captured → draft → reproduced → reusable). */
  --status-captured: #8b8f96;
  --status-draft: #c08a1e;
  --status-reproduced: #2f6db0;
  --status-reusable: #1f766f;

  /* Data provenance */
  --data-original: #1f766f;
  --data-digitized: #6a5bb5;
  --data-synthetic: #b4573f;
  --data-unknown: #8b8f96;

  --danger: #b3261e;
  --danger-soft: #fbe5e2;
  --warning: #8a5a00;
  --warning-soft: #fdf0d5;

  /* Type */
  --font-display: "Fraunces", "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(2rem, 4.2vw, 3.25rem);

  /* Shape and depth */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgb(40 32 20 / 0.06), 0 1px 1px rgb(40 32 20 / 0.04);
  --shadow-2: 0 10px 30px -12px rgb(40 32 20 / 0.22), 0 4px 10px -4px rgb(40 32 20 / 0.08);
  --shadow-3: 0 28px 60px -20px rgb(40 32 20 / 0.35);

  /* Layout */
  --page-max: 1320px;
  --gutter: clamp(16px, 3vw, 32px);
  --topbar-h: 60px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1517;
    --bg-glow: #17252a;
    --surface: #151d20;
    --surface-2: #1b2529;
    --surface-3: #243136;
    --figure-bg: #ffffff;
    --line: #26343a;
    --line-strong: #35464d;
    --ink: #e9eeec;
    --ink-2: #b4c0c0;
    --ink-3: #82918f;
    --ink-inverse: #0f1517;
    --accent: #4cb8ab;
    --accent-ink: #7fd3c8;
    --accent-soft: #173a37;
    --accent-2: #e08a70;
    --accent-2-soft: #3d2620;
    --status-captured: #9aa0a8;
    --status-draft: #e2b149;
    --status-reproduced: #6fa6e4;
    --status-reusable: #4cb8ab;
    --data-original: #4cb8ab;
    --data-digitized: #a397ea;
    --data-synthetic: #e08a70;
    --data-unknown: #9aa0a8;
    --danger: #ff8a80;
    --danger-soft: #3b1d1b;
    --warning: #f2c36b;
    --warning-soft: #3a2c10;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 12px 30px -12px rgb(0 0 0 / 0.6);
    --shadow-3: 0 30px 60px -20px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1517;
  --bg-glow: #17252a;
  --surface: #151d20;
  --surface-2: #1b2529;
  --surface-3: #243136;
  --figure-bg: #ffffff;
  --line: #26343a;
  --line-strong: #35464d;
  --ink: #e9eeec;
  --ink-2: #b4c0c0;
  --ink-3: #82918f;
  --ink-inverse: #0f1517;
  --accent: #4cb8ab;
  --accent-ink: #7fd3c8;
  --accent-soft: #173a37;
  --accent-2: #e08a70;
  --accent-2-soft: #3d2620;
  --status-captured: #9aa0a8;
  --status-draft: #e2b149;
  --status-reproduced: #6fa6e4;
  --status-reusable: #4cb8ab;
  --data-original: #4cb8ab;
  --data-digitized: #a397ea;
  --data-synthetic: #e08a70;
  --data-unknown: #9aa0a8;
  --danger: #ff8a80;
  --danger-soft: #3b1d1b;
  --warning: #f2c36b;
  --warning-soft: #3a2c10;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 12px 30px -12px rgb(0 0 0 / 0.6);
  --shadow-3: 0 30px 60px -20px rgb(0 0 0 / 0.7);
}
