/*
  styles.css は「色・大きさ・配置・動き」を決めるファイルです。

  よく変更する場所
  1. 全体の色          → 直下の :root と body
  2. ガラス枠の透明感  → .panel
  3. 顔写真            → .portrait-card / .portrait-card img
  4. 泡の大きさや速度  → .bubble-1 ～ .bubble-12
  5. スマホ表示        → ファイル下部の @media
*/

/* サイト全体で共通使用する色とサイズです。色は # または rgba(...) で指定します。 */
:root {
  color-scheme: light;
  --ink: #144458;                     /* 通常の文字色 */
  --muted: #2a6170;                   /* 補助説明などの薄い文字色 */
  --deep: #0c6680;                    /* 濃い水色 */
  --navy: #1688a4;                    /* 中間の水色 */
  --aqua: #ed646bf8;                    /* 見出し番号などのアクセント色 */
  --aqua-soft: #d66477;               /* 言語ボタンなどの明るい色 */
  --eu: #d94f66;                      /* Eu発光を意識した赤い差し色 */
  --line: rgba(255, 255, 255, 0.4); /* 区切り線の色と透明度 */
  --panel: rgba(255, 255, 255, 0.2); /* ガラス枠の基本色 */
  --panel-solid: #59b5c858;             /* 画像読み込み前の背景色 */
  --radius: 32px;                     /* ガラス枠の角丸 */
  --max: 1180px;                      /* ページ本文の最大幅 */
}

/* すべての要素で、余白を含めて横幅を計算するための基本設定です。 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ページ全体の背景、フォント、文字サイズです。 */
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  /* 3枚のグラデーションを重ね、水面のような明るい水色にしています。 */
  background:
    radial-gradient(circle at 78% 14%, rgba(245, 254, 255, 0.72), transparent 29rem),
    radial-gradient(circle at 8% 52%, rgba(213, 246, 250, 0.62), transparent 34rem),
    linear-gradient(155deg, #b8eaf1 0%, #82d3e0 48%, #55b8cb 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", sans-serif;
  font-size: 20px;
  line-height: 1.8;
}

a {
  color: inherit;
}

/* ===== 背景の泡 ===== */
.bubble-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -12rem;
  width: var(--size);
  aspect-ratio: 1;
  left: var(--left);
  border: 1px solid rgba(239, 253, 255, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.48), transparent 9%),
    radial-gradient(circle at 72% 76%, rgba(224, 250, 253, 0.14), transparent 46%);
  box-shadow:
    inset -10px -12px 24px rgba(6, 66, 83, 0.08),
    0 0 24px rgba(224, 250, 253, 0.14);
  opacity: var(--opacity);
  /* 個別設定した秒数で、下から上へ繰り返し動かします。 */
  animation: float-up var(--duration) linear var(--delay) infinite;
}

/*
  --size     泡の直径
  --left     画面左からの位置
  --duration 上まで移動する時間（大きいほどゆっくり）
  --delay    アニメーション開始位置のずれ
  --opacity  泡の濃さ（0で透明、1で不透明）
*/
.bubble-1 { --size: 5rem; --left: 4%; --duration: 28s; --delay: -9s; --opacity: 0.8; }
.bubble-2 { --size: 11rem; --left: 18%; --duration: 24s; --delay: -34s; --opacity: 0.38; }
.bubble-3 { --size: 3rem; --left: 33%; --duration: 23s; --delay: -14s; --opacity: 0.58; }
.bubble-4 { --size: 7rem; --left: 47%; --duration: 30s; --delay: -25s; --opacity: 0.48; }
.bubble-5 { --size: 4rem; --left: 61%; --duration: 27s; --delay: -20s; --opacity: 0.68; }
.bubble-6 { --size: 13rem; --left: 73%; --duration: 18s; --delay: -39s; --opacity: 0.32; }
.bubble-7 { --size: 6rem; --left: 88%; --duration: 29s; --delay: -6s; --opacity: 0.52; }
.bubble-8 { --size: 2rem; --left: 50%; --duration: 16s; --delay: -4s; --opacity: 0.7; }
.bubble-9 { --size: 8rem; --left: 95%; --duration: 39s; --delay: -29s; --opacity: 0.4; }
.bubble-10 { --size: 3rem; --left: 40%; --duration: 20s; --delay: -1s; --opacity: 0.68; }
.bubble-11 { --size: 9rem; --left: 25%; --duration: 15s; --delay: -11s; --opacity: 0.4; }
.bubble-12 { --size: 6rem; --left: 55%; --duration: 19s; --delay: -3s; --opacity: 0.6; }

@keyframes float-up {
  0% { transform: translate3d(0, 0, 0) scale(0.9); }
  50% { transform: translate3d(2.2rem, -60vh, 0) scale(1); }
  100% { transform: translate3d(-1.4rem, -125vh, 0) scale(0.92); }
}

