/* =========================================================
   v3 追加スタイル
   v2-motion.css のあとに読み込む。色は style.css の変数をそのまま使う
   0. 色（黒系の地に紫）  1. お問い合わせ  2. フッターのリンク  3. 文章の改行
   4. 手順リスト  5. 作品カードの番号  6. History（年表）  7. 遊ぶボタン
   ========================================================= */

/* ---------- 0. 色：黒系の地に紫の差し色（2026-10-31 ユーザー指定）。style.css の変数を上書き ---------- */
:root {
  --bg: #09070d;
  --bg-2: #120e19;
  --card: #17121f;
  --line: rgba(228, 218, 255, 0.12);
  --line-strong: rgba(228, 218, 255, 0.3);
  --fg: #ece9f5;
  --muted: #9a93ad;
  --accent: #a98bff;
  --accent-2: #d3c4ff;
  --on-accent: #0b0812;
}
:root[data-theme="light"] {
  --bg: #f7f6fa;
  --bg-2: #ece9f3;
  --card: #ffffff;
  --line: rgba(26, 14, 52, 0.14);
  --line-strong: rgba(26, 14, 52, 0.38);
  --fg: #120d1f;
  --muted: #4a4459;
  --accent: #6a3fd6;
  --accent-2: #4b28a6;
  --on-accent: #ffffff;
}

