/* TOP（動画背景・わたしたちについて・参画メンバー・応援メンバー） */

/* 背景動画は画面に固定し、ヒーロー・メッセージ・フッターで見せる（Figma「背景動画（スティッキー）」） */
.top-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  object-fit: cover;
}

.page-top .site-footer { background: transparent; }
.top-main { background: transparent; }

/* 本文の左端。ヘッダーと右下の目次にかからない幅を確保する（cqw = この箱の幅） */
.top-body {
  container-type: inline-size;
  --left: max(240px, calc((100cqw - 760px) / 2));
  --col: min(800px, calc(100cqw - var(--left) - 220px));
  position: relative;
  background: var(--paper);
  padding-bottom: 0;
}


/* 動画から白い背景へ：下から、白い粒の波が立ち上がって画面を覆う（波は js/mist.js が描く） */
.top-wave {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
.top-wave.is-on { visibility: visible; }
.top-wave-stack { position: absolute; left: 0; top: 0; width: 100%; height: 100%; will-change: transform; }
.top-wave-blank,
.top-wave-fade,
.top-wave-fill { position: relative; width: 100%; height: 100%; }
.top-wave-fill { background: var(--paper); }
.top-wave-item,
.top-wave-mask {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: calc(100% + 1px);
}
.top-wave-item {
  background-repeat: repeat-x;
  background-size: auto 80%;
  background-position: 0 100%;
  transform-origin: center bottom;
}
.top-wave-mask {
  background-repeat: repeat-x;
  background-size: 600% 100%;
  background-position: 0 0;
}
@media (orientation: portrait) and (max-width: 759px) {
  .top-wave { height: 110vh; height: 110lvh; }
  .top-wave-mask { background-size: 1000% 100%; }
}
.top-body { z-index: 3; }

/* ---------- ヒーロー ---------- */

/* 動画の上の白文字が明るいコマでも読めるよう、薄い暗幕を敷く */
.top-hero,
.top-message { background: rgba(0, 0, 0, 0.2); }

.top-hero {
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  padding: 0 var(--gutter);
  color: #fff;
}

.top-catch {
  font-size: clamp(22px, 2.8125vw, 44px);  /* 36 / 1280 */
  line-height: calc(49 / 36);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- メッセージ ---------- */

.top-message {
  position: relative;
  /* 1 スクロール目は文字を固定したまま動画を見せ、2 スクロール目で、文字が消えて白い波が立ち上がる */
  height: 200vh;
  height: 200svh;
  color: #fff;
}
.top-message-pin {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100svh;
  padding: 50px 10px 50px 180px;
  /* 消えていく度合い（0〜1）は site.js が入れる */
  opacity: calc(1 - var(--out, 0));
}

.top-message-text { position: relative; z-index: 1; }
.top-message-text {
  font-size: clamp(18px, 2.5vw, 40px);  /* PC：1280 で 32px（スマホは下で、画面の幅に合わせる） */
  line-height: calc(70 / 36);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.top-message-text span { display: block; }

/* ---------- わたしたちについて ---------- */

/* 1 スクロール目（画面 1 つぶんのスクロール）の間は、この文章を画面に固定する */
/* 固定が効く長さは、箱の「中身」の高さで決まる。下の余白ではなく、空の箱で画面 1 つぶん足す */
.top-about-track::after { content: ""; display: block; height: 100vh; height: 100svh; }
.top-about {
  position: sticky;
  top: 0;
  padding: 60px 0 50px var(--left);
}

.top-about-title {
  padding: 16px 0;
  margin-bottom: 36px;
}

.top-about-title .about-one {
  width: min(503px, 100%);
  height: auto;
}

/* スマホだけ：「みんな」と「しあわせもつくりだす」の 2 行にする（同じ SVG を境目の位置で左右に切り分ける）。
   境目は SVG の左から 116.5 / 503.2 */
.about-two { display: none; }

.top-about-text {
  width: var(--col);
  font-size: 20px;
  line-height: 36px;
  letter-spacing: 0.04em;
}

.top-about-text p + p { margin-top: 36px; }
/* 行末に「です。」「返す。」のような、短い言葉だけが残らないようにする */
.top-about-text p { text-wrap: pretty; word-break: auto-phrase; }

/* ---------- 参画メンバー ---------- */

.top-members {
  display: flex;
  padding: 100px 0 0 var(--left);
}

.members-label {
  flex: none;
  width: 180px;
}

.members-label h2 {
  position: sticky;
  top: 0;
  padding: 50px 0 28px;
  font-size: 21px;
  line-height: 42px;
  letter-spacing: 0.05em;
}

.members-groups {
  width: min(580px, calc(var(--col) - 180px));
}

.member-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 0;
  border-top: 1px solid #e2e2e2;
}

.member-group:first-child {
  padding-top: 50px;
  border-top: 0;
}

.member-group-h {
  font-size: 15px;
  line-height: 30px;
}

.member-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 36px 20px;
}

.member {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-photo {
  width: 180px;
  height: 216px;
  object-fit: cover;
  background: #eaeaea;
}

.member-photo--none { display: block; }

.member-name { order: 1; }
.member-role {
  order: 2;
  font-size: 13px;
  line-height: 20px;
  white-space: normal;  /* 肩書きが長くなったので、枠の中で折り返す */
  overflow-wrap: anywhere;
}

.member-name {
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0.04em;
}

/* ---------- 応援メンバー（スライダー） ---------- */

.top-supporters {
  position: relative;
  margin-top: 100px;
  padding: 240px 0 180px;
  background: #f3f2ef;
}

.supporters-label {
  position: absolute;
  top: 140px;
  left: var(--left);
  font-size: 21px;
  line-height: 42px;
  letter-spacing: 0.05em;
}

.slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--left);
  padding: 0 calc(100cqw - var(--left) - 600px) 0 var(--left);
  scrollbar-width: none;
  outline: none;
}

