/**
 * Front page
 */

/* About */
.front-about {
  padding: clamp(4rem, 9vw, 7.5rem) var(--space-md) clamp(8rem, 16vw, 15rem);
  text-align: center;
  background-color: var(--color-bg);
  background-image: url("../images/index/bg_about.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
}

.front-about__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.front-about__title {
  margin: 0;
  font-weight: var(--font-weight-heading);
  letter-spacing: var(--tracking-display);
}

.front-about__body {
  display: flex;
  flex-direction: column;
  gap: 2.6em;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.front-about__paragraph {
  margin: 0;
  line-height: 2.5;
}

.front-about__paragraph.text-body {
  font-size: 18px;
}

.front-about__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: clamp(2.75rem, 5vw, 4.5rem);
}

@media (max-width: 960px) {
  .front-about__title,
  .front-step__title {
    font-size: clamp(20px, 6.4vw, 40px);
    line-height: 1.5;
    letter-spacing: var(--tracking-heading);
  }

  .front-about {
    padding: clamp(3rem, 11vw, 5rem) var(--space-md) clamp(8rem, 26vw, 12rem);
  }

  .front-about__body {
    gap: 1.3em;
    margin-top: clamp(2rem, 7vw, 3rem);
  }

  .front-about__paragraph {
    line-height: 2.1;
  }

  .front-about__paragraph.text-body {
    font-size: 14px;
  }

  .front-about__actions {
    gap: 1rem;
    margin-top: clamp(2.25rem, 8vw, 3.25rem);
  }

  .front-about__button {
    width: 100%;
    max-width: 210px;
    min-width: 0;
  }
}

/* Step — 4つのご縁（PC: コンテナ1440px内で左右交互 / SP: 写真を縮小・ずらして背景レイヤーを見せる） */
.front-step {
  padding-block: 0 0;
  background-color: var(--color-bg);
  overflow-x: clip;
  --motion-duration-photo: 0.65s;
  --motion-delay-photo: 0s;
  --motion-duration-layer: 0.52s;
  --motion-delay-layer-back: 0.28s;
  --motion-duration-layer-mid: 0.46s;
  --motion-delay-layer-mid: 0.38s;
  --motion-ease-stack: var(--motion-ease-out);
  --motion-ease-slide: var(--motion-ease-out);
  --motion-slide-offset: 4%;
}

.front-step__title {
  margin: 0;
  text-align: center;
}

.front-step__list {
  width: 100%;
  margin: clamp(3rem, 10vw, 9rem) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 8vw, 7rem);
}

.front-step__item {
  display: flex;
  flex-direction: column;
}

.front-step__visual {
  width: 100%;
}

.front-step__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-inline: var(--space-md);
  text-align: center;
}

.front-step__eyebrow {
  margin: 1em 0 0;
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: var(--text-body-size);
  line-height: 1.45;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  opacity: 0.6;
}

.front-step__name {
  margin: 0.45em 0;
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.45;
  letter-spacing: 0.09em;
}

.front-step__text {
  align-self: stretch;
  line-height: 2.5;
  text-align: left;
}

.front-step__text + .front-step__text {
  margin-top: 1.2em;
}

/* Step — photo slide + watercolor extend */
.js .front-step__frame:not(.is-layer-visible) .framed-image__layer {
  opacity: 0;
}

.js
  .front-step__frame.framed-image--peek-right:not(.is-layer-visible)
  .framed-image__layer {
  transform: translate(-2%, -1%) scale(0.96);
}

.js
  .front-step__frame.framed-image--peek-left:not(.is-layer-visible)
  .framed-image__layer {
  transform: translate(2%, -1%) scale(0.96);
}

.js
  .front-step__frame.framed-image--peek-right:not(.is-layer-visible)
  .framed-image__photo {
  opacity: 0;
  transform: translateX(calc(-1 * var(--motion-slide-offset)));
}

.js
  .front-step__frame.framed-image--peek-left:not(.is-layer-visible)
  .framed-image__photo {
  opacity: 0;
  transform: translateX(var(--motion-slide-offset));
}

.js
  .front-step__frame.framed-image--peek-right.is-layer-visible
  .framed-image__photo {
  animation: ichigo-step-photo-slide-left var(--motion-duration-photo)
    var(--motion-ease-slide) var(--motion-delay-photo) both;
}

.js
  .front-step__frame.framed-image--peek-left.is-layer-visible
  .framed-image__photo {
  animation: ichigo-step-photo-slide-right var(--motion-duration-photo)
    var(--motion-ease-slide) var(--motion-delay-photo) both;
}

.js .front-step__frame.is-layer-visible .framed-image__layer--back {
  animation: ichigo-step-layer-extend var(--motion-duration-layer)
    var(--motion-ease-stack) var(--motion-delay-layer-back) both;
}

.js .front-step__frame.is-layer-visible .framed-image__layer--mid {
  animation: ichigo-step-layer-extend-mid var(--motion-duration-layer-mid)
    var(--motion-ease-stack) var(--motion-delay-layer-mid) both;
}

.js
  .front-step__frame.framed-image--peek-right.is-layer-visible
  .framed-image__layer--back {
  --layer-stack-x: 8%;
  --layer-stack-y: -10%;
  --layer-stack-opacity: var(--framed-image-layer-back-opacity);
  --layer-start-x: -2%;
  --layer-start-y: -1%;
}

