* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /*CSS変数として定義　メリット；管理がしやすい、コードが見やすい*/
  --primary-black: #2d2d2d;
  --dark-gray: #404040;
  --medium-gray: #5a5a5a;
  --light-gray: #8a8a8a;
  --very-light-gray: #e8e8e8;
  --background-light-gray: #fffff5;
  --background-gray: #e8e8e8;
  --white: #ffffff;
  --accent-gray: #666666;
  --surface: rgba(45, 45, 45, 0.05);
  --gradient: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  background: var(--background-gray);
  color: var(--primary-black);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* プログレスバー */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 9999;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2d2d2d, #404040);
  width: 0%;
  transition: width 0.3s ease;
}

/* ヘッダーナビゲーション固有のスタイル */
.header-nav {
  position: fixed;
  top: 2rem;
  right: max(2rem, calc((100vw - 1400px) / 2 + 2rem));
  z-index: 1001;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 0.8rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-nav a {
  color: var(--accent-gray);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--primary-black);
  transform: translateY(-1px);
}

.header-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-black);
  border-radius: 1px;
}

/* ヘッダーナビゲーション　タブレットレイアウト */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
}

/* フローティングナビゲーション固有のスタイル */
.floating-nav {
  position: fixed;
  top: 50%;
  right: max(2rem, calc((100vw - 1400px) / 2 + 2rem));
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 1rem 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--light-gray);
  margin: 0.8rem 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-dot.active {
  background: var(--primary-black);
  transform: scale(1.3);
}

.nav-dot:hover {
  background: var(--dark-gray);
  transform: scale(1.2);
}

.nav-dot::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-black);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-dot:hover::after {
  opacity: 1;
  visibility: visible;
  right: 25px;
}

/* フローティングナビゲーション　タブレットレイアウト */
@media (max-width: 768px) {
  .floating-nav {
    display: none;
  }
}

/* Hero セクション */
.hero-section {
  min-height: 100vh; /* 画面全体の高さを確保 */
  background-color: var(--light-gray);
  display: flex;
  flex-direction: column;
  justify-content: center; /* コンテンツを縦中央へ */
  align-items: center; /* コンテンツを横中央へ */
  position: relative; /* ::before / ::after の配置用に基準を作る */
  overflow: hidden; /* 擬似要素のはみ出しを隠す */
  width: 100%;
}

/* 背景画像（フェードイン効果） */
.hero-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("images/hero-background.png");
  background-size: cover; /* 画面サイズに合わせて拡大縮小 */
  background-position: center;
  opacity: 0; /* 初期は非表示 */
  transition: opacity 1.5s ease-in; /* 1.5秒かけて滑らかに表示 */
  z-index: 1; /* 背景レイヤー */
}

/* hero-loaded クラス追加で背景をフェードイン → JSで追加 */
.hero-section.hero-loaded::after {
  opacity: 1;
}

/* Heroセクション固有のスタイル */
.hero-content {
  text-align: center;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 80px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.8) 50%, 
    transparent 100%
  );
  padding: 5px 0;
  width: 50%;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--primary-black);
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.7);
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--primary-black);
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.7);
}

/* Heroセクション タブレットレイアウト */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content {
    padding: 2rem 20px;
  }
}

/* Heroセクション モバイルレイアウト */
@media (max-width: 480px) {
  .hero-content {
    padding: 1.5rem 15px;
  }
}

/* コンテンツセクションクラス固有のスタイル */
.content-section {
  min-height: 100vh;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  /* アニメーション用 */
  transform: translateY(
    100px
  ); /* 100px下にずらして配置（アニメーションの初期位置） */
  opacity: 0; /* 初期状態で非表示 */
  transition: all 1s ease; /* 1秒かけて滑らかにアニメーション */
  width: 100%;
  background: var(--background-light-gray);
}

.content-section.animate {
  transform: translateY(0);
  opacity: 1;
}

section.content-section:nth-of-type(odd) {
  /*　section要素の奇数番目のcontent-sectionクラスに適用 */
background: var(--background-gray);
}

.section-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 120px;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  transform: translateY(50px);
  opacity: 0;
  transition: all 1s ease;
}

.section-header.animate {
  transform: translateY(0);
  opacity: 1;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-black);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-black);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--accent-gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* コンテンツセクションクラス タブレットレイアウト */
@media (max-width: 768px) {
  .section-container {
    padding: 3rem 20px;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* コンテンツセクションクラス モバイルレイアウト */
@media (max-width: 480px) {
  .section-container {
    padding: 3rem 15px;
  }
}

/* Aboutセクション固有のスタイル */
.about-content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.about-content-wrapper h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--primary-black);
}

.about-content-wrapper p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: var(--accent-gray);
}

/* Careerセクション固有のスタイル */
.career-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.career-text-content {
  max-width: none; /* 制限解除 */
}

.career-main .career-main-title,
.career-details .details-title {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--primary-black);
}

.career-details {
  margin-top: 2rem;
}

