/* ===================================================================
   PAGE-SPECIFIC CSS - トップページ(index.html)専用
   ★common.cssの後に読み込むこと
   ★url()のパスはこのCSSファイル(css/)を基準にしている
   =================================================================== */

.nav-link {
  width: 110px;
}

@media (max-width: 1150px) and (min-width: 901px) {
  .nav-link {
    width: 96px;
  }
}

/* #story-bodyは内部のsticky領域が自前でヘッダー分の余白を持つため、
   COMMONのscroll-margin-topを打ち消す */
#story-body {
  scroll-margin-top: 0;
}

#hero {
  position: relative;
  z-index: 1;
  min-height: 75vh;
  min-height: 75svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 8vw, 7rem);
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--dark-navy);
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 0;
}

.slider-dots {
  position: absolute;
  bottom: 3rem;
  right: clamp(1.5rem, 5vw, 4rem);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s,
    transform 0.3s;
}

.hero-content {
  position: relative;
  z-index: 3;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s ease forwards;
  color: #fff;
  text-align: center;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s 1.4s ease forwards;
}

.scroll-hint span {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #89d0ea;
  font-family: var(--font-en);
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, #89d0ea, transparent);
  animation: scrollPulse 2s infinite;
}

/* ─── イントロ（白背景） ─── */

#intro {
  position: relative;
  z-index: 2;
  background: var(--bg-white);
  padding: clamp(4rem, 9vw, 7rem) clamp(1.5rem, 8vw, 7rem)
    clamp(4rem, 8vw, 6rem);
}

.intro-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ─── 動画 ─── */

#video {
  position: relative;
  z-index: 2;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 3rem)
    clamp(2.5rem, 5vw, 3.5rem);
}

.video-inner {
  max-width: 920px;
  margin: 0 auto;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #bcbfc4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-thumb {
  position: relative;
  display: flex;
  width: 100%;
  padding: 0;
  border: none;
  cursor: pointer;
}

.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-thumb:hover img {
  transform: scale(1.03);
}

.video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.video-play-icon svg {
  width: clamp(54px, 9vw, 84px);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s ease;
}

.video-thumb:hover .video-play-icon svg {
  transform: scale(1.08);
}

/* ─── 動画モーダル ─── */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1.5rem);
}

.video-modal.open {
  display: flex;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal.open .video-modal-backdrop {
  opacity: 1;
}

.video-modal-inner {
  position: relative;
  width: 100%;
  max-width: min(1600px, 96vw, 151vh);
  transform: scale(0.92);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.video-modal.open .video-modal-inner {
  transform: scale(1);
  opacity: 1;
}

.video-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .video-modal-close {
    top: -40px;
    right: 4px;
  }
}
@media (min-width: 901px) {
  /* 白基調の面（ページ全体と馴染ませる） */
  #video {
    background: #ffffff;
    padding-top: clamp(4.5rem, 7vw, 6.5rem);
    padding-bottom: clamp(4.5rem, 7vw, 6.5rem);
  }

  /* 面にめり込んだ凹（コンケイブ）パネル。影はニュートラルなグレー */
  .video-inner {
    background: #ffffff;
    padding: 26px;
    border-radius: 32px;
    box-shadow:
      inset 10px 10px 22px rgba(0, 0, 0, 0.14),
      inset -10px -10px 22px rgba(255, 255, 255, 0.9);
  }

  .video-frame {
    border-radius: 18px;
  }
}

#stats {
  position: relative;
  z-index: 2;
  margin-top: 4rem;
}

.stat-num > span[data-count] {
  line-height: 1;
}

.stat-unit {
  font-family: var(--font-body);
  font-size: 0.42em;
  color: var(--mid-blue);
  line-height: 1.8;
}

.stat-note {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.4;
}

.section-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 5vw, 4rem) 2.5rem;
}

.section-en {
  font-family: var(--font-en);
  font-size: clamp(10px, 1.3vw, 12px);
  letter-spacing: 0.42em;
  color: var(--misawa-blue);
  margin-bottom: 0.7rem;
}

