/* ==============================================
   1. 変数定義 (Design Tokens)
   ============================================== */

:root {
  /* Colors */
  --color-text: #333333;
  --color-primary: #1F3A56;
  --color-accent: #6FA2D6;
  --color-bg: #FFFFFF;
  --color-gray: #F8F9FA;
  --NELJAPAN-black: #363638;
  --NELJAPAN-navy: #37596F;
  --NELJAPAN-deepnavy: #1E3A4C;
  --NELJAPAN-paleblue: #D6E1E7;
  --NELJAPAN-gradation1: linear-gradient(180deg, rgba(214, 225, 231, 0.30) 0%, rgba(218, 215, 205, 0.30) 100%);
  --color-history-line: #2778AD;
  /* Fonts */
  --font-base: 'Noto Sans JP', sans-serif;
  --font-en: 'Montserrat', sans-serif;
  --font-serif: 'Noto Serif JP', serif;
  --font-title: 'Urbanist', sans-serif;
  /* Spacing / Layout */
  --padding-side-pc: 100px; 
  --padding-side-sp: 24px;
  --spacing-section: clamp(80px, 10vw, 160px);
  --header-offset-pc: 140px; 
  --header-offset-sp: 100px;
}


/* ==============================================
   2. リセット & 基本設定
   ============================================= */

*, *::before, *::after { 
  box-sizing: border-box; 
}
body {
  font-family: var(--font-base);
  color: var(--color-text);
  line-height: 1.8;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
/* 画像の基本設定（角丸3px） */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}
/* ロゴ画像・特定の画像は角丸にしない */
.header__logo img, 
.hero img,
.brand__name img,
.footer__bg-logo img {
  border-radius: 0;
}
a { 
  text-decoration: none; 
  color: inherit; 
  transition: opacity 0.3s; 
}
a:hover { 
  opacity: 0.7; 
}
ul { 
  list-style: none; padding: 0; margin: 0; 
}

/* --- コンテナ設定 --- */
.container {
  width: 100%;
  margin: 0;
  padding-left: var(--padding-side-pc);
  padding-right: var(--padding-side-pc);
}

.section {
  margin-bottom: var(--spacing-section);
  scroll-margin-top: var(--header-offset-pc);
}

/* --- 共通見出し --- */
.section-title {
  color: var(--NELJAPAN-deepnavy);
  font-family: var(--font-title);
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 3rem;
}
.section-title span {
  display: block;
  font-size: 0.875rem;
  font-family: var(--font-base);
  margin-top: 0.5rem;
  color: var(--NELJAPAN-deepnavy);
}


/* ==============================================
   3. ヘッダー
   ============================================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 40px var(--padding-side-pc);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  z-index: 1000;
  transition: padding 0.3s ease;
}
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: none; 
  margin: 0;
}
.header__logo {
  display: flex;
  width: 288px;
  align-items: center;
}
.header__nav {
  margin-left: auto; /* 必要に応じて右寄せを強化 */
}
.header__nav ul {
  display: flex;
  gap: 40px;
}
.header__nav a {
  font-family: var(--font-en);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--color-text);
}


/* ==============================================
   4. ヒーローセクション
   ============================================= */

.hero {
  background-color: #fff;
  padding-left: var(--padding-side-pc);
  padding-right: 0;
  width: 100%;
  padding-top: 180px;
  padding-bottom: 100px;
  position: relative;
  overflow-x: hidden;
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 45px;
  padding-right: var(--padding-side-pc); 
}

.hero__title {
  color: var(--NELJAPAN-navy);
  font-family: var(--font-title);
  font-size: 96px;
  font-weight: 400;
  line-height: 100px;
  margin: 0 0 20px 0;
}
.hero__subtitle { font-size: 14px; color: var(--NELJAPAN-deepnavy); margin: 0; }

/* Scroll Down */
.hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--color-history-line);
  cursor: pointer;
}
.hero__scroll-text {
  writing-mode: vertical-rl;
  font-family: var(--font-en);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}