.js
  .front-step__frame.framed-image--peek-right.is-layer-visible
  .framed-image__layer--mid {
  --layer-stack-x: 4%;
  --layer-stack-y: -5%;
  --layer-stack-opacity: var(--framed-image-layer-mid-opacity);
  --layer-start-x: -1%;
  --layer-start-y: -0.5%;
}

.js
  .front-step__frame.framed-image--peek-left.is-layer-visible
  .framed-image__layer--back {
  --layer-stack-x: -8%;
  --layer-stack-y: -10%;
  --layer-stack-opacity: var(--framed-image-layer-back-opacity);
  --layer-start-x: 2%;
  --layer-start-y: -1%;
}

.js
  .front-step__frame.framed-image--peek-left.is-layer-visible
  .framed-image__layer--mid {
  --layer-stack-x: -4%;
  --layer-stack-y: -5%;
  --layer-stack-opacity: var(--framed-image-layer-mid-opacity);
  --layer-start-x: 1%;
  --layer-start-y: -0.5%;
}

@keyframes ichigo-step-photo-slide-left {
  from {
    opacity: 0;
    transform: translateX(calc(-1 * var(--motion-slide-offset, 4%)));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ichigo-step-photo-slide-right {
  from {
    opacity: 0;
    transform: translateX(var(--motion-slide-offset, 4%));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ichigo-step-layer-extend {
  0% {
    opacity: 0;
    transform: translate(var(--layer-start-x, 0), var(--layer-start-y, 0))
      scale(0.96);
  }

  100% {
    opacity: var(
      --layer-stack-opacity,
      var(--framed-image-layer-back-opacity, 0.58)
    );
    transform: translate(var(--layer-stack-x, -8%), var(--layer-stack-y, -10%))
      scale(1);
  }
}

@keyframes ichigo-step-layer-extend-mid {
  0% {
    opacity: 0;
    transform: translate(var(--layer-start-x, 0), var(--layer-start-y, 0))
      scale(0.97);
  }

  100% {
    opacity: var(
      --layer-stack-opacity,
      var(--framed-image-layer-mid-opacity, 0.68)
    );
    transform: translate(var(--layer-stack-x, -4%), var(--layer-stack-y, -5%))
      scale(1);
  }
}

@media (min-width: 961px) {
  .front-step__item {
    flex-direction: row;
    column-gap: clamp(3.5rem, 7vw, 7rem);
  }

  /* 画像が右配置のときは並びを反転（写真が右端、テキストが左） */
  .front-step__item--image-right {
    flex-direction: row-reverse;
  }

  /* 写真はコンテナ内。横幅は約56% */
  .front-step__visual {
    flex: 0 0 55%;
    width: auto;
  }

  .front-step__body {
    flex: 1 1 auto;
    margin-top: 0;
    padding-inline: 0;
  }

  /* テキスト側の外側に余白を確保 */
  .front-step__item--image-left .front-step__body {
    padding-right: clamp(2rem, 4vw, 4rem);
  }

  .front-step__item--image-right .front-step__body {
    padding-left: clamp(2rem, 4vw, 4rem);
  }

  /* 本文幅をデザインに合わせて約5文字分狭める（改行位置調整） */
  .front-step__text {
    padding-inline: 2.5em;
    box-sizing: border-box;
  }
}

@media (max-width: 960px) {
  .front-step__visual {
    padding-top: clamp(0.75rem, 2.5vw, 1.25rem);
  }

  /* メイン写真を縮小・左右ずらし → 背面の水彩2枚がはみ出して見える */
  .front-step__frame {
    width: 86%;
    max-width: 100%;
  }

  .front-step__item--image-left .front-step__frame {
    margin-right: auto;
    margin-left: 0;
  }

  .front-step__item--image-right .front-step__frame {
    margin-left: auto;
    margin-right: 0;
  }

  .front-step__frame.framed-image--peek-right .framed-image__layer--back {
    transform: translate(9%, -9%);
  }

  .front-step__frame.framed-image--peek-right .framed-image__layer--mid {
    transform: translate(4.5%, -4.5%);
  }

  .front-step__frame.framed-image--peek-left .framed-image__layer--back {
    transform: translate(-9%, -9%);
  }

  .front-step__frame.framed-image--peek-left .framed-image__layer--mid {
    transform: translate(-4.5%, -4.5%);
  }

  .js
    .front-step__frame.framed-image--peek-right.is-layer-visible
    .framed-image__layer--back {
    --layer-stack-x: 9%;
    --layer-stack-y: -9%;
  }

  .js
    .front-step__frame.framed-image--peek-right.is-layer-visible
    .framed-image__layer--mid {
    --layer-stack-x: 4.5%;
    --layer-stack-y: -4.5%;
  }

  .js
    .front-step__frame.framed-image--peek-left.is-layer-visible
    .framed-image__layer--back {
    --layer-stack-x: -9%;
    --layer-stack-y: -9%;
  }

  .js
    .front-step__frame.framed-image--peek-left.is-layer-visible
    .framed-image__layer--mid {
    --layer-stack-x: -4.5%;
    --layer-stack-y: -4.5%;
  }

  .front-step__body {
    margin-top: clamp(0.75rem, 2.5vw, 1.25rem);
  }

  .front-step__title {
    padding-inline: var(--space-md);
  }

  .front-step__name {
    margin: 0.3em 0;
    font-size: clamp(22px, 6.4vw, 40px);
    line-height: 1.5;
    letter-spacing: var(--tracking-heading);
  }

  .front-step__text {
    line-height: 2.1;
  }
}
