/* ============================================================
   灼熱の詩、時々サボり。— Poem in the Scorching Heat
   style.css

   構成
   1. リセット & 基本設定
   2. カラー・タイポグラフィ変数（夏仕様）
   3. ローディング演出
   4. 空の背景シーン（グラデーション / 雲・太陽・粒子Canvas / 陽炎）
   5. 太陽・レンズフレア（DOM）
   6. マウス追従の太陽光
   7. ナビゲーション
   8. ヒーローセクション
   9. 詩ステージ（メイン演出）
   10. 装飾リング
   11. 終幕セクション
   12. 「全文を見る」ポエム一覧モーダル
   13. ランダムイベントのトースト通知
   14. サウンドトグル
   15. コピー抑止ユーティリティ
   16. グラスモーフィズム共通ユーティリティ
   17. 写真集ページ（ギャラリー / ライトボックス）
   18. レスポンシブ対応
   19. アクセシビリティ配慮
============================================================ */

/* ------------------------------------------------------------
   1. リセット & 基本設定
------------------------------------------------------------ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ------------------------------------------------------------
   2. カラー・タイポグラフィ変数（夏仕様）
------------------------------------------------------------ */
:root {
  /* 空・雲・太陽（背景） */
  --color-sky-zenith: #4FA8E8;
  --color-sky-a: #6EC6FF;
  --color-sky-b: #87CEEB;
  --color-cloud-blue: #BFE9FF;
  --color-cloud-white: #FFFFFF;
  --color-sunlight: #FFF8DC;
  --color-sun: #F7B733;
  --color-heat: #FF6B35;

  /* アクセント */
  --accent-yellow: #FFD54F;
  --accent-orange: #FF9800;
  --accent-red: #FF5722;
  --accent-cyan: #00BCD4;

  /* 文字色（明るい空を背景にするため、濃紺〜チャコールを基調にする） */
  --color-ink: #1E2B3C;
  --color-ink-dim: rgba(30, 43, 60, 0.62);
  --color-ink-faint: rgba(30, 43, 60, 0.38);
  --color-ink-white: #FFFFFF;

  /* フォント */
  --font-serif: 'Shippori Mincho', serif;
  --font-sans: 'Noto Sans JP', sans-serif;
  --font-en: 'Inter', sans-serif;

  /* トランジション */
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);

  /* スクロール量に応じて変化する熱気の強さ（JSから更新） */
  --heat-intensity: 0;
}

body {
  background: var(--color-sky-b);
  color: var(--color-ink);
  font-family: var(--font-sans);
  overflow-x: hidden;
  cursor: default;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  background: rgba(255, 152, 0, 0.3);
  color: var(--color-ink);
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 152, 0, 0.35);
  border-radius: 999px;
}