/* ===== ページ上部のヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 72px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(220, 248, 251, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  backdrop-filter: blur(20px) saturate(125%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid rgba(112, 216, 232, 0.5);
  border-radius: 50%;
  color: var(--aqua-soft);
  font-family: inherit;
  font-size: 0.82rem;
}

/* ===== 日本語・英語切替ボタン ===== */
.lang-switch {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.lang-switch button {
  min-width: 2.65rem;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang-switch button.is-active {
  color: #0c4e60;
  background: rgba(247, 254, 255, 0.8);
}

/* ページ本文の横幅。var(--max) は最上部の :root で変更できます。 */
main {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

/* ===== 氏名・所属・写真を表示する最上部 ===== */
.hero {
  position: relative;
  display: grid;
  /* 写真の幅と列幅を一致させ、写真も高さの計算に含めます。 */
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(2.5rem, 7vw, 6rem);
  justify-content: center;
  align-items: center;
  min-height: auto;
  padding: clamp(2.8rem, 6vw, 4.2rem) 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  max-width: 34rem;
  margin: 0 0 1.35rem;
  color: var(--aqua);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.6;
}

h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2.25rem, 4.2vw, 3.6rem);
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.18;
}

.name-en {
  margin: 0.2rem 0 1.5rem;
  color: rgba(12, 64, 80, 0.68);
  font-family: inherit;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  letter-spacing: 0.08em;
}

.affiliation {
  margin: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--eu);
  color: #174f5e;
  font-size: 0.94rem;
}

/* 顔写真を囲む枠です。width を変えると写真全体の大きさが変わります。 */
.portrait-card {
  /* 通常のグリッド配置。大きなmarginで位置を調節しないでください。 */
  position: relative;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(244, 254, 255, 0.6);
  width: 30rem;
  border-radius: 1.4rem 1.4rem 4rem 1.4rem;
  background: var(--panel-solid);
  box-shadow: 0 1.5rem 3.5rem rgba(5, 86, 105, 0.2);
  /* 写真を傾けず、水平に表示します。 */
  transform: none;
}

.portrait-card img {
  display: block;
  width: 100%;
  height: auto; /* HTMLのheight属性より4:3の表示比率を優先 */
  aspect-ratio: 4 / 3; /* 写真枠の横:縦を4:3に固定 */
  object-fit: cover;
  /* 横方向60%、縦方向64%を枠の中央に見せます。人物位置の微調整に使います。 */
  object-position: 60% 64%;
  filter: saturate(0.84) contrast(1.01) brightness(1.08);
}

/* 各セクションを縦1列に並べます。gap がセクション同士の間隔です。 */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/*
  ===== 略歴・研究・学会・趣味に共通するガラス枠 =====
  background の透明度を上げると白っぽく、下げると透明になります。
  blur(24px) の数字を大きくすると、背後がより強くぼけます。
*/
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba(246, 254, 255, 0.44);
  border-radius: var(--radius);
  background: linear-gradient(10deg, rgba(255, 255, 255, 0.3), rgba(220, 248, 252, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 1.4rem 4rem rgba(5, 87, 106, 0.14);
  /* Safari用と標準のぼかし量を揃えます。 */
  -webkit-backdrop-filter: blur(4px) saturate(130%);
  backdrop-filter: blur(4px) saturate(130%);
  scroll-margin-top: 6rem;
}

/* 各ガラス枠の「01 PROFILE 略歴」のような見出し部分です。 */
.section-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.section-heading > span {
  margin-top: 0.15rem;
  color: var(--aqua);
  font-family: inherit;
  font-size: 0.82rem;
}

.section-heading p,
.section-heading h2 {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.section-heading h2 {
  font-family: inherit;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  font-weight: 650;
  letter-spacing: 0.025em;
  line-height: 1.35;
}

/* ===== 01：略歴 ===== */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  /* 左の5.3remが年月、残りが出来事の文章です。 */
  grid-template-columns: 5.3rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.timeline time {
  color: var(--aqua);
  font-family: inherit;
  font-size: 0.92rem;
}

.timeline li span {
  color: #123f4c;
  font-size: 0.94rem;
}

/* ===== 02：研究テーマ ===== */
.research-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(220, 248, 252, 0.08));
}

.research-body {
  max-width: 70rem;
}

.research-body h3 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.65;
}

.research-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== 03：学会発表 ===== */
.presentations-panel {
  /* ほかのセクションと同じ間隔に揃えます。 */
  margin-top: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(220, 248, 252, 0.08));
}

.presentation-item {
  display: grid;
  /* 左が発表年月、右が発表区分・開催地・学会名です。 */
  grid-template-columns: 7.5rem 1fr;
  gap: clamp(1.0rem, 0vw, 10rem);
  align-items: center;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
}

/* 2件目以降の学会発表に上余白を加えます。 */
.presentation-item + .presentation-item {
  margin-top: 1rem;
}