.career-text-content .career-description,
.career-text-content .details-list li {
  color: var(--accent-gray);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.career-image {
  margin-left: 3rem;
  width: 35%;
  max-width: 360px;
  border: 4px solid var(--white);
}

.career-image img {
  width: 100%;
  height: auto;
}

/* Careerセクション タブレットレイアウト */
@media (max-width: 768px) {
  .career-layout {
    display: flex;
    align-items: center;
    min-height: auto;
  }

  .career-details .details-list {
    margin-bottom: 0;
  }

  .career-main .career-description,
  .career-details .details-list {
    line-height: 1.7; /* テキストの可読性を確保 */
  }

  .career-image {
    margin-top: auto; /*画像を下寄りにする*/
  }
}

/*Careerセクション　モバイルレイアウト */
@media (max-width: 480px) {
  .career-layout {
    flex-direction: column;
  }

  .career-text-content {
    max-width: none;
    padding: 1.5rem 0;
  }

  .career-image {
    display: none; /*画像の非表示*/
  }
}

/* Skillsセクション固有のスタイル */
.skill-list {
  list-style: none;
}

.skill-list li {
  color: var(--accent-gray);
  padding: 0.5rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: 0.05em;
}

.skill-list li .material-icons {
  color: var(--primary-black);
}

/* Skillsセクション用のコンテンツグリッド */
.content-grid {
  display: grid; /* CSSグリッドレイアウトにする */
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 450px));
  /* 1列300〜450pxの幅で、入るだけ自動で横に並べる（レスポンシブ） */
  justify-content: center; /* グリッド全体を中央寄せ */
}

.content-card {
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--very-light-gray);
  transition: all 0.8s ease; /* 全体の変化を滑らかに */
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  opacity: 0; /* アニメ開始前は非表示（透明） */
  transform: translateY(50px) scale(0.95);
  /* 下に50pxズレ＋少し縮んだ状態で始まる */
}

.content-card.animate {
  opacity: 1; /* 完全に表示 */
  transform: translateY(0) scale(1); /* 本来の位置＆サイズに戻る */
}

.content-card:hover {
  transform: translateY(-10px) scale(1.02); /* 少し浮き上がる */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); /* 影を濃くして強調 */
}

.content-card h3 {
  color: var(--primary-black);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Skillsセクション タブレットレイアウト */
@media (max-width: 768px) {
  #skills .content-grid {
    /*skillsIDを持つセクション内のcontent-gridクラスに適用*/
    grid-template-columns: 1fr; /*グリッドを1列レイアウトに変更する*/
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .content-card {
    padding: 1.5rem;
  }
}

/* Skillsセクション モバイルレイアウト */
@media (max-width: 480px) {
  .content-grid {
    gap: 1rem;
  }

  .content-card {
    padding: 1.25rem;
  }
}

/* Skillsセクション レーダーチャート */
.radar-chart-container {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  to {
      opacity: 1;
  }
}

.chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1;
}

/* Skillsセクション　　タブレットレイアウト */
@media (max-width: 768px) {
  .radar-chart-container {
      padding: 32px 24px;
  }
}

/* Skillsセクション　　モバイルレイアウト */
@media (max-width: 425px) {
  .radar-chart-container {
      padding: 24px 20px;
  }
}


/* Projectsセクション固有のスタイル */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.project-card {
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--white);
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
  color: var(--primary-black);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.project-card p {
  color: var(--accent-gray);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.project-card-cta {
  font-weight: 600;
  color: var(--primary-black);
  transition: color 0.3s ease;
}

.project-card:hover .project-card-cta {
  color: var(--medium-gray);
}

/* Projectsセクションのモーダル固有のスタイル */
.project-details {
  margin-top: 1.5rem;
}

.project-details h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-black);
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary-black);
}

.project-details ul {
  list-style-type: none;
  padding-left: 1rem;
}

.project-details ul li {
  color: var(--accent-gray);
  line-height: 1.6;
  font-size: 0.95rem;
}

.project-tech {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tech-tag {
  background: var(--primary-black);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Projectsセクションのモーダルオーバーレイ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible; /* モーダルがアクティブなときに表示 */
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  gap: 2rem;
  transform: scale(0.95);
  transition: transform 0.4s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--light-gray);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--primary-black);
}

.modal-img {
  flex: 1.5;
  max-width: 60%;
  height: auto;
  object-fit: cover; /* 画像の切り抜き方法 */
  border: #2d2d2d solid 2px;
  border-radius: 8px;
}

.modal-text {
  flex: 1;
}

/* Projectsセクションのモーダル内画像カルーセル */
.modal-img-container {
  flex: 1.5;
  max-width: 60%;
  position: relative;
  overflow: hidden;
  border: #2d2d2d solid 2px;
  border-radius: 8px;
}

.carousel-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease-in-out;
}

.carousel-img.active {
  opacity: 1;
  position: relative; /* コンテナに固有のサイズを与える */
}

.modal-img-prev,
.modal-img-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  padding: 1rem 0.75rem;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.modal-img-prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.modal-img-next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.modal-img-container:hover .modal-img-prev,
.modal-img-container:hover .modal-img-next {
  /* ホバー時にナビボタンを表示 */
  opacity: 1;
}

.modal-img-prev:hover,
.modal-img-next:hover {
  /* ナビボタンのホバー効果 */
  background: rgba(0, 0, 0, 0.7);
}