.section-ja {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: 0.08em;
}

.section-desc {
  font-size: 13.5px;
  color: var(--text-light);
  margin-top: 0.8rem;
  line-height: 2;
  font-weight: 500;
  letter-spacing: 0.09em;
}

#misawa-story-intro .story-replay {
  margin-top: 0;
}

/* ─── 南極のいま ─── */

#antarctic-now {
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-white);
}

#antarctic-now .section-header {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: 0;
}

#antarctic-now .section-ja {
  color: #000000;
}

#antarctic-now .section-desc {
  color: #25689e;
  font-size: 15px;
  letter-spacing: 0.12em;
  margin-top: 0.6rem;
}

/* ─── パートナークレジット（バッジ＋テキスト） ─── */

#partner-credit {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 3rem)
    clamp(7rem, 6vw + 6rem, 10.5rem);
  background: var(--bg-white);
  text-align: center;
}

@media (max-width: 900px) {
  #partner-credit {
    padding-bottom: clamp(3rem, 10vw, 4.5rem);
  }
}

.partner-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  margin-bottom: 1.6rem;
}

.partner-badge {
  width: clamp(130px, 16vw, 189px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.partner-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.partner-text {
  font-family: var(--font-body);
  color: #5a5757;
}

.partner-text p {
  letter-spacing: 0.06em;
  line-height: 1.9;
}

.partner-text .partner-text-main {
  font-size: clamp(15px, 1.9vw, 19px);
  font-weight: 500;
}

.partner-text .partner-text-sub {
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 500;
}

.partner-text .partner-text-link {
  margin-top: 0.4em;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 500;
}

.partner-text .partner-text-link a {
  color: var(--mid-blue);
  text-decoration: none;
}

.partner-text .partner-text-link a:hover {
  text-decoration: underline;
}

/* ─── MAP（南極の地図） ─── */

#explore {
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(3.5rem, 7vw, 5.5rem);
  background: var(--bg-white);
  text-align: center;
}

#explore .section-ja {
  color: var(--dark-navy);
}

.explore-minimap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.explore-minimap img {
  max-width: 320px;
  width: 100%;
  height: auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

#explore .btn-ghost {
  margin-top: 1.6rem;
  display: inline-block;
  padding: 15px 40px;
  border-radius: 999px;
  background: var(--bg-white);
  color: #0062af;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease;
}

#explore .btn-ghost:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

/* ─── PROJECT（南極×ミサワホーム／FRONTIER／eスクール誘導 統合セクション） ─── */

#project {
  background: var(--bg-white);
}

#projects {
  padding: 0 clamp(1.5rem, 5vw, 3rem) 0;
  text-align: center;
}

#projects .section-ja {
  color: var(--dark-navy);
}

#projects .section-desc {
  color: #25689e;
  font-size: 15px;
  letter-spacing: 0.1em;
  margin-top: 0.6rem;
}

.frontier-text p + p {
  margin-top: 1.2em;
}

.frontier-links {
  margin-top: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}

.frontier-text-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7em 1.8em;
  border: 1.5px solid #25689e;
  border-radius: 999px;
  background: #fff;
  color: #25689e;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.frontier-text-link:hover {
  background: #25689e;
  color: #fff;
}

/* タブボタン（切り替えトリガー） */

