/* ==========================================================================
   Liverey — Torch Star Map（灯を掲げる 星図ハブ）
   トップページ専用。自由の女神の松明 × オリーブの炎 × 星図ナビ
   ========================================================================== */

:root {
  --hub-gold: #d3a94e;
  --hub-gold-lt: #fff3d0;
  --hub-olive: #7c9b52;
  --hub-night: #0a0e16;
}

/* 背景を夜空に（既存の動画の上にグラデを重ねて深みを出す） */
.hub-page {
  background: radial-gradient(circle at 50% 38%, #16202f 0%, #090c13 60%, #05070c 100%);
}

.hub {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.hub__stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* --- つなぐ光の枝（JSが線を描画） --- */
.hub__connectors {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* --- 中央：松明（自由の女神の灯） --- */
.hub__core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  text-align: center;
  width: min(40vw, 260px);
}
.hub__flame {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  pointer-events: none;
  /* 進行度 0..1 を JS が --hub-progress に設定 → 炎が育つ */
  --hub-progress: 0;
  opacity: calc(0.35 + 0.65 * var(--hub-progress));
  transform: scale(calc(0.7 + 0.5 * var(--hub-progress)));
  background: radial-gradient(circle at 50% 45%,
      rgba(255, 236, 190, 0.85) 0%,
      rgba(211, 169, 78, 0.5) 26%,
      rgba(124, 155, 82, 0.22) 46%,
      rgba(211, 169, 78, 0) 68%);
  animation: hubFlicker 4s ease-in-out infinite;
  transition: opacity 1.2s ease, transform 1.2s ease;
}
@keyframes hubFlicker {
  0%, 100% { filter: brightness(1);    }
  45%      { filter: brightness(1.18); }
  70%      { filter: brightness(.92);  }
}
.hub__torch {
  position: relative;
  width: min(26vw, 132px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(211, 169, 78, 0.55));
}
.hub__title {
  margin-top: 14px;
  font-family: 'ITC', 'Times New Roman', serif;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: .28em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}
.hub__tagline {
  margin-top: 8px;
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: .18em;
  color: rgba(255, 255, 255, 0.68);
}

/* --- ノード（行き先の星 / 情報のオリーブ葉） --- */
.hub-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.hub-node__star {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7e0, var(--hub-gold));
  box-shadow: 0 0 10px 2px rgba(211, 169, 78, 0.6);
  transition: transform .35s ease, box-shadow .35s ease;
}
.hub-node__star::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform .35s ease, opacity .35s ease;
  opacity: .5;
}
.hub-node__label {
  font-family: 'ITC', 'Times New Roman', serif;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
  opacity: .7;
  transition: opacity .35s ease, letter-spacing .35s ease;
  white-space: nowrap;
}
.hub-node__sub {
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, 0.5);
}
.hub-node:hover .hub-node__star,
.hub-node:focus-visible .hub-node__star {
  transform: scale(1.5);
  box-shadow: 0 0 20px 5px rgba(211, 169, 78, 0.9);
}
.hub-node:hover .hub-node__star::after,
.hub-node:focus-visible .hub-node__star::after {
  transform: scale(1.6);
  opacity: 1;
}
.hub-node:hover .hub-node__label,
.hub-node:focus-visible .hub-node__label {
  opacity: 1;
  letter-spacing: .3em;
}
.hub-node:focus-visible { outline: none; }

/* 情報ノード（オリーブ葉）は少し小さく、緑みを帯びる */
.hub-node--info .hub-node__star {
  width: 12px; height: 12px;
  background: radial-gradient(circle, #eaf3d8, var(--hub-olive));
  box-shadow: 0 0 8px 2px rgba(124, 155, 82, 0.55);
}
.hub-node--info .hub-node__label { font-size: 11px; color: rgba(233, 243, 216, 0.8); }

/* すでに点灯済みの行き先（フェーズが灯っている）は強く光る */
.hub-node.is-lit .hub-node__star {
  box-shadow: 0 0 18px 5px rgba(211, 169, 78, 0.95);
}
.hub-node.is-lit .hub-node__label { opacity: 1; }

/* --- 操作ヒント --- */
.hub__hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  animation: hubHint 3s ease-in-out infinite;
}
@keyframes hubHint { 0%,100% { opacity: .4; } 50% { opacity: .9; } }