/* ---------- 1. お問い合わせ（トップの 04 — Contact） ---------- */
.contact-lead {
  max-width: 34em;
  margin: 0 0 clamp(40px, 6vw, 72px);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.2rem);
  line-height: 2;
  color: var(--muted);
  word-break: auto-phrase;
}
.contact-list { border-top: 1px solid var(--line); }
.contact-item {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr auto;
  align-items: center;
  gap: 12px 24px;
  padding: clamp(22px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.contact-k {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.contact-v {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw + 0.4rem, 3.4rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
  transition: color 0.5s var(--ease);
}
a.contact-v:hover,
a.contact-item:hover .contact-v { color: var(--accent-2); }
.contact-item .arrow {
  font-size: 1.6rem;
  transition: transform 0.6s var(--ease);
}
a.contact-item:hover .arrow { transform: translate(6px, -6px); }
.contact-copy { min-width: 9em; }
@media (max-width: 640px) {
  .contact-item { grid-template-columns: 1fr auto; }
  .contact-k { grid-column: 1 / -1; }
  .contact-v { overflow-wrap: normal; }
  .contact-copy { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- 2. フッターのリンク ---------- */
.footer-links { display: flex; gap: 28px; }

/* ---------- 3. 文章の改行（v3 で足した文は <wbr> の代わりに文節で折り返す） ---------- */
.ap, .ap p, .ap li { word-break: auto-phrase; }

/* ---------- 4. 作品詳細：番号つきの手順（作品07 の仕組み） ---------- */
.steps-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}
.steps-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.2em minmax(7em, 12em) 1fr;
  gap: 8px 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.9;
}
.steps-list li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 0.3em;
}
.steps-list b { font-family: var(--font-serif); font-weight: 500; }
.steps-list span { color: var(--muted); }
@media (max-width: 640px) {
  .steps-list li { grid-template-columns: 3.2em 1fr; }
  .steps-list span { grid-column: 2; }
}

/* ---------- 5. 作品カード：サムネが白い作品は番号を濃くする ---------- */
.work-card:has(a[href="work7.html"]) .work-no { color: #0a1020; text-shadow: none; }

/* ---------- 6. History（年表）：線がスクロールに合わせて伸び、通り過ぎた点が光る ---------- */
.history {
  position: relative;
  margin: 0;
  padding: 0 0 0 clamp(28px, 4vw, 44px);
  list-style: none;
}
.history::before,
.history-progress {
  content: "";
  position: absolute;
  top: 0.6em;
  bottom: 0.6em;
  left: 6px;
  width: 1px;
  background: var(--line-strong);
}
.history-progress {
  bottom: auto;
  height: calc(var(--hp, 0) * (100% - 1.2em));
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.history-year {
  margin: clamp(28px, 4vw, 44px) 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  color: var(--muted);
}
.history-year:first-child { margin-top: 0; }
.history-item { position: relative; }
.history-item::before {
  content: "";
  position: absolute;
  top: 1.45em;
  left: calc(-1 * clamp(28px, 4vw, 44px) + 2px);
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}
.history-item.is-lit::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); }
.history-item[data-kind="award"]::before { width: 13px; height: 13px; left: calc(-1 * clamp(28px, 4vw, 44px)); top: 1.3em; }
.history-row {
  display: grid;
  grid-template-columns: 6.6em 1fr auto;
  align-items: baseline;
  gap: 4px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
a.history-row { transition: padding 0.5s var(--ease), background 0.5s; }
a.history-row:hover { padding-left: 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.history-row time { font-family: var(--font-mono, monospace); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted); }
.history-row b { font-weight: 500; line-height: 1.6; }
.history-row b em { font-style: normal; color: var(--accent); }
.history-row small { grid-column: 2; font-size: 0.8rem; line-height: 1.7; color: var(--muted); word-break: auto-phrase; }
.history-row .arrow { grid-row: 1 / span 2; grid-column: 3; color: var(--accent); transition: transform 0.5s var(--ease); }
a.history-row:hover .arrow { transform: translateX(6px); }
.history-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 10px;
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  vertical-align: 0.15em;
}
/* 乗せると作品の絵が浮かぶ（マウスのときだけ・JS で動かす） */
.history-peek {
  position: fixed;
  z-index: 70;
  top: 0;
  left: 0;
  width: 240px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  background: var(--bg-2) center / cover no-repeat;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%) scale(0.9);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.history-peek.is-on { opacity: 1; transform: translate(-50%, -120%) scale(1); }
@media (max-width: 640px) {
  .history-row { grid-template-columns: 1fr auto; }
  .history-row time { grid-column: 1 / -1; }
  .history-row small { grid-column: 1; }
  .history-row .arrow { grid-row: 2 / span 2; grid-column: 2; }
}

/* ---------- 7. 遊ぶボタン：いちばん目立つ・何で遊ぶかがすぐ分かる ---------- */
.play-cta {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 16px;
  margin: 4px 0 18px;
  padding: 14px 28px 14px 16px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 14px 36px -14px var(--accent);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s;
}
.play-cta:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -14px var(--accent); background: var(--accent-2); }
.play-cta-icon {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent);
  font-size: 1.05rem;
  padding-left: 3px;
}
.play-cta-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--on-accent);
  border-radius: 50%;
  opacity: 0;
  animation: play-ping 2.2s var(--ease) infinite;
}
@keyframes play-ping { 0% { transform: scale(0.85); opacity: 0.7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.play-cta-text { display: grid; min-width: 0; gap: 2px; line-height: 1.3; }
.play-cta-text b { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.06em; }
.play-cta-text small { font-size: 0.75rem; opacity: 0.8; }
.play-req {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.play-req li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 0.8rem;
}
.play-req li span { font-size: 0.68rem; letter-spacing: 0.1em; color: var(--muted); }
.play-origin { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 0.85rem; line-height: 1.8; }
.play-origin > b:first-child { display: block; margin-bottom: 2px; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--accent); }
.play-note-pc { margin: 0 0 1em; font-size: 0.8rem; color: var(--muted); word-break: auto-phrase; }
/* 作品ページの上の「遊ぶ」ボタンも塗りつぶして目立たせる */
.detail-links .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.detail-links .btn.primary::before { background: var(--accent-2); }
.play-launch b::before { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .play-cta-icon::after { animation: none; } }

/* ---------- 8. トップの名前：Cormorant Garamond を太く（700）。2026-10-31 ユーザー指定
   （Gen Interface JP も試したが「前の書体のほうがよい、ただ少し細い」とのことで戻した。光の粒は hero.js がこの形から作る） ---------- */
.hero-name { font-weight: 700; letter-spacing: -0.015em; }

/* ---------- 9. 作品08（Figma のプロトタイプ）：スマホ形の枠・おことわり・試し方 ---------- */
.notice { margin: clamp(28px, 4vw, 44px) 0 0; padding: 14px 18px; border: 1px solid var(--line-strong); font-size: 0.82rem; line-height: 1.8; color: var(--muted); }
.notice > b:first-child { display: block; margin-bottom: 2px; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--accent); }
button.play-cta { border: 0; font: inherit; cursor: pointer; text-align: left; }
.try-list { margin: 0 0 16px; padding-left: 1.4em; font-size: 0.86rem; line-height: 1.9; color: var(--muted); }
.try-list b { color: var(--fg); font-weight: 600; }
.phone-embed {
  position: relative;
  justify-self: center;
  width: min(100%, 360px);
  aspect-ratio: 402 / 874;
  padding: 10px;
  border-radius: 44px;
  background: #0b0812;
  box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px -24px rgba(0, 0, 0, 0.8), 0 0 80px -20px var(--accent);
}
.phone-embed video,
.phone-embed iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 34px; background: #fff; object-fit: cover; }
.phone-embed-cap { position: absolute; left: 0; right: 0; bottom: -2em; text-align: center; font-size: 0.75rem; color: var(--muted); }
.phone-embed.is-live .phone-embed-cap { display: none; }
/* 読み込んだ後は Figma 側の余白があるので、スマホ枠をやめて大きな黒い画面にする */
.phone-embed.is-live { width: min(100%, 520px); aspect-ratio: 520 / 820; padding: 0; border-radius: 16px; background: #000; }
.phone-embed.is-live iframe { border-radius: 16px; background: #000; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: clamp(16px, 2.5vw, 32px); }
.screens figure { margin: 0; }
.screens img { display: block; width: 100%; aspect-ratio: 402 / 874; object-fit: cover; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); }
.screens figcaption { margin-top: 10px; font-size: 0.8rem; text-align: center; color: var(--muted); }

/* 作品08：Figma の「押せる場所が青く光る」ことの案内 */
.hint-blue { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid rgba(80, 170, 255, 0.45); background: rgba(80, 170, 255, 0.08); font-size: 0.85rem; line-height: 1.8; }
.hint-blue b { color: #6cc1ff; font-weight: 700; }
[data-theme="light"] .hint-blue b { color: #1a78d6; }
.hint-blue-swatch { flex: none; width: 34px; height: 22px; margin-top: 3px; border-radius: 4px; background: rgba(80, 170, 255, 0.35); box-shadow: 0 0 0 2px rgba(80, 170, 255, 0.85), 0 0 12px rgba(80, 170, 255, 0.7); animation: hint-blink 1.6s ease-in-out infinite; }
@keyframes hint-blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .hint-blue-swatch { animation: none; } }

/* 作品09：地図の画面と、幅を抑えたスマホの画面 */
.snapmap-preview img { display: block; width: 100%; height: auto; }
.snapmap-screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 720px; }
.snapmap-screens .zoomable { border-radius: 20px; }
.snapmap-screens img { display: block; width: 100%; height: auto; }
.snapmap-screen-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.8; }
.snapmap-screen-note a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .snapmap-screens { gap: 12px; } .snapmap-screens .zoomable { border-radius: 12px; } }
@media (max-width: 360px) { .detail-hero h1 { font-size: clamp(2.25rem, 11vw, 2.6rem); } }

