/**
 * Staff page
 */

.page--staff {
  position: relative;
  overflow-x: clip;
}

.site-main:has(.page--staff) {
  overflow-x: clip;
}

/* 江口さんと澤田さんの間 — 背景画像ブリッジ */
.staff-bridge-bg {
  position: relative;
  z-index: 1;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.staff-bridge-bg::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 0;
  width: 100%;
  height: clamp(300px, 72vw, 1015px);
  background: url("../images/staff/bg_staff.png") center / 100% 100% no-repeat;
  opacity: 0.9;
  mix-blend-mode: multiply;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@media (min-width: 961px) {
  .staff-bridge-bg::before {
    width: 100%;
    height: clamp(260px, 64vw, 900px);
    transform: translate(-50%, -10%);
  }
}

.page--staff .sub-kv-stage {
  position: relative;
  z-index: 2;
}

/* Intro — 右に縦長画像、左は Figma 準拠のプロフィールテキスト */
.staff-intro {
  position: relative;
  z-index: 1;
  padding: calc(40px + 86px + clamp(1rem, 2.5vw, 1.5rem)) var(--space-md)
    clamp(4rem, 8vw, 6rem);
}

.page--staff .sub-kv-stage > .staff-bridge-bg,
.page--staff .sub-kv-stage > .staff-profile {
  position: relative;
  z-index: 1;
}

.page--staff .sub-kv-stage > .staff-profile {
  z-index: 2;
}

.page--staff .staff-intro.sub-kv {
  overflow: visible;
  background: transparent;
}

.staff-intro__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.staff-intro__lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 700px);
  align-items: start;
  gap: clamp(2rem, 4vw, 3.5rem);
  --staff-intro-column-gap: clamp(2rem, 4vw, 3.5rem);
}

.staff-intro__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-top: clamp(2.5rem, 5vw, 4rem);
  text-align: left;
}

.staff-intro__content .staff-profile__catch {
  margin-top: 0;
}

@media (min-width: 961px) {
  .staff-intro__lead {
    --staff-intro-visual-edge-gap: clamp(
      36px,
      (100vw - var(--container-width)) / 2,
      (1440px - var(--container-width)) / 2
    );
    column-gap: var(--staff-intro-column-gap);
  }

  .staff-intro__content .staff-profile__name-line {
    width: calc(100% + var(--staff-intro-column-gap));
  }

  .staff-intro__visual {
    justify-self: end;
    width: min(700px, 100%);
    margin-right: calc(-1 * var(--staff-intro-visual-edge-gap));
  }

  .staff-intro__frame {
    width: 100%;
    margin-inline: 0;
  }

  .staff-intro__frame .framed-image__photo {
    display: block;
    width: 100%;
    margin-left: auto;
    margin-right: 0;
  }
}

.staff-intro__visual {
  position: relative;
}

.staff-intro__frame {
  width: min(100%, 700px);
  margin-left: auto;
  margin-right: 0;
}

.js .staff-intro__frame:not(.is-layer-visible) .framed-image__layer {
  opacity: 0;
}

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

.js .staff-intro__frame:not(.is-layer-visible) .framed-image__photo {
  opacity: 0;
  transform: translateX(var(--motion-slide-offset, 4%));
}

.js .staff-intro__frame.is-layer-visible .framed-image__photo {
  animation: ichigo-step-photo-slide-right 0.65s var(--motion-ease-out) 0s both;
}

.js .staff-intro__frame.is-layer-visible .framed-image__layer--back {
  animation: ichigo-step-layer-extend 0.52s var(--motion-ease-out) 0.18s both;
  --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 .staff-intro__frame.is-layer-visible .framed-image__layer--mid {
  animation: ichigo-step-layer-extend-mid 0.46s var(--motion-ease-out) 0.28s
    both;
  --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%;
}

/* Profiles */
.staff-profile {
  position: relative;
  z-index: 2;
  padding-top: clamp(6rem, 14vw, 12rem);
  padding-bottom: 0;
  overflow: visible;
  --staff-profile-visual-width: min(700px, 48.6vw);
  --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%;
}

.staff-profile__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
}

.staff-profile__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(2.75rem, 6vw, 4.5rem);
}

