/* ---- 5. ヒーロー(流れるライン) ------------------------------------------ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* 細いライン:点線がゆっくり流れ続ける */
.hf-base {
  fill: none;
  stroke: #e2e0d9;
  stroke-width: 1.5;
  stroke-dasharray: 2 13;
  animation: hf-drift 30s linear infinite;
}
@keyframes hf-drift { to { stroke-dashoffset: -300; } }
/* オレンジの光点:一本の区間が線上をゆっくり移動する */
.hf-orange {
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.5;
  stroke-dasharray: 64 2200;
  animation: hf-travel 11s linear infinite;
}
@keyframes hf-travel { to { stroke-dashoffset: -2264; } }
/* 分断された作業の断片:小さな刻みが、ゆっくり漂う */
.hf-node { fill: #c9c7bf; }
.hf-node--o { fill: var(--orange); }
.hf-frag { animation: hf-float 7s ease-in-out infinite alternate; }
.hf-frag--2 { animation-duration: 9s; animation-delay: -3s; }
.hf-frag--3 { animation-duration: 11s; animation-delay: -5s; }
@keyframes hf-float { from { transform: translateY(-5px); } to { transform: translateY(5px); } }

.hero-inner { position: relative; width: min(920px, 100% - 48px); margin-inline: auto; }
.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  color: var(--sub);
  margin-bottom: 30px;
}
.hero-title {
  font-size: clamp(2.1rem, 8.5vw, 5.4rem);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.22;
}
.hero-lead {
  margin-top: 30px;
  color: var(--sub);
  font-size: 15px;
  max-width: 30em;
}
.hero-actions { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-scroll::after {
  content: "";
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--ink) 60%, transparent);
  animation: scroll-hint 2.2s var(--ease) infinite;
}
@keyframes scroll-hint {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---- 6. 分断 → 接続 ------------------------------------------------------ */
.section { padding-block: clamp(88px, 13vw, 150px); }
.section--paper { background: var(--paper); }

.split { text-align: center; }
.split-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 900; }
.split-lead { margin-top: 14px; color: var(--sub); font-size: 14.5px; }

/* バラバラだった線分が、視界に入ると静かに一本に揃う */
.frag {
  --fragment-color: #c9c7bf;
  --fragment-thickness: 3px;
  position: relative;
  width: min(320px, 80%);
  margin: clamp(36px, 6vw, 56px) auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}
/* 星の飛行はセクション内でクリップ。画面横方向のはみ出しを防止。 */
.split { overflow: hidden; }
.frag::before {
  content: "";
  position: absolute;
  inset: calc(50% - var(--fragment-thickness) / 2) 0 auto;
  height: var(--fragment-thickness);
  background: var(--fragment-color);
  transform: scaleX(var(--connection-progress, 0));
  transform-origin: left;
}
.frag > i {
  display: block;
  flex-shrink: 0;
  width: 34px;
  height: var(--fragment-thickness);
  background: var(--fragment-color);
  transform-origin: center;
}
.frag > i:nth-child(1) { transform: translate(-8px, -14px) rotate(-8deg); }
.frag > i:nth-child(2) { transform: translate(4px, 12px) rotate(5deg); }
.frag > i:nth-child(3) { transform: translate(-6px, 10px) rotate(-4deg); }
.frag > i:nth-child(4) { transform: translate(10px, -12px) rotate(9deg); }
.frag > i:nth-child(5) { transform: translate(-4px, 6px) rotate(-3deg); }
.frag-star {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 0;
  top: 0;
  fill: var(--orange);
  opacity: 0;
  transform-origin: center;
  pointer-events: none;
}
/* 動きを減らす設定では飛行・ループなしの整った完成形にする。 */
@media (prefers-reduced-motion: reduce) {
  .frag > i { transform: none !important; }
  .frag::before { transform: scaleX(1); }
}
.frag-caption {
  margin-top: 22px;
  font-size: 13px;
  color: var(--sub);
  letter-spacing: .06em;
}

