/* =========================================================
   トップページ専用スタイル
   ヒーローは 1440×907 の原寸レイアウトを --u（1px相当）で
   比率スケールし、Wix 版の構図をそのまま保持する
   ========================================================= */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff url("../img/hero_bg.jpg") center / cover no-repeat;
  --u: calc(min(100vw, 1440px) / 1440);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.34);
  pointer-events: none;
}
/* 下端で波が切れないよう、白へ溶かして次のセクションへつなぐ */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(120px, 16vw, 220px);
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 60%, #fff 100%);
  pointer-events: none;
}
.hero-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 1440px);
  height: calc(907 * var(--u));
  margin: 0 auto;
}
.hero-photo {
  position: absolute;
  left: calc(577 * var(--u));
  top: calc(132 * var(--u));
  width: calc(860 * var(--u));
}
.hero-photo img { width: 100%; height: auto; }
/* 4枚スライド: 切り抜き形は外枠マスクで固定し、写真だけが「引き」ながらクロスフェード */
.hero-slides {
  position: relative;
  -webkit-mask-image: url("../img/hero_building.webp");
  mask-image: url("../img/hero_building.webp");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.hero-slides img {
  display: block; width: 100%; height: auto;
  opacity: 0;
  transform: scale(1.08);
  transform-origin: 50% 50%;
  transition: opacity 1.4s ease, transform 6.5s linear;
  will-change: opacity, transform;
}
.hero-slides img + img { position: absolute; inset: 0; }
.hero-slides img.is-active { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .hero-slides img { transition: opacity 0.6s ease; transform: none; }
}

/* 縦組みコピー */
.hero-copy {
  position: absolute;
  left: calc(219 * var(--u));
  top: calc(276 * var(--u));
  height: calc(367 * var(--u));
  display: flex;
  flex-direction: row-reverse; /* 縦書き: 右に見出し、左にサブ */
  align-items: flex-start;
  gap: calc(16 * var(--u));
}
.hero-copy h1,
.hero-copy .hero-sub {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0;
}
.hero-copy h1 {
  font-size: calc(45 * var(--u));
  font-weight: 900;
  line-height: 2;
  letter-spacing: 0.2em;
  color: var(--ink);
}
.hero-copy .hero-sub {
  font-size: calc(17 * var(--u));
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.2em;
  color: var(--gray);
  padding-top: calc(4 * var(--u));
}

/* ボタン */
.hero-btns {
  position: absolute;
  left: calc(128 * var(--u));
  top: calc(663 * var(--u));
  display: flex;
  gap: calc(25 * var(--u));
}
.hero-btns .btn {
  min-width: calc(210 * var(--u));
  height: calc(49 * var(--u));
  padding: 0 calc(24 * var(--u));
  font-size: calc(14 * var(--u));
  letter-spacing: 0.1em;
}

/* 丸バッジ */
.badge {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.badge-white {
  left: calc(503 * var(--u));  /* 1080 - 577（写真基準） */
  top: calc(584 * var(--u));   /* 716 - 132 */
  width: calc(140 * var(--u));
  height: calc(140 * var(--u));
  background: #fff;
  color: var(--pink);
  font-size: calc(14 * var(--u));
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.04em;
  z-index: 2;
}
.badge-pink {
  left: calc(630 * var(--u));  /* 1207 - 577 */
  top: calc(520 * var(--u));   /* 652 - 132 */
  width: calc(168 * var(--u));
  height: calc(168 * var(--u));
  background: var(--pink);
  color: #fff;
  border: 1px solid #fff;
  font-size: calc(25 * var(--u));
  line-height: 1.6;
  letter-spacing: 0.04em;
}
.badge-pink small { display: block; font-size: calc(21 * var(--u)); }

/* SELF MEDICATION */
.hero-slogan {
  position: absolute;
  left: calc(128 * var(--u));
  top: calc(795 * var(--u));
  font-size: calc(58 * var(--u));
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.4em;
  color: var(--ink);
  white-space: nowrap;
  margin: 0;
}
.hero-slogan .p { color: var(--pink); }
.hero-slogan .o { color: #fff; -webkit-text-stroke: 1px var(--footer); text-stroke: 1px var(--footer); }
.hero-tag {
  position: absolute;
  left: calc(128 * var(--u));
  top: calc(875 * var(--u));
  font-size: calc(15 * var(--u));
  letter-spacing: 0.8em;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--ink);
}
.hero-rule {
  position: absolute;
  left: calc(719 * var(--u));
  top: calc(887 * var(--u));
  width: calc(263 * var(--u));
  height: 1px;
  background: var(--ink);
}

/* ---------- REASON ---------- */
.reason {
  position: relative;
  padding: clamp(56px, 6vw, 80px) 0 clamp(72px, 7vw, 96px);
  background: #fff url("../img/reason_bg.jpg") center bottom / cover no-repeat;
  overflow: hidden;
}
.reason::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fff 0%, #fff 32%, rgba(255, 255, 255, 0.9) 52%, rgba(255, 255, 255, 0.6) 80%, rgba(255, 255, 255, 0.5) 100%);
}
.reason > .container { position: relative; }
.reason-grid {
  margin-top: clamp(44px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.reason-item { text-align: center; }
.reason-item img {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 12px;
}
.reason-item h3 {
  margin-top: 24px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.6;
}
.reason-item p {
  margin: 14px auto 0;
  max-width: 320px;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  text-align: left;
}
.reason .btn-row { margin-top: clamp(40px, 5vw, 60px); }

/* ---------- 製品マーキー ---------- */
.marquee {
  padding: 24px 0;
  overflow: hidden;
  background: #fff;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 60s linear infinite;
  will-change: transform;
}
.marquee-set {
  display: flex;
  flex: none;
  gap: 16px;
  padding-right: 16px; /* セット末尾にも同じ間隔を置き、継ぎ目を均一にする */
}
.marquee-set img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex: none;
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ---------- バナー（製品・Tera・事業） ---------- */
.banners { padding: 28px 0 var(--sec-pad-s); display: grid; gap: clamp(28px, 3.3vw, 48px); }
.banner {
  position: relative;
  width: min(1346px, calc(100% - var(--gutter) * 2));
  min-height: clamp(300px, 27.6vw, 398px);
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  color: #fff;
  isolation: isolate;
}
.banner img.bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s ease;
}
.banner:hover img.bg { transform: scale(1.03); }
.banner::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(270deg, rgba(47, 43, 54, 0) 21%, rgba(0, 0, 0, 0.34) 32%, rgba(0, 0, 0, 0.7) 44%, rgba(0, 0, 0, 0.7) 100%);
}
.banner-body { position: relative; padding: clamp(40px, 5vw, 64px) clamp(28px, 6.5vw, 88px); max-width: 780px; }
.banner .eyebrow { color: #fff; letter-spacing: 0.16em; text-transform: none; font-size: 13px; }
.banner h2 {
  margin-top: 14px;
  font-size: clamp(21px, 1.8vw, 26px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
}
.banner h2 .hl { display: inline-block; }
.banner p { margin-top: 16px; font-size: 15px; line-height: 1.9; letter-spacing: 0.06em; }
.banner .btn-row { margin-top: 28px; }
.banner .btn { min-width: 210px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1100px) {
  .reason-grid { gap: 28px; }
}
@media (max-width: 1000px) {
  /* ヒーロー: 原寸スケールでは文字が小さくなるため、縦組みを解いて上下に流し込む */
  /* 並び順: 写真 → 見出し → ボタン → SELF MEDICATION */
  .hero-stage { height: auto; padding: calc(var(--header-h) + 24px) var(--gutter) 48px; display: flex; flex-direction: column; align-items: flex-start; }
  .hero-photo, .hero-copy, .hero-btns, .badge, .hero-slogan, .hero-tag, .hero-rule { position: static; }
  .hero-photo { order: 1; }
  .hero-copy { order: 2; }
  .hero-btns { order: 3; }
  .hero-slogan { order: 4; }
  .hero-tag { order: 5; }
  .hero-copy { height: auto; flex-direction: column; gap: 12px; max-width: 640px; }
  /* 背景の流線を薄く */
  .hero::before { background: rgba(255, 255, 255, 0.62); }
  .hero-copy h1, .hero-copy .hero-sub { writing-mode: horizontal-tb; }
  .hero-copy h1 { font-size: clamp(36px, 6.5vw, 52px); line-height: 1.4; letter-spacing: 0.1em; }
  .hero-copy .hero-sub { font-size: clamp(13px, 1.8vw, 16px); line-height: 1.9; letter-spacing: 0.12em; padding: 0; margin-top: 4px; }
  .hero-btns { margin-top: 32px; gap: 14px; }
  .hero-btns .btn { min-width: 220px; height: 50px; padding: 0 28px; font-size: 14px; }
  .hero-photo { width: min(100%, 720px); margin: 0 0 36px; position: relative; left: auto; top: auto; }
  .hero-photo .badge-wrap { position: absolute; right: 0; bottom: -8px; display: flex; align-items: flex-end; gap: 10px; }
  .badge { position: static; }
  .badge-white { width: 112px; height: 112px; font-size: 13px; line-height: 1.5; }
  .badge-pink { width: 132px; height: 132px; font-size: 20px; }
  .badge-pink small { font-size: 17px; }
  .hero-slogan { margin-top: 48px; font-size: clamp(26px, 5.6vw, 44px); letter-spacing: 0.3em; white-space: normal; line-height: 1.3; }
  .hero-tag { margin-top: 12px; font-size: clamp(12px, 1.6vw, 14px); letter-spacing: 0.5em; white-space: normal; }
  .hero-rule { display: none; }
}
@media (max-width: 900px) {
  .reason-grid { grid-template-columns: 1fr; gap: 40px; max-width: 440px; margin-left: auto; margin-right: auto; }
  .reason-item img { max-width: none; }
  .reason-item p { max-width: none; }
}
@media (max-width: 760px) {
  /* スマホ: 流線は写真の背後に寄せ、テキスト帯は白へ溶かして読みやすく */
  .hero { background-position: center 22%; background-size: 190% auto; }
  .hero::before { background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.35) 34%, rgba(255,255,255,0.92) 52%, #fff 100%); }
  .hero-stage { padding: calc(var(--header-h) + 8px) 20px 20px; }
  .hero-copy { gap: 6px; }
  .hero-copy h1 { font-size: clamp(36px, 10.4vw, 44px); line-height: 1.3; letter-spacing: 0.22em; }
  .hero-copy .hero-sub { margin-top: 4px; font-size: 14px; line-height: 1.8; letter-spacing: 0.1em; color: var(--gray); }
  .hero-slogan { margin-top: 12px; padding-top: 0; border-top: 0; width: 100%; font-size: clamp(22px, 6.4vw, 30px); letter-spacing: 0.16em; line-height: 1.2; white-space: nowrap; }
  .hero-tag { margin-top: 4px; font-size: 13px; letter-spacing: 0.32em; color: var(--ink); white-space: normal; line-height: 1.7; }
  .hero-btns { margin-top: 28px; flex-direction: column; align-items: stretch; gap: 12px; max-width: 320px; }
  .hero-btns .btn { width: 100%; }
  /* 写真は画面幅いっぱいに（左右の余白分を広げる） */
  .hero-photo { width: calc(100% + 40px); max-width: none; margin: 0 -20px -8px; }
  .hero-photo .badge-wrap { right: 14px; bottom: -6px; gap: 6px; }
  .badge-white { width: 78px; height: 78px; font-size: 10px; line-height: 1.45; }
  .badge-pink { width: 92px; height: 92px; font-size: 15px; }
  .badge-pink small { font-size: 13px; }

  .reason { padding: 56px 0 64px; }
  .reason-item h3 { margin-top: 20px; font-size: 17px; }
  .reason-item p { font-size: 14px; line-height: 1.9; }
  .reason .btn-row { margin-top: 40px; }
  /* 写真の上に載るテキストの可読性を確保 */
  .reason::before { background: linear-gradient(180deg, #fff 0%, #fff 40%, rgba(255, 255, 255, 0.9) 70%, rgba(255, 255, 255, 0.72) 100%); }

  .marquee { padding: 18px 0; }
  .marquee-set img { width: 92px; height: 92px; }
  .marquee-set { gap: 12px; padding-right: 12px; }

  .banners { padding: 20px 0 56px; gap: 20px; }
  .banner { min-height: 0; align-items: flex-end; border-radius: 14px; }
  .banner::before { background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.74) 52%); }
  .banner-body { padding: 150px 22px 30px; }
  .banner .eyebrow { font-size: 12px; }
  .banner h2 { margin-top: 10px; font-size: 20px; letter-spacing: 0.06em; }
  .banner p { margin-top: 12px; font-size: 14px; line-height: 1.85; }
  .banner .btn-row { margin-top: 22px; flex-direction: column; align-items: stretch; max-width: 320px; gap: 12px; }
  .banner .btn { width: 100%; min-width: 0; height: 48px; }
}
