/* Fonts and tokens for every exhibit. The values come from the dc Design
   System (tokens.json, version 2). Load this file before the exhibit's
   own stylesheet, so the exhibit can override a token. */

@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --lime: #bccf00;
  --ocean: #4bbecf;
  --purple: #693dd0;
  --nightblue: #00121e;
  --nightblue-soft: #062230;
  --lime-light: #e6f1b1;
  --ocean-light: #d8f6fa;
  --purple-light: #cfbff5;
  --lime-ultra-light: #f3f8d8;
  --ocean-ultra-light: #f3fcfd;
  --purple-ultra-light: #eaeafd;
  --white: #ffffff;
  --light-gray: #f4f4f4;
  --gray: #dfdfdf;
  --middle-gray: #979797;
  --dark-gray: #757575;

  --surface: var(--white);
  --surface-muted: var(--light-gray);
  --ink: var(--nightblue);
  --ink-muted: var(--dark-gray);
  --border: var(--gray);
  --focus: var(--purple);
  --page: var(--light-gray);
  --shadow-sm: 0 1px 2px rgba(0, 18, 30, 0.08);

  /* Soft shadows in nightblue, from low to high. A card with one of these
     needs no border, and a page without many borders looks calmer. */
  --shadow-low: 0 0 3px rgba(0, 18, 30, 0.03), 0 0 2px rgba(0, 18, 30, 0.05);
  --shadow-high: 0 0 32px -12px rgba(0, 18, 30, 0.1), 0 0 12px -6px rgba(0, 18, 30, 0.07);
  --shadow-hover: 0 0 42px -14px rgba(0, 18, 30, 0.14), 0 0 16px -8px rgba(0, 18, 30, 0.09);

  /* Things appear a little slower than they go away. With the same timing
     for both, closing feels slow. */
  --motion-enter: 190ms;
  --motion-exit: 130ms;
  --ease-enter: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);

  --font-sans: "Barlow", Arial, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  --surface: var(--nightblue-soft);
  --surface-muted: var(--nightblue);
  --ink: var(--white);
  --ink-muted: var(--gray);
  --border: #2b3f4b;
  --focus: var(--ocean);
  --page: #000a11;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  /* A dark shadow on a dark page is almost invisible. The thin light
     line at the top edge shows where the card is instead. */
  --shadow-low: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-high: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 42px -14px rgba(0, 0, 0, 0.8);
}

/* The bar at the top of every page: back to the gallery on the left, the
   Dark Mode switch on the right. cabinet-bar.js fills it. The right
   margin keeps the switch next to the logo and not under it. */
.cab-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  margin: 0 72px var(--space-4) 0;
  font-family: var(--font-sans), sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.cab-home,
.cab-theme {
  border-radius: var(--radius-pill);
  color: inherit;
  opacity: 0.72;
  transition:
    opacity var(--motion-exit) var(--ease-exit),
    background-color var(--motion-exit) var(--ease-exit);
}

/* currentColor, so the hover works on light and dark pages and on the
   slides of Pipeline Wrapped, which have their own colors. */
.cab-home:hover,
.cab-theme:hover {
  opacity: 1;
  background: color-mix(in srgb, currentColor 10%, transparent);
  transition-duration: var(--motion-enter);
  transition-timing-function: var(--ease-enter);
}

.cab-home {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: calc(-1 * var(--space-3));
  padding: 10px var(--space-3);
  text-decoration: none;
}

/* A small arrow to the left. */
.cab-home::before {
  content: "";
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.cab-theme {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.cab-theme svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The button shows where a click goes: the moon in light mode, the sun
   in dark mode. */
.cab-sun,
[data-theme="dark"] .cab-moon {
  display: none;
}

[data-theme="dark"] .cab-sun {
  display: block;
}

.cab-switching,
.cab-switching * {
  transition:
    background-color 250ms var(--ease-enter),
    color 250ms var(--ease-enter),
    border-color 250ms var(--ease-enter),
    fill 250ms var(--ease-enter) !important;
}

@media (max-width: 480px) {
  .cab-bar {
    margin-right: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cab-switching,
  .cab-switching * {
    transition: none !important;
  }
}
