/* =====================================================
   profile.css — profile.html 固有スタイル
   ===================================================== */

/* ===== STITCH BORDERS (装飾: ページ両端の縫い目風ライン) ===== */
.stitch-canvas {
  position: fixed; top: 0;
  width: 48px; height: 100vh;
  pointer-events: none; z-index: 100; overflow: hidden;
  z-index: 0;
}
.stitch-canvas--left  { left: 0;  margin-left:  3vw; }
.stitch-canvas--right { right: 0; margin-right: 3vw; }

/* ===== PROFILE SECTION ===== */
.profile-section {
  padding: 0 0 clamp(60px, 10vw, 100px);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
  padding: 0 calc(15vw + 22px);
  max-width: 1600px;
  margin: 0 auto;
}

/* プロフィール写真 */
.profile-photo-wrap {
  opacity: 0;
  display: flex; justify-content: center;
  padding: clamp(16px, 3vw, 48px);
}
.profile-photo {
  width: 80%;
  border: solid 8px rgb(244, 241, 232);
  aspect-ratio: 3/4; object-fit: cover;
  display: block;
  transform-origin: center center;
  box-shadow: 4px 4px 0px #84744a79;
}

@keyframes throw-profile {
  0%   { opacity: 0; transform: translateX(-160px) rotate(-24deg) scale(.88); }
  100% { opacity: 1; transform: translateX(0px)    rotate(-2deg)  scale(1);   }
}
.profile-photo-wrap.is-visible { opacity: 1; }
.profile-photo-wrap.is-visible .profile-photo {
  animation: throw-profile 0.75s cubic-bezier(.22, .68, 0, 1) 0.1s both;
}
@media (min-width: 769px) {
  .profile-photo-wrap:hover .profile-photo {
    transform: rotate(-1.5deg);
    transition: transform 0.4s ease;
  }
}

/* プロフィールテキスト */
.profile-info {
  padding: clamp(24px, 4vw, 60px) clamp(24px, 4vw, 60px) clamp(24px, 4vw, 60px) clamp(16px, 2vw, 32px);
}
.profile-name-ja {
  font-family: var(--font-ja);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 500; letter-spacing: 0.2em;
  color: var(--text); margin-bottom: 2px;
}
.profile-name-en {
  font-family: var(--font-en);
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-light); letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.profile-affil {
  font-size: clamp(.72rem, 1.1vw, .82rem);
  color: var(--text-light); line-height: 1.8;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--sand-dark);
  margin-bottom: 24px; font-weight: 500;
}
.profile-affil .en {
  font-family: var(--font-en);
  font-size: clamp(.68rem, 1vw, .78rem);
  display: block; margin-top: 4px; color: var(--gold);
}

/* 日本語プロフィール本文 */
.profile-body {
  font-size: clamp(.78rem, 1.2vw, .9rem);
  line-height: 2.05; color: var(--text); font-weight: 500;
}
.profile-body p { margin-bottom: 16px; }

/* 英語プロフィール本文 */
.profile-body-en {
  font-family: var(--font-en);
  font-size: clamp(.75rem, 1.1vw, .85rem);
  line-height: 2; color: var(--gold);
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--sand-dark);
}
.profile-body-en p { margin-bottom: 12px; }

.link-gold {
  color: var(--gold);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.link-gold:hover { border-color: var(--gold); }

/* ===== BOOKS SECTION ===== */
.books-section {
  padding-bottom: 10vw;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 0 calc(15vw + 22px);
  max-width: 1600px; margin: 0 auto;
  align-items: start;
}

.book-card {
  display: flex; flex-direction: column;
  align-items: center; height: 100%;
}
.book-img-wrap {
  line-height: 0; flex-shrink: 0;
  width: 160px; height: 240px;
  display: flex; align-items: center; justify-content: center;
}
.book-cover {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; display: block;
  filter: drop-shadow(4px 4px 0px #84744a79);
}
.book-cover-placeholder {
  width: 160px; aspect-ratio: 2/3;
  background: linear-gradient(160deg, #2a2560 0%, #1a1540 100%);
  box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.18);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.35); font-size: 32px;
}
.book-title {
  margin-top: 30px; width: 260px; flex: 1;
  background: var(--white); border: 1px solid;
  border-radius: 8px 8px 0 8px;
  padding: 6px 14px;
  font-family: var(--font-ja); font-size: 11px;
  font-weight: 500; text-align: center;
  color: var(--text); line-height: 1.7;
  display: flex; align-items: center; justify-content: center;
}

.books-note {
  padding: 40px calc(15vw + 22px) 0;
  max-width: 1600px; margin: 0 auto;
  text-align: center;
  font-size: clamp(.78rem, 1.2vw, .88rem);
  font-weight: 500; color: var(--text); line-height: 2.1;
}

/* ===== THESIS SECTION ===== */
.thesis-section {
  padding: 0 18vw;
  max-width: 1600px; margin: 0 auto;
}
.thesis-list {
  display: flex; flex-direction: column;
}
.thesis-item {
  padding: 18px 22px;
  font-size: clamp(.75rem, 1.1vw, .85rem);
  font-weight: 500; line-height: 1.9; color: var(--text);
}
.thesis-item + .thesis-item {
  border-top: 1px solid var(--sand-dark);
}

/* ===== RESPONSIVE ===== */

/* 書籍グリッド: 1100px以下で1列 */
@media (max-width: 1100px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 40px; align-items: center; justify-items: center;
  }
  .book-card    { max-width: 240px; width: 100%; height: auto; }
  .book-img-wrap { width: 100%; height: 200px; }
  .book-cover   { max-width: 100%; max-height: 100%; }
  .book-title   { width: 100%; flex: none; }
  .books-note   { text-align: center; }
  .books-note-inner { display: inline-block; text-align: left; }
}

/* プロフィール: 1000px以下で縦並び */
@media (max-width: 1000px) {
  .profile-grid {
    grid-template-columns: 1fr; gap: 0;
  }
  .profile-photo-wrap {
    width: 100%; padding: 0;
    display: flex; opacity: 1;
  }
  .profile-photo { width: 60%; margin: 0 auto; }
  .profile-photo-wrap.is-visible .profile-photo {
    animation: throw-profile 0.75s cubic-bezier(.22, .68, 0, 1) 0.1s both;
  }
  .profile-info    { padding: 28px 0 0; }
  .profile-section { padding-bottom: 60px; }
}

/* タブレット (≤768px) */
@media (max-width: 768px) {
  .stitch-canvas--left  { margin-left:  0vw; }
  .stitch-canvas--right { margin-right: 0vw; }
  .profile-grid   { padding: 0 calc(10vw + 22px); }
  .books-grid     { padding: 0 calc(10vw + 22px); }
  .books-note     { padding-left: calc(10vw + 22px); padding-right: calc(10vw + 22px); }
  .thesis-section { padding: 0 10vw; }
  .profile-photo  { width: 80%; }
}

/* スマホ (≤480px) */
@media (max-width: 480px) {
  .section-title  { padding: clamp(32px, 6vw, 48px) 0 clamp(16px, 3vw, 28px); }
  .thesis-item    { padding: 14px 16px; }
  .books-section  { padding-bottom: 48px; }
}

/* 書籍グリッド: 1100px以上で3列に戻す */
@media (min-width: 1100px) {
  .books-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== FADE-IN ANIMATION ===== */
.fade-in         { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }