/* ベースカラー定義 */
:root {
  --bg-light: #f3f8ff;
  --bg-mid: #274776;
  --bg-deep: #050d22;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: "Courier New", sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 20% 10%, #f8fbff 0%, #95abcf 34%, #2a4269 62%, #08152f 100%),
    linear-gradient(140deg, var(--bg-light) 0%, var(--bg-mid) 45%, var(--bg-deep) 100%);
  color: #f9fcff;
}

/* 背景の流体描画キャンバス */
#fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* タイトル・説明・リンクを重ねる UI レイヤー */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* メインページ見出し */
.overlay h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow:
    0 0 18px rgb(206 225 255 / 28%),
    0 0 44px rgb(84 120 182 / 24%);
}

/* メインページ紹介文 */
.intro {
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: rgb(234 244 255 / 88%);
  letter-spacing: 0.03em;
  text-shadow: 0 0 14px rgb(67 103 162 / 28%);
}

/* ソーシャルリンク（横並び） */
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  pointer-events: auto;
}

.social-links a {
  color: #f3f8ff;
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgb(207 225 255 / 40%);
  border-radius: 999px;
  background: rgb(7 17 41 / 34%);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: #ffffff;
  border-color: rgb(233 244 255 / 82%);
  background: rgb(24 57 108 / 42%);
}

/* エラーページ用カード */
.error-page .overlay-content.error-content {
  width: min(90vw, 700px);
  padding: clamp(1rem, 2.2vw, 2rem);
  gap: 1rem;
  border: 1px solid rgb(217 233 255 / 24%);
  border-radius: 18px;
  background: linear-gradient(160deg, rgb(8 19 47 / 46%), rgb(11 26 63 / 32%));
  backdrop-filter: blur(3px);
}

/* エラーページ見出し */
.error-page h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.08em;
  text-shadow:
    0 0 20px rgb(206 225 255 / 34%),
    0 0 42px rgb(84 120 182 / 20%);
}

.error-message {
  max-width: 62ch;
  line-height: 1.8;
  color: rgb(236 246 255 / 92%);
}

.error-actions {
  margin-top: 0.3rem;
}

.error-actions a {
  min-width: 8rem;
  text-align: center;
}

/* WebGPU 非対応時はキャンバスを隠して背景アニメのみ表示 */
body.no-webgpu #fluid-canvas {
  display: none;
}

body.no-webgpu {
  background-size: 180% 180%;
  animation: fallbackTide 12s ease-in-out infinite alternate;
}

@keyframes fallbackTide {
  0% {
    background-position: 0% 15%;
    filter: saturate(1.04);
  }
  100% {
    background-position: 100% 85%;
    filter: saturate(0.94);
  }
}