/* ------------------------------------------------------------
   3. ローディング演出
------------------------------------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(180deg, var(--color-sky-zenith), var(--color-sky-a));
  transition: opacity 1.4s var(--ease-slow), visibility 1.4s var(--ease-slow);
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  display: flex;
  gap: 18px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.4em;
  color: var(--color-ink-white);
}

.loader-char {
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  filter: blur(6px);
  animation: loaderCharIn 1.1s var(--ease-soft) forwards;
  text-shadow: 0 0 18px rgba(255, 213, 79, 0.8);
}

.loader-char:nth-child(1) { animation-delay: 0.15s; }
.loader-char:nth-child(2) { animation-delay: 0.38s; }
.loader-char:nth-child(3) { animation-delay: 0.61s; }

@keyframes loaderCharIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.loader-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--accent-yellow), transparent);
  animation: loaderLineGrow 1.6s var(--ease-soft) 0.9s forwards;
  transform: scaleY(0);
  transform-origin: top;
}

@keyframes loaderLineGrow {
  to { transform: scaleY(1); }
}

.loader-text {
  font-family: var(--font-en);
  font-weight: 200;
  font-size: 0.68rem;
  letter-spacing: 0.5em;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: loaderTextIn 1.2s var(--ease-soft) 1.3s forwards;
}

@keyframes loaderTextIn {
  to { opacity: 1; }
}

/* ------------------------------------------------------------
   4. 空の背景シーン
------------------------------------------------------------ */
.sky-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.sky-backdrop {
  position: absolute;
  inset: -10% -10%;
  background: linear-gradient(
    180deg,
    var(--color-sky-zenith) 0%,
    var(--color-sky-a) 45%,
    var(--color-sky-b) 78%,
    var(--color-cloud-blue) 100%
  );
  transition: filter 0.6s var(--ease-soft);
  filter: saturate(calc(1 + var(--heat-intensity) * 0.25)) brightness(calc(1 + var(--heat-intensity) * 0.06));
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#canvas-clouds { z-index: 1; }
#canvas-particles { z-index: 3; }

/* 地表付近から立ち上る、ゆらゆらとした陽炎（Canvasで描画される波線に重ねる簡易シェーディング） */
.heat-shimmer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46vh;
  z-index: 4;
  pointer-events: none;
  opacity: calc(0.05 + var(--heat-intensity) * 0.09);
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0px,
    rgba(255, 255, 255, 0) 3px,
    rgba(255, 145, 0, 0.35) 6px,
    rgba(255, 255, 255, 0) 9px
  );
  mix-blend-mode: overlay;
  filter: blur(3px);
  animation: heatShimmerRise 5.5s linear infinite;
  transition: opacity 0.6s var(--ease-soft);
}

@keyframes heatShimmerRise {
  0%   { transform: translateY(0) scaleY(1); }
  50%  { transform: translateY(-2.5%) scaleY(1.015); }
  100% { transform: translateY(0) scaleY(1); }
}

/* ノイズオーバーレイ：フィルム的な粒状感をごく薄く重ねる */
.noise-overlay {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: noiseShift 8s steps(8) infinite;
  mix-blend-mode: overlay;
}

@keyframes noiseShift {
  0%   { transform: translate(0, 0); }
  12%  { transform: translate(-4%, 3%); }
  25%  { transform: translate(3%, -5%); }
  37%  { transform: translate(-3%, 4%); }
  50%  { transform: translate(5%, 2%); }
  62%  { transform: translate(-2%, -3%); }
  75%  { transform: translate(4%, -2%); }
  87%  { transform: translate(-4%, -4%); }
  100% { transform: translate(0, 0); }
}

/* 上部からやわらかく差し込む日差し。画面端は軽く明るさを落として奥行きを出す */
.light-overlay {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 82% 8%, rgba(255, 248, 220, 0.55) 0%, rgba(255, 248, 220, 0) 38%),
    radial-gradient(ellipse at 50% 100%, rgba(30, 43, 60, 0.12) 0%, rgba(30, 43, 60, 0) 55%);
}

/* ------------------------------------------------------------
   5. 太陽・レンズフレア（DOM）
------------------------------------------------------------ */
.sun-wrap {
  position: fixed;
  top: 9vh;
  right: 12vw;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

.sun-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46vmin;
  height: 46vmin;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 248, 220, 0.32) 0deg 4deg,
    rgba(255, 248, 220, 0) 4deg 18deg
  );
  border-radius: 50%;
  animation: sunRaysSpin 130s linear infinite;
  opacity: 0.8;
}

@keyframes sunRaysSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.sun-disc {
  position: relative;
  width: clamp(64px, 9vw, 128px);
  height: clamp(64px, 9vw, 128px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 34%,
    #FFFFFF 0%,
    var(--color-sunlight) 24%,
    var(--color-sun) 62%,
    var(--color-heat) 100%
  );
  box-shadow:
    0 0 60px 18px rgba(247, 183, 51, 0.55),
    0 0 140px 60px rgba(255, 213, 79, 0.28);
  animation: sunPulse 6s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.035); filter: brightness(1.08); }
}