.frontier-buttons {
  grid-area: buttons;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

/* 「南極クラス」パネル内、本文とテキストリンクの間に表示するロゴ2点。
   PC閲覧時は横並び、モバイル閲覧時は縦積みにする。 */

.frontier-class-logos {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  margin-top: 1.2em;
}

.frontier-class-logos img {
  height: 1.2rem;
  width: auto;
  display: block;
}

.frontier-btn:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

@media (max-width: 900px) {
  .frontier-panels {
    text-align: center;
  }

  .frontier-links {
    align-items: center;
  }

  .frontier-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .frontier-class-logos {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

/* ─── 南極eスクール誘導（凹みNeumorphismパネル） ─── */

#eschool-cta {
  padding: clamp(0.25rem, 1vw, 0.5rem) clamp(1.5rem, 5vw, 3rem)
    clamp(2.5rem, 6vw, 4rem);
}

.eschool-panel {
  max-width: var(--max-w);
  margin: 0 auto;
  border-radius: clamp(24px, 4vw, 48px);
  background: #f7f7f7;
  box-shadow:
    inset 10px 10px 22px rgba(163, 184, 202, 0.4),
    inset -10px -10px 22px rgba(255, 255, 255, 0.9);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(2rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  /* space-betweenだと画面を広げたときに余った余白が
     テキストと画像の"間"に足されてgapが際限なく広がってしまうため、
     固定gapで中央寄せするcenterに変更。余白はグループの外側に逃がす */
  justify-content: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.eschool-text {
  max-width: 580px;
}

.eschool-tagline {
  font-size: 13px;
  font-weight: 700;
  color: #5f5f5f;
  letter-spacing: 0.04em;
  margin-bottom: 0.6em;
}

.eschool-heading {
  font-size: clamp(19px, 2.2vw, 22px);
  font-weight: 700;
  color: #5f5f5f;
  letter-spacing: 0.04em;
  margin-bottom: 1.1em;
}

.eschool-desc {
  font-size: 14px;
  line-height: 1.9;
  color: #5a5757;
  letter-spacing: 0.04em;
}

.eschool-cta-btn {
  display: inline-block;
  margin-top: 1.8em;
  padding: 15px 40px;
  border-radius: 999px;
  background: var(--bg-white);
  color: #0062af;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease;
}

.eschool-cta-btn:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.eschool-image {
  flex-shrink: 0;
  width: clamp(220px, 26vw, 320px);
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  filter: drop-shadow(0 10px 20px rgba(90, 110, 130, 0.25));
}

.eschool-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 0;
}

.eschool-slide.active {
  opacity: 1;
  z-index: 1;
}

.eschool-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eschool-slider-dots {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.eschool-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s,
    transform 0.3s;
}

.eschool-slider-dot.active {
  background: #fff;
  transform: scale(1.25);
}

@media (max-width: 900px) {
  .eschool-panel {
    flex-direction: column;
    text-align: center;
  }

  .eschool-text {
    max-width: 100%;
  }

  .eschool-image {
    width: min(320px, 70vw);
  }
}

/* ─── 南極とミサワホーム（見出し） ─── */

#misawa-story-intro {
  padding: 0 clamp(1.5rem, 5vw, 3rem) 1rem;
  background: var(--bg-light);
  text-align: center;
}

#misawa-story-intro .section-ja {
  color: #000000;
}

#misawa-story-intro .section-desc {
  color: #25689e;
  font-size: 15px;
  letter-spacing: 0.1em;
  margin-top: 0.6rem;
}

/* 共通：凹み（コンケイブ）のNeumorphismフレーム */

.frame-neu {
  position: relative;
  border-radius: 28px;
  background: var(--bg-light);
  box-shadow:
    inset 8px 8px 18px rgba(163, 184, 202, 0.45),
    inset -8px -8px 18px rgba(255, 255, 255, 0.85);
  padding: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.frame-neu-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
}

/* ── 紙芝居スクロールスタック ── */

.story-stack-outer {
  position: relative;
  height: 600vh; /* 100vh × 6スライド */
  max-width: var(--max-w);
  margin: 0 auto;
}

.story-stack-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-stack-row {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  width: 100%;
}

.story-stack-frame {
  width: 46%;
  aspect-ratio: 4 / 3;
}

