@charset "UTF-8";

:root {
  /* 流れる速さ（ピクセル/秒）は js/script.js の SPEED で変更 */
  --background-color: #000;
  --color-cycle-duration: 30s; /* 背景色が1周する時間 */
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--background-color);
  isolation: isolate;
}

/* 回転で画面外にはみ出した部分を切り抜く */
.background-viewport {
  /* 背景色と画像だけを同じ合成範囲にまとめる */
  isolation: isolate;
  background-color: var(--background-color);
  animation: background-colors var(--color-cycle-duration) linear infinite;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* -10°回転した画面の四隅まで覆う寸法。端の丸め誤差用に4px追加。 */
.sliding-background {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(98.4807753vw + 17.3648178vh + 4px);
  height: calc(17.3648178vw + 98.4807753vh + 4px);
  transform: translate(-50%, -50%) rotate(-10deg);
  transform-origin: center;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  pointer-events: none;
  opacity: 0.3;
}
.background-row { min-width: 0; overflow: hidden; }
.background-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: slide-left var(--duration, 60s) linear infinite;
  will-change: transform;
}
.background-row--right .background-track { animation-direction: reverse; }
.background-viewport.is-paused,
.background-viewport.is-paused .background-track {
  animation-play-state: paused;
}
.background-group { display: flex; flex: none; height: 100%; }
.background-group img {
  display: block;
  flex: none;
  height: 100%;
  width: auto;
  object-fit: cover;
  max-width: none;
}
/* ロゴを通常のページ要素に置き、下にスクロール用の余白を確保 */
.site-content {
  position: relative;
  padding-bottom: 100vh;
  padding-bottom: 100svh;
}
.logo-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.center-logo {
  display: block;
  width: min(301px, 80vw);
  height: auto;
  max-height: 80vh;
  max-height: 80dvh;
  object-fit: contain;
}

/* 同じ画像列を2つ繋ぎ、ちょうど1列分移動して継ぎ目なく戻す */
@keyframes slide-left {
  from { transform: translateX(0); }
  to { transform: translateX(var(--distance)); }
}
/* 赤 → 紫 → 青 → 緑 → 黄 → 赤をなめらかに繰り返す */
@keyframes background-colors {
  0%, 100% { background-color: #ef4444; }
  20% { background-color: #a855f7; }
  40% { background-color: #3b82f6; }
  60% { background-color: #22c55e; }
  80% { background-color: #facc15; }
}
@media (prefers-reduced-motion: reduce) {
  .background-viewport { animation-play-state: paused; }
  .background-track { animation-play-state: paused; }
}
