/* HØJT: the look every page of the site shares. The colours and fonts are the plugins' own
   (crates/suite_common/src/ui/theme.rs): a dark bench, silk print, the orange of the Ø, and one
   paint per product. A page adds only what is its own, in its own stylesheet. */
@font-face {
  font-family: "Bebas Neue";
  src: url("fonts/BebasNeue-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Bowlby One SC";
  src: url("fonts/BowlbyOneSC-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bench: #121110;
  --panel: #1c1a18;
  --tape: #141210;
  --tape-text: #f4efe4;
  --silk: #eadfc8;
  --silk-dim: #b9af9b;
  --ink: #2a2622;
  --line: #3a3530;
  --brand-orange: #e2581e;
  --paint-orange: #de561e;
  --paint-teal: #1d8282;
  --paint-oxblood: #7c1c20;
  --paint-cobalt: #1e409c;
  --paint-plum: #602c78;
  --paint-pine: #1c683c;
  /* The piano viz's chassis (piano/DESIGN.md) */
  --paint-scarlet: #a8131c;
  --led-on: #ff3b24;

  --display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --model: "Bowlby One SC", "Arial Black", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* The fluid scale: every size of type and space a page uses, each growing from a phone
     (390px wide) to a desktop (1440px) and no further. site-design/DESIGN.md, Typography */
  --step--3: 0.75rem; /* 12px */
  --step--2: clamp(0.8125rem, 0.7893rem + 0.0952vw, 0.875rem); /* 13 to 14px */
  --step--1: clamp(0.875rem, 0.8518rem + 0.0952vw, 0.9375rem); /* 14 to 15px */
  --step-0: clamp(1rem, 0.9768rem + 0.0952vw, 1.0625rem); /* 16 to 17px */
  --step-1: clamp(1.125rem, 1.1018rem + 0.0952vw, 1.1875rem); /* 18 to 19px */
  --step-2: clamp(1.1875rem, 1.1179rem + 0.2857vw, 1.375rem); /* 19 to 22px */
  --step-3: clamp(1.375rem, 1.2821rem + 0.381vw, 1.625rem); /* 22 to 26px */
  --step-4: clamp(1.625rem, 1.5321rem + 0.381vw, 1.875rem); /* 26 to 30px */
  --step-5: clamp(2.25rem, 1.8786rem + 1.5238vw, 3.25rem); /* 36 to 52px */
  --step-6: clamp(2.25rem, 1.6464rem + 2.4762vw, 3.875rem); /* 36 to 62px */
  --step-7: clamp(2.625rem, 1.65rem + 4vw, 5.25rem); /* 42 to 84px */

  --space-2xs: clamp(0.5rem, 0.4536rem + 0.1905vw, 0.625rem); /* 8 to 10px */
  --space-xs: clamp(0.625rem, 0.5321rem + 0.381vw, 0.875rem); /* 10 to 14px */
  --space-s: clamp(1rem, 0.8607rem + 0.5714vw, 1.375rem); /* 16 to 22px */
  --space-m: clamp(1.25rem, 1.0643rem + 0.7619vw, 1.75rem); /* 20 to 28px */
  --space-l: clamp(1.625rem, 1.4393rem + 0.7619vw, 2.125rem); /* 26 to 34px */
  --space-xl: clamp(2rem, 1.6286rem + 1.5238vw, 3rem); /* 32 to 48px */
  --space-2xl: clamp(2.5rem, 2.1286rem + 1.5238vw, 3.5rem); /* 40 to 56px */
  --space-3xl: clamp(3.25rem, 2.7857rem + 1.9048vw, 4.5rem); /* 52 to 72px */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) var(--bench);
}

body {
  margin: 0;
  background: var(--bench);
  color: var(--silk);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

::selection {
  background: var(--brand-orange);
  color: #000;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--silk);
  text-decoration-color: color-mix(in srgb, var(--silk) 45%, transparent);
  text-underline-offset: 3px;
}
a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--silk);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* The bar on top of every page: the logo goes home, then the two products */

.site-bar {
  border-bottom: 1px solid var(--line);
  background: var(--bench);
}
.site-bar .wrap {
  display: flex;
  align-items: center;
  gap: 8px 28px;
  min-height: 64px;
  flex-wrap: wrap;
}
.site-bar .home {
  display: block;
  flex: none;
  border-radius: 6px;
}
.site-bar .home img {
  width: 76px;
  height: auto;
}
.site-bar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  flex: 1;
  font-family: var(--display);
  font-size: var(--step-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
.site-bar nav a {
  display: inline-block;
  padding: 10px 0 6px;
  border-bottom: 3px solid transparent;
  color: var(--silk-dim);
  text-decoration: none;
}
.site-bar nav a:hover {
  color: var(--silk);
}
.site-bar nav a[aria-current="page"] {
  color: var(--silk);
  border-bottom-color: var(--mark, var(--brand-orange));
}
.site-bar nav .dsp {
  --mark: var(--brand-orange);
}
.site-bar nav .piano {
  --mark: var(--paint-scarlet);
}
.site-bar nav .resources {
  --mark: var(--paint-teal);
}
.site-bar nav .source {
  margin-left: auto;
}

/* Label tape: short facts, in the mono of the plugins' labels */

.tape,
.facts li {
  padding: 5px 12px 4px;
  border-radius: 3px;
  background: var(--tape);
  border: 1px solid var(--line);
  color: var(--tape-text);
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.02em;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
}

/* The name of a thing, printed on a strip of cream tape stuck on its paint */

.band {
  display: inline-block;
  margin: 0;
  padding: 6px 26px 2px;
  background: var(--silk);
  color: var(--ink);
  font-family: var(--model);
  font-weight: 400;
  font-size: var(--step-6);
  line-height: 1.15;
  transform: rotate(-2deg);
  transform-origin: left center;
}

.caption {
  margin: var(--space-s) 0 0;
  font-family: var(--display);
  font-size: var(--step-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silk-dim);
}
.caption b {
  font-weight: 400;
  color: var(--silk);
}

/* Buttons: cream keys that sit on a ridge of their product's paint */

.button {
  display: inline-block;
  padding: 12px 22px 8px;
  border-radius: 6px;
  background: var(--silk);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 var(--paint, var(--line));
  transition: background-color 0.15s;
}
.button:hover {
  background: #fff;
  color: var(--ink);
}
.button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--paint, var(--line));
}
.button small {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: var(--step--3);
  letter-spacing: 0.02em;
}
/* The second choice beside a button: printed on the bench, not a key */
.button.plain {
  background: transparent;
  color: var(--silk);
  box-shadow: inset 0 0 0 2px var(--line);
}
.button.plain:hover {
  box-shadow: inset 0 0 0 2px var(--silk);
}
.button.plain:active {
  transform: none;
}

/* Bottom of every page */

.bottom {
  margin-top: var(--space-3xl);
  padding-block: var(--space-xl) var(--space-3xl);
  border-top: 1px solid var(--line);
  color: var(--silk-dim);
  font-size: var(--step--1);
}
.bottom p {
  max-width: 46em;
  margin: 0 0 10px;
}
.bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: var(--space-s);
  font-family: var(--display);
  font-size: var(--step-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .site-bar .wrap {
    padding-block: 10px;
  }
  .site-bar nav {
    flex-basis: 100%;
    gap: 4px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
