/*
 * Design tokens shared by the shell and by every app.
 * The theme is chosen with <html data-theme="light|dark">; the accent colour
 * comes from --accent-base, which Settings writes on <html>.
 */
:root {
  color-scheme: light;

  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  /* accent */
  --accent-base: #0078d4;
  --accent: color-mix(in srgb, var(--accent-base) 82%, #000);
  --accent-hover: color-mix(in srgb, var(--accent) 90%, #fff);
  --accent-pressed: color-mix(in srgb, var(--accent) 80%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent-base) 14%, transparent);
  --accent-text: color-mix(in srgb, var(--accent-base) 76%, #000);
  --on-accent: #fff;

  /* text */
  --text: rgba(0, 0, 0, .9);
  --text-2: rgba(0, 0, 0, .61);
  --text-3: rgba(0, 0, 0, .45);
  --text-disabled: rgba(0, 0, 0, .36);

  /* surfaces */
  --bg-solid: #f3f3f3;
  /* two scales, usable anywhere: bg-N is the colour of a surface at 100, 80, 60, 40, 20 and 10 % opacity;
     shade-N is the opposite colour (dark on light, light on dark) at the same steps, for hovers, lines and dimming */
  --bg-1: rgba(255, 255, 255, 1);
  --bg-2: rgba(255, 255, 255, .8);
  --bg-3: rgba(255, 255, 255, .6);
  --bg-4: rgba(255, 255, 255, .4);
  --bg-5: rgba(255, 255, 255, .2);
  --bg-6: rgba(255, 255, 255, .1);
  --shade-1: rgba(0, 0, 0, 1);
  --shade-2: rgba(0, 0, 0, .8);
  --shade-3: rgba(0, 0, 0, .6);
  --shade-4: rgba(0, 0, 0, .4);
  --shade-5: rgba(0, 0, 0, .2);
  --shade-6: rgba(0, 0, 0, .1);
  --bg-content-solid: var(--bg-1);
  --bg-content: var(--bg-3); /* the content area: a layer over the window material */
  --bg-menu-solid: #f9f9f9;
  --bg-card: rgba(255, 255, 255, .7);
  --bg-card-hover: rgba(249, 249, 249, .5);
  --bg-layer: rgba(255, 255, 255, .5);
  --bg-hover: rgba(0, 0, 0, .045);
  --bg-pressed: rgba(0, 0, 0, .075);
  --bg-selected: rgba(0, 0, 0, .06);
  --bg-control: rgba(255, 255, 255, .7);
  --bg-control-hover: rgba(249, 249, 249, .5);
  --bg-control-pressed: rgba(249, 249, 249, .3);
  --bg-input: rgba(255, 255, 255, .8);
  --thumb: #ffffff;

  /* window buttons: minimize, maximize, close */
  --caption-min: #febc2e;
  --caption-max: #28c840;
  --caption-close: #ff5f57;
  --caption-glyph: rgba(0, 0, 0, .6);

  /* strokes */
  --stroke: rgba(0, 0, 0, .08);
  --stroke-control: rgba(0, 0, 0, .07);
  --stroke-control-bottom: rgba(0, 0, 0, .17);
  --stroke-strong: rgba(0, 0, 0, .45);
  --stroke-window: rgba(0, 0, 0, .22);
  --divider: rgba(0, 0, 0, .08);

  /* materials */
  --acrylic: rgba(243, 243, 243, .76);
  --acrylic-menu: rgba(249, 249, 249, .88);
  --mica: rgba(243, 243, 243, .84);
  --blur: blur(2rem) saturate(1.6);
  --smoke: rgba(0, 0, 0, .3);

  /* elevation */
  --shadow-flyout: 0 0.6rem 1rem rgba(0, 0, 0, .14);
  --shadow-dialog: 0 2rem 4rem rgba(0, 0, 0, .19), 0 2px 1.4rem rgba(0, 0, 0, .15);
  --shadow-window: 0 2rem 4rem rgba(0, 0, 0, .28), 0 2px 1.4rem rgba(0, 0, 0, .22);
  --shadow-window-inactive: 0 1rem 2rem rgba(0, 0, 0, .18), 0 2px 0.6rem rgba(0, 0, 0, .14);
  --shadow-icon: drop-shadow(0 1px 2px rgba(0, 0, 0, .14));

  /* status */
  --danger: #c42b1c;
  --danger-text: #c42b1c;
  --success: #0f7b0f;

  /* metrics */
  --radius: 0.2rem;
  --radius-lg: 0.6rem;
  --taskbar-h: 3rem;
  --ease-out: cubic-bezier(.1, .9, .2, 1);
}

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

  --accent: color-mix(in srgb, var(--accent-base) 58%, #fff);
  --accent-hover: color-mix(in srgb, var(--accent) 90%, #000);
  --accent-pressed: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent-base) 26%, transparent);
  --accent-text: color-mix(in srgb, var(--accent-base) 50%, #fff);
  --on-accent: #000;

  --text: #ffffff;
  --text-2: rgba(255, 255, 255, .78);
  --text-3: rgba(255, 255, 255, .54);
  --text-disabled: rgba(255, 255, 255, .36);

  --bg-solid: #202020;
  --bg-1: rgba(25, 25, 25, 1);
  --bg-2: rgba(25, 25, 25, .8);
  --bg-3: rgba(25, 25, 25, .6);
  --bg-4: rgba(25, 25, 25, .4);
  --bg-5: rgba(25, 25, 25, .2);
  --bg-6: rgba(25, 25, 25, .1);
  --shade-1: rgba(255, 255, 255, 1);
  --shade-2: rgba(255, 255, 255, .8);
  --shade-3: rgba(255, 255, 255, .6);
  --shade-4: rgba(255, 255, 255, .4);
  --shade-5: rgba(255, 255, 255, .2);
  --shade-6: rgba(255, 255, 255, .1);
  --bg-content-solid: var(--bg-1);
  --bg-content: var(--bg-3);
  --bg-menu-solid: #2c2c2c;
  --bg-card: rgba(255, 255, 255, .05);
  --bg-card-hover: rgba(255, 255, 255, .08);
  --bg-layer: rgba(255, 255, 255, .04);
  --bg-hover: rgba(255, 255, 255, .06);
  --bg-pressed: rgba(255, 255, 255, .04);
  --bg-selected: rgba(255, 255, 255, .08);
  --bg-control: rgba(255, 255, 255, .06);
  --bg-control-hover: rgba(255, 255, 255, .09);
  --bg-control-pressed: rgba(255, 255, 255, .03);
  --bg-input: rgba(255, 255, 255, .06);
  --thumb: #454545;

  --stroke: rgba(255, 255, 255, .08);
  --stroke-control: rgba(255, 255, 255, .09);
  --stroke-control-bottom: rgba(255, 255, 255, .07);
  --stroke-strong: rgba(255, 255, 255, .54);
  --stroke-window: rgba(255, 255, 255, .15);
  --divider: rgba(255, 255, 255, .08);

  --acrylic: rgba(32, 32, 32, .74);
  --acrylic-menu: rgba(44, 44, 44, .9);
  --mica: rgba(32, 32, 32, .84);
  --smoke: rgba(0, 0, 0, .45);

  --shadow-flyout: 0 0.6rem 1rem rgba(0, 0, 0, .28);
  --shadow-dialog: 0 2rem 4rem rgba(0, 0, 0, .4), 0 2px 1.4rem rgba(0, 0, 0, .3);
  --shadow-icon: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  --shadow-window: 0 2rem 4rem rgba(0, 0, 0, .5), 0 2px 1.4rem rgba(0, 0, 0, .4);
  --shadow-window-inactive: 0 1rem 2rem rgba(0, 0, 0, .34), 0 2px 0.6rem rgba(0, 0, 0, .3);

  --danger-text: #ff99a4;
  --success: #6ccb5f;
}

/* High contrast: black, white and one bright accent, whatever the theme. */
:root.high-contrast {
  color-scheme: dark;

  --accent: #ffff00;
  --accent-hover: #ffff80;
  --accent-pressed: #cccc00;
  --accent-soft: rgba(255, 255, 0, .22);
  --accent-text: #ffff00;
  --on-accent: #000000;

  --text: #ffffff;
  --text-2: #ffffff;
  --text-3: #ffffff;
  --text-disabled: #3ff23f;

  --bg-solid: #000000;
  --bg-1: #000000;
  --bg-2: #000000;
  --bg-3: #000000;
  --bg-4: #000000;
  --bg-5: #000000;
  --bg-6: #000000;
  --shade-1: #ffffff;
  --shade-2: #ffffff;
  --shade-3: #ffffff;
  --shade-4: #333333;
  --shade-5: #333333;
  --shade-6: #1a1a1a;
  --bg-content-solid: var(--bg-1);
  --bg-content: var(--bg-3);
  --bg-menu-solid: #000000;
  --bg-card: #000000;
  --bg-card-hover: #1a1a1a;
  --bg-layer: #000000;
  --bg-hover: #1a1a1a;
  --bg-pressed: #333333;
  --bg-selected: #333333;
  --bg-control: #000000;
  --bg-control-hover: #1a1a1a;
  --bg-control-pressed: #333333;
  --bg-input: #000000;
  --thumb: #ffffff;

  --stroke: #ffffff;
  --stroke-control: #ffffff;
  --stroke-control-bottom: #ffffff;
  --stroke-strong: #ffffff;
  --stroke-window: #ffffff;
  --divider: #ffffff;

  --acrylic: #000000;
  --acrylic-menu: #000000;
  --mica: #000000;
  --blur: none;
  --smoke: rgba(0, 0, 0, .7);

  --danger-text: #ff8080;
  --success: #3ff23f;
}

/* "Transparency effects" switched off: every material becomes a solid colour. */
:root.no-transparency {
  --acrylic: var(--bg-solid);
  --acrylic-menu: var(--bg-menu-solid);
  --mica: var(--bg-solid);
  --bg-2: var(--bg-1);
  --bg-3: var(--bg-1);
  --bg-4: var(--bg-1);
  --bg-5: var(--bg-1);
  --bg-6: var(--bg-1);
  --blur: none;
}