.lens-flare {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lens-flare-1 {
  width: 22px; height: 22px;
  top: 145%; left: 78%;
  background: radial-gradient(circle, rgba(0, 188, 212, 0.55), transparent 70%);
}
.lens-flare-2 {
  width: 14px; height: 14px;
  top: 210%; left: 62%;
  background: radial-gradient(circle, rgba(255, 213, 79, 0.6), transparent 70%);
}
.lens-flare-3 {
  width: 34px; height: 34px;
  top: 290%; left: 48%;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.35), transparent 70%);
}
.lens-flare-4 {
  width: 10px; height: 10px;
  top: 350%; left: 38%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 70%);
}

/* ------------------------------------------------------------
   6. マウス追従の太陽光
------------------------------------------------------------ */
.cursor-glow,
.cursor-glow-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 7;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-glow {
  width: 380px;
  height: 380px;
  background: radial-gradient(
    circle,
    rgba(255, 213, 79, 0.16) 0%,
    rgba(255, 152, 0, 0.07) 35%,
    transparent 70%
  );
}

.cursor-glow-ring {
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 18px rgba(255, 213, 79, 0.5);
}

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

/* ------------------------------------------------------------
   7. ナビゲーション
------------------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
}

.site-nav a {
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--color-ink-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease-soft), background 0.4s var(--ease-soft);
}

.site-nav a:hover {
  color: var(--color-ink);
}

.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.55);
  color: var(--color-ink);
  box-shadow: 0 2px 14px rgba(255, 152, 0, 0.25);
}

/* ------------------------------------------------------------
   8. ヒーローセクション
------------------------------------------------------------ */
.stage {
  position: relative;
  z-index: 10;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
}

.hero-inner {
  text-align: center;
  max-width: 760px;
}

.hero-eyebrow {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.5em;
  color: var(--accent-red);
  opacity: 0;
  transform: translateY(10px);
  animation: heroFadeUp 1.4s var(--ease-soft) 0.3s forwards;
  margin-bottom: 28px;
  text-shadow: 0 0 20px rgba(255, 87, 34, 0.25);
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 7.4vw, 4.8rem);
  line-height: 1.35;
  letter-spacing: 0.07em;
  color: var(--color-ink);
}

.hero-title-line {
  display: block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(24px);
  animation: heroFadeUp 1.6s var(--ease-soft) forwards;
  text-shadow: 0 2px 22px rgba(255, 213, 79, 0.55);
}

.hero-title-line:nth-child(1) { animation-delay: 0.6s; }
.hero-title-line:nth-child(2) { animation-delay: 0.95s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hero-sub {
  margin-top: 32px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  letter-spacing: 0.1em;
  color: var(--color-ink-dim);
  opacity: 0;
  animation: heroFadeUp 1.6s var(--ease-soft) 1.35s forwards;
}

.hero-cta {
  margin-top: 44px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 1.6s var(--ease-soft) 1.6s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: heroFadeUp 1.6s var(--ease-soft) 1.9s forwards;
}

.hero-scroll-line {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, var(--accent-orange), transparent);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, #ffffff, transparent);
  animation: scrollLineMove 2.2s ease-in-out infinite;
}

@keyframes scrollLineMove {
  0%   { top: -100%; }
  60%  { top: 100%; }
  100% { top: 100%; }
}

.hero-scroll-text {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--color-ink-faint);
}

/* ------------------------------------------------------------
   9. 詩ステージ（メイン演出）
------------------------------------------------------------ */
.poem-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
  overflow: hidden;
}

.poem-frame {
  position: relative;
  z-index: 3;
  max-width: 880px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.poem-index {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--color-ink-faint);
  transition: opacity 1s var(--ease-soft);
}

.poem-text {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.8vw, 1.85rem);
  line-height: 1.85;
  letter-spacing: 0.06em;
  color: var(--color-ink);
  min-height: 5em;
  text-align: center;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.5);
}

