/* Images of the work are paired with the same person's name throughout. */
.hero-work-image {
  position: absolute;
  inset: 95px 0 auto;
  margin: 0;
  border-top: 4px solid var(--accent, #d9ee7c);
  background: #fbfcf6;
  color: var(--ink);
  box-shadow: 13px 16px 0 #0000000b;
  opacity: 0;
  visibility: hidden;
  transform: translateY(26px) rotate(2deg);
  transition: opacity .45s, transform .8s cubic-bezier(.2,.7,.1,1), visibility .45s;
}

.hero-work-image > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.hero-work-image figcaption {
  padding: 15px 20px 17px;
  border-top: 1px solid #173e3117;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 500;
}

.nishida-stage[data-step="1"] .audit-image,
.nishida-stage[data-step="2"] .execute-image {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nishida-stage[data-step="2"] .audit-image {
  transform: translateY(-28px) rotate(-2deg);
}

.nishida-stage[data-step="2"] .execute-image {
  border-top-color: var(--ink);
}

.team-work-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 4vw, 64px);
}

.team-work-intro > figure {
  margin: 0;
  min-width: 0;
  background: #fbfcf6;
}

.team-work-intro > figure > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.team-work-intro > div { min-width: 0; }

.team-work-intro h2 {
  font-size: clamp(35px, 3.15vw, 48px);
  line-height: 1.7;
  letter-spacing: 0;
}

.team-work-intro p {
  margin-top: 25px;
  font-size: 18px;
  line-height: 2;
}

.same-person-flow {
  position: relative;
  margin-top: 58px;
  padding: 36px 32px 32px;
  border: 1px solid #cdd5cc;
  background: #f1f4eb;
}

.flow-person {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 30px;
}

.flow-person > img,
.flow-face {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  background: #d9ee7c;
}

.flow-face {
  display: block;
  position: relative;
  overflow: hidden;
}

.flow-face > img {
  position: absolute;
  width: 190%;
  max-width: none;
  height: auto;
  left: -45%;
  top: -29%;
}

.flow-person > p {
  font-size: 16px;
  line-height: 1.8;
}

.flow-person strong {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.6;
  letter-spacing: .04em;
}

.flow-scenes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.flow-scenes > figure {
  min-width: 0;
  margin: 0;
  background: #fbfcf6;
}

.flow-scenes > figure > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.flow-scenes figcaption {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 23px 22px 26px;
  border-top: 1px solid #dbe1d5;
}

.flow-scenes figcaption > span {
  flex: none;
  font-family: Instrument, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  color: #627d4d;
}

.flow-scenes figcaption > div {
  min-width: 0;
}

.flow-scenes h3 {
  font-size: 22px;
  line-height: 1.65;
  font-weight: 600;
}

.flow-scenes figcaption p {
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.9;
}

.flow-connector {
  display: grid;
  place-items: center;
  align-self: center;
  width: 46px;
  height: 46px;
  margin-top: -82px;
  border-radius: 50%;
  background: var(--accent, #d9ee7c);
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
}

.service-picture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 68px;
}

.service-picture-grid > article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 32px 32px;
  border: 1px solid #d4dccd;
  background: #f3f5ee;
}

/* The source has two equal panels. Each crop keeps the source's proportions. */
.service-picture {
  position: relative;
  width: min(100%, 270px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  align-self: center;
  margin-bottom: 26px;
  background: #f9faf5;
}

.service-picture > img {
  display: block;
  width: 200%;
  max-width: none;
  height: 100%;
  object-fit: fill;
}

.service-picture-people > img {
  transform: translateX(-50%);
}

.service-picture-grid h3 {
  font-family: var(--serif);
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.7;
}

.service-picture-grid p {
  margin-top: 15px;
  font-size: 18px;
  line-height: 1.95;
}

.service-picture-grid a {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: auto;
  padding-top: 25px;
  padding-bottom: 8px;
  border-bottom: 1px solid #8ea27b;
  font-size: 16px;
  line-height: 1.8;
}

.service-picture-grid a::after {
  content: "↓";
  font-size: 22px;
  line-height: 1;
}

.service-picture-grid a:hover {
  border-bottom-color: var(--ink);
}

.service-row:target {
  background: #e9efde;
  outline: 1px solid #9fb68b;
  outline-offset: 8px;
}

.process-picture {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  max-width: 1100px;
  margin: 0 auto 54px;
  background: #fbfcf6;
}

.process-picture > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.process-picture figcaption {
  padding: 30px 36px;
  font-family: var(--serif);
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.85;
}

.contact-picture {
  margin: 38px 0 0;
  max-width: 560px;
}

.contact-picture > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #fbfcf6;
}

