/* A mounted family photograph opens the story. */
.counter-memory {
  margin: clamp(3rem, 7vw, 6rem) 4% 0;
  border-top: 1px solid var(--rule);
  padding-top: clamp(1.6rem, 3vw, 3rem);
  display: grid;
  grid-template-columns: .88fr 1fr;
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
}
.counter-memory > p { font-size: 1.05rem; max-width: 42ch; }
.counter-memory blockquote {
  margin: 0;
  color: var(--green);
  font: italic clamp(1.95rem, 3.55vw, 3.2rem)/1.12 var(--serif);
}
.memory-credit { margin-top: .75rem; font-size: .9rem; }
@media (max-width: 720px) {
  .counter-memory { grid-template-columns: 1fr; gap: 1.3rem; margin-inline: 0; }
}
.counter-intro {
  grid-template-columns: minmax(0, .88fr) minmax(0, 1fr);
  padding-inline: 4%;
}
.counter-intro .chapter-portrait {
  align-self: center;
  background: #fffdf5;
  padding: clamp(9px, 1.2vw, 18px);
  transform: rotate(-2deg);
  box-shadow: 1px 4px 7px #473d2724, 3px 14px 22px -12px #44351f40;
}
.counter-intro .chapter-portrait img {
  aspect-ratio: .93;
  object-fit: cover;
  object-position: 55% center;
}
.counter-intro figcaption {
  padding: .35em .25em .1em;
  font-size: clamp(.9rem, 1.2vw, 1.03rem);
}
.chapter-intro h2 {
  font: normal clamp(3rem, 6.2vw, 5.6rem)/.99 var(--serif);
  letter-spacing: -.045em;
}
.roastery-intro {
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  column-gap: clamp(1.75rem, 5vw, 5rem);
}
.roastery-intro .chapter-portrait {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-self: center;
  align-items: center;
  isolation: isolate;
  padding: .6rem 2% .5rem;
}
.roastery-intro .chapter-portrait::before {
  content: "";
  grid-area: 1 / 1 / 2 / 6;
  align-self: start;
  margin-top: 21%;
  aspect-ratio: 500 / 654;
  background: #ded9cd url("/assets/roastery-machine-detail.webp") center / cover;
  border: clamp(4px, .6vw, 8px) solid #fffdf5;
  box-shadow: 1px 4px 6px #473d2729;
  transform: rotate(-7deg);
}
.roastery-intro .chapter-portrait img {
  grid-area: 1 / 5 / 2 / -1;
  z-index: 1;
  aspect-ratio: 4 / 4.7;
  object-fit: cover;
  object-view-box: inset(15% 3% 8% 29%);
  object-position: 83% center;
  border: clamp(5px, .65vw, 10px) solid #fffdf5;
  box-shadow: 1px 5px 10px #473d272b;
  transform: rotate(2deg);
}
.roastery-intro figcaption {
  grid-area: 2 / 2 / 3 / 11;
  position: relative;
  z-index: 2;
  justify-self: start;
  margin: clamp(-40px, -2.5vw, -15px) 0 0;
  padding: .8em 1.25em;
  color: var(--paper);
  background: var(--ink);
  font: normal clamp(1rem, 1.25vw, 1.17rem)/1.4 var(--serif);
  transform: rotate(-1deg);
}
.roastery-intro figcaption em {
  display: block;
  font-size: 1.5em;
  line-height: 1.15;
}
/* The small control-room print sits over the margin of the large release. */
.roasting-photos {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas: none;
  align-items: start;
  gap: 0;
}
.roasting-photos .roast-controls {
  grid-area: 1 / 1 / 2 / 5;
  margin-top: 15%;
  z-index: 1;
  border: clamp(5px, .65vw, 9px) solid #fffdf5;
  transform: rotate(-2deg);
  box-shadow: 1px 4px 8px #3b332d30;
}
.roasting-photos .roast-release {
  grid-area: 1 / 4 / 3 / -1;
  aspect-ratio: 1.65;
  height: auto;
}
.roasting-photos .roast-beans {
  grid-area: 3 / 2 / 4 / 8;
  aspect-ratio: 2.45;
  margin-top: clamp(-36px, -2.5vw, -12px);
  border: clamp(5px, .65vw, 9px) solid var(--paper);
  object-position: 55% 58%;
}
@media (max-width: 720px) {
  .chapter-intro { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .chapter-intro h2 { font-size: clamp(2.75rem, 11vw, 4rem); }
  .counter-intro .chapter-portrait { margin: .8rem 6% .2rem; }
  .roastery-intro .chapter-portrait { padding-inline: 3%; }
  .roastery-intro figcaption { grid-column: 1 / 12; padding: .65em 1em; }
  .roasting-photos .roast-controls { grid-area: 1 / 1 / 2 / 8; margin-top: 0; }
  .roasting-photos .roast-release { grid-area: 2 / 2 / 3 / -1; margin-top: -.65rem; }
  .roasting-photos .roast-beans { grid-area: 3 / 1 / 4 / 8; aspect-ratio: 1.25; }
}
@media (prefers-reduced-motion: no-preference) {
  .counter-intro .chapter-portrait, .roasting-photos .roast-controls {
    transform-origin: 30% 85%;
    transform: rotate(calc(-2deg - 4deg * var(--entry-left, 0)));
  }
  .roastery-intro .chapter-portrait::before {
    transform: translateX(calc(10% * var(--entry-left, 0))) rotate(calc(-7deg + 5deg * var(--entry-left, 0)));
  }
  .roastery-intro figcaption {
    transform: translateY(calc(12px * var(--entry-left, 0))) rotate(-1deg);
  }
  .roasting-photos .roast-release {
    clip-path: inset(0 0 calc(12% * var(--entry-left, 0)) 0);
  }
  .roasting-photos .roast-beans {
    transform: translateY(calc(24px * var(--entry-left, 0))) rotate(calc(3deg * var(--entry-left, 0)));
  }
}