.poem-char {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(10px) scale(0.96);
  white-space: pre;
  transition:
    opacity 0.9s var(--ease-soft),
    filter 0.9s var(--ease-soft),
    transform 0.9s var(--ease-soft);
  text-shadow: 0 0 14px rgba(255, 152, 0, 0.2);
}

.poem-char.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.poem-char.is-leaving {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity 1.1s var(--ease-slow),
    filter 1.1s var(--ease-slow),
    transform 1.1s var(--ease-slow);
}

.poem-progress {
  width: 120px;
  height: 2px;
  background: rgba(30, 43, 60, 0.14);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.poem-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--accent-orange), var(--accent-yellow));
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.6);
}

.poem-view-all-btn {
  margin-top: 4px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--color-ink-dim);
  border: 1px solid rgba(30, 43, 60, 0.18);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.4s var(--ease-soft), border-color 0.4s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.poem-view-all-btn:hover {
  color: var(--color-ink);
  border-color: rgba(255, 152, 0, 0.5);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------
   10. 装飾リング
------------------------------------------------------------ */
.geo-ring {
  position: absolute;
  border: 1px solid rgba(255, 152, 0, 0.14);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.geo-ring-1 {
  width: 60vmin;
  height: 60vmin;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: geoSpin 90s linear infinite;
  border-color: rgba(255, 152, 0, 0.12);
}

.geo-ring-2 {
  width: 42vmin;
  height: 42vmin;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: geoSpin 60s linear infinite reverse;
  border-color: rgba(0, 188, 212, 0.12);
  border-style: dashed;
}

.geo-ring-3 {
  width: 78vmin;
  height: 78vmin;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: geoSpin 140s linear infinite;
  border-color: rgba(255, 255, 255, 0.35);
}

@keyframes geoSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ------------------------------------------------------------
   11. 終幕セクション
------------------------------------------------------------ */
.finale {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10vh 6vw;
  text-align: center;
}

.finale-inner {
  max-width: 640px;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity 1.6s var(--ease-slow), transform 1.6s var(--ease-slow), filter 1.6s var(--ease-slow);
}

.finale-inner.is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.finale-label {
  font-family: var(--font-en);
  font-size: 0.68rem;
  letter-spacing: 0.5em;
  color: var(--color-ink-faint);
  margin-bottom: 26px;
}

.finale-text {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3.6vw, 2rem);
  line-height: 2;
  color: var(--color-ink);
  letter-spacing: 0.05em;
}

.replay-btn {
  margin-top: 56px;
  position: relative;
  padding: 18px 44px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  color: var(--accent-red);
  border: 1px solid rgba(255, 87, 34, 0.4);
  border-radius: 999px;
  overflow: hidden;
  transition: color 0.6s var(--ease-soft), border-color 0.6s var(--ease-soft), box-shadow 0.6s var(--ease-soft);
}

.replay-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(255, 152, 0, 0.35), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft);
}

.replay-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 152, 0, 0.8);
  box-shadow: 0 0 26px rgba(255, 152, 0, 0.35);
}

.replay-btn:hover::before { opacity: 1; }
.replay-btn span { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   12.「全文を見る」ポエム一覧モーダル
------------------------------------------------------------ */
.poem-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-soft), visibility 0.45s var(--ease-soft);
}

.poem-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.poem-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 45, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.poem-modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 26px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.5s var(--ease-soft);
}

.poem-modal.is-open .poem-modal-panel {
  transform: translateY(0) scale(1);
}

.poem-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.poem-modal-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--color-ink);
}

.poem-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-dim);
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
  flex-shrink: 0;
}

.poem-modal-close:hover {
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.85);
  transform: rotate(90deg);
}

.poem-modal-search {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(30, 43, 60, 0.15);
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--color-ink);
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.3s var(--ease-soft), background 0.3s var(--ease-soft);
}

