/* =============================================
   スクロールアニメーション CSS
============================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   ページトップボタン
============================================= */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--color-primary-dark);
}

/* =============================================
   コードコピーボタン
============================================= */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.code-copy-btn:hover {
  background: rgba(255,255,255,0.25);
}

.code-copy-btn.copied {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* =============================================
   ヘッダースクロール時のスタイル
============================================= */
#site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}
