/* =========================================================
   fable-enhance.css  v20260702
   追加演出レイヤー：デンキAI / 電流スクロール / 実績カウント
   既存 style.css / next-hero.css の後に読み込む前提。
   ========================================================= */

/* --- intro-loader の h1 → p 置き換え分（見た目は従来どおり） --- */
.intro-loader__h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.intro-loader__h1 span {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(43, 216, 255, 0.42);
}

/* =========================================================
   1) ヒーロー：グラデーションメッシュ（次世代感の下地）
   ========================================================= */
.next-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(42% 55% at 18% 20%, rgba(43, 216, 255, 0.16), transparent 70%),
    radial-gradient(38% 48% at 84% 12%, rgba(90, 120, 255, 0.14), transparent 70%),
    radial-gradient(50% 60% at 70% 88%, rgba(255, 157, 46, 0.08), transparent 72%);
  animation: fable-mesh-drift 16s ease-in-out infinite alternate;
}

@keyframes fable-mesh-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.9; }
  to   { transform: translate3d(-2%, 1.5%, 0) scale(1.06); opacity: 1; }
}

/* =========================================================
   2) 電流スクロールライン（左端のプログレス）
   ========================================================= */
.scroll-current-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 3px;
  height: 100vh;
  z-index: 950;
  background: rgba(43, 216, 255, 0.08);
  pointer-events: none;
}

.scroll-current-line span {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #2bd8ff, #5a78ff 60%, #2bd8ff);
  box-shadow: 0 0 12px rgba(43, 216, 255, 0.75), 0 0 28px rgba(43, 216, 255, 0.35);
  position: relative;
}

.scroll-current-line span::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #d9f7ff;
  box-shadow: 0 0 10px #2bd8ff, 0 0 26px rgba(43, 216, 255, 0.9);
  animation: fable-spark 1.1s ease-in-out infinite;
}

@keyframes fable-spark {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.65; transform: translateX(-50%) scale(1.45); }
}

/* 見出しに電流アンダーライン（表示された時に走る） */
.section-head h2 {
  position: relative;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  height: 2px;
  width: 64px;
  background: linear-gradient(90deg, #2bd8ff, rgba(43, 216, 255, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms;
}

.section-head.is-visible h2::after,
.section-head h2.fable-underline-on::after {
  transform: scaleX(1);
}

/* =========================================================
   3) 実績カウントアップ・ダッシュボード
   ========================================================= */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 6px;
}

.stat-cell {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 16px;
  border: 1px solid rgba(43, 216, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(15, 35, 65, 0.92), rgba(10, 23, 48, 0.92));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.stat-cell::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #2bd8ff, rgba(43, 216, 255, 0.1));
}

.stat-cell.stat-denken {
  border-color: rgba(255, 157, 46, 0.5);
}

.stat-cell.stat-denken::before {
  background: linear-gradient(180deg, var(--orange), rgba(255, 157, 46, 0.1));
}

.stat-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-number {
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  font-weight: 900;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(43, 216, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

.stat-cell.stat-denken .stat-number {
  color: var(--orange);
  text-shadow: 0 0 18px rgba(255, 157, 46, 0.45);
}

.stat-cell.is-counted .stat-number {
  animation: fable-stat-pop 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fable-stat-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.stat-unit {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.stat-note {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--muted);
}

.stats-dashboard-note {
  margin: 8px 0 18px;
  font-size: 0.74rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .stats-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .stats-dashboard {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   4) AI進路ナビ「デンキAI」
   ========================================================= */
.denki-ai-inline-btn {
  cursor: pointer;
  border: 1px solid rgba(43, 216, 255, 0.55);
  background: linear-gradient(135deg, #0a3f8f, #0a78c8);
  box-shadow: 0 0 22px rgba(43, 216, 255, 0.28);
}

.denki-ai-launcher {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 940;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 64px;
  height: 64px;
  padding: 6px 4px;
  border: 1px solid rgba(43, 216, 255, 0.6);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(10, 40, 90, 0.96), rgba(7, 17, 38, 0.96));
  color: #d9f7ff;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4), 0 0 22px rgba(43, 216, 255, 0.3);
  animation: fable-launcher-glow 2.6s ease-in-out infinite;
}

@keyframes fable-launcher-glow {
  0%, 100% { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4), 0 0 16px rgba(43, 216, 255, 0.25); }
  50%      { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4), 0 0 30px rgba(43, 216, 255, 0.55); }
}

.denki-ai-launcher-bolt {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(43, 216, 255, 0.8));
}

.denki-ai-launcher-text {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.denki-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
}

.denki-ai-modal[hidden] {
  display: none;
}

.denki-ai-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 20, 0.55);
  backdrop-filter: blur(3px);
}