.slider-track::-webkit-scrollbar { display: none; }
.slider-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.supporter {
  flex: none;
  display: flex;
  gap: 28px;
  width: 600px;
  min-height: 460px;
  padding: 28px;
  background: var(--paper);
  scroll-snap-align: start;
}

.supporter-side {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 180px;
}

.supporter-photo {
  width: 180px;
  height: 216px;
  object-fit: cover;
  margin-bottom: 16px;
}

.supporter-photo { order: 0; }

.supporter-name {
  order: 1;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.supporter-role {
  order: 2;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.03em;
}

.supporter-comment {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  font-size: 14px;
  line-height: 28px;
  letter-spacing: 0.03em;
}

.supporter-quote { width: 22px; height: 19px; }

.slider-controls {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 48px 0 0 calc(var(--left) + 98px);
}

.slider-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  transition: opacity 0.3s ease-out;
}

.slider-ring { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 0.5s var(--ease-out); }
.slider-btn:hover .slider-ring { transform: rotate(40deg); }
.slider-arrow { position: relative; width: 17px; height: auto; transition: transform 0.35s var(--ease-out); }
.slider-prev .slider-arrow { transform: rotate(180deg); }
.slider-next:hover .slider-arrow { transform: translateX(3px); }
.slider-prev:hover .slider-arrow { transform: rotate(180deg) translateX(3px); }
.slider-btn:disabled { opacity: 0.25; cursor: default; }
.slider-btn:disabled .slider-ring { transform: none; }
.slider-btn:disabled .slider-arrow { transform: none; }
.slider-prev:disabled .slider-arrow { transform: rotate(180deg); }

.slider-count {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.slider-sl { font-size: 15px; }

/* ---------- スマホ ---------- */

@media (max-width: 767px) {
  .top-body { --left: var(--gutter); --col: calc(100cqw - var(--gutter) * 2); padding-bottom: 0; }

  .top-catch { letter-spacing: 0.06em; }

  .top-message-pin { padding: 72px var(--gutter); }
  .top-message-text { line-height: 1.9; letter-spacing: 0.02em; }
  /* 段落（行）は折り返さず、いちばん長い行（18 文字）が画面の幅いっぱいに収まる大きさにする */
  .top-message-text { font-size: calc((100vw - var(--gutter) * 2) / 18.5); }

  .top-about { padding: 40px var(--gutter) 24px; }
  .top-about-title { margin-bottom: 20px; --w: min(332px, calc(100vw - var(--gutter) * 2)); }
  .top-about-title .about-one { display: none; }
  .about-two { display: block; font-size: 0; }
  .about-two img { display: block; width: var(--w); max-width: none; height: auto; }
  .about-l1,
  .about-l2 { display: block; overflow: hidden; height: calc(var(--w) * 32.54 / 503.2); }
  /* 行間：8px に、文字の高さの 0.2 倍を足す */
  .about-l1 { width: calc(var(--w) * 116.5 / 503.2); margin-bottom: calc(8px + var(--w) * 32.54 / 503.2 * 0.2); }
  /* 2 行目は、「し」の左端が「み」の左端（目視で約 3.0）に合うように、切り出しを 119.9 から始める（122.9 だと「し」が少し左すぎた） */
  .about-l2 { width: calc(var(--w) * (503.2 - 119.9) / 503.2); }
  .about-l2 img { margin-left: calc(var(--w) * -119.9 / 503.2); }
  .top-about-text { font-size: 15px; line-height: 30px; }
  .top-about-text p + p { margin-top: 30px; }

  .top-members { flex-direction: column; padding: 72px var(--gutter) 0; }
  .members-label { width: auto; }
  .members-label h2 { position: static; padding: 0 0 8px; font-size: 19px; }
  .members-groups { width: 100%; }
  .member-group:first-child { padding-top: 16px; }
  .member-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 15px; }
  .member-photo { width: 100%; height: auto; aspect-ratio: 180 / 216; }
  .member-role { font-size: 11px; line-height: 17px; white-space: normal; }
  .member-name { font-size: 16px; line-height: 24px; }

  .top-supporters { margin-top: 72px; padding: 112px 0 96px; }
  .supporters-label { top: 56px; font-size: 19px; }
  .slider-track { padding: 0 var(--gutter); scroll-padding-left: var(--gutter); gap: 12px; }
  .supporter { flex-direction: column; gap: 18px; width: calc(100vw - var(--gutter) * 2); min-height: 0; padding: 22px; }
  /* 写真は左寄せで、参画メンバーと同じ大きさ。その下に、名前（上）と肩書き（下）を縦に並べる */
  .supporter-side { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: auto; }
  .supporter-photo { width: calc((100vw - var(--gutter) * 2 - 15px) / 2); height: auto; aspect-ratio: 180 / 216; margin: 0 0 12px; }
  .supporter-name { margin: 0 0 4px; font-size: 18px; line-height: 26px; white-space: normal; }
  .supporter-role { margin: 0; text-align: left; line-height: 16px; }
  .supporter-comment { font-size: 13px; line-height: 26px; }
  .slider-controls { margin: 28px var(--gutter) 0; gap: 28px; justify-content: center; }
}
