@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Noto+Sans+JP:wght@400;700&display=swap');

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* ベーススタイル */
body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #121212;
  color: #f5f5f5;
  font-size: 20px;
  line-height: 1.8;
  position: relative;
}

/* particles.js のキャンバスを背景に */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* 固定ヘッダー */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  padding: 1em 2em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  z-index: 1000;
}

.header.shrink {
  padding: 0.5em 2em;
  background: rgba(0, 0, 0, 0.9);
}

/* ロゴ（寒色系） */
.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8em;
  font-weight: 700;
  color: #64b5f6; /* 寒色の青 */
}

@media (max-width: 768px) {
  .logo {
    position: absolute;
    top: 1.5em; /* ハンバーガーメニューと同じ高さ */
    left: 1em; /* 左端に配置 */
  }
}

/* ナビゲーション & ボタン */
nav a,
nav button {
  color: #64b5f6;
  text-decoration: none;
  margin: 0 1em;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05em;
  background: none;
  border: none;
  cursor: pointer;
}

nav a:hover,
nav button:hover {
  color: #ffffff;
}

/* Hamburger menu button */
.hamburger-menu {
  display: block;
  font-size: 2em;
  background: none;
  border: none;
  color: #64b5f6;
  cursor: pointer;
  z-index: 1001;
  position: fixed;
  top: 1.5em;
  left: 50%;
  transform: translateX(-50%);
}

/* Adjusting the .nav-menu to avoid overlapping with the hamburger menu icon */
.nav-menu {
  position: absolute;
  top: calc(100% + 1em); /* Place the menu below the hamburger icon */
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  padding: 1em;
  border-radius: 8px;
  z-index: 1000;
  display: none; /* Hidden by default */
  flex-direction: column;
}

.nav-menu.active {
  display: flex; /* Show the menu when active */
}

/* ヒーローセクション（画像＋グラデーション） */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 100px; /* ヘッダー分 */
  background:
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("assets/rich-bg.jpg") center/cover no-repeat;
  z-index: -1;
}

/* 見出し */
.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 4.5em;
  font-weight: 700;
  margin-bottom: 0.4em;
}

/* タイピング風アニメ */
.typing-text {
  font-size: 1.5em;
  border-right: 2px solid #f5f5f5;
  white-space: nowrap;
  overflow: hidden;
  animation: blink-caret 0.8s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #f5f5f5; }
}

/* スクロールアニメに合わせるセクション */
.fade-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  padding: 4em 2em;
  max-width: 800px;
  margin: auto;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* セクション本文内のリンクも寒色系に */
section a {
  color: #64b5f6;
  text-decoration: underline;
  transition: color 0.3s;
}
section a:hover {
  color: #ffffff;
}

/* Projects セクション：カードレイアウト */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2em;
  margin-top: 2em;
}

.project-card {
  background: #1e1e1e;
  padding: 1.5em;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

/* フッター */
footer {
  text-align: center;
  padding: 2em;
  background-color: #1e1e1e;
  font-size: 0.95em;
  color: #aaa;
}

/* ディスクレーマーだけ控えめに */
.footer-disclaimer {
  font-size: 0.75em;        /* 小さめフォント */
  color: rgba(255,255,255,0.5); /* やや薄い白文字 */
  margin-top: 0.5em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 3em;
  }
  .typing-text {
    font-size: 1.2em;
  }
  nav a,
  nav button {
    display: block;
    margin: 0.5em 0;
  }
  .header {
    flex-direction: column;
  }
  .hamburger-menu {
    display: block;
    position: fixed; /* 固定位置に変更 */
    top: 1.5em; /* ヘッダー内で少し下に配置 */
    left: 80%; /* Move further to the right */
    transform: none; /* Remove centering transformation */
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 1em;
    border-radius: 8px;
    z-index: 1000;
  }

  .nav-menu.active {
    display: flex;
  }

  .header {
    z-index: 1000; /* Ensure header stays above content */
  }

  .hero {
    padding-top: 120px; /* Add padding to prevent overlap with header */
  }
}

/* Ensure navigation menu is displayed inline for PC view */
@media (min-width: 769px) {
  .nav-menu {
    display: flex !important; /* Always show menu items inline */
    position: static; /* Remove absolute positioning */
    flex-direction: row; /* Align items horizontally */
    background: none; /* Remove background */
    padding: 0; /* Remove padding */
    gap: 1em; /* Add spacing between items */
  }

  .hamburger-menu {
    display: none; /* Hide hamburger menu icon */
  }
}

/* Ensure navigation menu is displayed on the right for PC view */
@media (min-width: 769px) {
  .nav-menu {
    justify-content: flex-end; /* Align menu items to the right */
  }
}

/* Ensure the navigation menu aligns to the right for PC view */
@media (min-width: 769px) {
  .header {
    justify-content: space-between; /* Ensure header items are spaced */
  }

  .nav-menu {
    margin-left: auto; /* Push the menu to the right */
  }
}