.poem-modal-search::placeholder { color: var(--color-ink-faint); }

.poem-modal-search:focus {
  border-color: rgba(255, 152, 0, 0.55);
  background: rgba(255, 255, 255, 0.8);
}

.poem-modal-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.poem-card {
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-align: left;
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.poem-card:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.poem-card-index {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--accent-orange);
  margin-bottom: 6px;
  display: block;
}

.poem-card-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--color-ink);
  white-space: pre-line;
}

.poem-modal-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--color-ink-faint);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   13. ランダムイベントのトースト通知
------------------------------------------------------------ */
.event-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 90;
  max-width: 300px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transform: translateX(24px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease-soft), opacity 0.55s var(--ease-soft);
}

.event-toast.is-visible {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.event-toast-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.event-toast-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.event-toast-body {
  font-size: 0.78rem;
  color: var(--color-ink-dim);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   14. サウンドトグル
------------------------------------------------------------ */
.sound-toggle {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom));
  right: calc(28px + env(safe-area-inset-right));
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(30, 43, 60, 0.15);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.5s var(--ease-soft), box-shadow 0.5s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.sound-toggle:hover {
  border-color: rgba(255, 152, 0, 0.5);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.25);
  transform: scale(1.06);
}

.sound-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.sound-bar {
  width: 3px;
  background: var(--accent-orange);
  border-radius: 2px;
  height: 40%;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.sound-toggle[aria-pressed="true"] .sound-bar {
  opacity: 1;
  animation: soundBarPulse 1s ease-in-out infinite;
}

.sound-toggle .sound-bar:nth-child(1) { height: 45%; }
.sound-toggle .sound-bar:nth-child(2) { height: 90%; }
.sound-toggle .sound-bar:nth-child(3) { height: 60%; }

.sound-toggle[aria-pressed="true"] .sound-bar:nth-child(1) { animation-delay: 0s; }
.sound-toggle[aria-pressed="true"] .sound-bar:nth-child(2) { animation-delay: 0.15s; }
.sound-toggle[aria-pressed="true"] .sound-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes soundBarPulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* ------------------------------------------------------------
   15. コピー抑止ユーティリティ
------------------------------------------------------------ */
.no-copy {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ------------------------------------------------------------
   16. グラスモーフィズム共通ユーティリティ
------------------------------------------------------------ */
.glass-panel {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 18px 50px rgba(30, 43, 60, 0.12);
}

/* ------------------------------------------------------------
   17. 写真集ページ（ギャラリー / ライトボックス）
------------------------------------------------------------ */
.gallery-page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12vh 6vw 8vh;
}

.gallery-header {
  text-align: center;
  margin-bottom: 6vh;
}

.gallery-eyebrow {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.5em;
  color: var(--accent-red);
  margin-bottom: 18px;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--color-ink);
}

.gallery-sub {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--color-ink-dim);
}

.gallery-slider {
  position: relative;
  width: min(1000px, 100%);
}

.gallery-viewport {
  overflow: hidden;
  border-radius: 24px;
}

.gallery-track {
  display: flex;
  cursor: grab;
  touch-action: pan-y;
  transition: transform 0.55s var(--ease-soft);
}

.gallery-track.is-dragging {
  transition: none;
  cursor: grabbing;
}

.gallery-slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* pointer-events は無効化しない（PCでの右クリック保存を妨げないため）。
     ネイティブのドラッグゴーストのみ gallery.js 側で dragstart を抑止している */
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-slide-hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(20, 30, 45, 0.35), transparent);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.3s var(--ease-soft);
}

.gallery-slide:hover .gallery-slide-hint { opacity: 1; }

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
  z-index: 5;
  transition: transform 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft), opacity 0.3s var(--ease-soft);
}