.story-image-item {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* 手前の画像ほど上に重ね、めくれて退場すると次が見える */

.story-image-item[data-i="0"] {
  z-index: 5;
}

.story-image-item[data-i="1"] {
  z-index: 4;
}

.story-image-item[data-i="2"] {
  z-index: 3;
}

.story-image-item[data-i="3"] {
  z-index: 2;
}

.story-image-item[data-i="4"] {
  z-index: 1;
}

.story-image-item[data-i="5"] {
  z-index: 0;
}

.story-text-col {
  position: relative;
  width: 54%;
  height: clamp(320px, 32vw, 440px);
}

.story-text-item p + p {
  margin-top: 1.1em;
}

.story-replay {
  display: flex;
  justify-content: center;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.story-replay-btn {
  display: inline-block;
  padding: 13px 34px;
  border: none;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--text-dark);
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  cursor: pointer;
  text-decoration: none;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.story-replay-btn:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

/* 640px、または縦向き（iPad Proなど横幅があっても縦長の場合）は
   画像とテキストを横並びにせず縦積みにする。
   ★横幅だけでなく「向き」も条件に加えたのがポイント。 */
@media (max-width: 639px), (orientation: portrait) {
  .story-stack-viewport {
    padding-top: var(--header-h, 96px);
  }

  .story-stack-row {
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
  }

  .story-stack-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto;
    max-height: 60%;
  }

  .story-text-col {
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
  }
}

#news {
  position: relative;
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(6rem, 11vw, 10rem);
  background: #eef2f5;
}

#news .section-ja {
  color: var(--dark-navy);
}

.news-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  border-radius: clamp(24px, 4vw, 40px);
  overflow: hidden;
  background: #f7f7f7;
  box-shadow:
    inset 10px 10px 22px rgba(163, 184, 202, 0.4),
    inset -10px -10px 22px rgba(255, 255, 255, 0.9);
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 3vw, 1.75rem);
}

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.3rem 1.25rem;
  border-radius: 16px;
  text-decoration: none;
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

@media (max-width: 600px) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    align-items: start;
    padding: 1.7rem 1.6rem;
  }

  #projects {
    padding-left: clamp(1rem, 4vw, 1.5rem);
    padding-right: clamp(1rem, 4vw, 1.5rem);
  }
}

.news-item:not(:last-child) {
  border-bottom: 1px solid rgba(163, 184, 202, 0.28);
}

.news-item:hover {
  background: var(--bg-white);
  box-shadow:
    4px 4px 10px rgba(163, 184, 202, 0.3),
    -3px -3px 8px rgba(255, 255, 255, 0.85);
}

.news-date {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--misawa-blue);
}

.news-title {
  font-size: 13.5px;
  color: var(--text-dark);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.news-more {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#connect {
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.5rem, 5vw, 3rem);
  background: var(--bg-white);
}

.connect-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.connect-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
  flex-wrap: wrap;
  margin-bottom: clamp(3.5rem, 7vw, 5.5rem);
  padding-bottom: 1rem;
}

.connect-text {
  max-width: 560px;
  text-align: left;
}

.connect-ja {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  font-weight: 700;
  color: var(--dark-navy);
  letter-spacing: 0.1em;
  margin-bottom: 1.4rem;
  text-align: center;
}

.connect-desc {
  font-size: 14px;
  color: var(--misawa-blue);
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  text-align: center;
}

.connect-catalog-btn {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 15px 40px;
  border-radius: 999px;
  background: var(--bg-white);
  color: #0062af;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease;
}

.connect-catalog-btn:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.connect-image {
  flex-shrink: 0;
  width: clamp(320px, 34vw, 560px);
  aspect-ratio: 8 / 5;
  border-radius: 6px;
  overflow: hidden;
  filter: drop-shadow(0 14px 24px rgba(90, 110, 130, 0.3));
}

.connect-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  .connect-panel {
    flex-direction: column;
    text-align: center;
  }

  .connect-text {
    max-width: 100%;
    text-align: center;
  }
}

/* ニュースの「すべてみる／閉じる」ボタン */
#news .btn-ghost {
  display: inline-block;
  padding: 13px 34px;
  border: none;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

#news .btn-ghost:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.hero-en {
  font-family: var(--font-en);
  font-size: clamp(0.85rem, 1.8vw, 1.25rem);
  letter-spacing: 0.3em;
  color: #fff;
  margin-top: 0.7rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.6s ease forwards;
  text-align: center;
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  text-align: center;
}

.intro-sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 500;
  color: var(--text-dark);
  margin-top: 1.5rem;
  line-height: 2.1;
  letter-spacing: 0.09em;
  text-align: center;
}