/* 業種:触ると流れが反応する */
.fields {
  margin-top: clamp(40px, 7vw, 64px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}
.field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--sub);
  background: var(--white);
  cursor: default;
  transition: color .3s, border-color .3s;
}
.field::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
  transition: background .3s, transform .3s;
}
.field:hover, .field:focus-visible { color: var(--ink); border-color: var(--ink); }
.field:hover::before, .field:focus-visible::before { background: var(--orange); transform: scale(1.5); }

/* ---- 7. 仕事の流れ(スクロール描画レール) -------------------------------- */
.flow { background: var(--white); }
.flow-head { margin-bottom: clamp(48px, 8vw, 80px); }
.flow-title { font-size: clamp(1.6rem, 3.8vw, 2.3rem); font-weight: 900; }

.rail-wrap { position: relative; max-width: 640px; margin-inline: auto; }
.rail {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 7px;
  width: 2px;
  background: var(--ink);
}
.rail-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform: none;
}
/* 選択段階までの線を、黒いベースに重ねてオレンジへ。 */
.rail-orange {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 1.1s var(--ease), opacity 1.1s ease;
}
.rail-orange i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--orange);
}

/* 最下端の星。外側は出現・飛行、内側SVGは回転と光を担当。 */
.flow-star {
  position: absolute;
  left: -9px;
  top: calc(100% - 10px);
  width: 20px;
  height: 20px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: scale(.35);
}
.flow-star.is-visible { animation: flow-star-appear .9s ease-out both; }
.flow-star svg { fill: var(--orange); }
.flow-star.is-visible svg {
  animation: flow-star-glow 2.8s ease-in-out infinite;
}
@keyframes flow-star-appear {
  from { opacity: 0; transform: scale(.35); }
  to { opacity: 1; transform: scale(1); }
}
.flow-star.is-flying { animation: none; opacity: 1; transform: none; z-index: 110; }
.work-impact { display: inline-block; transform-origin: center bottom; }
.work-impact.is-hit { animation: work-impact-bounce .65s ease-out; }
@keyframes work-impact-bounce {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.22); }
  65% { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  .work-impact.is-hit { animation: none; }
}
@keyframes flow-star-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(235,94,40,.25)); }
  50% { filter: drop-shadow(0 0 7px rgba(235,94,40,.65)); }
}
@media (prefers-reduced-motion: reduce) {
  .flow-star.is-visible { animation: none; opacity: 1; transform: none; }
  .flow-star.is-visible svg { animation: none; }
}
.stages { position: relative; }
.stage {
  position: relative;
  padding: clamp(30px, 5vw, 44px) 0 clamp(30px, 5vw, 44px) 56px;
}
.stage + .stage { border-top: 1px solid transparent; }
.stage-dot {
  position: absolute;
  left: 2px;
  top: calc(clamp(30px, 5vw, 44px) + .35em);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--ink);
  transition: background 1.1s ease, border-color 1.1s ease;
}
.stage-num {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .2em;
  color: #f0f0ef;
  display: block;
  margin-bottom: 4px;
  transition: color 1.2s ease;
}
.stage h3 {
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
  font-weight: 900;
  color: #f0f0ef;
  transition: color 1.2s ease;
}
.stage p { margin-top: 6px; font-size: 14px; color: #f0f0ef; max-width: 34em; transition: color 1.2s ease; }
.stage { cursor: pointer; touch-action: pan-y; }
.stage:focus-visible { outline: 1px solid var(--orange); outline-offset: 5px; }
.stage.is-on h3, .stage.is-on p, .stage.is-on .stage-num { color: var(--ink); }
/* 到達した各ノードに、既存の静かな光の脈動を適用。 */
.stage.is-on .stage-dot {
  background: var(--orange);
  border-color: var(--orange);
  animation: dot-pulse 2.8s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(235, 94, 40, .28); }
  50% { box-shadow: 0 0 0 9px rgba(235, 94, 40, 0); }
}