.denki-ai-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: min(640px, calc(100dvh - 32px));
  border: 1px solid rgba(43, 216, 255, 0.4);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(175deg, rgba(10, 23, 48, 0.98), rgba(5, 10, 24, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 40px rgba(43, 216, 255, 0.18);
  animation: fable-panel-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fable-panel-in {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.denki-ai-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(43, 216, 255, 0.22);
  background: linear-gradient(90deg, rgba(43, 216, 255, 0.1), transparent 70%);
}

.denki-ai-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.3rem;
  background: radial-gradient(circle at 35% 30%, #0a78c8, #071126 78%);
  border: 1px solid rgba(43, 216, 255, 0.6);
  box-shadow: 0 0 16px rgba(43, 216, 255, 0.4);
  animation: fable-spark 2.2s ease-in-out infinite;
}

.denki-ai-head-text h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.denki-ai-status {
  margin: 2px 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #7fe8b0;
}

.denki-ai-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #37e08a;
  box-shadow: 0 0 8px rgba(55, 224, 138, 0.9);
  animation: fable-spark 1.6s ease-in-out infinite;
}

.denki-ai-close {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.denki-ai-close:hover {
  color: var(--text);
  border-color: rgba(43, 216, 255, 0.5);
}

.denki-ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.denki-ai-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.denki-ai-msg--bot {
  align-self: flex-start;
  border: 1px solid rgba(43, 216, 255, 0.3);
  border-bottom-left-radius: 4px;
  background: rgba(15, 35, 65, 0.85);
  color: var(--text);
}

.denki-ai-msg--user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, #0a3f8f, #0a78c8);
  color: #eef9ff;
}

.denki-ai-msg--result {
  border-color: rgba(255, 157, 46, 0.55);
  box-shadow: 0 0 18px rgba(255, 157, 46, 0.18);
}

.denki-ai-msg--result strong {
  color: var(--orange);
}

.denki-ai-msg a {
  color: var(--cyan);
  font-weight: 700;
}

.denki-ai-typing {
  display: inline-flex;
  gap: 5px;
  padding: 12px 14px;
}

.denki-ai-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: fable-typing 1s ease-in-out infinite;
}

.denki-ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.denki-ai-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes fable-typing {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-4px); }
}

.denki-ai-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(43, 216, 255, 0.16);
  min-height: 54px;
}

.denki-ai-choice {
  padding: 9px 14px;
  border: 1px solid rgba(43, 216, 255, 0.45);
  border-radius: 999px;
  background: rgba(15, 35, 65, 0.8);
  color: #d9f7ff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.denki-ai-choice:hover {
  background: rgba(10, 120, 200, 0.5);
  box-shadow: 0 0 14px rgba(43, 216, 255, 0.4);
  transform: translateY(-1px);
}

.denki-ai-disclaimer {
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 0.64rem;
  line-height: 1.6;
  color: rgba(185, 199, 216, 0.75);
}

@media (max-width: 560px) {
  .denki-ai-modal {
    padding: 0;
    align-items: stretch;
  }

  .denki-ai-modal__panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .denki-ai-launcher {
    bottom: 84px;
  }
}

/* =========================================================
   4.5) 内定ハイライト：関西電力送配電 強調カード
   ========================================================= */
.career-highlight-grid article.career-star {
  position: relative;
  border: 1px solid rgba(255, 157, 46, 0.6);
  box-shadow: 0 0 22px rgba(255, 157, 46, 0.16), inset 0 0 30px rgba(255, 157, 46, 0.05);
  border-radius: 10px;
}

.career-star-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 157, 46, 0.55);
  background: rgba(255, 157, 46, 0.12);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(255, 157, 46, 0.5);
  animation: fable-career-glow 2.4s ease-in-out infinite;
}

@keyframes fable-career-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 157, 46, 0.25); }
  50%      { box-shadow: 0 0 16px rgba(255, 157, 46, 0.55); }
}

.career-star-num {
  font-size: 1.25em;
  font-weight: 900;
  color: var(--orange);
  text-shadow: 0 0 10px rgba(255, 157, 46, 0.5);
}

/* =========================================================
   5) reduced motion 配慮
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .next-hero::before,
  .scroll-current-line span::after,
  .denki-ai-launcher,
  .denki-ai-avatar,
  .denki-ai-status-dot,
  .stat-cell.is-counted .stat-number {
    animation: none;
  }

  .section-head h2::after {
    transition: none;
    transform: scaleX(1);
  }
}