@media (max-width: 600px) {
  .intro-sub br.pc-br {
    display: none;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 0;
  padding-top: clamp(2rem, 4vw, 3rem);
}

.stat-item {
  text-align: center;
  padding: 1.6rem 1rem;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-left: 1px solid var(--light-blue-gray);
}

.stat-item:last-child {
  border-right: 1px solid var(--light-blue-gray);
}

.stat-num {
  font-family: var(--font-en);
  font-size: clamp(2.6rem, 5.6vw, 4.1rem);
  color: var(--mid-blue);
  letter-spacing: 0.05em;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.stat-label {
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--mid-blue);
  margin-top: 5px;
  font-weight: 500;
  line-height: 1.5;
}

/* ─── STORY / PROJECT / MAP / TOPICS の全画面フォトヒーロー（パララックス対応） ─── */

#story-hero,
#project-hero,
#explore-hero,
#news-hero {
  position: relative;
  z-index: 2;
  min-height: clamp(340px, 46vw, 620px);
  overflow: hidden;
  display: flex;
  align-items: center; /* タイトルは画像の中央に配置 */
}

.story-hero-bg,
.project-hero-bg,
.explore-hero-bg,
.news-hero-bg {
  position: absolute;
  inset: -20% 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* ★CSSファイル(css/)からの相対パスなので ../image/ になる */
.story-hero-bg {
  background-image: url("../image/keyvisual_story.webp");
}

.project-hero-bg {
  background-image: url("../image/keyvisual_project.webp");
}

.explore-hero-bg {
  background-image: url("../image/keyvisual_connect.webp");
}

.news-hero-bg {
  background-image: url("../image/keyvisual_topics.webp");
}

/* 上下パディングを揃えて、見た目の中心とタイトル位置を合わせる */
.story-hero-content,
.project-hero-content,
.explore-hero-content,
.news-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}

.story-hero-title,
.project-hero-title,
.explore-hero-title,
.news-hero-title {
  font-family: var(--font-en);
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  letter-spacing: 0.14em;
  color: #ffffff;
  line-height: 1;
}

.story-divider,
.project-divider,
.explore-divider,
.news-divider,
.connect-hero-divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  z-index: 3;
  line-height: 0;
  pointer-events: none;
}

.story-divider svg,
.project-divider svg,
.explore-divider svg,
.news-divider svg,
.connect-hero-divider svg {
  display: block;
  width: 100%;
  height: clamp(28px, 5vw, 64px);
}

/* インラインSVGなのでfillで次セクションの背景色に直接合わせる */

.story-divider-svg polygon {
  fill: var(--bg-light);
}

.project-divider-svg polygon {
  fill: var(--bg-white);
}

@media (max-width: 600px) {
  .story-divider svg,
  .project-divider svg {
    width: 130%;
    margin-left: -15%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-hero-bg,
  .project-hero-bg,
  .explore-hero-bg,
  .news-hero-bg {
    transform: none !important;
  }
}
/* 画面には表示せず、スクリーンリーダーにだけ読ませるためのクラス */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* ─── FRONTIER（南極移動基地／南極クラス／南極eスクール） ───
   画像・ボタン・テキストの3つを独立したgrid-areaに分離。
   デスクトップでは「画像→テキスト｜ボタン」の2カラム、
   モバイルでは「画像→テキスト→ボタン」の縦積みに、
   grid-template-areasの切り替えだけで対応する。 */

#frontier {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  grid-template-areas:
    "visual buttons"
    "panels buttons";
  align-items: stretch;
  column-gap: clamp(1.5rem, 4vw, 3rem);
  row-gap: clamp(1rem, 2.5vw, 1.5rem);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem)
    clamp(0.25rem, 1vw, 0.5rem);
}

/* 画像専用パネル：タブ切り替え時はここだけをopacityでクロスフェード。 */

.frontier-visual {
  grid-area: visual;
  transition: opacity 0.38s ease;
}

.frontier-visual img {
  display: block;
  width: 100%;
  height: auto;
}

#frontier.is-switching .frontier-visual {
  opacity: 0;
}

