/* ==========================================================================
   Rooton Chiropractic — Luxury Architectural Vector Spine Scrollbar
   極限の洗練美・生体力学的S字カーブ × 25椎骨シャンパンゴールド整頓シフト
   ========================================================================== */

:root {
  /* 洗練されたジュエリー調のプロポーション（スリム＆エレガント） */
  --rt-spine-width: 36px;
  --rt-spine-height: 240px;
}

@media (min-width: 1024px) {
  :root {
    --rt-spine-width: 38px;
    --rt-spine-height: 256px;
  }
}

/* 固定スクロールバーコンテナ（画面右端）: ファーストビューでは非表示、スクロールで滑らかにフェードイン */
.rooton-scrollbar-container {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%) translateX(24px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  cursor: pointer;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s;
}

/* ファーストビュー（ヒーロー）通過後に表示 */
.rooton-scrollbar-container.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 1024px) {
  .rooton-scrollbar-container,
  .rooton-scrollbar-container.is-visible {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* 極細・洗練されたフロストガラスカプセル（上質なジュエリー調デザイン） */
.rooton-scrollbar-card {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(197, 160, 89, 0.32);
  box-shadow: 0 10px 32px rgba(15, 28, 20, 0.08), 0 1px 4px rgba(0, 0, 0, 0.02);
  border-radius: 9999px;
  padding: 11px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: visible;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.rooton-scrollbar-card:hover {
  border-color: rgba(197, 160, 89, 0.7);
  box-shadow: 0 14px 40px rgba(15, 28, 20, 0.12), 0 0 18px rgba(197, 160, 89, 0.25);
  background: rgba(255, 255, 255, 0.95);
}

/* 上部ラベル：洗練されたセリフ・タイポグラフィ */
.rooton-scrollbar-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--rt-font-en, "Cormorant Garamond", serif);
  font-size: 0.5625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8B6914;
  font-weight: 600;
  opacity: 0.95;
  line-height: 1;
}

/* 25椎骨SVGラッパー */
.rooton-scrollbar-spine-wrap {
  position: relative;
  width: var(--rt-spine-width);
  height: var(--rt-spine-height);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.rooton-scrollbar-pure-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 個々の椎骨ユニット（全25個） */
.rt-spine-bone-unit {
  transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1),
              filter 0.28s ease,
              opacity 0.28s ease;
  transform-origin: center center;
}

/* 1. デフォルト（未整頓）：静謐で洗練されたウォームパール調 */
.rt-bone-shape {
  fill: #ECE9E2;
  stroke: rgba(160, 150, 136, 0.45);
  stroke-width: 0.65;
  transition: all 0.35s ease;
}

.rt-disc-shape {
  stroke: rgba(160, 150, 136, 0.35);
  stroke-width: 0.5;
  stroke-linecap: round;
  transition: all 0.35s ease;
}

.rt-bone-wing {
  stroke: rgba(160, 150, 136, 0.4);
  stroke-width: 0.65;
  stroke-linecap: round;
  fill: none;
  transition: all 0.35s ease;
}

.rt-pelvis-wing {
  stroke: rgba(160, 150, 136, 0.32);
  stroke-width: 0.6;
  transition: all 0.35s ease;
}

.rt-sacrum-foramen {
  fill: rgba(160, 150, 136, 0.4);
  transition: all 0.35s ease;
}

/* 2. 整頓状態（スクロール通過で1骨ずつ点灯）：最高級シャンパンゴールド */
.rt-spine-bone-unit.is-aligned .rt-bone-shape {
  fill: url(#pure-bone-gold-grad);
  stroke: #C5A059;
  stroke-width: 0.75;
  filter: drop-shadow(0 1px 2.5px rgba(197, 160, 89, 0.4));
}

.rt-spine-bone-unit.is-aligned .rt-disc-shape {
  stroke: #D4AF37;
  stroke-width: 0.65;
}

.rt-spine-bone-unit.is-aligned .rt-bone-wing {
  stroke: #C5A059;
  stroke-width: 0.75;
}

.rt-spine-bone-unit.is-aligned .rt-pelvis-wing {
  stroke: #C5A059;
  opacity: 0.75;
}

.rt-spine-bone-unit.is-aligned .rt-sacrum-foramen {
  fill: #FFF5DD;
}

/* 3. 現在整復中の骨（Focus）の繊細なマイクロスケール＆光彩 */
.rt-spine-bone-unit.is-current {
  transform: scale(1.12);
}

.rt-spine-bone-unit.is-current .rt-bone-shape {
  stroke: #FFF2CE;
  stroke-width: 1.05;
  filter: drop-shadow(0 0 5px rgba(229, 195, 120, 0.9));
}

.rt-spine-bone-unit.is-current .rt-bone-wing {
  stroke: #FFF2CE;
  stroke-width: 0.9;
}

/* スクロール進捗パーセント */
.rooton-scrollbar-percent {
  font-family: var(--rt-font-sans, "Noto Sans JP", sans-serif);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--rt-dark, #1E1E1E);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* 100%整頓完了時の調和パルス */
.rooton-scrollbar-card.is-complete {
  border-color: #C5A059;
  box-shadow: 0 0 22px rgba(197, 160, 89, 0.45), 0 8px 32px rgba(15, 28, 20, 0.12);
  animation: spineHarmonizeGlow 2.5s ease-in-out infinite;
}

@keyframes spineHarmonizeGlow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(197, 160, 89, 0.3);
  }
  50% {
    box-shadow: 0 0 28px rgba(197, 160, 89, 0.6);
  }
}

/* ホバー時の部位名ツールチップ */
.rooton-scrollbar-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #0F1C14;
  color: #FAF9F5;
  font-family: var(--rt-font-sans, "Noto Sans JP", sans-serif);
  font-size: 0.6875rem;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  border: 1px solid rgba(197, 160, 89, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.rooton-scrollbar-card:hover .rooton-scrollbar-tooltip {
  opacity: 1;
}

/* 頭部・後頭骨ベース（誰が見ても背骨と直感できるランドマーク） */
.rt-spine-skull-base path {
  fill: #ECE9E2;
  stroke: rgba(160, 150, 136, 0.5);
  stroke-width: 0.75;
  transition: all 0.35s ease;
}

.rooton-scrollbar-card.is-complete .rt-spine-skull-base path {
  fill: #FFF9ED;
  stroke: #C5A059;
}
