/*
 * 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.
 *
 * 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: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2.5rem;
  --text-hero: 3rem;

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

  --leading-tight: 1.1;
  --leading-body: 1.47;
  --tracking-tight: -0.022em;

  /* Surfaces and text. */
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f5f7;
  --color-header: rgba(251, 251, 253, 0.8);
  --color-text: #1d1d1f;
  --color-text-secondary: #66666b;
  --color-text-tertiary: #6e6e73;
  --color-border: #d2d2d7;
  --color-separator: #e8e8ed;
  --color-scrim: rgba(0, 0, 0, 0.3);

  /* The brand and its one action colour. */
  --color-brand: #0071e3;
  --color-primary: #0071e3;
  --color-primary-hover: #0068d1;
  --color-primary-active: #005cb8;
  --color-on-primary: #ffffff;
  --color-primary-tint: rgba(0, 113, 227, 0.1);
  --color-primary-tint-hover: rgba(0, 113, 227, 0.16);
  --color-link: #005ebd;
  --color-focus-ring: rgba(0, 113, 227, 0.35);

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

  /* Status. */
  --color-success: #1e7433;
  --color-success-tint: rgba(36, 138, 61, 0.12);
  --color-warning: #a84c00;
  --color-warning-tint: rgba(255, 149, 0, 0.14);
  --color-danger: #cc0014;
  --color-danger-tint: rgba(215, 0, 21, 0.08);

  /* Shape and depth. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 980px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.08);
  --header-blur: saturate(180%) blur(20px);

  /* Space and size. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  --width-content: 980px;
  --width-auth: 400px;
  --width-auth-wide: 520px;
  --width-message: 560px;
  --height-header: 52px;
  --size-control: 44px;
  --size-control-small: 30px;

  --transition: 160ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-hover: #2c2c2e;
    --color-header: rgba(22, 22, 23, 0.8);
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #86868b;
    --color-border: #48484a;
    --color-separator: #38383a;
    --color-scrim: rgba(0, 0, 0, 0.6);

    --color-brand: #2997ff;
    --color-primary: #0071e3;
    --color-primary-hover: #0068d1;
    --color-primary-active: #005cb8;
    --color-on-primary: #ffffff;
    --color-primary-tint: rgba(41, 151, 255, 0.16);
    --color-primary-tint-hover: rgba(41, 151, 255, 0.24);
    --color-link: #4aa7ff;
    --color-focus-ring: rgba(41, 151, 255, 0.45);

    --color-secondary-fill: #2c2c2e;
    --color-secondary-fill-hover: #3a3a3c;

    --color-success: #30d158;
    --color-success-tint: rgba(48, 209, 88, 0.16);
    --color-warning: #ff9f0a;
    --color-warning-tint: rgba(255, 159, 10, 0.16);
    --color-danger: #ff6159;
    --color-danger-tint: rgba(255, 69, 58, 0.16);

    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}
