@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,300..800;1,300..800&display=swap");

:root {
  --ink: #111;
  --paper: #f2f2f0;
  --edge: clamp(16px, 3vw, 46px);
  font-family: "Inter Tight", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html,
body {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  font-weight: 350;
  letter-spacing: -.045em;
}

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

.scrap-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  width: 100%;
  padding: 30px var(--edge) 0;
  font-size: clamp(.82rem, 1vw, 1rem);
  line-height: .95;
  pointer-events: none;
}

.scrap-header > * { pointer-events: auto; }

.scrap-home { justify-self: start; text-transform: uppercase; }

.scrap-name { justify-self: end; }
.scrap-name em { font-style: italic; }

.scrap-heading {
  justify-self: center;
  text-align: center;
}

.scrap-title {
  margin: 0;
  font-size: clamp(2.25rem, 4.2vw, 4.8rem);
  font-weight: 350;
  letter-spacing: -.05em;
  line-height: .95;
  text-align: center;
  white-space: nowrap;
}

.scrap-subtitle {
  margin: .55rem 0 0;
  color: #969693;
  font-size: clamp(.78rem, 1vw, 1rem);
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.scrap-canvas {
  position: relative;
  width: 100%;
  min-height: 2200px;
  overflow: hidden;
}

.scrap-piece {
  position: absolute;
  z-index: 1;
  width: min(34vw, 500px);
  margin: 0;
}

.scrap-piece img,
.scrap-piece video {
  display: block;
  width: 100%;
  height: auto;
}

.scrap-piece video { background: #111; }

.scrap-piece figcaption {
  margin-top: 7px;
  color: #9a9a96;
  font-size: clamp(.75rem, .84vw, .9rem);
  font-weight: 300;
  letter-spacing: -.018em;
  line-height: 1.15;
}

.scrap-piece--poem {
  top: 285px;
  left: 7%;
  width: min(34vw, 510px);
  transform: rotate(-.45deg);
}

.scrap-piece--affection {
  top: 205px;
  right: 6%;
  width: min(22vw, 330px);
  transform: rotate(.62deg);
}

.scrap-piece--walking-men {
  top: 805px;
  left: 35%;
  width: min(39vw, 590px);
  transform: rotate(-.28deg);
}

.scrap-piece--davide {
  top: 1320px;
  right: 4%;
  width: min(61vw, 930px);
  transform: rotate(.38deg);
}

.scrap-piece--kontakthof {
  top: 1650px;
  left: 6%;
  width: min(29vw, 410px);
  transform: rotate(-.31deg);
}

.scrap-fly {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: clamp(29px, 2.5vw, 39px);
  height: clamp(29px, 2.5vw, 39px);
  pointer-events: none;
  transform: translate3d(-60px, -60px, 0);
  transform-origin: 50% 50%;
  transition: opacity .18s ease;
  will-change: transform;
}

.scrap-fly.is-away { opacity: 0; }

.scrap-fly img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .24));
  transform-origin: 50% 50%;
}

.scrap-fly.is-flying img {
  animation: fly-buzz 55ms steps(2, end) infinite;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .16)) blur(.15px);
}

.scrap-fly.is-landed img { animation: fly-alive 1.25s ease-in-out infinite; }

@keyframes fly-buzz {
  0% { transform: scale(.96) rotate(-2deg); }
  100% { transform: scale(1.035) rotate(2deg); }
}

@keyframes fly-alive {
  0%, 70%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  76% { transform: translate3d(.5px, -.5px, 0) rotate(-1.5deg); }
  82% { transform: translate3d(-.5px, 0, 0) rotate(1deg); }
}

@media (max-width: 720px) {
  .scrap-header {
    grid-template-columns: 1fr 1fr;
    padding-top: 18px;
  }

  .scrap-heading {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 52px;
  }

  .scrap-title {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .scrap-subtitle {
    margin-top: .42rem;
    font-size: .78rem;
  }

  .scrap-home { grid-column: 1; grid-row: 1; }
  .scrap-name { grid-column: 2; grid-row: 1; text-align: right; }

  .scrap-canvas { min-height: calc(2400px + 66vw); }

  .scrap-piece--affection {
    top: 225px;
    right: 5%;
    width: 59vw;
  }

  .scrap-piece--poem {
    top: 650px;
    left: 6%;
    width: 76vw;
  }

  .scrap-piece--walking-men {
    top: 1225px;
    left: 7%;
    width: 86vw;
  }

  .scrap-piece--davide {
    top: 1580px;
    right: 3%;
    width: 92vw;
  }

  .scrap-piece--kontakthof {
    top: calc(1750px + 61vw);
    left: 6%;
    width: 88vw;
  }

  .scrap-fly { width: 29px; height: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  .scrap-fly { display: none; }
}