.gallery-nav-btn:hover { transform: translateY(-50%) scale(1.08); }
.gallery-nav-btn:disabled { opacity: 0.3; pointer-events: none; }
.gallery-nav-prev { left: -22px; }
.gallery-nav-next { right: -22px; }

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(30, 43, 60, 0.22);
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.gallery-dot.is-active {
  background: var(--accent-orange);
  transform: scale(1.3);
}

/* ライトボックス */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 20, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-soft), visibility 0.4s var(--ease-soft);
  touch-action: none;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  position: relative;
  max-width: 92vw;
  max-height: 84vh;
  transform: translateY(0);
  transition: transform 0.4s var(--ease-soft);
}

.lightbox-figure img {
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  right: calc(20px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(90deg);
}

.lightbox-download {
  position: absolute;
  bottom: calc(-58px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.lightbox-download:hover {
  background: rgba(255, 213, 79, 0.28);
  transform: translateX(-50%) translateY(-1px);
}

.lightbox-counter {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-en);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
}

/* ------------------------------------------------------------
   18. レスポンシブ対応
------------------------------------------------------------ */
.hero,
.poem-stage,
.finale {
  padding-left: max(6vw, calc(env(safe-area-inset-left) + 16px));
  padding-right: max(6vw, calc(env(safe-area-inset-right) + 16px));
}

@media (max-width: 1024px) {
  .poem-frame { gap: 28px; }
  .poem-text { line-height: 1.95; }
  .geo-ring-1 { width: 78vmin; height: 78vmin; }
  .geo-ring-2 { width: 56vmin; height: 56vmin; }
  .geo-ring-3 { width: 100vmin; height: 100vmin; }
  .hero-scroll { bottom: 4vh; }
  .gallery-nav-prev { left: 8px; }
  .gallery-nav-next { right: 8px; }
}

@media (max-width: 768px) {
  .hero-title { letter-spacing: 0.05em; }
  .poem-text { line-height: 1.75; }
  .cursor-glow, .cursor-glow-ring { display: none; }
  .geo-ring-1 { width: 90vmin; height: 90vmin; }
  .geo-ring-2 { width: 66vmin; height: 66vmin; }
  .geo-ring-3 { width: 116vmin; height: 116vmin; }
  .sun-wrap { top: 6vh; right: 8vw; }
  .sun-disc { width: 56px; height: 56px; }

  .hero { padding-top: 8vh; padding-bottom: 8vh; }
  .poem-stage { padding-top: 5vh; padding-bottom: 5vh; }
  .poem-frame { gap: 24px; }
  .poem-text { min-height: 4.5em; }
  .finale-text { line-height: 1.85; }
  .replay-btn { margin-top: 42px; }
  .site-nav { top: 14px; }
  .event-toast { left: 14px; right: 14px; max-width: none; top: 14px; }
}

@media (max-width: 480px) {
  .hero-eyebrow { letter-spacing: 0.32em; font-size: 0.62rem; }
  .hero-sub { margin-top: 24px; }
  .poem-index { letter-spacing: 0.4em; }
  .poem-frame { gap: 24px; }
  .poem-progress { width: 92px; }
  .replay-btn { padding: 16px 32px; font-size: 0.75rem; }
  .sound-toggle { width: 42px; height: 42px; }
  .gallery-slide { aspect-ratio: 3 / 4; }
  .lightbox-download { bottom: -50px; padding: 10px 18px; }
}

@media (max-width: 360px) {
  .hero-title { letter-spacing: 0.02em; }
  .poem-text { letter-spacing: 0.03em; }
  .finale-text { letter-spacing: 0.03em; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero, .poem-stage, .finale {
    padding-top: 4vh;
    padding-bottom: 4vh;
  }
  .hero-scroll,
  .geo-ring-1,
  .geo-ring-2,
  .geo-ring-3 {
    display: none;
  }
  .poem-text { min-height: 0; }
  .hero-title { font-size: clamp(1.8rem, 6vw, 3rem); }
  .replay-btn { margin-top: 28px; }
}

/* ------------------------------------------------------------
   19. アクセシビリティ配慮
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
