/* === Reset / Base === */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* === Header === */
header {
  display: flex;
  align-items: center;
  gap: 40px;                 /* h1 と nav の間隔 */
  padding: 20px 40px;
  border-bottom: 1px solid #ddd;
}
header h1 {
  font-size: 20px;
  font-weight: normal;
  margin: 0;
}
header h1,
header h1 a {
  white-space: nowrap;       /* Nozomi Terashima を改行させない */
}
header h1 a {
  color: inherit;
  text-decoration: none;
}
nav a {
  text-decoration: none;
  color: #000;
  font-size: 13px;
  line-height: 1;
  margin-right: 20px;
  font-weight: normal;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
nav a:focus,
nav a:active {
  font-weight: normal;
  outline: none;
  border: 0;
}

/* === Profile page === */
.profile {
  padding: 40px 20px 60px 40px;
}
.bio {
  max-width: 1000px;
  font-size: 12px;
  line-height: 1.6;
}
.bio p { margin: 0 0 20px; }
.profile-image img {
  display: block;
  width: 300px;
  height: auto;
  margin-top: 20px;
}

/* === Project detail page === */
.project-detail {
  max-width: 800px;
  padding: 40px 0 60px 40px;
  margin: 0;
}
.project-detail h2 {
  font-size: 15px;
  font-weight: normal;
  margin: 0 0 15px;
  text-align: left;
}
.sticky-title {
  position: sticky;
  top: 60px;                 /* ヘッダー高に合わせて適宜調整 */
  background: #fff;
  z-index: 10;
  padding: 10px 0;
}
.project-description {
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 10px;
  max-width: 400px;
  white-space: pre-line;
  text-align: justify;
}
.project-images { text-align: center; }
.project-images img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  margin: 0 0 3px;
  padding: 0;
}

/* === Home / Projects grid === */
.commission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 50px 15px 10px;  /* ← 上を50pxにして画像を下げる */
  margin: 0 auto;
}
.commission-card {
  display: block;
  color: #000;
  text-decoration: none;
  position: relative;       /* 擬似要素の基準にする */
}
.commission-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.card-title { display: none; }

/* Hover時の黒い線（パッと表示） */
.commission-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid #fff694;
  opacity: 0;
  pointer-events: none;  /* 余白を邪魔しない */
  transition: none;      /* アニメーションなしで即表示 */
}
.commission-card:hover::after {
  opacity: 1;
}

/* === Misc (older list layout kept tidy) === */
.project-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  max-width: 800px;
  margin: 0 auto;
}
.project-item { text-decoration: none; }
.project-item img { width: 100%; height: auto; display: block; }
.project-text a {
  font-size: 10px;
  color: #000;
  text-decoration: none;
  display: inline-block;
  margin-top: 5px;
  font-weight: normal;
  line-height: 1.4;
}
.project-text a:hover { text-decoration: underline; }
.credit {
  font-size: 0.65rem;   /* 小さめ */
  color: #666;          /* グレー */
  line-height: 1.6;
  max-width: 425px;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .commission-grid {
    grid-template-columns: repeat(3, 1fr); /* Tablet: 3列 */
    padding: 24px 16px;
  }
}

@media (max-width: 600px) {
  header h1 { font-size: 14px; }
  nav a { font-size: 14px; margin: 0 8px; }

  .profile { padding: 20px 12px; }

  .project-detail { padding: 20px 10px; }

  .commission-grid {
    grid-template-columns: repeat(2, 1fr); /* Phone: 2列 */
    padding: 10px;
    gap: 3px;
  }

  .credit {
    font-size: 0.75rem;
  }
}
/* ===== ホバー時：画面中央にタイトルを固定表示 ===== */
.commission-card {
  position: relative; /* 既存 */
}

/* 初期状態：非表示 */
.commission-card::before {
  content: attr(data-title);
  position: fixed;           /* ← ビューポート基準で中央に出す */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;      /* クリック操作を邪魔しない */
  opacity: 0;

  /* 見た目（好みで調整） */
  font-size: clamp(20px, 4vw, 36px);
  font-weight: 400;
  letter-spacing: .02em;
  color: #fff694;
  text-align: center;

  /* 背景を付けたい場合は下2行のコメントを外す */
  /* background: rgba(255,255,255,.7);
     padding: .2em .5em; border-radius: 6px; */

  /* “パッと出る”なら transition: none; 少し滲ませるなら 120ms 程度 */
  transition: none; /* or: opacity .12s ease; */
  z-index: 999;     /* ヘッダーより上にしたい場合は 1001 などへ */
}

/* ホバー時に表示 */
.commission-card:hover::before,
.commission-card:focus-visible::before {
  opacity: 1;
}
.commission-card:active::before { opacity: 1; }
