/*
  AXON brand system.

  Colour values are taken from computed styles on axon-com.com and the official
  logo asset, not approximated. The six spectrum colours are the arms of the X in
  the logo mark, in their left-to-right order; the app uses them as a functional
  sequence (review-stage progress, category accents), never decoratively, so a
  writer can tell where they are in a 16-section review at a glance.

  Served at /api/v1/brand/theme.css and loaded before the app renders. The names below
  are the contract with the web app: see brands/README.md.

  Avenir Next LT Pro is licensed to AXON through Adobe Fonts. Typekit kits are
  domain-locked, so this kit only serves fonts once this app's domain is added
  to it. Until then the stack below falls back to Mulish.
*/

@import url('https://use.typekit.net/tfx3vnl.css');
@import url('https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,400;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
  /* -- Brand ------------------------------------------------------------- */
  --color-strong: #211550; /* dominant heading and text navy */
  --color-strong-soft: #3d2a85;
  --color-accent: #b04fc4; /* links, primary actions */
  --color-accent-light: #b155cc;
  --color-accent-dark: #9639ab;
  /* What a primary button's background becomes on hover, and the label on it. */
  --color-accent-hover: var(--color-accent-dark);
  --color-on-accent: #ffffff;

  /* Spectrum, in logo order. Also the review-stage and source-role sequence. */
  --color-spectrum-green: #0ab76f;
  --color-spectrum-cyan: #13a1db;
  --color-spectrum-indigo: #6463c0;
  --color-spectrum-magenta: #e13ab0;
  --color-spectrum-red: #fb4862;
  --color-spectrum-orange: #ff7900;

  /* The thin bar under the header and on the sign-in page. */
  --brand-bar: linear-gradient(
    90deg,
    var(--color-spectrum-green) 0%,
    var(--color-spectrum-cyan) 20%,
    var(--color-spectrum-indigo) 40%,
    var(--color-accent) 58%,
    var(--color-spectrum-magenta) 74%,
    var(--color-spectrum-red) 88%,
    var(--color-spectrum-orange) 100%
  );

  /* -- Neutrals ---------------------------------------------------------- */
  --color-ink: #333333;
  --color-paper: #ffffff;
  --color-grey-50: #fafafa;
  --color-grey-100: #f4f4f4;
  --color-grey-200: #e8e8ea;
  --color-grey-300: #d6d6d6;
  --color-grey-500: #8a8a94;
  --color-grey-700: #5a5a66;

  /* -- Status ------------------------------------------------------------ */
  --color-ok: #0ab76f;
  --color-warn: #ff7900;
  --color-fail: #fb4862;

  /* -- Type -------------------------------------------------------------- */
  --font-sans:
    'avenir-next-lt-pro', 'Mulish', 'Avenir Next', 'Avenir', ui-sans-serif, system-ui, sans-serif;
  --font-heading: var(--font-sans);

  /*
    AXON sets display headings in heavy uppercase with negative tracking that
    tightens as the type gets larger. It is the most recognisable part of the identity.
  */
  --heading-weight: 800;
  --h1-weight: 900;
  --h1-transform: uppercase;
  --h1-tracking: -0.03em;
  --h1-leading: 1.02;
  --h2-tracking: -0.02em;
  --h3-tracking: -0.01em;

  /* -- Shape ------------------------------------------------------------- */
  --radius-card: 8px;
  --radius-pill: 60px;

  /* -- Labels and buttons: tracked, uppercase, small -------------------- */
  --label-transform: uppercase;
  --label-tracking: 1; /* a multiplier on each label's own tracking; 0 turns it off */
  --label-size: 0.6875rem;

  /* -- Header: the page surface, lightly translucent -------------------- */
  --header-bg: color-mix(in srgb, var(--surface-raised) 85%, transparent);
  --header-fg: var(--text-primary);
  --header-muted: var(--text-muted);
  --header-accent: var(--text-accent);
  --header-line: var(--line-subtle);
  --header-active: var(--surface-sunken);
  --header-focus: var(--focus-ring);
  --header-logo-url: var(--logo-url);

  /* -- Logo -------------------------------------------------------------- */
  /* The artwork for light and dark surfaces, and each one's width over height. */
  --logo-url: url('/api/v1/brand/assets/logo-light.svg');
  --logo-aspect: 3.663;
  --mark-url: url('/api/v1/brand/assets/mark.svg');
  --mark-aspect: 1;

  /* -- Semantic layer ---------------------------------------------------- */
  color-scheme: light;

  --surface: var(--color-grey-100);
  --surface-raised: var(--color-paper);
  --surface-sunken: var(--color-grey-200);
  --surface-inverse: var(--color-strong);

  --text-primary: var(--color-strong);
  --text-body: var(--color-ink);
  --text-muted: var(--color-grey-700);
  --text-on-inverse: var(--color-paper);
  --text-accent: var(--color-accent);
  --link-underline: currentColor;
  /* The underline of a quiet link (a project name in a list): a hairline until hovered. */
  --link-decoration: var(--line);

  --line: var(--color-grey-300);
  --line-subtle: var(--color-grey-200);

  --focus-ring: var(--color-accent);

  --shadow-card: 0 1px 2px rgb(33 21 80 / 0.04), 0 8px 24px -12px rgb(33 21 80 / 0.14);
  --shadow-lift: 0 2px 4px rgb(33 21 80 / 0.06), 0 18px 44px -16px rgb(33 21 80 / 0.24);
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --surface: #14102e;
  --surface-raised: #1c1740;
  --surface-sunken: #0e0b22;
  --surface-inverse: var(--color-paper);

  --text-primary: #f2f0fa;
  --text-body: #d8d5e8;
  --text-muted: #9a95b8;
  --text-on-inverse: var(--color-strong);
  --text-accent: var(--color-accent-light);

  --line: #322a5e;
  --line-subtle: #262048;

  --logo-url: url('/api/v1/brand/assets/logo-dark.svg');

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.5);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 18px 44px -16px rgb(0 0 0 / 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --surface: #14102e;
    --surface-raised: #1c1740;
    --surface-sunken: #0e0b22;
    --surface-inverse: var(--color-paper);

    --text-primary: #f2f0fa;
    --text-body: #d8d5e8;
    --text-muted: #9a95b8;
    --text-on-inverse: var(--color-strong);
    --text-accent: var(--color-accent-light);

    --line: #322a5e;
    --line-subtle: #262048;

    --logo-url: url('/api/v1/brand/assets/logo-dark.svg');

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.5);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 18px 44px -16px rgb(0 0 0 / 0.6);
  }
}