.scroll-circle {
  position: relative;
  width: 140px;
  height: 140px;
  border: 1px solid var(--color-history-line);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
}
.scroll-circle::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 110px; height: 110px;
  background-color: #F2F4F6;
  border-radius: 50%;
  z-index: 0;
}
/* 矢印画像の設定 */
.arrow-img {
  position: relative;
  z-index: 1;
  width: 30px; 
  height: auto;
  margin-top: 0px;
}

/* ---------------------------------------------- 
   Banner Area (Image + SVG)
   ---------------------------------------------- */

/* 画像とSVGを包むコンテナ */
.hero__banner {
  position: relative;
  width: 100%;
  margin-bottom: 100px;
  margin-right: 0;
}

/* 背景画像 */
.hero__banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* SVG（画像の上に絶対配置で重ねる） */
.hero__svg {
  position: absolute;
  top: 0;
  right: 0;
  
  width: 60%; /* SVGのサイズ感（適宜調整） */
  height: 100%;
  
  pointer-events: none; /* クリックを邪魔しない */
  z-index: 2;
}


/* ---------------------------------------------- 
   SVG Animation Definitions
   ---------------------------------------------- */

/* 共通の初期状態 */
[class^="js-hex-group-"] {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

/* グループ1（左）：左下から飛んでくる */
.js-hex-group-1 {
animation: flyInLeft 3s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
  animation-delay: 0.5s;
  transform-box: fill-box;
  transform-origin: center;
}

/* グループ2（中央）：上から飛んでくる */
.js-hex-group-2 {
  animation: flyInTop 1.6s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
  animation-delay: 0.4s;
}

/* グループ3（右）：右から飛んでくる */
.js-hex-group-3 {
  animation: flyInRight 1.2s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
  animation-delay: 0.6s;
}

/* --- グループ4：移動せずに徐々に現れる --- */
.js-hex-group-4 {
  /* 2秒かけてゆっくり表示 */
  animation: fadeIn 2s ease-out forwards;
  
  /* 他のパーツが動き出した頃に表示開始（お好みで調整してください） */
  animation-delay: 0.5s;
}

/* --- キーフレーム（動きの設定） --- */

@keyframes flyInLeft {
  0% {
    opacity: 0;
    /* translate(-300px, 0): 左に300pxずらす
       rotate(-90deg): 反時計回りに90度傾けておく
       scale(0.5): 小さくしておく
    */
    transform: translate(-300px, 0) rotate(-90deg) scale(0.5);
  }
  100% {
    opacity: 1;
    /* 元の位置・角度・サイズに戻る */
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@keyframes flyInTop {
  0% {
    opacity: 0;
    transform: translate(0, -150px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes flyInRight {
  0% {
    opacity: 0;
    transform: translate(150px, 50px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}


/* ---------------------------------------------- 
   Hero Bottom Area
   ---------------------------------------------- */

.hero__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 60px;
  padding-right: var(--padding-side-pc);
}
.hero__watermark { opacity: 0.1; max-width: 200px; }

.hero__message-area {
  margin-top: 0;
  width: 846px;
  margin-left: auto;
  text-align: right;
  color: var(--NELJAPAN-black);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 2.2;
  letter-spacing: 0.15em;
}
.hero__message-area p { margin-top: 0; margin-bottom: 24px; }
.hero__message-area p:first-child { margin-top: -0.65em;}


/* ==============================================
   5. Brand Section
   ============================================= */

.brand {
  width: 100%;
  background: var(--NELJAPAN-gradation1);
  padding-top: 120px;
  padding-bottom: 120px;
  scroll-margin-top: calc(var(--header-offset-pc) - 120px);
}

.brand__item {
  display: flex;
  justify-content: flex-end;
  gap: 60px;
  align-items: center;
  margin-bottom: 120px;
  position: relative;
  width: 100%;
}
.brand__item:last-child { margin-bottom: 0; }

.brand__img {
  width: 400px;
  position: relative;
  z-index: 1;
}
.brand__img::before {
  content: '';
  position: absolute;
  top: 30px; left: -30px;
  width: 100%; height: 100%;
  border-radius: 3px;
  background: var(--NELJAPAN-gradation1); /* 色は同じだが配置用 */
  z-index: -1;
}

.brand__content {
  width: 400px;
  flex: 0 0 400px;
  display: flex;
  flex-direction: column;
}
.brand__name {
  font-family: var(--font-en);
  font-size: 3rem;
  line-height: 1;
  margin-top: -0.2em;
  margin-bottom: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.brand__name img {
  height: 50px;
  width: auto;
  display: block;
}
.brand__desc {
  font-size: 1rem;
  line-height: 2;
  color: var(--color-text);
  margin-bottom: 3rem;
}

/* リンクボタン本体 */
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 20px; /* テキストと円の間隔 */
  
  font-family: var(--font-en);
  font-size: 1rem;
  color: var(--color-history-line); /* 指定の色変数を使用 */
  text-decoration: none;

  align-self: flex-end; /* 右端に配置 */
  margin-top: 10px;
}

/* 円形矢印 */
.circle-arrow {
  width: 80px; 
  height: 80px;
  border: 1px solid currentColor; /* 文字色と同じ色の線 */
  border-radius: 50%;
  display: grid;
  place-items: center;
  
  font-size: 1.8rem; /* 矢印のサイズ */
  font-weight: 300;
  line-height: 1;
  
  /* アニメーション設定 */
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* --- ホバー時の動き (PC用) --- */
.btn-arrow:hover .circle-arrow {
  transform: translateX(10px); /* 右に動く */
}


/* ==============================================
   6. Philosophy Section
   ============================================= */

.philosophy {
  padding-top: 0px;
  padding-bottom: 0px;
}

.philosophy__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 80px;
  align-items: flex-start;
}
/* 階段状レイアウト */
.card:nth-child(1) { margin-top: 126px; }
.card:nth-child(2) { margin-top: 63px; }
.card:nth-child(3) { margin-top: 0; }

.card__img {
  position: relative;
  margin: 0 0 2rem 0;
  overflow: hidden;
  background-color: #000;
  border-radius: 3px;
}
.card__img img {
  width: 100%; height: auto;
  transition: transform 0.6s, opacity 0.3s;
  opacity: 0.85;
}

.card__img figcaption {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: auto; min-width: 70%;
  padding: 30px;
  text-align: center;
  color: #fff;
  z-index: 2;
  text-shadow: 0 0px 15px rgba(0,0,0,0.9);
}

.caption-en {
  font-family: var(--font-en);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.caption-ja {
  font-family: var(--font-base);
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 500;
}

.card__title {
  color: var(--NELJAPAN-black);
  font-family: var(--font-base);
  font-size: 18px;
  font-weight: 400;
  line-height: 2;
  text-align: left;
  margin-top: 1rem;
}


/* ==============================================
   7. History Section
   ============================================= */

.history .container {
  display: grid;
  /* 左余白100px + 320px = 420px地点に線 */
  grid-template-columns: 320px 1fr 335px;
  align-items: start;
}
.history .section-title {
  grid-column: 1; grid-row: 1;
  margin: 0; padding: 0; margin-top: -0.2em;
}
.history__timeline {
  grid-column: 2; grid-row: 1;
  margin-left: 0; max-width: 100%;
  border-left: 3px solid var(--color-history-line);
  padding-left: 40px;
  padding-bottom: 50px;
}
.history__image {
  grid-column: 3; grid-row: 1;
  width: 335px;
  margin-left: 0;
  position: sticky; top: 100px;
}
/* 丸位置補正 */
.history__item::before {
  left: -41.5px; /* -40px(pad) -1.5px(線) */
}

.history__item {
  position: relative;
  margin-bottom: 80px;
}
.history__item:last-child { margin-bottom: 0; }

.history__item::before {
  content: '';
  position: absolute;
  transform: translateX(-50%);
  top: 25.5px;
  width: 13px; height: 13px;
  background: #fff;
  border: 3px solid var(--color-history-line);
  border-radius: 50%;
  z-index: 1;
}

.history__year {
  display: block;
  color: var(--NELJAPAN-paleblue);
  font-family: 'Ubuntu', sans-serif;
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 16px;
}
.history__text {
  color: var(--NELJAPAN-black);
  font-size: 16px;
  line-height: 2;
  margin: 0;
}


/* ==============================================
   8. Company Section
   ============================================= */

.company {
  width: 100%;
  background: var(--NELJAPAN-gradation1);
  padding-top: 120px;
  padding-bottom: 120px;
  margin-bottom: 0;
  /* 余白(120px)の分だけ、停止位置を上にずらす */
  scroll-margin-top: calc(var(--header-offset-pc) - 120px);
}

.company__layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: center;
}

.company__list { margin: 0; }
.company__row {
  display: flex;
  border-bottom: 1px solid #ccc;
  padding: 20px 0;
}
.company__row:last-child { border-bottom: none; }

.company__row dt {
  width: 120px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--NELJAPAN-black);
}
.company__row dd {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* 地図のコンテナ */
.company__map {
  width: 100%;
  height: 400px; 
  background-color: #f0f0f0;
}

.company__map iframe {
  width: 100%;
  height: 100%; 
  border-radius: 3px;
  filter: grayscale(70%);
  border: none;
  display: block;
}


/* ==============================================
   9. Footer
   ============================================= */

.footer {
  position: relative;
  background-color: #fff;
  padding: 120px 0;
  overflow: hidden;
  width: 100%;
}

.footer__nav ul {
  display: flex;
  justify-content: flex-start;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.footer__nav a {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 500;
  color: var(--NELJAPAN-black);
  letter-spacing: 0.05em;
  transition: opacity 0.3s;
}
.footer__nav a:hover { opacity: 0.6; }

.copyright {
  font-family: var(--font-en);
  font-size: 12px;
  color: #666;
  text-align: left;
  margin: 0;
}

.footer__bg-logo {
  position: absolute;
  bottom: 0;
  right: 40px;
  width: 55%;
  max-width: 900px;
  z-index: 0;
  pointer-events: none;
  line-height: 0;
}
.footer__bg-logo img { width: 100%; height: auto; display: block; }
.footer__content { position: relative; z-index: 1; }


/* ==============================================
   10. アニメーション
   ============================================= */

/* Fade Up */
.js-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.js-fade-up.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Left (History用) */
.js-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.js-slide-left.is-active {
  opacity: 1;
  transform: translateX(0);
}


/* ==============================================
   11. 改行制御用ユーティリティ
   ============================================= */

/* PCでのみ改行（モバイルでは無効） */
.br-pc {
  display: block;
}

/* モバイルでのみ改行（PCでは無効） */
.br-mobile {
  display: none;
}


/* ==============================================
   12. モバイル
   ============================================= */

@media (max-width: 768px) {

  /* --- 1. 共通設定 --- */
  .container {
    padding-left: var(--padding-side-sp);
    padding-right: var(--padding-side-sp);
  }

  /* タイトルを横並び（ベースライン揃え）に変更 */
  .section-title {
    font-size: 36px;
    margin-bottom: 40px;
    display: flex;  /* 横並びにする */
    align-items: baseline;  /* 文字のベースラインを揃える */
    gap: 15px;
    border-bottom: 1px solid #E0E0E0;
    padding-bottom: 15px; /* 線と文字の間隔 */
    width: 100%;
  }
  .section-title span {
    display: inline;
    margin-top: 0;
    font-size: 0.6rem;
    transform: none;
    color: var(--NELJAPAN-deepnavy);
  }

  p.section-lead{
    font-size: 0.85rem;
  }

  /* --- 2. ヘッダー --- */
  .header {
    padding: 15px var(--padding-side-sp);
    transition: background-color 0.3s;
  }
  .header.is-open { background-color: #fff; }
  .header__nav {
    display: block; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: #fff; 
    z-index: 1001; 
    
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    
    /* フレックスボックス設定 */
    display: flex;
    flex-direction: column; /* 縦並び */
    
    /* 中央揃え(center)をやめて、上揃え(flex-start)にする */
    justify-content: flex-start; 
    
    align-items: center; /* 左右は中央のまま */
    
    /* 上からの余白を追加（ヘッダーと被らない位置まで下げる） */
    padding-top: 120px; 
  }
  .header.is-open .header__nav { opacity: 1; visibility: visible; pointer-events: auto; }
  .header__nav ul { flex-direction: column; align-items: center; gap: 30px; }
  .header__nav a { font-size: 1rem; font-weight: 300; color: var(--NELJAPAN-black); }
  .header__logo img { width: 140px; height: auto; position: relative; z-index: 1002; }
  .header__hamburger { 
    display: block; 
    position: relative; 
    z-index: 1002; 
    width: 44px; 
    height: 44px; 
    cursor: pointer;
    margin-left: auto; /* 右端に寄せる */
  }
  
  /* 線の共通設定 */
  .header__hamburger span { 
    position: absolute;
    right: 0;
    height: 1.5px; /* 線の太さ */
    background-color: #37596F; /* 線の色 (Navy) */
    transition: all 0.3s ease-in-out;
    display: block;
  }
  /* 3本線のそれぞれの位置 */
  .header__hamburger span:nth-child(1) { top: 12px; width: 32px; }
  .header__hamburger span:nth-child(2) { top: 18px; width: 32px; }
  .header__hamburger span:nth-child(3) { top: 24px; width: 32px; }
  
  .header.is-open .header__hamburger span:nth-child(1) { top: 21px; width: 30px; transform: rotate(45deg); }
  .header.is-open .header__hamburger span:nth-child(2) { opacity: 0; }
  .header.is-open .header__hamburger span:nth-child(3) { top: 21px; width: 30px; transform: rotate(-45deg); }

  /* --- 3. ヒーロー --- */
  .hero {
    padding-top: 100px;
    padding-bottom: 60px;
    padding-left: var(--padding-side-sp);
    padding-right: 0; /* 画像を右端につけるためゼロ */
    overflow-x: hidden;
  }
  
  /* タイトルエリア調整：Scroll Downを右側に配置 */
  .hero__top {
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* タイトルとボタンを左右に離す */
    align-items: flex-end; /* 下揃え */
    margin-bottom: 65px;
    padding-right: var(--padding-side-sp); /* ここに右余白をつける */
  }

  .hero__title {
    font-size: 42px;
    line-height: 1.1;
    margin-bottom: 0;
    /* flex:1 を削除し、自然な幅にする（ボタンのスペース確保のため） */
  }

  /* Scroll Down：絶対配置をやめ、フローに配置 */
  .hero__scroll {
    position: static; /* 絶対配置解除 */
    margin-bottom: 5px; /* タイトルとのベースライン微調整 */
    flex-shrink: 0; /* 縮まないようにする */
  }
  .scroll-circle { width: 50px; height: 50px; }
  .scroll-circle::before { width: 38px; height: 38px; }
  .scroll-circle .arrow-down { font-size: 1.2rem; }

  /* スマホ版の矢印画像を小さくする設定 */
  .arrow-img {
    width: 13px;     /* PCの30pxから縮小 */
    margin-top: 2px; /* 位置微調整 */
  }

  .hero__scroll-text { font-size: 0.6rem; letter-spacing: 0.05em;}

  /* ヒーロー画像 */
  .hero__banner {
    margin-bottom: 60px;
    height: 200px;
    width: 100vw;

    /* 親(.hero)の左パディング(24px)を打ち消して左端に寄せる */
    margin-left: calc(-1 * var(--padding-side-sp)); 
    margin-right: 0;
    margin-bottom: 0;

    position: relative;
    overflow: hidden;
  }
  .hero__banner img {
    width: 100%;
    height: 100%;      /* 枠の高さ(200px)に合わせる */
    object-fit: cover; /* 縦横比を崩さずにエリアを埋める */
  }
  .hero__svg {
    position: absolute; top: 0; right: 0; left: auto;
    height: 100%; width: auto; max-width: none; z-index: 2;
  }

  /* 透かしロゴマーク：画像左下に配置 */
  .hero__bottom {
    display: flex;
    flex-direction: column; /* 縦並び */
    align-items: flex-start; /* 左寄せ */
    padding-right: var(--padding-side-sp);
    margin-top: 0; /* 画像との間隔 */
  }

  /* 透かしロゴマーク：通常の配置に戻す */
  .hero__watermark {
    display: block; /* スマホで表示 */
    position: static; /* 絶対配置を解除 */
    margin-top: 30px;
    margin-bottom: 30px;
    margin-left: 0px;
    opacity: 0.8;
    z-index: 1;
  }
  .hero__watermark img {
    width: 53px; /* スマホ用サイズ */
    height: auto;
  }

  /* メッセージエリア */
  .hero__message-area {
    width: 100%;
    text-align: left;
    margin-top: 0; /* ロゴとの間隔はロゴ側のmargin-bottomで調整 */
    font-size: 14px;
    line-height: 2;
  }
  .hero__message-area br { display: inline; }

  /* --- 4. BRAND --- */
  .brand {
    scroll-margin-top: calc(var(--header-offset-sp) - 60px);
    padding-top: 80px; 
    padding-bottom: 0;
  }
  .brand .container { display: block; }
  .brand__item {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    margin-bottom: 0px;
  }
  /* 最後のブランドの下には余白を入れない */
  .brand__item:last-child {
    margin-bottom: 0;
  }
  /* 画像のマージンを大きく（＝画像を小さく表示） */
  .brand__img {
    width: 80%; /* 100%から80%に変更して小さく */
    max-width: 300px;
    margin: 0 auto; /* 中央配置 */
    margin-bottom: 60px;
  }
  
  .brand__content { 
    width: 100%; 
    text-align: left;
    margin-bottom: 0; 
  }
  /* ブランドロゴ */
  .brand__name {
    font-size: 2.2rem; 
    margin-bottom: 1.5rem; 
    
    /* 左配置 */
    text-align: left; 
    margin-left: 0;
  }
  .brand__name img { 
    height: 40px; 
    margin: 0; 
  }

  /* 説明文 */
  .brand__desc { 
    font-size: 0.85rem; 
    text-align: left; /* 左揃え */
    line-height: 1.8;
    margin-bottom: 2.5rem;
  }

  /* リンクボタン（Scroll Down風デザイン） */
  .btn-arrow {
    /* 左配置 */
    display: inline-flex;
    align-items: center;
    gap: 20px; /* テキストと円の間隔 */
    
    font-family: var(--font-en);
    font-size: 0.8rem;
    color: var(--color-history-line);
    font-weight: 500;
  }
  
  /* 円形矢印 */
  .circle-arrow {
    color: var(--color-history-line); 
    /* Scroll Down (50px) と同じくらいのサイズ */
    width: 60px; 
    height: 60px;
    border: 1px solid currentColor; /* 文字色と同じ色の線 */
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.4rem; /* 矢印のサイズ */
    font-weight: 300;
    
    /* マウスホバー時の動きなど（PC兼用クラスの場合） */
    transition: transform 0.3s;
  }
  /* スマホでのホバー挙動（タップ時） */
  .btn-arrow:active .circle-arrow {
    transform: translateX(5px);
  }

  /* --- 5. PHILOSOPHY --- */
  .philosophy__grid { grid-template-columns: 1fr; gap: 40px; margin-top: 40px; }
  .card:nth-child(n) { margin-top: 0; }
  .card__img figcaption { width: 90%; padding: 20px; }
  h3.card__title {
    font-size: 0.85rem;
  }

  /* --- 6. HISTORY --- */
  .history .container { display: block; }
  
  /* 画像を年表の下に表示 */
  .history__image {
    display: block; 
    width: 80%;       /* 100%から80%に縮小 */
    max-width: 300px; /* PC版画像サイズを超えないように制限 */
    margin: 60px auto 0; /* 上に余白、左右中央揃え */
  }

  .history__timeline {
    margin-left: 20px;
    padding-left: 30px; 
    border-left: 4px solid var(--color-history-line); 
    padding-bottom: 0;
    
    /* タイトルとの間に余白を設ける */
    margin-top: 40px;
  }

  .history__item { margin-bottom: 60px; }

  /* 丸の位置調整：中心を完全に揃える */
  /* 計算式: -(padding 30px) - (丸の半径 10px) - (線の半径 2px) = -42px */
  .history__item::before {
    width: 14px;
    height: 14px;
    border: 3px solid var(--color-history-line);
    
    /* 以前の -40px から微調整 */
    left: -32px; 
    top: 10px;
  }

  .history__year { 
    font-size: 40px; 
    margin-bottom: 8px; 
    color: var(--NELJAPAN-paleblue);
  }
  .history__text { font-size: 14px; }

  /* --- 7. COMPANY --- */
 .company { 
    scroll-margin-top: calc(var(--header-offset-sp) - 60px);
    padding-top: 80px; 
    padding-bottom: 55px;
  }
  
  .company__layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  /* リスト全体の余白調整 */
  .company__list {
    width: 100%;
  }

  /* 行ごとのスタイル */
  .company__row {
    /* 【変更】縦並び(column)をやめて横並び(row)にする */
    flex-direction: row; 
    align-items: baseline; /* テキストのベースラインで揃える */
    
    /* 添付画像のような余白感 */
    padding: 20px 20px; 
    gap: 20px;
    
    /* 以前の線を消す */
    border-bottom: none; 
  }

  /* 奇数行（1, 3, 5行目）に薄いグレーの背景 */
  .company__row:nth-child(odd) {
    background-color: #F9F9F9; 
  }
  /* 偶数行（2, 4行目）は白（または透明） */
  .company__row:nth-child(even) {
    background-color: #FFFFFF;
  }

  /* 項目名（社名、所在地など） */
  .company__row dt {
    /* 横並びになっても幅が潰れないように固定 */
    width: 80px; 
    flex-shrink: 0;
    
    color: var(--NELJAPAN-black);
    font-size: 0.9rem;
    font-weight: 700;
  }
  
  /* 内容 */
  .company__row dd {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  /* 地図の枠（コンテナ） */
  .company__map {
    width: 100%;
    height: 500px; 
    background-color: #f0f0f0; 
    margin-bottom: 0;
  }

  /* iframeの設定 */
  .company__map iframe {
    width: 100%;
    height: 100%; 
    border: none; /* 枠線なし */
    display: block; /* 隙間防止 */
  }

  body.is-auto-scrolling iframe {
    pointer-events: none;
  }

  /* --- 8. Footer --- */
  .footer {
    /* 下部にロゴが表示されるスペースを確保するため、下余白を増やす */
    padding: 30px 0 80px; 
    overflow: hidden;
    position: relative;
  }
  
  .footer__content {
    position: relative;
    z-index: 2; /* 文字をロゴより手前に */
  }

  /* ナビゲーション：縦並び・左寄せ */
  .footer__nav ul {
    flex-direction: column; 
    align-items: flex-start;
    gap: 0px;
    margin-bottom: 0px;
  }
  
  .footer__nav a {
    font-size: 14px;
    display: inline-block;
    line-height: 1; /* 行の高さも少し詰める */
  }

  /* コピーライト */
  .copyright {
    text-align: left;
    margin-top: 30px;
    font-size: 11px;
    color: #333;
  }

  /* フッターロゴ：下部中央配置 */
  .footer__bg-logo {
    display: block;   /* 強制表示 */
    width: 330px;     /* スマホで見えやすいサイズに固定 */
    max-width: none;
    
    left: auto;
    right: 10px;
    transform: none;
    bottom: 1px;     
    
    opacity: 1;
    z-index: 1;
    pointer-events: none;
  }

  /* --- 改行制御 --- */
  /* スマホではPC用の改行を消す */
  .br-pc {
    display: none;  
  }
  /* スマホではモバイル用の改行を有効にする */
  .br-mobile {
    display: block; 
  }
}


/* ==============================================
   14. 自動スクロール安定化対策
   ============================================= */

/* スクロール挙動の競合回避 */
html:has(body.is-auto-scrolling),
body.is-auto-scrolling {
    scroll-behavior: auto !important;
    pointer-events: none !important;
}

/* 重いCSSプロパティの完全無効化 */
body.is-auto-scrolling .header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important; 
    will-change: transform;
    transform: translateZ(0);
}

/* アニメーション・トランジションの全停止 */
body.is-auto-scrolling * {
    animation: none !important;
    transition: none !important;
}

/* 消えてしまう要素の強制表示 */
body.is-auto-scrolling .js-fade-up,
body.is-auto-scrolling .js-slide-left,
body.is-auto-scrolling [data-aos],
body.is-auto-scrolling .js-fade-in,
body.is-auto-scrolling [class^="js-hex-group-"] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* 停止ボタン等は操作可能に戻す */
body.is-auto-scrolling .hero__scroll,
body.is-auto-scrolling .header { 
    pointer-events: auto !important;
}