.heritage-reveal {
  --wipe: 0;
  position: relative;
  background-color: var(--offwhite);
  color: var(--black);
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal {
    height: 260vh;
  }
}

.heritage-reveal.is-static {
  height: auto;
}

/* ============================================ */
/* PINNED FRAME */
/* ============================================ */

.heritage-reveal__sticky {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}

.heritage-reveal.is-static .heritage-reveal__sticky {
  position: relative;
  height: auto;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.heritage-reveal__wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-left: 20px;
  padding-right: 20px;
}

/* Tablet Portrait Up - Min 600px */
@media (min-width: 600px) {
  .heritage-reveal__wrapper {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__wrapper {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100%;
  }
}

/* Desktop Up - Min 1200px */
@media (min-width: 1200px) {
  .heritage-reveal__wrapper {
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* ============================================ */
/* TEXT */
/* ============================================ */

.heritage-reveal__text {
  max-width: 600px;
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__text {
    flex-basis: 44%;
  }
}

.heritage-reveal__year {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--secondary-color-darkened);
  font-size: 88px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* Desktop Up - Min 1200px */
@media (min-width: 1200px) {
  .heritage-reveal__year {
    font-size: 136px;
  }
}

.heritage-reveal__text h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 36px;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

/* Tablet Portrait Up - Min 600px */
@media (min-width: 600px) {
  .heritage-reveal__text h2 {
    font-size: 48px;
  }
}

/* Desktop Up - Min 1200px */
@media (min-width: 1200px) {
  .heritage-reveal__text h2 {
    font-size: 56px;
  }
}

.heritage-reveal__description {
  margin-top: 0;
  margin-bottom: 2.5rem;
  color: var(--dark-gray);
  font-size: 17px;
  line-height: 1.6;
}

/* ============================================ */
/* THEN AND NOW */
/* ============================================ */

.heritage-reveal__frames {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__frames {
    display: block;
    height: 74vh;
    aspect-ratio: 4 / 5;
  }
}

.heritage-reveal__then,
.heritage-reveal__now {
  position: relative;
  /* keeps each caption inside its own photograph's layer */
  isolation: isolate;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--sand);
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__then,
  .heritage-reveal__now {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
  }
}

.heritage-reveal__then::after,
.heritage-reveal__now::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background-image: linear-gradient(to top, rgba(10, 26, 18, 0.7), rgba(10, 26, 18, 0));
  pointer-events: none;
}

.heritage-reveal__then img,
.heritage-reveal__now img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heritage-reveal__then img {
  transform: scale(calc(1 + var(--wipe) * 0.08));
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__now {
    clip-path: inset(calc((1 - var(--wipe)) * 100%) 0 0 0);
  }
}

.heritage-reveal.is-static .heritage-reveal__now {
  clip-path: none;
}

/* Without the scroll wipe (reduced motion), then and now sit side by side, as on phones */

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal.is-static .heritage-reveal__frames {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex-basis: 48%;
    height: auto;
    aspect-ratio: auto;
  }
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal.is-static .heritage-reveal__then {
    position: relative;
    aspect-ratio: 4 / 5;
  }
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal.is-static .heritage-reveal__now {
    position: relative;
    aspect-ratio: 4 / 5;
  }
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal.is-static .heritage-reveal__now img {
    transform: none;
  }
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__now img {
    transform: scale(calc(1.12 - var(--wipe) * 0.12));
  }
}

.heritage-reveal__then figcaption,
.heritage-reveal__now figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  color: var(--offwhite);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

/* Tablet Landscape Up - Min 900px */
@media (min-width: 900px) {
  .heritage-reveal__then figcaption,
  .heritage-reveal__now figcaption {
    left: 20px;
    bottom: 18px;
  }
}

/* A plate is artwork rather than a photograph, such as the original logo printed on old paper:
   no shade under the caption, which is set dark */
.heritage-reveal__plate {
  background-color: var(--offwhite);
}

.heritage-reveal__plate::after {
  display: none;
}

/* Set in black: over the faint photograph printed in the paper, dark gray would fall under 4.5:1 */
.heritage-reveal__plate figcaption {
  color: var(--black);
}
