/*
 * theme.css - every brand value the application has, and nothing else
 * (ADR-0032).
 *
 * To rebrand, change the values in this file. app.css builds every page from
 * these variables and names no colour, font, or shadow of its own, and
 * internal/web/theme_test.go fails if one appears anywhere else, or if
 * app.css uses a variable this file does not define. The logo and product
 * name are the only other brand values, in internal/view/brand.templ.
 * favicon.svg beside this file repeats the logo and --color-brand's light
 * value, because a tab icon cannot read a stylesheet; the same test file
 * fails if either copy drifts.
 *
 * The second block is the dark appearance, chosen by the person's operating
 * system. It redefines only the colours; everything else is shared.
 *
 * Text colours keep at least 4.5:1 against every background they are written
 * on, in both appearances (WCAG 2.1 AA). internal/web/theme_test.go holds
 * that, so a rebrand that fades some text fails there.
 */

:root {
  color-scheme: light dark;

  /* Type. The system font: no font files to serve or licence. */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 0.9375rem;
  --text-lg: 1rem;
  --text-xl: 1.0625rem;
  --text-2xl: 1.625rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-tight: 1.2;
  --leading-body: 1.5;
  --tracking-tight: -0.014em;

  /* Surfaces and text. */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-hover: #f4f6f9;
  --color-header: #f4f6f9;
  --color-text: #17202e;
  --color-text-secondary: #536074;
  --color-text-tertiary: #596679;
  --color-border: #ccd4df;
  --color-separator: #e4e9f0;
  --color-scrim: rgba(16, 24, 38, 0.36);

  /* The brand and its one action colour. */
  --color-brand: #1b57b8;
  --color-primary: #1b57b8;
  --color-primary-hover: #164a9e;
  --color-primary-active: #123f87;
  --color-on-primary: #ffffff;
  --color-primary-tint: #eaf1fc;
  --color-primary-tint-hover: #dbe7fa;
  --color-link: #1b57b8;
  --color-focus-ring: rgba(27, 87, 184, 0.4);

  /* Buttons that are not the primary action. */
  --color-secondary-fill: #ffffff;
  --color-secondary-fill-hover: #f4f6f9;

  /* Status. */
  --color-success: #1a6b3a;
  --color-success-tint: #e6f4ea;
  --color-warning: #8a4b00;
  --color-warning-tint: #fdf1dc;
  --color-danger: #b3261e;
  --color-danger-tint: #fcebea;

  /* Shape and depth. */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 980px;
  --shadow-card: none;
  --shadow-card-hover: none;
  --shadow-pop: 0 8px 28px rgba(16, 24, 38, 0.16);

  /* Space and size. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 32px;
  --space-7: 36px;
  --space-8: 64px;

  --width-content: 1120px;
  --width-auth: 400px;
  --width-auth-wide: 520px;
  --width-message: 560px;
  --width-sidebar: 232px;
  --height-header: 56px;
  --height-tabbar: 60px;
  --size-control: 40px;
  --size-control-small: 34px;

  --transition: 140ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #12171f;
    --color-surface: #12171f;
    --color-surface-hover: #1c232e;
    --color-header: #0d1218;
    --color-text: #e8ecf2;
    --color-text-secondary: #a6b0bf;
    --color-text-tertiary: #95a0b0;
    --color-border: #3a4453;
    --color-separator: #262f3b;
    --color-scrim: rgba(0, 0, 0, 0.6);

    --color-brand: #7db0ff;
    --color-primary: #2d69c9;
    --color-primary-hover: #285fb8;
    --color-primary-active: #22539f;
    --color-on-primary: #ffffff;
    --color-primary-tint: #18273f;
    --color-primary-tint-hover: #1f3252;
    --color-link: #8ab8ff;
    --color-focus-ring: rgba(125, 176, 255, 0.5);

    --color-secondary-fill: #12171f;
    --color-secondary-fill-hover: #1c232e;

    --color-success: #6fd08f;
    --color-success-tint: #14291c;
    --color-warning: #f2b45c;
    --color-warning-tint: #2f2412;
    --color-danger: #ff8f87;
    --color-danger-tint: #351b1a;
    --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}
