/* The photo on turning slats: warm paper, one photo in the middle cut into horizontal slats, a thin ruler on its
   left and a short caption under it, in a variable typeface (Archivo, width 62 to 125 and weight 100 to 900). */
:root {
  --paper: #f3f0e8;    /* the page */
  --ink: #141414;      /* the caption, the name of the studio */
  --muted: #8d887e;    /* the small print, the ruler */
  --accent: #e2432a;   /* the marker that runs down the ruler with the turning slats */
  --shade: #141414;    /* the colour a slat turns towards as it faces away from the light */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mark {
  position: absolute;
  top: 26px;
  left: 32px;
  margin: 0;
  font-size: 15px;
  font-weight: 620;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.005em;
}

/* the script writes left, top, width and height */
.plate {
  position: absolute;
  margin: 0;
  visibility: hidden;
}

.plate.is-ready {
  visibility: visible;
}

/* an element for GSAP (the one-pixel settle when the last slat lands) */
.settle {
  position: absolute;
  inset: 0;
}

/* the next photo, waiting behind the slats */
.behind {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
}

.slats {
  position: absolute;
  inset: 0;
  perspective: 1100px;
  -webkit-perspective: 1100px;
}

/* one slat: the script turns it on its long axis; the photo it shows now on the front, the next one on the back */
.slat {
  position: absolute;
  left: 0;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform;
}

.face {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.face--back {
  transform: rotateX(180deg);
}

/* the shade on a face: darker the more it turns away */
.face i {
  position: absolute;
  inset: 0;
  background: var(--shade);
  opacity: 0;
}

/* the ruler: one hairline tick on every seam between two slats */
.ruler {
  position: absolute;
  top: 0;
  left: -22px;
  width: 10px;
  height: 100%;
  pointer-events: none;
}

.ruler i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--muted);
  opacity: 0.55;
  transform-origin: 100% 50%;
}

.marker {
  position: absolute;
  top: 0;
  left: -30px;
  width: 18px;
  height: 1px;
  background: var(--accent);
  transform-origin: 100% 50%;
  pointer-events: none;
  opacity: 0;
}

.cap {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

/* two lines in the same box: the one leaving goes up, the one arriving comes up from below */
.cap__title {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 1.3em;
  font-size: 36px;
  line-height: 1.1;
  overflow: hidden;
}

.cap__line {
  position: absolute;
  left: 0;
  bottom: 0.12em;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* every letter carries its own weight and width */
.cap__line span {
  --g: 560;
  --w: 100;
  display: inline-block;
  white-space: pre;
  font-variation-settings: 'wght' var(--g), 'wdth' var(--w);
}

.cap__meta {
  position: relative;
  height: 1.4em;
  min-width: 9em;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 440;
  font-variation-settings: 'wdth' 96;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  margin-bottom: 0.5em;
}

.cap__meta b {
  position: absolute;
  right: 0;
  bottom: 0;
  font-weight: inherit;
}

@media (max-width: 640px) {
  .mark {
    top: 20px;
    left: 20px;
    font-size: 14px;
  }

  .ruler {
    left: -16px;
    width: 7px;
  }

  .marker {
    left: -21px;
    width: 12px;
  }

  .cap {
    margin-top: 14px;
    gap: 10px;
  }

  .cap__title {
    font-size: 26px;
  }

  .cap__meta {
    font-size: 11px;
    min-width: 8em;
  }
}
