/* ============================================================
   ORBIS.NFT — 切り抜きクラゲ + 背景画像
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 背景画像の読み込みが終わるまでの下地。画像の平均色に合わせてある */
  --sea: #2263ac;
  --sea-deep: #0f418a;
  --ink: #f2f8ff;
  --font-hand: 'Yomogi', 'Hiragino Maru Gothic ProN', cursive;
}

body {
  margin: 0;
  overflow: hidden;
  background-color: var(--sea-deep);
}

/* ============================================================
   SCENE — 背景画像（泡はこの画像に描き込まれている）
   ============================================================ */

.scene {
  position: relative;
  /* iOS Safari の 100vh はツールバーを含まない「大きい方」のビューポートなので、
     画面下がツールバーの裏に回り込む。svh（小さい方）に合わせて必ず収まるようにする。
     svh 非対応のブラウザ向けに 100vh を先に置いている */
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--sea);
}

/* 背景レイヤー。クラゲと同じリズムでふよふよ動く
   （元は背景ごと1本の動画だったので、画面全体が揺れていた）
   scale(1.02) は、動かしたときに画面端が欠けないための余白 */
.scene::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('kurage-back.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center center;
  animation: sceneFloat 4s ease-in-out infinite;
  will-change: transform;
}

@keyframes sceneFloat {
  0% {
    transform: translateY(0px) scale(1.02);
  }

  50% {
    transform: translateY(-12px) scale(1.02);
  }

  100% {
    transform: translateY(0px) scale(1.02);
  }
}

/* ============================================================
   JELLYFISH
   ============================================================ */

/* Float layer — ふよふよアニメーション */
.jelly-float {
  position: relative;
  z-index: 2;
  animation: jellyFloat 4s ease-in-out infinite;
}

@keyframes jellyFloat {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }

  100% {
    transform: translateY(0px);
  }
}

.jelly-video {
  display: block;
  height: 58vh;
  width: auto;
  /* 水中でほのかに光っている感じ */
  filter: drop-shadow(0 0 40px rgba(130, 200, 255, 0.35));
}

@media (max-width: 640px) {
  .jelly-video {
    height: 42vh;
  }
}

/* 動きを抑える設定の人には、ふよふよを止める */
@media (prefers-reduced-motion: reduce) {

  .scene::before,
  .jelly-float {
    animation: none;
  }
}

/* ============================================================
   NOTE — 操作の説明（手書き風）
   ============================================================ */

/* 背景と一緒には揺らさない。
   揺れる背景の上で文字まで動くと読みづらいため */
.note-text {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 11vh;
  bottom: 11svh;
  /* flex にしておくと、span 同士の間の改行が空白として残らない */
  display: flex;
  justify-content: center;
  /* ほんの少しだけ傾けると手書きらしくなる */
  transform: translateX(-50%) rotate(-1.2deg);
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-hand);
  font-size: clamp(16px, 2vw, 26px);
  letter-spacing: 0.08em;
  color: var(--ink);
  /* 青の上でも輪郭が沈まないように、ごく淡い影を敷く */
  text-shadow: 0 2px 18px rgba(0, 30, 70, 0.55);
  pointer-events: none;
}

@media (max-width: 640px) {
  .note-text {
    /* 下のツールバーに隠れないよう、最低でも 44px は床から離す */
    bottom: max(7vh, 44px);
    bottom: max(7svh, 44px);
    font-size: 14px;
    letter-spacing: 0.02em;
    /* 文が長いので、画面幅に収めて折り返す */
    white-space: normal;
    text-align: center;
    width: min(92vw, 420px);
    line-height: 1.7;
  }
}

/* マウスのある環境とタッチ環境で文言を出し分ける。
   画面幅ではなく入力デバイスで見るので、小さいウィンドウの PC でも
   「マウスに追従して」のままになる */
.note-touch {
  display: none;
}

@media (hover: none),
(pointer: coarse) {
  .note-pointer {
    display: none;
  }

  .note-touch {
    display: inline;
  }
}







/* ============================================================
   ポートフォリオへ戻る導線（5ページ共通）
   ============================================================ */

.pf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 24px);
  background: #021522;
  border-bottom: 1px solid rgba(154, 229, 238, .22);
  font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .2em;
  color: rgba(226, 243, 250, .66);
  line-height: 1.6;
}

.pf-bar a {
  color: #9ae5ee;
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s ease;
}

.pf-bar a:hover { color: #fff; }
.pf-bar a:focus-visible { outline: 2px solid #cbf5ff; outline-offset: 4px; }


@media (max-width: 640px) {
  .pf-bar { font-size: 10px; letter-spacing: .1em; }
}

/* 戻る導線を画面の上に固定し、スクロールしても右上に出したままにする */
.pf-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* 固定したぶん、本文が隠れないよう同じ高さの場所を空けておく */
.pf-bar-space {
    height: 39px;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .pf-bar-space { height: 37px; }
}
