/* JournTech design tokens — shared by the public site (backend/journtech/web/static/css/tokens.css, a copy kept in
   sync by scripts/sync-design.sh and checked in CI) and the panel (panel/src/app.css imports this file).
   Light theme by default; dark theme follows the OS setting. Colours meet WCAG 2.2 AA on their intended surfaces. */

:root {
  /* typography */
  --jt-font-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --jt-font-serif: "Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --jt-font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --jt-text-xs: 0.75rem;   /* 12 */
  --jt-text-sm: 0.875rem;  /* 14 */
  --jt-text-md: 1rem;      /* 16 */
  --jt-text-lg: 1.125rem;  /* 18 */
  --jt-text-xl: 1.25rem;   /* 20 */
  --jt-text-2xl: 1.5rem;   /* 24 */
  --jt-text-3xl: 1.875rem; /* 30 */
  --jt-text-4xl: 2.375rem; /* 38 */
  --jt-text-5xl: 3rem;     /* 48 */
  --jt-leading: 1.6;
  --jt-leading-tight: 1.25;

  /* neutrals */
  --jt-ink: #0e1726;        /* body text */
  --jt-ink-2: #39455a;      /* secondary text */
  --jt-ink-3: #5f6b80;      /* muted (AA on white and bg) */
  --jt-line: #e3e7ef;       /* hairlines */
  --jt-line-2: #cfd6e2;     /* input borders */
  --jt-bg: #f6f7fb;         /* page */
  --jt-surface: #ffffff;    /* cards */
  --jt-surface-2: #eef1f7;  /* subtle panels, table headers */
  --jt-overlay: rgba(14, 23, 38, 0.48);

  /* brand */
  --jt-brand: #2643d6;
  --jt-brand-hover: #1c34ad;
  --jt-brand-soft: #e8ecfd;
  --jt-brand-ink: #1a2f9c;  /* brand-coloured text on light surfaces */
  --jt-on-brand: #ffffff;
  --jt-accent: #e8710a;     /* open access */
  --jt-accent-soft: #fdf0e3;
  --jt-accent-ink: #9c4705;

  /* status */
  --jt-success: #12784a;
  --jt-success-soft: #e5f4ec;
  --jt-warning: #9a5a00;
  --jt-warning-soft: #fcf1de;
  --jt-danger: #bf2a30;
  --jt-danger-soft: #fcebec;
  --jt-info: #0b679e;
  --jt-info-soft: #e5f1f9;

  /* publication type accents (badges, placeholders) */
  --jt-type-book: #2643d6;
  --jt-type-chapter: #4f5fcf;
  --jt-type-journal: #0f7f86;
  --jt-type-article: #127a5e;
  --jt-type-proceedings: #7a4bc2;
  --jt-type-thesis: #8a5a12;
  --jt-type-children: #d0461f;

  /* shape & depth */
  --jt-radius-sm: 6px;
  --jt-radius: 10px;
  --jt-radius-lg: 16px;
  --jt-radius-pill: 999px;
  --jt-shadow-1: 0 1px 2px rgba(14, 23, 38, 0.06), 0 1px 1px rgba(14, 23, 38, 0.04);
  --jt-shadow-2: 0 6px 20px -6px rgba(14, 23, 38, 0.14), 0 2px 6px rgba(14, 23, 38, 0.05);
  --jt-shadow-3: 0 24px 48px -16px rgba(14, 23, 38, 0.24);
  --jt-focus: 0 0 0 3px rgba(38, 67, 214, 0.35);

  /* spacing (4 px grid) */
  --jt-space-1: 0.25rem;
  --jt-space-2: 0.5rem;
  --jt-space-3: 0.75rem;
  --jt-space-4: 1rem;
  --jt-space-5: 1.5rem;
  --jt-space-6: 2rem;
  --jt-space-7: 3rem;
  --jt-space-8: 4rem;

  /* layout */
  --jt-content: 72rem;      /* max page width */
  --jt-prose: 42rem;        /* comfortable reading width */
  --jt-header-h: 4rem;
  --jt-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --jt-dur: 160ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --jt-ink: #e6eaf2;
    --jt-ink-2: #b7c0d0;
    --jt-ink-3: #8f99ac;
    --jt-line: #223049;
    --jt-line-2: #304260;
    --jt-bg: #0a1120;
    --jt-surface: #101a2d;
    --jt-surface-2: #16223a;
    --jt-overlay: rgba(2, 6, 14, 0.66);

    --jt-brand: #7d93ff;
    --jt-brand-hover: #9aabff;
    --jt-brand-soft: #1a2551;
    --jt-brand-ink: #a9b8ff;
    --jt-on-brand: #0a1120;
    --jt-accent: #ff9a43;
    --jt-accent-soft: #3a2410;
    --jt-accent-ink: #ffb877;

    --jt-success: #4fd18f;
    --jt-success-soft: #0f2d20;
    --jt-warning: #f2b04b;
    --jt-warning-soft: #33250c;
    --jt-danger: #ff7a7f;
    --jt-danger-soft: #3a1518;
    --jt-info: #5cb8f0;
    --jt-info-soft: #0e2a3d;

    --jt-type-book: #7d93ff;
    --jt-type-chapter: #9aa6ff;
    --jt-type-journal: #47c7cf;
    --jt-type-article: #53d0a6;
    --jt-type-proceedings: #b796f2;
    --jt-type-thesis: #e2b45c;
    --jt-type-children: #ff8b67;

    --jt-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --jt-shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --jt-shadow-3: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    --jt-focus: 0 0 0 3px rgba(125, 147, 255, 0.45);

    color-scheme: dark;
  }
}
