/* Shared by every Lab design: the fonts and the frosted buttons at the top – the name (back to
   the main site), About, and Lab with its menu of designs – light by default, inverted on
   designs with a dark background. Lab is for computers only */

@font-face {
  font-family: "Suisse Works";
  src: url("/Font/SuisseWorks-Regular.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("/Font/SuisseIntl-Regular.otf") format("opentype");
  font-display: swap;
}

/* For the menu buttons at the top */
@font-face {
  font-family: "Suisse Intl";
  src: url("/Font/SuisseIntl-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --gutter: 4px;
  /* The main site's cursor: a small black dot, the same over anything clickable and on every background */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4' fill='black'/%3E%3C/svg%3E") 4 4, auto;
  --cursor-clickable: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4' fill='black'/%3E%3C/svg%3E") 4 4, pointer;
}

* {
  box-sizing: border-box;
}

html {
  cursor: var(--cursor);
}

/* Fading in, slowly and smoothly, once the design is ready (lab.js adds lab-ready, then lab-shown): a
   veil in the page's own background lies over the design and fades away. The menu at the top stays above
   it, there from the start – and nothing in the designs is touched, so their own fades, filters and
   frosted boxes work as before */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99; /* under the menu */
  background: inherit;
  pointer-events: none;
  transition: opacity 1.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.lab-ready::after {
  opacity: 0;
}

.lab-shown::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html::after {
    transition: none;
  }
}

a[href],
button,
.is-pointing {
  cursor: var(--cursor-clickable);
}

.lab-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: var(--gutter);
}

.lab-button {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 0;
  background: rgb(220 220 220 / 50%);
  -webkit-backdrop-filter: blur(20px); /* "40" in Figma – Figma's blur value is twice the CSS one */
  backdrop-filter: blur(20px);
  font: 500 14px/18px "Suisse Intl", sans-serif;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #121212; /* always dark on the frosted button, whatever the design's own text colour */
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  transition: color 0.6s ease, background-color 0.6s ease; /* designs may switch light/dark */
}

@media (hover: hover) {
  .lab-button[href]:hover {
    background: #00ff59;
    transition: none;
  }
}

/* The design you are on */
.lab-button.is-active {
  background: #121212;
  color: #eeeeee;
}

/* Lab: the list of designs below it. Closed, only the design you are on shows, right under Lab;
   hovering (or keyboard focus) opens the whole list. The padding keeps the pointer over the menu on
   its way from Lab down to the list */
.lab-menu {
  position: relative;
}

.lab-menu-list {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-top: 2px;
}

.lab-menu:not(:hover, :focus-within) .lab-menu-list > :not(.is-active) {
  display: none;
}

/* The inverted buttons, for designs with a dark background: <html class="lab-dark">. Dark grey
   boxes with light text, like an open project on the main site. The cursor stays black */
.lab-dark .lab-button {
  background: #474747;
  color: #eeeeee;
}

@media (hover: hover) {
  .lab-dark .lab-button[href]:hover {
    background: #00ff59;
    color: #121212;
  }
}

.lab-dark .lab-button.is-active {
  background: #eeeeee;
  color: #121212;
}

/* The label next to the pointer naming the project of the image under it (label.js): two boxes one above the
   other, 2px apart, exactly like the boxes in The Garden (a harvested project's title and what is said about it):
   square, frosted, Suisse Intl Medium, the name as it is written. Light grey with dark text; on a dark design
   (<html class="lab-dark">) dark grey with light text, like the buttons at the top. A box is as wide as its text,
   up to 320px, then wraps */
.lab-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.lab-label.is-shown {
  opacity: 1;
}

.lab-label > span {
  display: block;
  width: max-content;
  max-width: 320px;
  margin: 0;
  padding: 4px 10px;
  background: rgb(220 220 220 / 50%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font: 500 14px/18px "Suisse Intl", sans-serif;
  letter-spacing: -0.01em;
  color: #121212;
  white-space: normal;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease, color 0.6s ease;
}

.lab-label > span:empty {
  display: none;
}

.lab-dark .lab-label > span {
  background: #474747;
  color: #eeeeee;
}