/* ---------- 10. 作品ページの先頭：文字と画像を重ねない（2026-11-03 Claude）----------
   以前は画像の上に題名を重ねていたため、画面内の文字やロゴと題名が被って読みにくかった。
   PC は「左に文字・右に額縁の画像」、狭い画面は「文字の下に画像」にする */
.detail-hero {
  min-height: 0;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding: calc(var(--header-h) + clamp(32px, 6vw, 72px)) 0 clamp(40px, 6vw, 80px);
  overflow: visible;
}
.detail-hero::before { display: none; }
.detail-hero .bg {
  position: relative;
  inset: auto;
  z-index: 0;
  width: min(1280px, 100% - var(--gutter) * 2);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  filter: none;
  transform: none !important;
  box-shadow: 0 0 0 1px var(--line-strong), 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 0 120px -40px var(--accent);
  grid-row: 2;
}
[data-theme="light"] .detail-hero .bg { filter: none; opacity: 1; }
.detail-hero .wrap { grid-row: 1; }
.detail-hero h1 { font-size: clamp(2.4rem, 7vw, 5.6rem); line-height: 1.05; }
@media (min-width: 1100px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .detail-hero .wrap { grid-column: 1; width: auto; margin: 0; padding: 0; }
  .detail-hero .bg { grid-column: 2; grid-row: 1; width: 100%; margin: 0; aspect-ratio: 16 / 10; }
  .detail-hero h1 { font-size: clamp(2.6rem, 4.4vw, 4.8rem); }
}

/* ---------- 11. トップの横スクロール：縦に少しだけ動かないようにする ----------
   カードが乗せたときに浮く分だけ上下に余白を取り、はみ出しでスクロールが生まれないよう縦は隠す */
.rail {
  overflow-y: hidden;
  padding-top: 18px;
  padding-bottom: 30px;
  margin-top: clamp(18px, 3.4vw, 46px);
  margin-bottom: -10px;
  touch-action: pan-x pan-y;
}

/* ---------- 12. 更新履歴（各作品ページ・トップ） ---------- */
.updates { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.updates li { display: grid; grid-template-columns: 6em 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; line-height: 1.7; word-break: auto-phrase; }
.updates time { font-family: var(--font-mono, monospace); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.15em; }

/* ---------- 13. 作品カード：説明文の行数が違っても、タグ・区切り線・日付の高さをそろえる ---------- */
.work-card > a { display: flex; flex-direction: column; }
.work-card .work-media { flex: none; }
.work-card .work-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.work-card .tags { margin-top: auto; padding-top: 12px; align-items: baseline; }
.work-card .work-meta { align-items: baseline; }

/* ---------- 14. 更新履歴：作品情報と同じ列・同じ線にそろえる ---------- */
.updates { border-top-color: var(--line-strong); }
.updates li { font-size: inherit; align-items: baseline; }
.updates li > span { font-size: 0.9rem; }
.updates time { padding-top: 0; }
@media (min-width: 561px) { .updates li { grid-template-columns: 8em 1fr; gap: 16px; padding: 14px 0; } }