.staff-profile__item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-block: 0;
  --staff-profile-column-gap: clamp(2.5rem, 5vw, 4.5rem);
  --staff-profile-body-inner-gap: clamp(1.25rem, 2.5vw, 2rem);
  --staff-profile-body-edge-gap: max(
    56px,
    calc((100vw - var(--container-width)) / 2 + 56px)
  );
}

.staff-profile__item--has-bg {
  overflow: visible;
}

.staff-profile__body,
.staff-profile__visual {
  position: relative;
  z-index: 1;
}

.staff-profile__item:first-child {
  padding-top: 0;
}

.staff-profile__visual {
  width: var(--staff-profile-visual-width);
  margin-inline: auto;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.staff-profile__frame {
  width: 100%;
}

.staff-profile__frame--eguchi .framed-image__photo {
  object-position: center 18%;
}

.staff-profile__frame--sawada .framed-image__photo {
  object-position: 68% center;
}

.staff-profile__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-inline: 36px;
  overflow: visible;
  text-align: left;
}

.staff-profile__catch {
  margin: 0 0 clamp(1.75rem, 3vw, 2.5rem);
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: clamp(28px, 4.8vw, 50px);
  line-height: 1.44;
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
}

.staff-profile__role {
  margin: 0 0 clamp(0.85rem, 2vw, 1.25rem);
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.47;
  letter-spacing: var(--tracking-body);
  color: var(--color-text);
}

.staff-profile__name {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: clamp(32px, 4.8vw, 50px);
  line-height: 1.44;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.staff-profile__name-line {
  display: block;
  flex-shrink: 0;
  align-self: stretch;
  width: 100%;
  height: 1px;
  margin: clamp(0.5rem, 1.5vw, 0.875em) 0 clamp(1rem, 2vw, 1.35rem);
  border: none;
  background-color: #c98726;
  transform: scaleY(0.5);
  transform-origin: left center;
  pointer-events: none;
}

.staff-profile__text {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: var(--font-weight-heading);
  font-size: clamp(15px, 2vw, 20px);
  line-height: 2.5;
  letter-spacing: var(--tracking-body);
  color: var(--color-text);
}

.staff-profile__text + .staff-profile__text {
  margin-top: 0.5em;
}

/* Photo slide + watercolor extend */
.js .staff-profile__frame:not(.is-layer-visible) .framed-image__layer {
  opacity: 0;
}

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

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

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

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

.js
  .staff-profile__frame.framed-image--peek-bottom-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
  .staff-profile__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 .staff-profile__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 .staff-profile__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
  .staff-profile__frame.framed-image--peek-bottom-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
  .staff-profile__frame.framed-image--peek-bottom-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
  .staff-profile__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
  .staff-profile__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) {
  .staff-profile__item {
    flex-direction: row;
    align-items: flex-start;
    column-gap: var(--staff-profile-column-gap);
  }

  .staff-profile__item--image-left {
    flex-direction: row-reverse;
  }

  .staff-profile__visual {
    flex: 0 0 var(--staff-profile-visual-width);
    width: var(--staff-profile-visual-width);
    margin-top: 0;
    margin-inline: 0;
  }

  .staff-profile__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.25rem;
  }

  .staff-profile__item--image-right .staff-profile__body {
    padding-left: var(--staff-profile-body-edge-gap);
    padding-right: var(--staff-profile-body-inner-gap);
  }

  .staff-profile__item--image-left .staff-profile__body {
    padding-right: var(--staff-profile-body-edge-gap);
    padding-left: var(--staff-profile-body-inner-gap);
  }

  .staff-profile__item--image-right .staff-profile__name-line {
    width: calc(
      100% + var(--staff-profile-body-inner-gap) +
        var(--staff-profile-column-gap)
    );
  }

  .staff-profile__item--image-left .staff-profile__name-line {
    width: calc(
      100% + var(--staff-profile-body-inner-gap) +
        var(--staff-profile-column-gap)
    );
    margin-left: calc(
      -1 *
        (
          var(--staff-profile-body-inner-gap) +
            var(--staff-profile-column-gap)
        )
    );
    transform-origin: right center;
  }
}

