.flow__grid { display: grid; gap: 40px; --flow-gap: clamp(40px, 6vw, 104px); }
.flow__media { display: none; }
.flow__list { position: relative; padding-left: 48px; max-width: 760px; }

.flow__line { display: none; position: absolute; left: 11px; top: 14px; width: 2px; height: calc(100% - 28px); overflow: visible; }
.flow__track { stroke: var(--line-2); stroke-width: 2; }
.flow__draw { stroke: var(--accent); stroke-width: 2; }
.flow__tip { display: none; }
.step { position: relative; padding-bottom: 64px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ""; position: absolute; left: -37px; top: 15px; bottom: -15px; width: 2px; background: var(--accent); }
.step__node { position: absolute; left: -48px; top: 3px; display: grid; place-items: center; width: 24px; height: 24px; }
.step__node::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease);
}
.step__node::after { content: ""; position: absolute; left: 24px; top: 11px; width: 14px; height: 2px; background: var(--line-2); transition: background-color .4s var(--ease); }
.step--last .step__node::after { background: var(--accent); }

.step__fig { position: relative; margin-bottom: 20px; }
.step__ph { position: relative; overflow: hidden; border-radius: var(--r2); background: #0E1320; }
.step__ph > img { width: 100%; }
.step__cap, .flow__cap { margin-top: 8px; color: var(--text-3); font-size: 12px; line-height: 1.6; letter-spacing: .04em; }
html[lang="en"] .step__cap, html[lang="en"] .flow__cap { letter-spacing: .02em; }

.step__no {
  display: block; margin-bottom: 6px;
  color: var(--accent); font-family: var(--ff-en); font-size: 14px; font-weight: 600; letter-spacing: .16em; line-height: 1;
}
.step__title { font-size: clamp(24px, 2.4vw, 40px); font-weight: 900; line-height: 1.35; }
html[lang="en"] .step__title { font-family: var(--ff-en); font-weight: 800; text-transform: uppercase; }
.step__text { margin-top: 8px; max-width: 32em; color: var(--text-2); }
.step__tbd { margin-top: 6px; font-size: 13px; line-height: 1.6; }
.step__tbd mark.tbd { margin-inline: 0; font-size: 12px; }
.step__wire { display: none; }

.step__board { margin-top: 22px; }
.step__board .step__fig { margin-bottom: 0; }
.flow__panel { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #0E1320; }
.flow__k { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flow__k:not(.flow__k--last) { display: none; }
html.fx .flow__k { display: block; will-change: opacity; }
.flow__hl { display: none; }
html.fx .flow__hl {
  display: block; position: absolute; z-index: 1; pointer-events: none;
  border: 1.5px solid rgba(255, 255, 255, .92); border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(11, 15, 22, .45), 0 0 16px rgba(255, 255, 255, .22);
  opacity: 0; transform: scale(1.08);
  transition: opacity .4s var(--ease), transform .55s var(--ease-out);
}
.flow__hl--main { left: 45.7%; top: 14.4%; width: 4.7%; height: 6.8%; }
.flow__hl--br { left: 41.2%; top: 25%; width: 14%; height: 48%; }
html.fx .flow__panel[data-state="1"] .flow__hl--main,
html.fx .flow__panel[data-state="2"] .flow__hl--br { opacity: 1; transform: none; }
.flow__state {
  position: absolute; z-index: 2; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 9px; border-radius: 3px;
  background: rgba(11, 15, 22, .8);
  color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: .06em; line-height: 1.6; white-space: nowrap;
}
html[lang="en"] .flow__state { font-family: var(--ff-en); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.flow__bars { display: inline-flex; gap: 3px; }
.flow__bars i { width: 10px; height: 3px; border-radius: 1px; background: var(--dim); transition: background-color .3s var(--ease); }
.flow__st { display: none; }
.flow__panel[data-state="0"] .flow__st:nth-child(1),
.flow__panel[data-state="1"] .flow__st:nth-child(2),
.flow__panel[data-state="2"] .flow__st:nth-child(3),
.flow__panel[data-state="3"] .flow__st:nth-child(4) { display: inline; }
.flow__panel[data-state="0"] .flow__bars i:nth-child(-n+1),
.flow__panel[data-state="1"] .flow__bars i:nth-child(-n+2),
.flow__panel[data-state="2"] .flow__bars i:nth-child(-n+3),
.flow__panel[data-state="3"] .flow__bars i { background: var(--accent); }
.flow__prop {
  padding: 0 5px; border: 1px dashed var(--tbd-line); border-radius: 3px;
  background: var(--tbd-bg); color: var(--tbd-text);
  font-family: var(--ff-ja); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.5; text-transform: none;
}

.step__checks {
  display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, max-content);
  gap: 8px 28px; margin-top: 18px;
}
.step__check {
  display: flex; align-items: flex-start; gap: 9px;
  color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.55; letter-spacing: .02em;
  transition: color .35s var(--ease);
}
html[lang="en"] .step__checks { grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; }
.step__checks { counter-reset: flowchk; }
.step__check { counter-increment: flowchk; }
.step__checktxt::before {
  content: counter(flowchk); margin-right: .55em;
  color: var(--text-3); font-family: var(--ff-en); font-size: .95em; font-weight: 600;
}
.step__check mark.tbd { font-size: 11px; margin-inline: .3em 0; }
.step__tick {
  flex: none; position: relative; width: 16px; height: 16px; margin-top: .22em; border-radius: 3px;
  background: var(--accent);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.step__tick::after {
  content: ""; position: absolute; left: 5px; top: 1.5px; width: 6px; height: 10px;
  border: solid var(--ink); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(1); transform-origin: 60% 60%;
  transition: transform .3s var(--ease-out), opacity .2s var(--ease);
}

@media (min-width: 1101px), (min-width: 861px) and (min-aspect-ratio: 3001/4000) {
  html:not(.fx) .flow__list { max-width: 1240px; }
  html:not(.fx) .step:not(.step--last),
  html:not(.fx) .step__pin {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    column-gap: clamp(32px, 4vw, 72px); align-items: start;
  }
  html:not(.fx) .step { padding-bottom: 72px; }
  html:not(.fx) .step:last-child { padding-bottom: 0; }
  html:not(.fx) .step__fig { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
  html:not(.fx) .step__head { grid-column: 2; grid-row: 1; }
  html:not(.fx) .step__board { display: contents; }
  html:not(.fx) .step__checks { grid-column: 2; grid-row: 2; align-self: start; }
  html:not(.fx) .step__text { font-size: var(--fs-lead); }
}

html.fx .flow.is-armed { padding-bottom: calc(var(--sec) + var(--flow-after, 0px)); }
html.fx .flow.is-armed .step::before { display: none; }
html.fx .flow.is-armed .flow__line { display: block; }
html.fx .flow.is-armed .flow__draw { stroke-dasharray: 1 1; }
html.fx .flow.is-armed .step:not(.is-on) .step__node::before { background: var(--bg); box-shadow: 0 0 0 5px var(--bg), inset 0 0 0 2px var(--line-2); }
html.fx .flow.is-armed .step.is-on .step__node::before { box-shadow: 0 0 0 5px var(--bg), 0 0 14px 4px rgba(255, 208, 52, .45); }
html.fx .flow.is-armed .step__no { transition: color .4s var(--ease); }
html.fx .flow.is-armed .step:not(.is-on) .step__no { color: var(--text-3); }
html.fx .flow.is-armed .flow__tip {
  display: block; position: absolute; z-index: 1; left: 12px; top: 0; width: 0; height: 0;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
html.fx .flow.is-armed .flow__tip::before {
  content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: #FFF6D6;
  box-shadow: 0 0 10px 3px rgba(255, 208, 52, .7), 0 0 26px 8px rgba(255, 208, 52, .22);
}
html.fx .flow.is-armed.is-running:not(.is-last) .flow__tip { opacity: 1; }
html.fx .flow.is-armed .step__check:not(.is-on) { color: var(--text-3); }
html.fx .flow.is-armed .step__check:not(.is-on) .step__tick { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
html.fx .flow.is-armed .step__check:not(.is-on) .step__tick::after { opacity: 0; transform: rotate(45deg) scale(.4); }
html.fx .flow.is-armed .step__check.is-on .step__tick { box-shadow: 0 0 12px 1px rgba(255, 208, 52, .35); }
html.fx .flow .flow__stack, html.fx .flow .step__fig--panel .step__ph { transition: box-shadow .5s var(--ease); }
html.fx .flow.is-wired .flow__stack,
html.fx .flow.is-wired .step__fig--panel .step__ph { box-shadow: 0 0 0 1px rgba(255, 208, 52, .7), 0 0 36px rgba(255, 208, 52, .16); }
html.fx .flow.is-armed:not(.is-wired) .step--last .step__node::after { background: var(--line-2); }
html.fx .step--last { --flow-travel: 64vh; }
@supports (height: 1svh) { html.fx .step--last { --flow-travel: 64svh; } }

@media (min-width: 1101px), (min-width: 861px) and (min-aspect-ratio: 3001/4000) {
  html.fx .flow__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--flow-gap); align-items: stretch; }
  html.fx .flow__media { display: block; position: relative; z-index: 1; }
  html.fx .flow__sticky { position: sticky; top: var(--flow-top, max(calc(var(--hdr-h) + 24px), calc(50vh - 22vw))); }
  html.fx .flow__frame { position: relative; will-change: transform; }
  html.fx .flow__stack { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--r2); background: #0E1320; }
  html.fx .flow__imgs { position: absolute; inset: 0; isolation: isolate; }
  html.fx .flow__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  html.fx .flow__img--panel .flow__panel { position: absolute; inset: 0; aspect-ratio: auto; }
  html.fx .flow__state { left: 16px; bottom: 16px; font-size: 13px; }
  html.fx .flow__frame > .kari { opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
  html.fx .flow__frame.is-kari > .kari { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
  html.fx .flow__cap { margin-top: 12px; }
  html.fx .flow__term {
    position: absolute; z-index: 3; right: -5px; top: var(--flow-term-y, 50%); width: 10px; height: 10px; margin-top: -5px;
    border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 3px var(--bg), 0 0 12px 3px rgba(255, 208, 52, .5);
    opacity: 0; transform: scale(.4); transition: opacity .3s var(--ease), transform .4s var(--ease-out);
  }
  html.fx .flow.is-wired .flow__term { opacity: 1; transform: none; }
  html.fx .step__fig { display: none; }
  html.fx .step { display: flex; flex-direction: column; justify-content: center; min-height: 36vh; min-height: 36svh; padding-bottom: 0; }
  html.fx .step__text { font-size: var(--fs-lead); }
  html.fx .step__node { top: calc(50% - 12px); }
  html.fx .step__board { margin-top: 0; }
  html.fx .flow__list { padding-block: 10vh 0; }
  html.fx .flow__line { top: calc(10vh + 18svh); height: calc(100% - 20vh - 36svh); }
  html.fx .step--last { display: block; min-height: calc(var(--flow-pin-h, 36vh) + var(--flow-travel)); }
  html.fx .step--last .step__pin {
    position: sticky; top: var(--flow-pin-top, 32vh);
    display: flex; flex-direction: column; justify-content: center; min-height: 36vh; min-height: 36svh;
  }
  html.fx .step__wire {
    display: block; position: absolute; right: calc(100% + 36px); top: calc(50% - 1px);
    width: calc(var(--flow-gap) + 28px); height: 2px;
    background: var(--accent); box-shadow: 0 0 10px rgba(255, 208, 52, .45);
    transform: scaleX(0); transform-origin: 100% 50%;
  }
}
@media (max-width: 860px), (max-width: 1100px) and (max-aspect-ratio: 3/4) {
  .step__checks { gap: 6px 14px; margin-top: 14px; }
  .step__check { font-size: 12.5px; letter-spacing: 0; gap: 7px; }
  .step__tick { width: 14px; height: 14px; }
  .step__tick::after { left: 4.5px; top: 1.5px; width: 5px; height: 8.5px; }
  .step__board { margin-top: 18px; }
}
@media (max-width: 400px) {
  .step__checks { grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; }
}
@media (max-width: 860px), (max-width: 1100px) and (max-aspect-ratio: 3/4) {
  html.fx .step--last { --flow-travel: 70vh; }
  @supports (height: 1svh) { html.fx .step--last { --flow-travel: 70svh; } }
  html.fx .step--last.is-pin .step__pin { min-height: calc(var(--flow-pin-h, 80vh) + var(--flow-travel)); }
  html.fx .step--last.is-pin .step__board { position: sticky; top: var(--flow-pin-top, 64px); }
  html.fx .step--last.is-pin-all { min-height: calc(var(--flow-pin-h, 80vh) + var(--flow-travel)); }
  html.fx .step--last.is-pin-all .step__pin { position: sticky; top: var(--flow-pin-top, 64px); }
  html[lang="ja"] .step__title { word-break: keep-all; overflow-wrap: anywhere; }
  html[lang="en"] .step--last .step__title { text-wrap: pretty; }
}
@media (min-width: 861px) and (max-width: 1100px) and (max-aspect-ratio: 3/4) {
  .flow__list { max-width: none; }
}
@media (max-width: 860px) and (orientation: landscape) and (max-height: 540px) {
  html.fx .step__board { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; align-items: center; }
  html.fx .step__board .step__fig { width: min(60vw, calc((100vh - 140px) * 4 / 3)); }
  @supports (height: 1svh) { html.fx .step__board .step__fig { width: min(60vw, calc((100svh - 140px) * 4 / 3)); } }
  html.fx .step__board .step__checks { margin-top: 0; grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; }
}

html.rm .flow *, html.rm .flow *::before, html.rm .flow *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .flow *, .flow *::before, .flow *::after { transition: none !important; animation: none !important; }
}
