/* ==========================================================================
   千賀史貴公式サイト / BOOKS・WORKS・SITES版
   ==========================================================================

   このCSSの役割：
   - サイト全体の色・幅・余白を変数で管理
   - 背景の大きな白い光彩は使わず、JSで描画する粒子だけを残す
   - タイトル画像と区切り線画像を廃止し、テキスト見出しとCSS線で表示
   - BOOKSは3列、WORKSは縦並び、SITESはPC/スマホとも4列の正方形グリッド
   - スクロール時フェードイン、ポップアップ、ホバー時の浮き上がりを制御

   調整しやすい主な値：
   - SITES画像の横幅      : .site-list の max-width
   - SITES画像の間隔      : --gap-sites-pc / --gap-sites-sp
   - 区切り線の透明度     : .section-separator の rgba(..., 0.25)
   - タイトル上下余白     : .section-heading の margin
   ========================================================================== */

:root {
  --color-background: #ffe70a;
  --color-text: #0f504a;
  --color-link: #0f504a;
  --color-link-hover: #000;
  --color-focus: #000;
  --font-family-base: 'Lucida Grande', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;

  /* タイトルの文字サイズ */
--font-family-heading: 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --content-width: 800px;
  --side-padding: 20px;

  --gap-books-pc: 20px;
  --gap-books-sp: 10px;
  /* SITES画像同士の間隔。PCとスマホで別々に管理します。 */
  --gap-sites-pc: 20px;
  --gap-sites-sp: 12px;
  /* 作品バナー・単行本・SITES画像の角丸。 */
  --image-radius: 4px;

  /* スクロール表示アニメーションの基本時間と移動距離。 */
  --reveal-duration: 0.86s;
  --reveal-distance: 34px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, div, span, h1, h2, p, a, img, ul, li, header, main, section, footer, canvas {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}
header, main, section, footer { display: block; }
ul { list-style: none; }
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }

html { min-width: 320px; }
body {
  min-height: 100vh;
  overflow-x: hidden;

  /*
    背景色。
    以前の大きな白い radial-gradient 光彩は削除し、単色背景にしています。
    動く粒子は js/rich-effects.js が .particle-layer に canvas を追加して描画します。
  */
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: 0.875rem;
  line-height: 1.8;
  text-align: center;
}

/*
  背景粒子レイヤー。
  HTML側の <div class="particle-layer"> に対して、JSが canvas を追加します。
  opacity を下げると粒子全体が薄くなります。
  mix-blend-mode: screen は、粒子を背景に明るく重ねるための指定です。
*/
.particle-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.88;
  mix-blend-mode: screen;
}
.particle-layer canvas { display: block; width: 100%; height: 100%; }

.site-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 var(--side-padding) 64px;
}
.site-main { width: 100%; }

.visually-hidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

a { color: var(--color-link); text-decoration: none; }
a:visited { color: var(--color-link); }
a:hover, a:active { color: var(--color-link-hover); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; }
.image-link { display: block; }

/* ==========================================================================ヘッダー / ロゴ演出========================================================================== */
.site-header { padding-top: 56px; margin-bottom: 32px; }
.site-logo {
  position: relative;
  display: inline-block;
  line-height: 1;
  transform-origin: center;
}
.site-logo__image {
  display: inline-block;
  filter: drop-shadow(0 10px 18px rgba(255, 255, 255, 0.28));
}

/* ぼけた状態からはっきり見えてくるロゴアニメーション。 */
.js-enabled .js-logo-intro {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  filter: blur(14px) brightness(1.12);
}
.js-enabled .js-logo-intro.is-intro-ready {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0) brightness(1);
  transition:
    opacity 1.05s ease,
    transform 1.15s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.2s ease;
  animation: logoClearGlow 2.2s ease-in-out 0.95s 1;
}
@keyframes logoClearGlow {
  0%, 100% { filter: blur(0) brightness(1) drop-shadow(0 10px 18px rgba(255, 255, 255, 0.28)); }
  46% { filter: blur(0) brightness(1.08) drop-shadow(0 16px 30px rgba(255, 255, 255, 0.55)); }
}

/* ==========================================================================
   見出し・区切り線
   ==========================================================================
   BOOKS / WORKS / SITES のテキスト見出しと、画像を使わない区切り線です。
   タイトル画像 title1.png / title3.png、区切り線画像 line.png は使いません。
   ========================================================================== */
.section-heading {
  width: min(100%, var(--content-width));

  /* PC時のタイトル上下余白。上0、左右auto、下40px。 */
  margin: 0 auto 40px;
  color: rgba(0, 0, 0, 0.8);
  font-family: var(--font-family-heading);
  font-size: 20pt;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

/*
  区切り線画像の代わりにCSSで描画します。
  height: 2px が線の太さ。
  rgba(0, 0, 0, 0.25) の最後の 0.25 が透明度25%です。
*/
.section-separator {
  width: min(100%, var(--content-width));
  height: 2px;
  margin: 34px auto 42px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  line-height: 1;
}

/* ==========================================================================
   BOOKS / WORKS / SITES の一覧レイアウト
   ==========================================================================
   - .book-list  : 単行本一覧。3列グリッド。
   - .works-list : 作品バナー一覧。縦方向のグリッド。
   - .site-list  : SITES一覧。PC/スマホともに4列の正方形グリッド。
   ========================================================================== */
.books-section,
.works-section,
.sites-section {
  width: 100%;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-books-pc);
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}
.book-list__link { width: 100%; }
.book-list__image { display: block; width: 100%; }
.book-list__item--placeholder { pointer-events: none; }

