/* 全体の設定 */
body {
  margin: 0;
  padding: 0;
  background-color: #000; /* 黒背景 */
  color: #fff; /* 白文字 */
  font-family: "Helvetica Neue", sans-serif;
  scroll-behavior: smooth;
  transition: background-color 0.3s, color 0.3s;
}

/* ダークモード（デフォルト） */
html.dark body,
body.dark {
  background-color: #000;
  color: #fff;
}

/* ライトモード */
body:not(.dark) {
    background-color: #fff;
    color: #222;
}

/* ヘッダー（ナビゲーション） */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
}

/* ライトモードのヘッダー */
html:not(.dark) body header,
body:not(.dark) header {
  background-color: rgba(255,255,255,0.8);
  color: #222;
}

/* ダークモードのヘッダー */
html.dark body header,
body.dark header {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 1rem 0;
}

nav ul li {
  margin: 0 1.5rem;
}

nav ul li a {
  text-decoration: none;
  color: #fff;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}

/* ライトモードのリンク */
body:not(.dark) nav ul li a {
    color: #222;
}


nav ul li a:hover {
  opacity: 1;
}

/* 各セクション */
section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5rem 2rem;
  text-align: center;
}

#hero h1 {
  font-size: 2rem;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

#hero p {
  margin-top: 1rem;
  font-size: 1rem;
  opacity: 0.5;
}

/* セクション背景色 */
#index,
#about,
#projects,
#contact {
  background-color: #111; /* 黒に近いグレーで少し変化 */
}

/* ライトモードのセクション背景色 */
body:not(.dark) #index,
body:not(.dark) #about,
body:not(.dark) #projects,
body:not(.dark) #contact {
    background-color: #f5f5f5;
    color: #222;
}


