/* ============================================================
   BELLA TECH — Evolution Section
   index.html「自動化の3段階進化」セクション専用スタイル
   tokens.css の変数に依存。.rv → .vis 発火に乗る（main.js が制御）
   ============================================================ */

/* === Section header =========================================== */
.evolution-header {
  text-align: center;
  margin-bottom: 64px;
}
.evolution-section .section-eyebrow {
  display: block;
  text-align: center;
  margin: 0 auto 14px;
}
.evolution-section .sec-heading {
  text-align: center;
  margin-bottom: 20px;
}
.evolution-intro {
  max-width: 44ch;
  margin: 0 auto;
  color: var(--text);
  font-size: 16px;
  line-height: 2;
  font-weight: 500;
  text-align: center;
}

/* === Stages grid ============================================== */
.stages-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  max-width: 1040px;
  margin: 0 auto;
}
.stage-card {
  padding: 40px 24px;
  border-top: 0.5px solid var(--border);
  position: relative;
}
.stage-card:first-child { border-top: none; }

@media (min-width: 768px) {
  .stages-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stage-card {
    border-top: none;
    border-right: 0.5px solid var(--border);
  }
  .stage-card:last-child { border-right: none; }
}

.stage-num {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent-dark);
  margin-bottom: 14px;
  text-transform: uppercase;
  font-weight: 600;
}
.stage-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.stage-tag {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 28px;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.stage-svg-wrap {
  margin: 0 auto 28px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-svg-wrap svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}
.stage-desc {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  font-weight: 400;
  margin: 0;
}

/* バッジ「AI不使用」: 既存トーン（ベージュ+ダークゴールド）に寄せる */
.stage-note {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  background: rgba(196, 163, 90, 0.10);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
  vertical-align: middle;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: 1px solid rgba(196, 163, 90, 0.25);
  white-space: nowrap;
}

/* === SVG 初期状態（.vis が付くまで非表示の要素）=============== */
.stage-svg-wrap .gas-particle { opacity: 0; }
.stage-svg-wrap .b1,
.stage-svg-wrap .b2,
.stage-svg-wrap .b3,
.stage-svg-wrap .b4 {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  opacity: 0;
}
.stage-svg-wrap .t1,
.stage-svg-wrap .t2,
.stage-svg-wrap .t3,
.stage-svg-wrap .t4 { opacity: 0; }

/* === Keyframes ================================================ */
@keyframes evo-manual-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes evo-flow-particle {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(180px); opacity: 0; }
}
@keyframes evo-pulse-core {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@keyframes evo-branch-fire {
  0%, 10% { stroke-dashoffset: 80; opacity: 0; }
  20%, 60% { stroke-dashoffset: 0; opacity: 1; }
  75%, 100% { opacity: 0.15; }
}
@keyframes evo-tool-pop {
  0%, 10% { transform: scale(0.6); opacity: 0; }
  20%, 60% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(0.92); opacity: 0.25; }
}

/* === .stage-card.vis でアニメ発火（既存 rv→vis に同調）======= */
.stage-card.vis .manual-icon {
  animation: evo-manual-bob 2.4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.stage-card.vis .manual-icon:nth-of-type(2) { animation-delay: 0.4s; }
.stage-card.vis .manual-icon:nth-of-type(3) { animation-delay: 0.8s; }

.stage-card.vis .gas-particle { animation: evo-flow-particle 3.2s linear infinite; }
.stage-card.vis .gas-particle:nth-of-type(2) { animation-delay: 1.1s; }
.stage-card.vis .gas-particle:nth-of-type(3) { animation-delay: 2.2s; }

.stage-card.vis .llm-core {
  animation: evo-pulse-core 2.4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.stage-card.vis .b1 { animation: evo-branch-fire 4.4s ease-in-out infinite; }
.stage-card.vis .b2 { animation: evo-branch-fire 4.4s ease-in-out infinite 1.1s; }
.stage-card.vis .b3 { animation: evo-branch-fire 4.4s ease-in-out infinite 2.2s; }
.stage-card.vis .b4 { animation: evo-branch-fire 4.4s ease-in-out infinite 3.3s; }

.stage-card.vis .t1,
.stage-card.vis .t2,
.stage-card.vis .t3,
.stage-card.vis .t4 {
  transform-origin: center;
  transform-box: fill-box;
}
.stage-card.vis .t1 { animation: evo-tool-pop 4.4s ease-in-out infinite; }
.stage-card.vis .t2 { animation: evo-tool-pop 4.4s ease-in-out infinite 1.1s; }
.stage-card.vis .t3 { animation: evo-tool-pop 4.4s ease-in-out infinite 2.2s; }
.stage-card.vis .t4 { animation: evo-tool-pop 4.4s ease-in-out infinite 3.3s; }

/* === Philosophy block（締めメッセージ）======================= */
.philosophy-section {
  max-width: 720px;
  margin: 80px auto 0;
  padding: 56px 24px 0;
  text-align: center;
  border-top: 0.5px solid var(--border);
}
.philosophy-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
}
.philosophy-heading {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', 'Zen Kaku Gothic New', serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 32px;
  letter-spacing: -0.005em;
  line-height: 1.5;
  text-wrap: balance;
}
.philosophy-heading em {
  font-style: italic;
  color: var(--accent-dark);
  font-weight: 600;
}
.philosophy-body {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  text-align: left;
  margin: 0 auto 40px;
  max-width: 600px;
  font-weight: 400;
}
.philosophy-body p { margin: 0 0 20px; }
.philosophy-body p:last-child { margin: 0; }
.philosophy-body strong {
  color: var(--text);
  font-weight: 600;
}
.philosophy-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

/* LINE ボタンのホバー演出を白背景でも効くようにゴールド塗りに上書き
   （cta-btn-shine の base hover は薄ベージュで、白背景セクションでは効きが弱いため） */
.philosophy-cta .cta-btn-shine:hover {
  color: #fff;
  border-color: var(--accent);
}
.philosophy-cta .cta-btn-shine:hover::before {
  background: var(--accent);
}

/* === Reduced motion: アニメ無効、要素は表示状態にする ========= */
@media (prefers-reduced-motion: reduce) {
  .stage-card.vis .manual-icon,
  .stage-card.vis .gas-particle,
  .stage-card.vis .llm-core,
  .stage-card.vis .b1,
  .stage-card.vis .b2,
  .stage-card.vis .b3,
  .stage-card.vis .b4,
  .stage-card.vis .t1,
  .stage-card.vis .t2,
  .stage-card.vis .t3,
  .stage-card.vis .t4 {
    animation: none !important;
    transform: none !important;
  }
  .stage-svg-wrap .gas-particle { opacity: 1; }
  .stage-svg-wrap .b1,
  .stage-svg-wrap .b2,
  .stage-svg-wrap .b3,
  .stage-svg-wrap .b4 {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  .stage-svg-wrap .t1,
  .stage-svg-wrap .t2,
  .stage-svg-wrap .t3,
  .stage-svg-wrap .t4 { opacity: 1; }
}

/* === Mobile fine tune ========================================= */
@media (max-width: 768px) {
  .evolution-header { margin-bottom: 48px; }
  .evolution-intro { font-size: 15px; }
  .stage-card { padding: 36px 20px; }
  .stage-title { font-size: 22px; }
  .stage-tag { font-size: 13.5px; }
  .stage-desc { font-size: 14.5px; }
  .stage-svg-wrap { min-height: 200px; }
  .philosophy-section {
    margin-top: 56px;
    padding: 48px 16px 0;
  }
  .philosophy-body { font-size: 14.5px; }
  .philosophy-cta .cta-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}
