:root {
  color-scheme: dark;
  --bg-color: #0b0d10;
  --text-color: #f2f4f7;
  --muted-color: #b7bec9;
  --accent-color: #a6b1c2;
  --overlay-color: rgba(10, 12, 16, 0.55);
  --max-width: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Serif 4", "Times New Roman", serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  scrollbar-width: none;
}

main {
  position: relative;
  overflow-x: hidden;
}

.scrolly {
  position: relative;
  min-height: 320vh;
}

.scrolly__background {
  position: fixed;
  inset: 0;
  background-image: url("../assets/ScrollyTellingA-bg.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(var(--bg-scale, 1));
  transform-origin: center;
  will-change: transform;
  z-index: 0;
}

@media (max-width: 1024px) {
  .scrolly__background {
    background-image: url("../assets/ScrollyTellingA-tablet-bg.jpg");
  }
}

.scrolly__overlay {
  position: fixed;
  inset: 0;

  z-index: 1;
  pointer-events: none;
}

.scrolly__layers {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.layer-group {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 500ms ease;
}

.layer-group.is-active {
  opacity: 1;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 120ms linear, transform 120ms linear;
}

.layer-1 {
  z-index: 1;
}

.layer-2 {
  z-index: 2;
  object-fit: contain;
}


.scrolly__steps {
  position: relative;
  z-index: 3;
}

.step {
  min-height: 140vh;
}

.step[data-step="3"] {
  min-height: 220vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.article {
  position: relative;
  z-index: 5;
  background: #0b0d10;
  padding: 96px 20px 120px;
}

.article__inner {
  margin: 0 auto;
  max-width: var(--max-width);
}

.article__kicker {
  font-family: "Source Sans 3", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  color: var(--muted-color);
  margin: 0 0 16px;
}

.article__headline {
  font-size: clamp(2.1rem, 3vw + 1.5rem, 3.4rem);
  line-height: 1.15;
  margin: 0 0 12px;
}

.article__byline {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 0.95rem;
  color: var(--accent-color);
  margin: 0 0 32px;
}

.article p {
  font-size: 1.05rem;
  color: var(--text-color);
  margin: 0 0 20px;
}

@media (max-width: 768px) {
  .scrolly__background {
    background-image: url("../assets/ScrollyTellingA-mobile-bg.jpg");
  }

  .scrolly {
    min-height: 300vh;
  }

  .scrolly__layers,
  .layer-group {
    height: 100svh;
    place-items: end center;
  }

  .layer {
    width: 100vw;
    height: 100svh;
    min-width: 100vw;
    object-fit: cover;
    object-position: center bottom;
  }

  @supports (height: 100dvh) {
    .scrolly__layers,
    .layer-group {
      height: 100dvh;
    }

    .layer {
      height: 100dvh;
    }
  }

  .layer-1 {
    object-position: right bottom;
  }

  .layer-2 {
    object-position: center center;
    object-fit: contain;
  }

  .article {
    padding: 72px 18px 96px;
  }

  .article p {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer,
  .layer-group {
    transition: none;
  }
}