/* Projectsセクション タブレットレイアウト */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* モーダルレイアウト内のカルーセルの調整 */
  .modal-content {
    flex-direction: column;
  }

  .modal-img-container {
    max-width: 100%;
  }

  .modal-img {
    max-width: 100%;
  }

  .modal-close {
    top: 1rem;
    z-index: 10;
    margin-left: auto;
  }
}

/* Timelineセクション固有のスタイル */
.timeline-container {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 3px dashed var(--light-gray);
}

.timeline-item {
  padding: 1rem 0;
  position: relative;
  width: 50%;
  /* アニメーション用 */
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}

.timeline-item.animate {
  opacity: 1;
  transform: translateY(0);
}

/* 奇数番目のアイテムを右側に */
.timeline-item:nth-child(odd) {
  /*odd:奇数番目、奇数番目のtimeline-itemを対象にする*/
  left: 50%; /*左端を親要素の幅の50%（中央）に合わせる*/
  padding-left: 60px;
}

/* 偶数番目のアイテムを左側に */
.timeline-item:nth-child(even) {
  /*even:偶数番目、偶数番目のtimeline-itemを対象にする*/
  padding-right: 60px;
}

.timeline-item:nth-child(even) .timeline-content {
  /*even:偶数番目、偶数番目のtimeline-itemを対象にする*/
  flex-direction: row-reverse; /*Flexboxの方向を逆にする row:左から右に並ぶ(デフォ) row-reverse:左から右に並ぶ*/
}

.timeline-marker {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid var(--background-gray);
  box-shadow: 0 0 0 3px var(--primary-black);
  z-index: 2;
  background: var(--background-gray);
}

.timeline-item:nth-child(odd) .timeline-marker {
  /*odd:奇数番目、奇数番目のtimeline-markerを対象にする*/
  left: 0;
  transform: translate(
    -50%,
    -50%
  ); /*translate(x,y):要素をx方向y方向に移動させる、中央配置*/
}

.timeline-item:nth-child(even) .timeline-marker {
  /*even:偶数番目、偶数番目のtimeline-markerを対象にする*/
  right: 0;
  transform: translate(
    50%,
    -50%
  ); /*translate(x,y):要素をx方向y方向に移動させる、中央配置*/
}

.timeline-content {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.timeline-image {
  flex-shrink: 0; /*Flexboxで縮まないように固定*/
  width: 180px;
  height: 180px;
  border-radius: 50%; /*丸くして円形にする*/
  background: var(--background-gray);
  border: 2px solid var(--very-light-gray);
  overflow: hidden; /*中身がはみ出た場合は隠す(画像の円形化の為)*/
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.timeline-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 親のサイズに合わせて画像を切り抜きつつ表示、縦横比を保つ */
}

.timeline-text {
  flex: 1; /*Flexコンテナ内で残りのスペースを全部使う*/
  min-width: 0; /*子要素の長さによって勝手に横幅が広がるのを防ぐ*/
  display: flex;
  flex-wrap: wrap; /*子要素を横幅いっぱいで折り返す*/
  align-items: center;
}

.timeline-item:nth-child(even) .timeline-text {
  justify-content: flex-end;
  text-align: right;
}

.timeline-period {
  margin-right: 1rem;
}

.timeline-content p {
  flex-basis: 100%;
  margin-top: 0.75rem;
  color: var(--accent-gray);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 0;
}

.timeline-content h3 {
  color: var(--primary-black);
  margin-bottom: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Timelineセクション モバイルレイアウト */
@media (max-width: 768px) {
  .timeline-container {
    padding: 0;
  }

  .timeline-line {
    left: 80px; /* 端から少しスペースを空ける */
  }

  .timeline-item:nth-child(even),
  .timeline-item:nth-child(odd) {
    width: 100%;
    position: static; /* 配置をリセット */
    padding-left: 30px;
    padding-right: 30px;
  }

  .timeline-item:nth-child(even) .timeline-content,
  .timeline-item:nth-child(odd) .timeline-content {
    padding: 1rem 0;
    flex-direction: row;
    align-items: flex-start; /* すべてのコンテンツを左揃えに */
  }

  .timeline-item:nth-child(even) .timeline-text,
  .timeline-item:nth-child(odd) .timeline-text {
    justify-content: flex-start;
    text-align: left;
  }

  /* マーカーを削除 */
  .timeline-marker {
    display: none;
  }

  .timeline-image {
    width: 100px; /* サイズを調整 */
    height: 100px;
  }

  .timeline-content h3 {
    font-size: 1.2rem;
  }
}

/* Contactセクション固有のスタイル */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-buttons-section {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-btn-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-black);
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: 0 5px 20px rgba(45, 45, 45, 0.2);
}

.contact-btn-section:hover {
  background: var(--dark-gray);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(45, 45, 45, 0.3);
}

/* Contactセクション　モバイルレイアウト */
@media (max-width: 768px) {
  .contact-buttons {
    flex-direction: column;
    align-items: center;
  }

  .contact-buttons-section {
    flex-direction: column;
    align-items: center;
  }
}