/* パネル（コンテンツ切り替え用） */

.frontier-panels {
  grid-area: panels;
  position: relative;
  width: 100%;
  min-height: clamp(220px, 27vw, 270px);
  /* 表示中タブの実測高さにJSで追従させる（下記height transitionでタブ切替と同時に滑らかに変化） */
  transition: height 0.38s ease;
}

.frontier-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
  margin-top: -1rem;
}

.frontier-panel.active {
  opacity: 1;
  pointer-events: auto;
}

#frontier.is-switching .frontier-panel.active {
  opacity: 0;
}

.frontier-text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}

.frontier-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 16px 34px;
  min-width: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #25689e;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition:
    box-shadow 0.25s ease,
    color 0.25s ease;
}

.frontier-btn:focus-visible {
  outline: 2px solid var(--misawa-blue);
  outline-offset: 3px;
}

/* 現在表示中のコンテンツ＝凹んだ（押し込まれた）状態 */

.frontier-btn.active {
  color: var(--misawa-blue);
  cursor: default;
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

@media (max-width: 900px) {
  /* 画像→テキスト→ボタンの順に縦積み */
  #frontier {
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "panels"
      "buttons";
  }

  .frontier-panels {
    width: 100%;
    min-height: clamp(260px, 62vw, 320px);
  }

  .frontier-panel {
    align-items: center;
    padding-bottom: clamp(3rem, 9vw, 4rem);
  }

  /* パネル本文とボタン列の間だけを詰める（visual-panels間のgapはそのまま） */
  .frontier-buttons {
    margin-top: clamp(-4rem, -9vw, -3rem);
  }

  .frontier-btn {
    flex: 1 1 auto;
  }
}

/* ─── 南極とミサワホーム 本文（画像+テキスト／紙芝居スクロール） ─── */

#story-body {
  background: var(--bg-light);
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(3rem, 6vw, 5rem);
}

#story-body .section-ja {
  color: var(--dark-navy);
}

/* 紙芝居スクロールの各画像 */

.story-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-link {
  color: inherit;
  text-decoration: none;
  background-color: rgba(137, 208, 234, 0.4);
  padding: 0.05em 0.1em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.story-text-item {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
  will-change: opacity, transform;
  font-size: 14px;
  line-height: 1.95;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  pointer-events: none;
}
/* ─── PC(640px〜)かつ横向き: 紙芝居と見出し／ボタンを同時表示するためのレイアウト ─── */
@media (min-width: 640px) and (orientation: landscape) {
  #misawa-story-intro {
    display: none;
  }
  #story-body > .story-replay {
    display: none;
  }

  .story-stack-viewport {
    flex-direction: column;
    justify-content: flex-start;
    /* ヘッダーの実測高さ(--header-h、JSで算出済み)ぶん、
       上に余白を確保してh2がヘッダーに潜り込まないようにする */
    padding: calc(var(--header-h, 96px) + 1rem) clamp(1.5rem, 5vw, 3rem) 1.5rem;
    gap: clamp(1rem, 2.5vw, 1.75rem);
  }

  .story-stack-header,
  .story-stack-footer {
    flex: 0 0 auto; /* 高さを自身のコンテンツ分だけに固定し、伸びないようにする */
    text-align: center;
  }

  .story-stack-header .section-ja {
    font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  }

  .story-stack-header .section-desc {
    font-size: 12px;
    margin-top: 0.4rem;
  }

  .story-stack-header .story-replay-btn {
    margin-top: 1rem;
    padding: 10px 26px;
    font-size: 12px;
  }

  .story-stack-footer .story-replay-btn {
    padding: 10px 26px;
    font-size: 12px;
  }

  .story-stack-row {
    /* 固定サイズではなく、header/footerを除いた残りの高さいっぱいまで伸ばす */
    flex: 1 1 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
  }

  /* 実際のwidth/heightはJS(syncStackLayout)がpxで直接指定する。
     aspect-ratioに幅・高さ両方の制約を同時に持たせるとSafari(特にiPad)で
     破綻するため、CSS側では初期値・フォールバックのみに留める。 */
  .story-stack-frame {
    flex: 0 0 auto;
  }

  .story-text-col {
    flex: 0 0 auto;
  }
}