.contact-picture figcaption {
  padding-top: 15px;
  font-size: 16px;
  line-height: 1.8;
  color: #e7efd9;
}

@media (max-width: 1200px) and (min-width: 761px),
       (max-height: 820px) and (min-width: 761px) {
  .hero-work-image { top: 80px; }
  .hero-work-image figcaption { padding: 13px 16px 15px; }
}

@media (min-width: 761px) and (max-width: 799px) {
  .hero-work-image figcaption { font-size: 15px; }
}

@media (max-width: 980px) {
  .team-work-intro { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .team-work-intro > figure { width: 100%; max-width: 780px; margin-inline: auto; }
  .team-work-intro h2 { font-size: 44px; }
  .team-work-intro p { max-width: 700px; }
  .same-person-flow { padding: 28px 24px 24px; }
  .flow-scenes { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 10px; }
  .flow-connector { width: 36px; height: 36px; font-size: 24px; }
  .flow-scenes figcaption { gap: 12px; padding: 20px 17px 23px; }
  .flow-scenes h3 { font-size: 20px; }
  .flow-scenes figcaption p { font-size: 17px; }
  .service-picture-grid { gap: 24px; }
  .service-picture-grid > article { padding: 25px 24px 28px; }
}

@media (max-width: 760px) {
  .nishida-stage[data-step="1"] .work-visual,
  .nishida-stage[data-step="2"] .work-visual { top: 325px; }
  .story-chapters { gap: 8px; }
  .story-chapters button { font-size: 13px; white-space: nowrap; }
  .team-work-intro { gap: 25px; }
  .team-work-intro h2 { font-size: clamp(30px, 7.8vw, 38px); line-height: 1.7; }
  .team-work-intro p { margin-top: 18px; font-size: 16px; line-height: 2; }
  .hero-work-image {
    top: 56px;
    width: min(100%, 320px);
    margin-inline: auto;
    border-top-width: 3px;
    box-shadow: 7px 9px 0 #0000000b;
  }

  .hero-work-image figcaption {
    padding: 10px 15px 12px;
    font-size: 14px;
    line-height: 1.65;
  }

  .same-person-flow { margin-top: 36px; padding: 25px 18px 20px; }
  .flow-person { gap: 15px; margin-bottom: 25px; }
  .flow-person > img, .flow-face { width: 60px; height: 60px; flex-basis: 60px; }
  .flow-person > p { font-size: 14px; }
  .flow-person strong { font-size: 24px; }
  .flow-scenes { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .flow-connector { justify-self: center; margin: 0; transform: rotate(90deg); }
  .flow-scenes figcaption { padding: 20px 17px 22px; }
  .flow-scenes figcaption > span { font-size: 29px; }
  .flow-scenes h3 { font-size: 20px; }
  .flow-scenes figcaption p { margin-top: 10px; font-size: 16px; line-height: 1.9; }
  .service-picture-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 43px; }
  .service-picture-grid > article { padding: 22px 22px 26px; }
  .service-picture { margin-bottom: 22px; }
  .service-picture-grid h3 { font-size: 25px; }
  .service-picture-grid p { margin-top: 12px; font-size: 16px; line-height: 1.95; }
  .service-picture-grid a { padding-top: 22px; font-size: 16px; }
  .process-picture { grid-template-columns: minmax(0, 1fr); max-width: 540px; margin-bottom: 36px; }
  .process-picture figcaption { padding: 20px 24px 25px; font-size: 24px; line-height: 1.75; }
  .contact-picture { margin-top: 28px; }
  .contact-picture figcaption { font-size: 15px; }
}

@media (max-width: 360px) {
  .nishida-stage[data-step="1"] .work-visual,
  .nishida-stage[data-step="2"] .work-visual { top: 330px; }
  .story-chapters { gap: 6px; }
  .story-chapters button { font-size: 12px; }
  .hero-work-image { top: 58px; }
  .team-work-intro h2 { font-size: 29px; }
  .same-person-flow { padding-inline: 12px; }
  .flow-scenes figcaption { gap: 10px; padding-inline: 14px; }
  .flow-scenes h3 { font-size: 18px; }
  .service-picture-grid > article { padding-inline: 18px; }
  .service-picture-grid h3 { font-size: 23px; }
  .process-picture figcaption { padding-inline: 20px; font-size: 22px; }
}