@media (max-width: 1200px) {
  .staff-intro__lead {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .staff-intro__visual {
    order: -1;
  }

  /* Profile — SP stack（image-left: 画像上・テキスト下） */
  .staff-profile__item {
    flex-direction: column;
  }

  .staff-profile__item--image-left {
    flex-direction: column;
  }

  .staff-profile__item--image-left .staff-profile__visual {
    order: -1;
    flex: none;
    width: 100%;
    max-width: none;
    margin-top: 0;
    margin-bottom: clamp(3rem, 9vw, 5rem);
    margin-inline: auto;
  }

  .staff-profile__item--image-left .staff-profile__body {
    order: 0;
  }

  .staff-profile__item--image-left .staff-profile__frame {
    width: 86%;
    max-width: 100%;
    margin-right: auto;
    margin-left: 0;
  }

  .staff-profile__item--image-left .staff-profile__name-line {
    width: 100%;
    margin-left: 0;
    transform-origin: left center;
  }
}

@media (max-width: 960px) {
  .staff-intro {
    padding: calc(16px + 71px + 1rem) var(--space-md) clamp(3.5rem, 10vw, 6rem);
  }

  .staff-profile {
    padding-top: clamp(4rem, 12vw, 8rem);
    padding-bottom: 0;
  }

  .staff-bridge-bg::before {
    width: 118%;
    height: clamp(320px, 98vw, 760px);
    transform: translate(-50%, -62%);
  }

  .staff-profile__item--image-left .staff-profile__visual {
    margin-bottom: clamp(3.5rem, 10vw, 5.5rem);
  }

  .staff-intro__content {
    padding-top: clamp(2rem, 4.5vw, 3.5rem);
  }

  .staff-intro__lead {
    gap: clamp(1.25rem, 4vw, 2rem);
  }

  .staff-intro__visual {
    width: calc(100% + var(--space-md));
    max-width: none;
    margin-right: calc(-1 * var(--space-md));
    margin-left: 0;
  }

  .staff-intro__frame {
    width: 86%;
    max-width: 100%;
    margin-left: auto;
    margin-right: 0;
  }

  .staff-intro__frame .framed-image__photo {
    margin-left: auto;
    margin-right: 0;
  }

  .js .staff-intro__frame.is-layer-visible .framed-image__layer--back {
    --layer-stack-x: -9%;
    --layer-stack-y: 9%;
  }

  .js .staff-intro__frame.is-layer-visible .framed-image__layer--mid {
    --layer-stack-x: -4.5%;
    --layer-stack-y: 4.5%;
  }

  .staff-profile__body {
    padding-inline: var(--space-md);
  }

  .staff-profile__visual {
    width: 100%;
    margin-top: clamp(1.75rem, 5vw, 2.5rem);
    margin-inline: auto;
  }

  .staff-profile__frame {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .staff-profile__frame.framed-image--peek-bottom-right .framed-image__layer--back {
    transform: translate(9%, 9%);
  }

  .staff-profile__frame.framed-image--peek-bottom-right .framed-image__layer--mid {
    transform: translate(5%, 5%);
  }

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

  .staff-profile__frame.framed-image--peek-left .framed-image__layer--mid {
    transform: translate(-5%, -5%);
  }

  .js
    .staff-profile__frame.framed-image--peek-bottom-right.is-layer-visible
    .framed-image__layer--back {
    --layer-stack-x: 12%;
    --layer-stack-y: 12%;
  }

  .js
    .staff-profile__frame.framed-image--peek-bottom-right.is-layer-visible
    .framed-image__layer--mid {
    --layer-stack-x: 7%;
    --layer-stack-y: 7%;
  }

  .js
    .staff-profile__frame.framed-image--peek-left.is-layer-visible
    .framed-image__layer--back {
    --layer-stack-x: -12%;
    --layer-stack-y: -12%;
  }

  .js
    .staff-profile__frame.framed-image--peek-left.is-layer-visible
    .framed-image__layer--mid {
    --layer-stack-x: -7%;
    --layer-stack-y: -7%;
  }

  .staff-profile__catch {
    margin-bottom: clamp(0.5rem, 2vw, 0.85rem);
    font-size: clamp(24px, 7vw, 34px);
  }

  .staff-profile__name {
    font-size: clamp(28px, 7vw, 40px);
  }

  .staff-profile__role {
    margin-top: 0;
    font-size: 16px;
    line-height: 1.6;
  }

  .staff-profile__text {
    font-size: 14px;
    line-height: 2.1;
  }
}
