:root {
  --bg: #f4f2ee;
  --fg: #e10600;
  --muted: #777;
  --gap: clamp(1rem, 3vw, 2rem);
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: var(--gap);
  text-transform: lowercase;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
  }
}

header {
  margin-bottom: 20vh;
}

nav {
  display: flex;
  justify-content: flex-end;
  gap: var(--gap);
}

nav [aria-current] {
  opacity: 0.6;
}

.hero h1 {
  font-size: clamp(3rem, 16vw, 14rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* shortcut: Noto Sans Symbols 2 subset with only ⠗⠑⠝, regenerate if the braille text changes */
@font-face {
  font-family: "Braille";
  src: url("../fonts/braille.woff2") format("woff2");
}

.braille {
  font-family: "Braille";
  font-weight: 400;
}

.cloud {
  height: 500vh;
  margin: 0 calc(-1 * var(--gap));
}

.cloud figure {
  --shift: 1;
  --side: -1;
  --fit-x: 0.45;
  --fit-y: 0.9;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 100vh;
}

.cloud canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  translate: calc(var(--shift) * var(--side) * 25%) 0;
}

.cloud figcaption {
  position: relative;
  grid-column: 2;
  padding: var(--gap);
}

.lens {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg) no-repeat;
  box-shadow: 0 0 0 2px var(--fg);
  pointer-events: none;
}

@media (min-width: 701px) {
  .cloud:nth-child(even of .cloud) figure {
    --side: 1;
  }

  .cloud:nth-child(even of .cloud) figcaption {
    grid-column: 1;
    justify-self: end;
    text-align: right;
  }
}

.cloud h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  margin-bottom: 0.5em;
}

.cloud p {
  max-width: 40ch;
  margin-top: 0.5em;
}

@media (prefers-reduced-motion: reduce) {
  .cloud {
    height: 100vh;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cloud figure {
    --shift: 0;
  }

  .cloud figcaption > * {
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .cloud figure {
    --fit-x: 0.9;
    --fit-y: 0.62;
    grid-template-columns: 1fr;
    grid-template-rows: 2fr 1fr;
  }

  /* centre the drawing in the top two thirds: from 50% up to 33.3% */
  .cloud canvas {
    translate: 0 calc(var(--shift) * -100% / 6);
  }

  .cloud figcaption {
    grid-column: 1;
    grid-row: 2;
    text-align: center;
  }

  .cloud p {
    margin-inline: auto;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.grid figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.about {
  max-width: 40ch;
  font-size: 1.25rem;
}

.about p + p {
  margin-top: 1em;
}
