@import url("https://fonts.googleapis.com/css2?family=Parisienne&display=swap");

* {
  box-sizing: border-box;
}

html {
  background: #f7f5ef;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(20, 20, 18, 0.045) 1px, transparent 1px),
    #f7f5ef;
  background-size: 56px 56px;
  color: #171716;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

figure {
  margin: 0;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.flow {
  width: min(1260px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 58px 0 86px;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(110px, 0.26fr) minmax(0, 1fr);
  column-gap: clamp(18px, 3vw, 42px);
  row-gap: clamp(14px, 1.6vw, 22px);
  min-height: 124px;
  padding: clamp(34px, 4.5vw, 62px) 0;
}

.step:first-child {
  padding-top: 0;
}

.step:last-child {
  padding-bottom: 0;
}

.rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(54px, 10.4vw, 130px);
  width: 2px;
  background: #22211f;
}

.step:first-child .rail {
  top: 50%;
}

.step:last-child .rail {
  bottom: 50%;
}

.step::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: clamp(54px, 10.4vw, 130px);
  width: 12px;
  height: 12px;
  border: 2px solid #22211f;
  border-radius: 50%;
  background: #f7f5ef;
  transform: translate(-5px, -50%);
}

.moodboard,
.caption,
.variant-grid,
.hero-image {
  grid-column: 2;
}

.caption {
  margin: 0;
  max-width: 880px;
  align-self: end;
  color: #2a2925;
  font-family: "Parisienne", "Snell Roundhand", "Apple Chancery", cursive;
  font-size: clamp(30px, 4.3vw, 58px);
  font-weight: 400;
  line-height: 0.95;
  text-wrap: balance;
}

.prompt {
  max-width: 980px;
  font-size: clamp(28px, 3.7vw, 52px);
}

.moodboard {
  width: min(360px, 74vw);
  align-self: center;
  border: 1px solid rgba(26, 25, 22, 0.18);
  box-shadow: 0 18px 48px rgba(22, 22, 20, 0.12);
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 22px);
  align-items: center;
}

.variant-grid figure,
.hero-image,
.reference {
  overflow: hidden;
  border: 1px solid rgba(26, 25, 22, 0.16);
  background: #ebe8df;
  box-shadow: 0 20px 54px rgba(22, 22, 20, 0.13);
}

.variant-grid img,
.hero-image img {
  aspect-ratio: 4928 / 3360;
  object-fit: cover;
}

.hero-image {
  align-self: center;
}

.with-reference {
  grid-template-columns: minmax(110px, 0.26fr) minmax(120px, 0.22fr) minmax(0, 1fr);
}

.with-reference .caption {
  grid-column: 2 / 4;
}

.with-reference .reference {
  grid-column: 2;
  width: min(100%, 220px);
  align-self: center;
  justify-self: end;
}

.with-reference .reference img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.with-reference .hero-image {
  grid-column: 3;
}

.selected .hero-image,
.final .hero-image {
  box-shadow: 0 24px 68px rgba(22, 22, 20, 0.18);
}

@media (max-width: 820px) {
  .flow {
    width: min(100% - 24px, 620px);
    padding: 28px 0 56px;
  }

  .step,
  .with-reference {
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 12px;
    padding: 30px 0;
  }

  .rail,
  .step::before {
    left: 17px;
  }

  .moodboard,
  .caption,
  .variant-grid,
  .hero-image,
  .with-reference .hero-image {
    grid-column: 2;
  }

  .caption,
  .prompt,
  .with-reference .caption {
    grid-column: 2;
    font-size: clamp(28px, 12vw, 42px);
    line-height: 1;
  }

  .variant-grid {
    grid-template-columns: 1fr;
  }

  .with-reference .reference {
    grid-column: 2;
    width: min(42vw, 150px);
    justify-self: start;
    margin-bottom: 12px;
  }
}
