/* ========================================
   ワタシの神話 LP — Base Styles
   ======================================== */

/* --- @font-face --- */
@font-face {
  font-family: 'AB-DON2';
  src: url('../fonts/AB-DON2-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AB-countryroad';
  src: local('AB-countryroad'), local('AB-countryroad Regular'),
       url('../fonts/AB-countryroad.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Shoufutai';
  src: local('手札体-简'), local('ShouFuTi-Jian'), local('手札体-简 Regular');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Custom Properties (YUMEKAWA) --- */
:root {
  --cherry-blossom: #F268AB;
  --dreamy-blush: #F2CBE2;
  --aqua-pop: #00C9F2;
  --star-lemon: #F2D430;
  --magic-violet: #9954F2;
  --candy-red: #F24967;
  --soft-pink: #F296C2;
  --ink: #2D0A22;
  --base: #FFFAFD;
}

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

html, body {
  overflow: hidden;
  background: var(--base);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 110, 180, 0.15);
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html.lp-active,
html.lp-active body {
  overflow: hidden;
}

/* ========================================
   SPLASH SCREEN
   ======================================== */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--base);
}

#splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* YUMEKAWAカラーオーバーレイ */
#splash-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(255, 110, 180, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(162, 89, 255, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 214, 238, 0.10) 0%, transparent 65%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* バブルキャンバス */
#bubble-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ========================================
   LP MAIN
   ======================================== */
#lp-main {
  opacity: 0;
  visibility: hidden;
}

#lp-main.visible {
  visibility: visible;
  display: flex;
  height: 100vh;
  height: var(--vh, 100vh);
  height: 100dvh;
}

/* ========================================
   HORIZONTAL SWIPE SYSTEM
   ======================================== */
.swipe-page {
  width: 100vw;
  height: 100vh;
  height: var(--vh, 100vh);
  height: 100dvh;
  flex-shrink: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Nav Arrows (YUMEKAWA gradient chevrons) --- */
.swipe-arrow {
  position: fixed;
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 88px;
  height: 88px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.swipe-arrow .chevron {
  display: inline-block;
  color: var(--aqua-pop);
  margin: 0 -3px;
  transition: color 0.2s ease;
  font-weight: 700;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
}

.swipe-arrow:hover .chevron {
  color: var(--star-lemon);
}

.swipe-arrow:active .chevron {
  color: #fff;
}

.swipe-arrow:focus-visible {
  outline: 2px solid var(--magic-violet);
  outline-offset: 2px;
}

.swipe-arrow--prev { left: 8px; transform: translateY(-50%) scaleX(-1); }
.swipe-arrow--next { right: 8px; }

.swipe-arrow[aria-disabled="true"] {
  visibility: hidden;
  pointer-events: none;
}

/* --- Dot Indicators --- */
.swipe-dots {
  position: fixed;
  bottom: calc(16px + 16px + 1rem + env(safe-area-inset-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.swipe-dots.visible { opacity: 1; }

.swipe-dot {
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: width 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.swipe-dot:focus-visible {
  outline: 2px solid var(--magic-violet);
  outline-offset: 2px;
}

.swipe-dot[aria-current="true"] {
  width: 24px;
  border-radius: 4px;
  background: #fff;
}

/* LP背景バブル */
.bubble-bg {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  filter: blur(1px);
}

/* セクション共通 */
section {
  position: relative;
  z-index: 1;
}

/* ========================================
   HERO SECTION
   ======================================== */
#hero {
  background: var(--base);
  /* CTAボタンの高さ分だけ下部に余白を確保し、コンテンツが隠れないようにする */
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

/* SP: コンテンツが画面に収まらない場合は上詰め+スクロール可能に */
@media (max-width: 639px) {
  #hero {
    justify-content: flex-start;
    padding-top: 2rem;        /* 64px → 32px: ステータスバー下の余白を縮小 */
  }

  /* タイトル〜ロゴ間の gap を縮小: 32px → 16px */
  #hero .relative.z-10.flex {
    gap: 1rem;
  }

  /* ロゴを少し縮小して縦スペースを節約 */
  #hero .flex-shrink-0.w-48 {
    width: 10rem;    /* 192px → 160px */
  }

  /* イベント情報ブロックの上マージンを縮小: 48px → 24px */
  #hero .relative.z-10.mt-12 {
    margin-top: 1.5rem;
  }
}

/* タイトル (SVG版) */
#hero-title-svg {
  display: block;
}

/* アクセシビリティ: スクリーンリーダー用 h1 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 軌道背景 */
#orbit-bg {
  z-index: 0;
}

/* ========================================
   CREDITS END-ROLL (PAGE 2)
   ======================================== */
#credits-page {
  background: var(--ink);
}

#credits-orbit-bg {
  z-index: 0;
}

/* クロスハッチメッシュ (Page 2) */
#credits-mesh {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 30%,
    rgba(0, 0, 0, 0.55) 100%
  );
  clip-path: inset(0 0 100% 0);
  opacity: 0;
}
/* clip-path非対応環境: opacityのみでフォールバック */
@supports not (clip-path: inset(0 0 0 0)) {
  #credits-mesh { opacity: 1; }
}