.presentation-date {
  display: flex;
  flex-direction: column;
  color: var(--aqua-soft);
  font-family: inherit;
  line-height: 1;
}

.presentation-date span {
  font-size: 2.6rem;
}

.presentation-date small {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.presentation-meta {
  display: flex;
  gap: 0.55rem;
}

.presentation-meta span {
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 93, 115, 0.11);
  color: #a62f44;
  font-size: 0.75rem;
}

.presentation-copy h3 {
  margin: 0.65rem 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 10rem;
}

.lower-grid {
  grid-template-columns: 1fr;
  margin-top: 1rem;
}

.compact-panel {
  min-height: 0;
}

/* ===== 04：好きなこと ===== */
.interest-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.interest-list li {
  display: grid;
  /* 左の16remが写真、右側が趣味の名前です。 */
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.interest-list h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 550;
}

/* 写真がまだない場合に表示する「PHOTO」枠です。 */
.interest-photo-slot {
  display: grid;
  width: 9rem;
  aspect-ratio: 4 / 3; /* 写真枠の横:縦 */
  place-items: center;
  border: 1px dashed rgba(244, 254, 255, 0.62);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(218, 248, 252, 0.07));
  color: rgba(12, 88, 105, 0.66);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.14em;
}

/* PHOTO枠を実際のimg要素へ置き換えたときに適用される設定です。 */
.interest-list img {
  display: block;
  width: 16rem;
  aspect-ratio: 4 / 3;
  border-radius: 0.9rem;
  object-fit: cover;
}

/* ===== ページ最下部 ===== */
footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--max));
  margin: 1rem auto 0;
  padding: 4rem 0 3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

footer p {
  margin: 0;
}

.footer-name {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.footer-name span + span {
  margin-left: 0.6rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
}

footer small {
  color: rgba(21, 79, 94, 0.76);
}

.copyright {
  text-align: right;
}

:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 8px;
}

/*
  ===== 画面幅900px以下（タブレットなど） =====
  通常の設定を、この範囲だけ上書きします。
*/
@media (max-width: 900px) {
  .site-header {
    min-height: 64px;
  }

  .hero {
    grid-template-columns: minmax(0, 31rem) 9rem;
    gap: 2rem;
    justify-content: center;
    padding: 3rem 0 2.5rem;
  }

  .hero-copy {
    max-width: 42rem;
  }

  .portrait-card {
    width: 9rem;
    margin: 0;
    transform: none;
  }

  .portrait-card img {
    aspect-ratio: 4 / 3;
  }

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

  .compact-panel {
    min-height: 0;
  }
}

/* ===== 画面幅600px以下（スマートフォン） ===== */
@media (max-width: 600px) {
  .site-header {
    width: min(calc(100% - 1.25rem), var(--max));
  }

  .brand > span:last-child {
    display: none;
  }

  main,
  footer {
    width: min(calc(100% - 1.25rem), var(--max));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 6.4rem;
    gap: 1rem;
    padding: 2.8rem 0 2.2rem;
  }

  .eyebrow {
    margin-bottom: 1.8rem;
  }

  h1 {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .portrait-card {
    width: 6.4rem;
    border-radius: 1rem 1rem 2.4rem 1rem;
  }

  .portrait-card img {
    aspect-ratio: 4 / 3;
  }

  .panel {
    padding: 1.4rem;
    border-radius: 1.25rem;
  }

  .section-heading {
    margin-bottom: 1.7rem;
  }

  .presentation-item {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .presentation-date {
    flex-direction: row;
    gap: 0.7rem;
    align-items: baseline;
  }

  .presentation-date span {
    font-size: 2rem;
  }

  .interest-list li {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1rem;
  }

  .interest-photo-slot,
  .interest-list img {
    width: 6.5rem;
  }

  footer {
    display: block;
  }

  .copyright {
    margin-top: 2rem;
    text-align: left;
  }
}

/* 端末側で「視差効果を減らす」が有効な場合は、泡を動かしません。 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bubble {
    animation: none;
  }

  .bubble-1 { top: 12%; bottom: auto; }
  .bubble-2 { top: 50%; bottom: auto; }
  .bubble-3 { top: 28%; bottom: auto; }
  .bubble-4 { top: 70%; bottom: auto; }
  .bubble-5 { top: 18%; bottom: auto; }
  .bubble-6 { top: 44%; bottom: auto; }
  .bubble-7 { top: 65%; bottom: auto; }
  .bubble-8 { top: 38%; bottom: auto; }
  .bubble-9 { top: 8%; bottom: auto; }
}

/* 趣味の写真枠。写真を重ね、透明度でゆっくり切り替えます。 */
.hobby-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--panel-solid);
}
.interest-list .hobby-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* 2.5秒かけて次の写真に溶け込むように切り替えます。 */
  transition: opacity 2.5s ease-in-out;
}
.interest-list .hobby-slideshow img.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .interest-list .hobby-slideshow img { transition: none; }
}