/* スマホ(640px)または縦向き */
@media (max-width: 639px), (orientation: portrait) {
  /* 複製したヘッダー・フッターは非表示（元の構成のまま） */
  .story-stack-header,
  .story-stack-footer {
    display: none;
  }

  /* テキスト列の高さはflexで決まるため、centerのままだと
     短いテキストの項目が箱の中央に寄って上に空白ができる。上詰めにして回避する。 */
  .story-text-item {
    font-size: 12.5px;
    line-height: 1.8;
    justify-content: flex-start;
  }
}
/* 横並びレイアウトで画面の高さが低いとき（ノートPC・横向きスマホ等）。
   複製見出しの説明文と複製フッターを隠して本文の高さを確保する。
   「最初からよむ」は紙芝居下の元ボタンを代わりに表示する */
@media (min-width: 640px) and (orientation: landscape) and (max-height: 640px) {
  .story-stack-header .section-desc,
  .story-stack-footer {
    display: none;
  }

  #story-body > .story-replay {
    display: flex;
  }

  .story-stack-viewport {
    gap: 0.75rem;
    padding-bottom: 1rem;
  }

  .story-text-item {
    font-size: 13px;
    line-height: 1.8;
  }
}

@media (min-width: 640px) and (orientation: landscape) and (max-height: 450px) {
  .story-stack-header {
    display: none;
  }

  #misawa-story-intro {
    display: block;
  }

  /* 上下左右の余白と、画像・テキスト間の余白を詰めて本文の領域を広げる */
  .story-stack-viewport {
    padding: calc(var(--header-h, 64px) + 0.5rem) 1rem 0.5rem;
  }

  .story-stack-row {
    gap: 1.25rem;
  }

  .story-text-item {
    font-size: 12.5px;
    line-height: 1.7;
  }

  .story-text-item p + p {
    margin-top: 0.6em;
  }
}
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item {
    padding: 1.4rem 0.5rem;
  }

  /* 2列レイアウトでは右列（偶数番目）の右端すべてに罫線を付ける */
  .stat-item:nth-child(2n) {
    border-right: 1px solid var(--light-blue-gray);
  }
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.slider-dot.active {
  background: #fff;
  transform: scale(1.25);
}

.news-item.visible {
  opacity: 1;
  transform: translateX(0);
}

/* .visibleのtransformに負けないよう、ホバー時の移動は.visibleと組み合わせて指定 */
.news-item.visible:hover {
  transform: translateX(4px);
}

#news .btn-ghost.open {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}
/* ─── スライダーの一時停止／再生ボタン（ヒーロー・南極eスクール共通） ─── */

.slider-dots,
.eschool-slider-dots {
  align-items: center; /* ドットとボタンの大きさが違うため縦中央で揃える */
}

.slider-toggle {
  width: 22px;
  height: 22px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
}

.slider-toggle svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.slider-toggle .icon-play {
  display: none;
}

.slider-toggle.is-paused .icon-pause {
  display: none;
}

.slider-toggle.is-paused .icon-play {
  display: block;
}

.slider-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 南極eスクールの小さい画像用 */
.slider-toggle--sm {
  width: 18px;
  height: 18px;
  margin-left: 4px;
}

.slider-toggle--sm svg {
  width: 8px;
  height: 8px;
}
/* ─── 「動きを減らす」設定への対応 ─── */
@media (prefers-reduced-motion: reduce) {
  /* ヒーローの文字とSCROLL表示：浮き上がりアニメーションなしで最初から表示 */
  .hero-title,
  .hero-en,
  .scroll-hint {
    animation: none;
    opacity: 1;
  }

  .scroll-line {
    animation: none;
  }

  /* トピックス：左からのスライドインとホバー時の移動を止める */
  .news-item {
    opacity: 1;
    transform: none;
  }

  .news-item.visible:hover {
    transform: none;
  }
}
