@layer reset, base, components, utilities;

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/Figtree-VariableFont_wght-89352678.ttf") format("truetype");
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/Figtree-Italic-VariableFont_wght-cdc1fc1e.ttf") format("truetype");
}

:root {
  /* Typography */
  --font-sans:
    "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans", Helvetica, Arial, sans-serif;
  --font-mono: var(--font-sans);

  /* Spacing scale (used by m-, p-, gap-*) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;

  /* Text scale */
  --text-xx-small: 0.625rem;
  --text-x-small: 0.75rem;
  --text-small: 0.875rem;
  --text-normal: 1rem;
  --text-medium: 1.125rem;
  --text-large: 1.25rem;
  --text-x-large: 1.5rem;
  --text-xx-large: 2rem;

  /* Typography: Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* Typography: Letter spacing for text in capitals */
  --letter-spacing-uppercase: 0.05em;

  /* Brand */
  --blue-main: #00104b;
  --blue-accent: #0070f0;
  --blue-light: #e0effe;

  /* Neutral */
  --white: #ffffff;
  --black: #000000;
  --gray-soft: #f9fafb;
  --gray-surface: #f2f3f6;
  --gray-border: #e5e7ed;
  --gray-muted: #4b5563;

  /* Status colors */
  --green-main: #0a8547;
  --green-light: #f3fcf9;

  --yellow-main: #a3691f;
  --yellow-light: #fef9e8;

  /* Citations in the text on Write (write.css): stronger than the light ones, as they mark text, not surfaces */
  --green-highlight: #dff4e8;
  --yellow-highlight: #fcefc9;

  --red-main: #c2002a;
  --red-light: #fef1f6;

  /* Semantic tokens used by base and utilities */
  --color-canvas: var(--gray-soft);
  --color-ink: var(--blue-main);
  --color-blue-accent: var(--blue-accent);
  --color-blue-main: var(--blue-main);
  --color-ink-inverted: #ffffff;
  --color-link: var(--blue-accent);
  --color-selected: var(--blue-light);

  --color-muted: var(--gray-muted);
  --color-border: var(--gray-border);
  --color-surface: var(--gray-soft);
  --color-surface-soft: var(--gray-surface);
  /* What stands out from the canvas: cards, inputs, buttons, column headers (dark in dark mode) */
  --color-surface-raised: var(--white);

  --color-positive: var(--green-main);
  --color-positive-soft: var(--green-light);

  --color-warning: var(--yellow-main);
  --color-warning-soft: var(--yellow-light);

  --color-negative: var(--red-main);
  --color-negative-soft: var(--red-light);

  --color-ink-lightest: var(--gray-surface);

  /* Focus ring */
  --focus-ring-color: var(--color-link);
  --focus-ring-size: 2px;
  --focus-ring-offset: 2px;

  /* Border primitives */
  --border-width-0: 0;
  --border-width-1: 1px;
  --border-width-2: 2px;

  --border-style-solid: solid;
  --border-style-dashed: dashed;
  --border-style-dotted: dotted;

  --border-color: var(--color-border);
  --border-color-strong: var(--color-muted);
  --border-color-subtle: var(--color-surface-soft);

  /* Ready-to-use border shorthands */
  --border: var(--border-width-1) var(--border-style-solid) var(--border-color);
  --border-strong: var(--border-width-1) var(--border-style-solid)
    var(--border-color-strong);
  --border-subtle: var(--border-width-1) var(--border-style-solid)
    var(--border-color-subtle);
  --border-dashed: var(--border-width-1) var(--border-style-dashed)
    var(--border-color);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 10px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 24px rgb(0 0 0 / 0.14);
  --shadow-inset-sm: inset 0 1px 2px rgb(0 0 0 / 0.08);

  /* Optional focus shadow helper (for custom controls) */
  --shadow-focus: 0 0 0 var(--focus-ring-size)
    color-mix(in srgb, var(--focus-ring-color), transparent 70%);

  /* Z-index */
  --z-0: 0;
  --z-1: 1;
  /* Write (write.css): what scrolls with the text over it, under the toolbar that stays at the top */
  --z-write-overlay: 2;
  --z-write-toolbar: 3;
  --z-nav: 50;
  --z-flash: 200;
  --z-modal: 100;
}