.works-list {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}
.works-list__image { display: block; width: 100%; }

.site-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-sites-pc);
  width: 100%;
  /*
    SITES画像全体の横幅。
    ここを小さくすると、4つの正方形画像もまとめて小さくなります。
  */
  max-width: 640px;
  margin: 0 auto;
}
.site-list__link {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.site-list__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
  画像ホバー演出。
  BOOKS / WORKS / SITES の各画像リンクに付く .rich-hover で使います。
  border-radius は --image-radius で一括管理します。
*/
.rich-hover {
  position: relative;
  overflow: hidden;
  border-radius: var(--image-radius);
  transform: translateZ(0);
  transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), filter 0.36s ease, box-shadow 0.36s ease;
}
.rich-hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,0.42) 46%, transparent 66%);
  transform: translateX(-130%);
  transition: transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .rich-hover:hover {
    transform: translateY(-7px) scale(1.018);
    filter: saturate(1.08) contrast(1.03);
    box-shadow: 0 8px 14px rgba(255, 255, 255, 0), 0 9px 18px rgba(15, 80, 74, 0.5);
    text-decoration: none;
  }
  .rich-hover:hover::after { transform: translateX(130%); }
}
.rich-hover:active { transform: translateY(-1px) scale(0.992); }

/* ==========================================================================お問い合わせ========================================================================== */
.contact-section { width: 100%; max-width: var(--content-width); margin: 0 auto; }
.contact-section__image { display: block; width: min(100%, 400px); margin: 0 auto 16px; }
.social-link { display: inline-block; border-radius: 50%; }
.social-link__image { display: block; width: 100px; }

/* ==========================================================================
   スクロール時アニメーション
   ==========================================================================
   JSが画面内に入った要素へ .is-visible を付けます。
   初期状態と表示後の見た目はCSSで分けています。
   ========================================================================== */
.js-enabled .js-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance)) scale(0.985);
  transition:
    opacity var(--reveal-duration) ease,
    transform var(--reveal-duration) cubic-bezier(0.16, 1, 0.3, 1),
    filter var(--reveal-duration) ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js-enabled .js-reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.js-enabled .js-reveal--fade-only { transform: none; transition: opacity 0.75s ease; }
.js-enabled .js-reveal--fade-only.is-visible { transform: none; }

.js-enabled .js-reveal--work { transform: translateY(44px) scale(0.94); filter: blur(4px) saturate(0.86); }
.js-enabled .js-reveal--work.is-visible { transform: translateY(0) scale(1); filter: blur(0) saturate(1); }

.js-enabled .js-reveal--title { transform: translateY(18px) scale(0.98); filter: blur(2px); }
.js-enabled .js-reveal--title.is-visible { transform: translateY(0) scale(1); filter: blur(0); }

.js-enabled .js-reveal--book { transform: translateY(24px) scale(0.82) rotate(-1.5deg); filter: saturate(0.8); }
.js-enabled .js-reveal--book.is-visible { transform: translateY(0) scale(1) rotate(0deg); filter: saturate(1); }

.js-enabled .js-reveal--site { transform: translateY(24px) scale(0.86); filter: blur(3px) saturate(0.9); }
.js-enabled .js-reveal--site.is-visible { transform: translateY(0) scale(1); filter: blur(0) saturate(1); }

.js-enabled .js-reveal--contact { transform: translateY(18px) scale(0.98); transition-duration: 1.05s; }
.js-enabled .js-reveal--contact.is-visible { transform: translateY(0) scale(1); }

/* ==========================================================================フッター========================================================================== */
.site-footer { padding-top: 64px; color: var(--color-text); font-size: 0.8125rem; line-height: 1.8; }
.site-footer p + p { margin-top: 0.25em; }

@media (prefers-reduced-motion: reduce) {
  .particle-layer { display: none; }
  .js-enabled .js-reveal,
  .js-enabled .js-logo-intro {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: none;
    will-change: auto;
  }
  .rich-hover,
  .rich-hover::after { transition: none; }
}

@media screen and (max-width: 640px) {
  :root {
    --side-padding: 14px;
    --reveal-distance: 22px;
  }

  body { font-size: 0.8125rem; }
  .site-wrapper { padding-bottom: 48px; }
  .site-header { padding-top: 32px; margin-bottom: 24px; }
  .section-separator { margin: 26px auto 34px; }
  /* スマホ時のタイトル下余白。指定どおり margin-bottom: 30px にしています。 */
  .section-heading { margin-bottom: 30px; font-size: 16pt; }
  .works-list { gap: 16px; }
  .book-list { gap: var(--gap-books-sp); }
  /* スマホでもSITESは4列を維持します。間隔は --gap-sites-sp で管理します。 */
  .site-list { grid-template-columns: repeat(4, 1fr); gap: var(--gap-sites-sp); }
  .contact-section__image { margin-bottom: 14px; }
  .site-footer { padding-top: 48px; font-size: 0.75rem; }
}