/* ==========================================================================
   パネル（情報を開く）
   ========================================================================== */
.hub-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(5, 7, 12, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.hub-panel-backdrop.is-open { opacity: 1; pointer-events: auto; }

.hub-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10002;
  width: min(92vw, 720px);
  max-height: 84vh;
  overflow-y: auto;
  transform: translate(-50%, -46%);
  padding: 46px 48px 40px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(22, 28, 40, 0.96), rgba(10, 14, 22, 0.96));
  border: 1px solid rgba(211, 169, 78, 0.28);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.hub-panel.is-open { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }

.hub-panel__eyebrow {
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--hub-gold);
}
.hub-panel__title {
  margin: 8px 0 6px;
  font-family: 'ITC', 'Times New Roman', serif;
  font-size: clamp(24px, 4.6vw, 38px);
  letter-spacing: .06em;
}
.hub-panel__title::after {
  content: "";
  display: block;
  width: 54px; height: 2px; margin-top: 16px;
  background: linear-gradient(90deg, var(--hub-gold), rgba(211,169,78,0));
}
.hub-panel__body { margin-top: 26px; line-height: 1.95; letter-spacing: .04em; }
.hub-panel__body p { margin: 0 0 18px; font-size: 15px; color: rgba(255,255,255,0.9); }
.hub-panel__lead {
  font-size: 19px !important;
  font-weight: 700;
  line-height: 1.7 !important;
  color: #fff !important;
}

/* SERVICE パネル内の事業リスト */
.hub-serv { display: flex; flex-direction: column; gap: 22px; }
.hub-serv__item { border-left: 2px solid rgba(211,169,78,0.5); padding-left: 18px; }
.hub-serv__tag {
  font-family: 'ITC', serif; font-style: italic; font-size: 14px;
  letter-spacing: .1em; color: var(--hub-gold);
}
.hub-serv__name { margin: 4px 0 6px; font-size: 17px; font-weight: 700; }
.hub-serv__desc { font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.8; }

/* COMPANY パネル内の定義リスト */
.hub-info dl {
  display: flex; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 16px 0; margin: 0;
}
.hub-info dl:last-child { border-bottom: 1px solid rgba(255,255,255,0.12); }
.hub-info dt {
  flex: 0 0 40%; font-size: 11px; letter-spacing: .2em;
  color: rgba(255,255,255,0.5); font-style: italic;
}
.hub-info dd { flex: 1; margin: 0; font-size: 16px; letter-spacing: .06em; }

.hub-panel__cta {
  display: inline-block; margin-top: 12px; padding: 12px 30px;
  font-size: 13px; letter-spacing: .16em; color: #fff;
  border: 1px solid rgba(255,255,255,0.55); border-radius: 4px;
  text-decoration: none; cursor: pointer; transition: .25s;
}
.hub-panel__cta:hover { background: #fff; color: #111; }

.hub-panel__close {
  position: absolute; top: 16px; right: 18px;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 20px;
  cursor: pointer; transition: background .25s ease;
}
.hub-panel__close:hover { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   スマホ：星を縦に並べる
   ========================================================================== */
@media (max-width: 720px) {
  .hub { min-height: auto; padding: 90px 0 60px; }
  .hub__stage { position: relative; inset: auto; display: flex; flex-direction: column; align-items: center; gap: 30px; }
  .hub__connectors { display: none; }
  .hub__core { position: relative; left: auto; top: auto; transform: none; margin-bottom: 20px; width: auto; }
  .hub__flame { top: 30%; }
  .hub-node { position: relative !important; left: auto !important; top: auto !important; transform: none; flex-direction: row; gap: 14px; }
  .hub-node__label { opacity: 1; font-size: 14px; }
  .hub__hint { position: relative; left: auto; bottom: auto; transform: none; margin-top: 30px; }
  .hub-panel { padding: 40px 24px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub__flame { animation: none; }
  .hub__hint { animation: none; }
}