/* SVG filter非対応環境: opacityで明度を代替(安全網) */
@supports not (filter: brightness(1)) {
  #credits-orbit-bg { opacity: 0.5; }
}

#credits-header {
  flex-shrink: 0;
  margin: 0;
  font-size: inherit;
}

#credits-viewport {
  position: relative;
  /* フェードマスク: 上下グラデーション */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
}

#credits-track {
  text-align: center;
  padding: 2rem 1rem 60vh;
  will-change: transform;
}

/* アーティスト1行 */
.credits-line {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.625;
  padding: 0.5em 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .credits-line {
    font-size: 1.375rem;
  }
}

/* アーティスト名カラー (JS で --line-color を設定) */
.credits-name {
  color: var(--line-color, var(--cherry-blossom));
  -webkit-text-stroke: 2.5px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
  filter: saturate(0.7) brightness(1.6);
}

/* genre テキスト: モノクロ */
.credits-genre {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7em;
}

.credits-separator {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 0.5em;
}

/* セクション見出し */
.credits-section-heading {
  font-family: 'AB-DON2', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.4);
  paint-order: stroke fill;
  margin-top: 2.5em;
  margin-bottom: 0.5em;
  letter-spacing: 0.1em;
}

@media (min-width: 640px) {
  .credits-section-heading {
    font-size: 1.75rem;
  }
}

/* ========================================
   CONCEPT PAGE (PAGE 3)
   ======================================== */
#concept-page {
  background: var(--dreamy-blush);
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

/* コンテンツ高さに背景が追従するラッパー */
.concept-inner {
  position: relative;
  min-height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SP: コンテンツが溢れる場合は上詰め */
@media (max-width: 639px) {
  .concept-inner {
    align-items: flex-start;
  }
}

.concept-orbit,
.concept-clouds {
  z-index: 0;
}

/* 可読性カーテン (Page 3) — 白系半透明 */
#concept-mesh {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 255, 255, 0.60) 0%,
    rgba(255, 255, 255, 0.60) 60%,
    rgba(255, 255, 255, 0.45) 100%
  );
  clip-path: inset(0 0 100% 0);
}

.concept-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}

#concept-heading {
  font-family: 'AB-countryroad', 'Kaisei Tokumin', serif;
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 1.5rem;
  -webkit-text-stroke: 1.5px #000;
  paint-order: stroke fill;
}

#concept-heading .char-wa   { color: var(--cherry-blossom); }
#concept-heading .char-ta   { color: var(--star-lemon); }
#concept-heading .char-shi  { color: var(--magic-violet); }
#concept-heading .char-no   { color: var(--soft-pink); }
#concept-heading .char-shi2 { color: var(--cherry-blossom); }
#concept-heading .char-n    { color: var(--star-lemon); }
#concept-heading .char-wa2  { color: var(--aqua-pop); }

.concept-body {
  font-family: 'Shoufutai', 'BIZ UDPMincho', serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 2;
  color: var(--ink);
  text-align: left;
}

.concept-body p {
  margin-bottom: 1.25em;
}

.concept-body p:last-child {
  margin-bottom: 0;
}

.concept-attribution {
  font-family: 'Shoufutai', 'BIZ UDPMincho', serif;
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--ink);
  opacity: 0.65;
  margin-top: 1.5rem;
  text-align: right;
  align-self: flex-end;
}

@media (min-width: 640px) {
  #concept-heading {
    font-size: 3rem;
  }
  .concept-body {
    font-size: 1.125rem;
  }
}

/* ========================================
   FIXED CTA BUTTON
   ======================================== */
/* CTAの上に密着する白半透明バー */
#cta-backdrop {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  height: calc((16px + 16px + 1rem + env(safe-area-inset-bottom)) * 1.2);
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transform: translateY(100%);
  opacity: 0;
}

#fixed-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: block;
  padding: 16px 24px;
  background: var(--candy-red);
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.05em;
  overflow: hidden;
  /* 初期状態: 画面外に隠す */
  transform: translateY(100%);
  opacity: 0;
  /* safe area for notch devices */
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Golden border sweep (Bidirectional Ping-Pong) */
#fixed-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #BF953F 15%,
    #FBF5B7 50%,
    #B38728 85%,
    transparent 100%
  );
  animation: cta-gold-sweep 3s ease-in-out infinite alternate;
}

@keyframes cta-gold-sweep {
  0%   { left: -30%; opacity: 0.6; }
  50%  { opacity: 1; }
  100% { left: 70%; opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  #fixed-cta::before {
    animation: none;
    left: 0;
    width: 100%;
    opacity: 0.5;
  }
}

#fixed-cta:hover {
  background: #e84460;
}

#fixed-cta:focus-visible {
  outline: 3px solid var(--magic-violet);
  outline-offset: -3px;
}