/* ---- 8. 支援の形・実績 --------------------------------------------------- */
.work-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 900; margin-bottom: clamp(36px, 6vw, 56px); }
.work-list { border-top: 1px solid var(--line); }
.work-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.work-num { font-size: 12px; font-weight: 900; letter-spacing: .18em; color: var(--orange); }
/* 短い光の区間だけが罫線を通過。文字・行の位置は動かさない。 */
.work-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  background-image: linear-gradient(90deg, transparent, var(--orange) 35%, var(--orange) 65%, transparent);
  background-size: 80px 1px;
  background-repeat: no-repeat;
  background-position: -80px 0;
}
.work-item.is-flowing::after { animation: work-line-pass 2.8s ease-in-out both; }
.work-item.is-flowing .work-num { animation: work-number-breathe 2.8s ease-in-out both; }
@keyframes work-line-pass {
  0% { opacity: 0; background-position: -80px 0; }
  12% { opacity: .9; }
  85% { opacity: .9; }
  100% { opacity: 0; background-position: calc(100% + 80px) 0; }
}
@keyframes work-number-breathe {
  0%, 100% { filter: brightness(1); text-shadow: none; }
  45% { filter: brightness(1.15); text-shadow: 0 0 6px rgba(235,94,40,.22); }
}
@media (prefers-reduced-motion: reduce) {
  .work-item.is-flowing::after, .work-item.is-flowing .work-num { animation: none; }
}
.work-item h3 { font-size: 16.5px; font-weight: 700; }
.work-item p { margin-top: 4px; font-size: 13.5px; color: var(--sub); }
@media (min-width: 720px) {
  .work-item { grid-template-columns: 56px 1fr 1fr; gap: 28px; }
}

/* ---- 9. 思想 ------------------------------------------------------------ */
.idea { text-align: center; }
.idea-quote {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .1em;
  line-height: 1.9;
}
.idea-sub { margin-top: 26px; color: var(--sub); font-size: 14px; }
/* 思想:3秒の余韻の後、2行が順に定まる。
   色の毎フレーム再描画ではなくopacity/transformで滑らかに表現。
   JSなしでは通常の完成形を表示。 */
.idea-line { display: inline-block; color: var(--ink); }
.idea.is-armed:not(.is-settled) .idea-line { opacity: .32; }
.idea.is-armed:not(.is-settled) .idea-line--change { transform: translate3d(0, 24px, 0); }
.idea.is-armed:not(.is-settled) .idea-line--remain { transform: translate3d(0, 14px, 0); }
.idea.is-armed:not(.is-settled) .idea-period { opacity: .25; }
.idea.is-armed .idea-line { will-change: transform, opacity; }
.idea.is-settled .idea-line--change {
  animation: idea-change-settle 2s cubic-bezier(.25, .46, .45, .94) both;
}
.idea.is-settled .idea-line--remain {
  animation: idea-remain-settle 2.2s cubic-bezier(.25, .46, .45, .94) .55s both;
}
.idea.is-settled .idea-period { animation: idea-period-light 1.2s ease 2.1s both; }
@keyframes idea-change-settle {
  from { opacity: .32; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes idea-remain-settle {
  from { opacity: .32; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes idea-period-light {
  from { opacity: .25; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .idea.is-settled .idea-line, .idea.is-settled .idea-period { animation: none; }
  .idea.is-armed .idea-line { opacity: 1; transform: none; will-change: auto; }
  .idea.is-armed .idea-period { opacity: 1; }
}

/* ---- 11. レスポンシブ / アクセシビリティ --------------------------------- */
@media (max-width: 860px) {
  .gnav-list { display: none; }
  .header-cta { padding: 8px 16px; }
  .hero-lead { font-size: 14px; }
}
@media (max-width: 719px) {
  .work-item { grid-template-columns: 40px 1fr; gap: 6px 16px; }
  .work-item > p:last-child { grid-column: 2; font-size: 12px; }
  .stage { padding-left: 44px; }
  .rail { left: 5px; }
  .stage-dot { left: 0; width: 11px; height: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hf-base, .hf-orange, .hf-frag, .hero-scroll::after, .stage--ai.is-on .stage-dot { animation: none; }
  .frag i, .frag::before { transition: none; }
  .rail-orange, .stage-dot, .stage-num, .stage h3, .stage p { transition: none; }
  .stage.is-on .stage-dot { animation: none; }
}
@media print {
  .site-header, .hero-scroll, .cta { display: none; }
}