h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* プロジェクトリスト */
.project-item {
    background-color: #222;
    padding: 2rem;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

/* ライトモードのプロジェクトリスト */
body:not(.dark) .project-item {
    background-color: #fff;
    color: #222;
}
.project-item {
  background-color: #222;
  padding: 2rem;
  border-radius: 8px;
}

/* レスポンシブ対応 */
@media (min-width: 768px) {
  #hero h1 {
    font-size: 4rem;
  }
  #hero p {
    font-size: 1.2rem;
  }
  .project-list {
    grid-template-columns: 1fr 1fr;
  }
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* 追加：モダンなテーマ切り替えボタン */
.theme-toggle-btn {
  padding: 0.4em 1.2em;
  border: none;
  border-radius: 2em;
  background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 100%);
  color: #222;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.3s, color 0.3s;
}
body.dark .theme-toggle-btn {
  background: linear-gradient(90deg, #222 0%, #444 100%);
  color: #fff;
}
.theme-toggle-btn:hover {
  filter: brightness(0.95);
}

/* SNSのアイコン */
.social-icons {
  margin-top: 1rem;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  align-items: center;
}
.social-icons a img {
  width: 28px;
  height: 28px;
  filter: invert(1);
  transition: filter 0.3s, transform 0.2s;
}
body:not(.dark) .social-icons a img {
  filter: invert(0);
}
.social-icons a:hover img {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.social-icons a:hover img {
  transform: scale(1.15);
  filter: invert(1) brightness(1.5) drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
body:not(.dark) .social-icons a:hover img {
  filter: invert(0) brightness(0.7) drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

/* indexの差写真ギャラリー関係 */
.angled-gallery {
  display: flex;
  max-width: 100vw;
  overflow-x: auto;
  gap: 16px;
  margin: 2rem 0;
  scroll-behavior: smooth; /* スムーズスクロール */
  scrollbar-width: none; /* Firefox */
  scroll-snap-type: x mandatory; /* スナップで自動整列 */
}

.angled-img {
  position: relative;
  width: 350px;
  height: 220px;
  flex: 0 0 auto;
  overflow: hidden;
  scroll-snap-align: start; /* スナップ位置 */
}

/* 両端とも同じ斜めカット */
.angled-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
  filter: brightness(70%);
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  display: block;
}

/* 2枚目以降は左側を重ねて斜めがつながるようにする */
.angled-img:not(:first-child) {
  margin-left: -35px; /* 重なり調整（必要に応じて調整） */
}

.angled-img img:hover {
  filter: brightness(100%);
}

.angled-gallery::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* レスポンシブ */
@media (max-width: 800px) {
  .angled-img {
    width: 70vw;
    height: 40vw;
    min-width: 200px;
    min-height: 120px;
  }
}
/* ここまで */


.project-item {
  display: block;
  width: 320px;
  padding: 2rem;
  background: #222;
  color: #fff;
  border-radius: 1rem;
  text-align: center;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  transition: background 0.3s, color 0.3s, transform 0.2s;
  cursor: pointer;
}

.project-item:hover {
  background: #444;
  color: #ffd700;
  transform: translateY(-4px) scale(1.03);
}

/* ライトモード対応 */
body:not(.dark) .project-item {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body:not(.dark) .project-item:hover {
  background: #f5f5f5;
  color: #0077cc;
}

/* style.cssに追加・修正 */
/* ヒーローセクション全体 */
.intro-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181818; /* 黒に近いグレー */
  color: #fff;
  text-align: center;
  padding: 0 1rem;
}

.hello-block {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.hello-world {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 2.2rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.5em;
}

.hello-gradient {
  color: #fff;
  background: none;
}

.hello-outline {
  color: transparent;
  -webkit-text-stroke: 2px #fff;
  text-stroke: 2px #fff;
  letter-spacing: 0.05em;
}

/* ライトテーマ用アウトライン色 */
body:not(.dark) .hello-outline {
  -webkit-text-stroke: 2px #222;
  text-stroke: 2px #222;
}

.profile-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7em;
}

.name {
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0;
}

.affiliation {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 400;
  opacity: 0.7;
}

.callsign {
  font-size: 1.1rem;
  color: #fff;
  font-family: monospace;
  letter-spacing: 0.12em;
  opacity: 0.5;
}

.social-icons {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.7em;
}
.social-icons a img {
  width: 32px;
  height: 32px;
  filter: invert(1);
  transition: filter 0.3s, transform 0.2s;
  opacity: 0.85;
}
body:not(.dark) .social-icons a img {
  filter: invert(0);
}
.social-icons a:hover img {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 6px #fff);
  opacity: 1;
}

.openbadges {
  display: flex;
  gap: 1.2em;
  justify-content: center;
  align-items: center;
  margin-top: 1em;
  flex-wrap: wrap;
}
.openbadges a {
  display: inline-block;
}
.openbadges .badge {
  display: block;
  width: clamp(120px, 20vw, 160px);
  height: auto;
  object-fit: contain;
}

/* レスポンシブ対応 */
@media (max-width: 700px) {
  .profile-row {
    flex-direction: column;
    gap: 1.5rem;
  }
  .hello-world {
    font-size: 2.2rem;
    flex-direction: column;
    gap: 0;
  }
  .openbadges {
    flex-direction: row;
    justify-content: center;
    gap: 1em;
  }
}

.faculty {
  font-size: 1rem;
  color: #fff;
  opacity: 0.6;
  margin-bottom: 0.5em;
  text-align: left;
  display: block;
  white-space: nowrap;
}

.work-info {
  font-size: 1rem;
  color: #fff;
  opacity: 0.6;
  margin-bottom: 0.5em;
  text-align: left;
  display: block;
  white-space: nowrap;
}

.research-info {
  font-size: 1rem;
  color: #fff;
  opacity: 0.6;
  margin-bottom: 0.5em;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  white-space: nowrap;
}

/* ダークテーマ */
.intro-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181818;
  color: #fff;
  text-align: center;
  padding: 0 1rem;
}

/* ライトテーマ */
body:not(.dark) .intro-section {
  background: #f5f5f5;
  color: #222;
}
body:not(.dark) .hello-gradient,
body:not(.dark) .affiliation,
body:not(.dark) .faculty,
body:not(.dark) .research-info,
body:not(.dark) .work-info,
body:not(.dark) .callsign,
body:not(.dark) .name {
  color: #222;
}

/* style.cssに追加（任意） */
.about-list {
  list-style: disc inside;
  margin: 2rem auto 0 auto;
  padding: 0;
  max-width: 600px;
  text-align: left;
  color: #fff;
  opacity: 0.85;
}
.about-list li {
  margin-bottom: 0.7em;
  font-size: 1.1rem;
}

/* style.cssに追加 */
.profile-brief {
  margin-bottom: 1.5em;
  font-size: 1.05rem;
  color: #fff;         /* 文字色を白に */
  text-align: left;
  line-height: 1.7;
  opacity: 1;          /* しっかり白く */
}
.profile-brief span {
  display: block;
  margin-bottom: 0.1em;
}
/* 論文DOIリンクのスタイル */
.profile-brief a {
  color: #6ab0ff;      /* ダークモード用：明るい青 */
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}
.profile-brief a:hover {
  color: #9fd4ff;      /* ホバー時はさらに明るく */
  text-decoration: underline;
}
body:not(.dark) .profile-brief a {
  color: #0066cc;      /* ライトモード用：濃い青 */
}
body:not(.dark) .profile-brief a:hover {
  color: #0055aa;      /* ホバー時は少し暗く */
}

/* style.cssに追加 */
.contact-form {
  max-width: 400px;
  margin: 2rem auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1em;
  background: rgba(30,30,30,0.7);
  padding: 2em 1.5em;
  border-radius: 1em;
}
.contact-form label {
  font-size: 1em;
  color: #fff;
  margin-bottom: 0.2em;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7em;
  border: none;
  border-radius: 0.5em;
  background: #222;
  color: #fff;
  font-size: 1em;
  margin-bottom: 0.5em;
  resize: vertical;
}
.contact-form button {
  background: #fff;
  color: #222;
  border: none;
  border-radius: 0.5em;
  padding: 0.7em 1.5em;
  font-size: 1em;
  font-weight: bold;
  cursor: not-allowed;
  opacity: 0.6;
}
body:not(.dark) .contact-form {
  background: #f5f5f5;
}
body:not(.dark) .contact-form label {
  color: #222;
}
body:not(.dark) .contact-form input,
body:not(.dark) .contact-form textarea {
  background: #fff;
  color: #222;
}
body:not(.dark) .contact-form button {
  background: #222;
  color: #fff;
}

body:not(.dark) .profile-brief {
  color: #222;
}

.lang-icons {
  display: flex;
  gap: 1.2em;
  justify-content: center;
  align-items: center;
  margin: 1.5em 0 0 0;
}
.lang-icons img {
  width: 36px;
  height: 36px;
  filter: invert(1);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
body:not(.dark) .lang-icons img {
  filter: invert(0);
}
.lang-icons img:hover {
  opacity: 1;
  transform: scale(1.1);
}
.verilog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;    /* 白枠 */
  border-radius: 8px;
  background: transparent;    /* 塗りつぶしなし */
  color: #fff;
  font-size: 0.85em;
  font-family: monospace;
  margin: 0 0.2em;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
body:not(.dark) .verilog-icon {
  border: 2px solid #222;    /* ライトテーマは黒枠 */
  color: #222;
}
.verilog-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

nav {
  position: relative;
  background: transparent;
}
.menu-toggle {
  display: none;
  background: none;         /* ← 背景色を消す */
  border: none;
  font-size: 2rem;
  color: #fff;
  border-radius: 0;         /* ← 角丸をなくす */
  width: auto;              /* ← サイズを自動に */
  height: auto;
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 1001;
  box-shadow: none;         /* ← 影も消す */
  transition: color 0.2s, transform 0.2s;
}
.menu-toggle:active {
  background: none;
  transform: scale(0.95);
}

/* メニューリスト */
.nav-list {
  display: flex;
  gap: 1.5em;
  list-style: none;
  margin: 0;
  padding: 0.7em 1.5em;
  align-items: center;
  background: rgba(30,30,30,0.92);
  border-radius: 2em;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  transition: box-shadow 0.3s, background 0.3s;
}

/* メニューアイテム */
.nav-list li {
  border-radius: 1.2em;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-list li a, .nav-list li button {
  display: block;
  padding: 0.5em 1.2em;
  border-radius: 1.2em;
  color: #fff;
  text-decoration: none;
  background: none;
  border: none;
  font-size: 1em;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-list li a:hover, .nav-list li button:hover {
  background: #444;
  color: #fff;
  transform: translateY(-2px) scale(1.07);
}

/* ライトテーマ対応 */
body:not(.dark) .nav-list {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
body:not(.dark) .nav-list li a, 
body:not(.dark) .nav-list li button {
  color: #222;
}
body:not(.dark) .nav-list li a:hover, 
body:not(.dark) .nav-list li button:hover {
  background: #e0e0e0;
  color: #222;
}

/* スマホ用 */
@media (max-width: 700px) {
  .menu-toggle {
    display: block;
  }
  .nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 70px;
    right: 1rem;
    left: 1rem;
    background: rgba(30,30,30,0.97);
    border-radius: 2em;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-30px) scale(0.98);
    transition: opacity 0.35s cubic-bezier(.4,2,.6,1), transform 0.35s cubic-bezier(.4,2,.6,1);
  }
  .nav-list.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

/* style.cssに追加・修正 */
/* ライトテーマ時のメニューバーアイコン（ハンバーガー）の色を黒に */
body:not(.dark) .menu-toggle {
  color: #222;
}

/* style.cssに追加 */
.site-footer {
  text-align: center;
  padding: 2em 0 1em 0;
  color: #aaa;
  font-size: 0.95em;
  background: none;
  letter-spacing: 0.05em;
}
body:not(.dark) .site-footer {
  color: #555;
}


.licenses {
  margin: 0.3em 0 0.7em 0;
  font-size: 1em;
  color: #888;
  letter-spacing: 0.03em;
}

.degree {
  font-size: 1em;
  color: #888;
  margin: 0.2em 0 0.5em 0;
  letter-spacing: 0.03em;
  margin-top: 0;
}

/* ===== indexページ：スマホ表示の横はみ出し修正 ===== */

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  #hero.intro-section {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    padding: 5rem 1rem 2rem;
    overflow: hidden;
  }

  .hello-block {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hello-world {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2rem, 11vw, 2.6rem);
    letter-spacing: 0.08em;
  }

  .profile-row {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
  }

  .profile-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: flex-start;
  }

  .name {
    max-width: 100%;
    font-size: clamp(1.35rem, 7vw, 1.7rem);
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
  }

  .faculty,
  .work-info,
  .research-info {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .research-info span {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .social-icons {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .openbadges {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
}
