/* The photo from the slit: warm paper, one photo in the middle and a short caption under it, in a variable
   typeface (Archivo, width 62 to 125 and weight 100 to 900). The photo opens from one thin vertical slit. */
:root {
  --paper: #f3f0e8;    /* the page */
  --ink: #141414;      /* the caption once the photo has landed */
  --muted: #8d887e;    /* the caption while the photo opens, the small print */
  --accent: #e2432a;   /* the two hairlines of the slit */
}

* {
  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;
}

.cols {
  position: absolute;
  inset: 0;
}

/* one column of the photo: an element for the window (clip-path), its child for the photo that slides inside */
.col {
  position: absolute;
  top: 0;
  height: 100%;
  clip-path: inset(0 0 0 100%);
  will-change: clip-path;
}

.col__photo {
  position: absolute;
  top: 0;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

/* the two hairlines of the slit: they ride the outer edges of the opening, a little longer than the photo */
.edge {
  position: absolute;
  left: 0;
  top: -14px;
  width: 1px;
  height: calc(100% + 28px);
  background: var(--accent);
  transform-origin: 50% 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: baseline;
  gap: 16px;
}

.cap__title {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 0.06em 0.14em 0;
  margin-bottom: -0.14em;
}

/* every letter carries its own weight and width: the script turns them up when the photo lands */
.cap__title span {
  --g: 220;
  --w: 112;
  display: inline-block;
  white-space: pre;
  color: var(--muted);
  font-variation-settings: 'wght' var(--g), 'wdth' var(--w);
}

.cap__meta {
  font-size: 12px;
  font-weight: 440;
  font-variation-settings: 'wdth' 96;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

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

  .cap__title {
    font-size: 20px;
  }

  .cap__meta {
    font-size: 11px;
  }
}
