/* ===========================================================================
   Services / Manufacturing — the four levels, low to high.
   1. level colours + term chips (FA, MES, ERP…)
   2. hero model: an isometric plant of four terraces (generated SVG, no text
      inside; labels are HTML). Plays its story once on load, then keeps a few
      quiet loops while it is on screen.
   3. small machine / warehouse scenes in the delivered projects
   4. each small figure inside a solution screen plays as a mini-story
   5. "the plant can decide with confidence" block, who NAL is, client words
   The solution tour itself lives in svc-manufacturing-map.css.
   Motion uses transform and opacity only. Without JS, and under reduced
   motion, everything rests in its final picture.
   =========================================================================== */

/* --- 1. level colours and term chips ---------------------------------------- */
.mf-term--t1, .mf-ch--t1, .mf-idx--t1, .mf-tab--1, .mf-lg--1, .mf-model__n1 { --mf-tc: var(--amber); }
.mf-term--t2, .mf-ch--t2, .mf-idx--t2, .mf-tab--2, .mf-lg--2, .mf-model__n2 { --mf-tc: var(--orange); }
.mf-term--t3, .mf-ch--t3, .mf-idx--t3, .mf-tab--3, .mf-lg--3, .mf-model__n3 { --mf-tc: var(--green); }
.mf-term--t4, .mf-ch--t4, .mf-idx--t4, .mf-tab--4, .mf-lg--4, .mf-model__n4 { --mf-tc: var(--blue-pale); }
.mf-term { display: inline-block; margin-left: 2px; padding: 1px 8px 1px 7px; border: 1px solid var(--line-strong); border-left: 4px solid var(--mf-tc, var(--navy)); background: var(--white); color: var(--navy); font-size: 12px; font-weight: 700; line-height: 1.6; letter-spacing: .04em; white-space: nowrap; vertical-align: .1em; }

/* --- 2. hero model ---------------------------------------------------------- */
.mf-model { flex: 11 1 460px; min-width: 0; margin: 0; }
.mf-model__stage { position: relative; }
/* the steps are filled with the tier colours, so the three machine beacons get a white rim to stay readable */
.mfm-lamp polygon { stroke: var(--white); stroke-width: 1.6px; stroke-linejoin: round; }
.mfm { display: block; width: 100%; height: auto; overflow: visible; }
.mf-model__n { position: absolute; display: grid; place-items: center; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--mf-tc); color: var(--navy); font-size: 14px; font-weight: 900; line-height: 1; box-shadow: 0 0 0 3px rgba(11, 32, 54, .6); animation: mf-pop .4s var(--ease-out) both; }
.mf-model__n1 { left: 39.7%; top: 88.8%; animation-delay: .55s; }
.mf-model__n2 { left: 55.8%; top: 71.2%; animation-delay: .8s; }
.mf-model__n3 { left: 71.8%; top: 53.6%; animation-delay: 1.05s; }
.mf-model__n4 { left: 87.9%; top: 36%; animation-delay: 1.3s; }
.mf-model__leg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.mf-lg { display: grid; grid-template-rows: subgrid; grid-row: span 3; gap: 3px; padding: 10px 0 0; border-top: 4px solid var(--mf-tc); animation: mf-rise .5s var(--ease-out) both; }
.mf-lg--1 { animation-delay: .55s; } .mf-lg--2 { animation-delay: .8s; } .mf-lg--3 { animation-delay: 1.05s; } .mf-lg--4 { animation-delay: 1.3s; }
.mf-lg b { font-size: 13px; font-weight: 900; letter-spacing: .12em; color: var(--mf-tc); }
.mf-model .mf-lg span { font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--white); }
.mf-lg em { font-style: normal; font-size: 13px; line-height: 1.5; color: var(--on-dark-muted); }
.mf-model__cap { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--on-dark-muted); }
/* two small screens floating on the plant: what the shop floor and the director's office see */
.mf-float { position: absolute; display: grid; gap: 1px; width: 176px; margin: 0; padding: 9px 12px 10px; background: var(--white); border-left: 4px solid var(--mf-tc); border-radius: 6px; box-shadow: 0 16px 28px -14px rgba(0, 0, 0, .65); animation: mf-pop .4s var(--ease-out) 1.7s both; }
.mf-float b { font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: .1em; color: var(--muted); }
.mf-float span { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--navy); }
.mf-float em { font-style: normal; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; color: var(--ink); }
.mf-float u { display: block; height: 8px; margin: 4px 0 2px; background: var(--line); text-decoration: none; }
.mf-float u i { display: block; height: 100%; background: var(--blue); }
.mf-float--a { --mf-tc: var(--orange); left: 0; top: 5%; }
.mf-float--b { --mf-tc: var(--blue-pale); right: 0; bottom: 1%; width: 190px; animation-delay: 1.95s; }
.mf-hero__sure { margin: 8px 0 0; font-size: 14px; line-height: 1.7; color: var(--on-dark-muted); }

/* entrance, once: terraces rise from the lowest to the highest, then their contents land */
@keyframes mfm-rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes mfm-land { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.mfm-t { animation: mfm-rise .7s var(--ease-out) both; }
.mfm-obj { animation: mfm-land .5s var(--ease-out) both; }
.mfm-t1 { animation-delay: .15s; } .mfm-t1 .mfm-obj { animation-delay: .5s; }
.mfm-t2 { animation-delay: .4s; }  .mfm-t2 .mfm-obj { animation-delay: .75s; }
.mfm-t3 { animation-delay: .65s; } .mfm-t3 .mfm-obj { animation-delay: 1s; }
.mfm-t4 { animation-delay: .9s; }  .mfm-t4 .mfm-obj { animation-delay: 1.25s; }

/* quiet loops. --rx/--ry = how far a part travels along its belt, in SVG units */
.mfm--plant { --rx: 147.9px; --ry: 73.95px; }
.mfm--line { --rx: 173.4px; --ry: 86.7px; }
.mfm--rfid { --rx: 161.5px; --ry: 80.75px; }
@keyframes mfm-ride { 0% { opacity: 0; transform: translate(0, 0); } 6%, 90% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--rx), var(--ry)); } }
@keyframes mfm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes mfm-press { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes mfm-glow { 0%, 100% { opacity: .5; } 50% { opacity: .16; } }
@keyframes mfm-tick { 0%, 62%, 100% { transform: scale(1); } 76% { transform: scale(1.28); } }
@keyframes mfm-swing { from { transform: rotate(-5deg); } to { transform: rotate(4deg); } }
@keyframes mfm-write { 0% { transform: scaleX(.25); opacity: 1; } 45%, 88% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: .4; } }
@keyframes mfm-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.62); } }
@keyframes mfm-step { 0%, 12% { opacity: .25; } 24%, 46% { opacity: 1; } 60%, 100% { opacity: .25; } }
@keyframes mfm-hop { 0%, 55%, 100% { transform: scale(1); } 20% { transform: scale(1.3); } }
@keyframes mfm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* resting positions (also the picture shown under reduced motion): parts spread along the belt */
.mfm-part2 { transform: translate(calc(var(--rx) * .3), calc(var(--ry) * .3)); }
.mfm-part3 { transform: translate(calc(var(--rx) * .6), calc(var(--ry) * .6)); }
.mfm-part4 { transform: translate(calc(var(--rx) * .9), calc(var(--ry) * .9)); }
@media (prefers-reduced-motion: no-preference) {
  .mfm-part { animation: mfm-ride 7.2s linear infinite backwards; }
  .mfm--plant .mfm-part1 { animation-delay: 1.8s; } .mfm--plant .mfm-part2 { animation-delay: 3.6s; }
  .mfm--plant .mfm-part3 { animation-delay: 5.4s; } .mfm--plant .mfm-part4 { animation-delay: 7.2s; }
  .mfm--line .mfm-part, .mfm--rfid .mfm-part { animation-duration: 6s; }
  .mfm--line .mfm-part2 { animation-delay: 2s; } .mfm--line .mfm-part3 { animation-delay: 4s; }
  .mfm--rfid .mfm-part2 { animation-delay: 3s; }
  .mfm-cone { animation: mfm-glow 1.8s ease-in-out infinite; }
  .mfm-ok { animation: mfm-tick 1.8s var(--ease-out) 2.4s infinite; }
  .mfm-arm { animation: mfm-swing 1.8s ease-in-out 1.8s infinite alternate; }
  .mfm-l1 { animation: mfm-blink 2.4s ease-in-out infinite; }
  .mfm-l2 { animation: mfm-blink 2.4s ease-in-out 1.2s infinite; }
  .mfm-pulse { animation: mfm-write 3.2s ease-in-out 1.6s infinite both; }
  .mfm-row { animation: mfm-step 4.2s ease-in-out infinite both; }
  .mfm-row2 { animation-delay: .7s; } .mfm-row3 { animation-delay: 1.4s; }
  .mfm-carton--hot, .mfm-cell--hot, .mfm-tile2 { animation: mfm-blink 2.2s ease-in-out infinite; }
  .mfm-tag { animation: mfm-hop 3.6s var(--ease-out) 2s infinite; }
  .mfm-tag2 { animation-delay: 2.6s; } .mfm-tag3 { animation-delay: 3.2s; }
  .mfm-bar { animation: mfm-breathe 4.8s ease-in-out 1.6s infinite; }
  .mfm-bar2 { animation-delay: 2.1s; } .mfm-bar3 { animation-delay: 2.9s; } .mfm-bar4 { animation-delay: 1.9s; } .mfm-bar5 { animation-delay: 3.3s; }
  .mfm-st { animation: mfm-press 2s ease-in-out infinite; }
  .mfm-st2 { animation-delay: .33s; } .mfm-st3 { animation-delay: .66s; } .mfm-st4 { animation-delay: 1s; } .mfm-st5 { animation-delay: 1.33s; } .mfm-st6 { animation-delay: 1.66s; }
  .mfm-scan, .mfm-mark { animation: mfm-step 3.6s ease-in-out infinite both; }
  .mfm-scan2 { animation-delay: 1.2s; } .mfm-scan3 { animation-delay: 2.4s; }
  .mfm-mark2 { animation-delay: .3s; } .mfm-mark3 { animation-delay: .6s; } .mfm-mark4 { animation-delay: .9s; } .mfm-mark5 { animation-delay: 1.2s; }
  .mfm-grip { animation: mfm-bob 3.6s ease-in-out infinite; }
  .mfm-recrow { animation: mfm-write 3.6s ease-in-out 1s infinite both; }
  .mfm-recrow2 { animation-delay: 1.3s; } .mfm-recrow3 { animation-delay: 1.6s; }
  .mfm-wave { animation: mfm-blink 1.5s ease-in-out infinite; }
  /* off screen: every loop holds still (home-motion.js toggles .is-in on [data-io]) */
  html.js [data-io]:not(.is-in) .mfm *, html.js [data-io]:not(.is-in) .mf-model__n { animation-play-state: paused; }
}

/* --- 3. scenes in the delivered projects ------------------------------------ */
.mf-feat__num .mf-feat__fig { display: block; margin: -6px -10px 12px; font-size: 0; }
.mf-built .mf-built__fig { display: block; margin: -20px -20px 16px; padding: 10px 12px; background: var(--surface-2); font-size: 0; }
.mf-built__fig .mfm { height: 168px; }

/* --- 4. small figures --------------------------------------------------------- */
@keyframes mf-grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes mf-flag { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes mf-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* each small figure tells its story when its solution scrolls into view, and ends on the full picture */
@media (prefers-reduced-motion: no-preference) {
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr) { animation: mf-rise .45s var(--ease-out) .15s both; }
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr):nth-child(2) { animation-delay: .3s; }
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr):nth-child(3) { animation-delay: .45s; }
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr):nth-child(4) { animation-delay: .6s; }
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr):nth-child(5) { animation-delay: .75s; }
  html.js .mf-sol.is-in .mf-fig :is(li, tbody tr):nth-child(6) { animation-delay: .9s; }
  html.js .mf-sol.is-in .mf-bars span i, html.js .mf-sol.is-in .mf-track i { transform-origin: 0 50%; animation: mf-grow-x .7s var(--ease-out) .35s both; }
  html.js .mf-sol.is-in .mf-fig li:nth-child(2) :is(span, .mf-track) i { animation-delay: .5s; }
  html.js .mf-sol.is-in .mf-fig li:nth-child(3) :is(span, .mf-track) i { animation-delay: .65s; }
  html.js .mf-sol.is-in .mf-fig li:nth-child(4) :is(span, .mf-track) i { animation-delay: .8s; }
  html.js .mf-sol.is-in .mf-dots i { animation: mf-pop .3s var(--ease-out) .2s both; }
  html.js .mf-sol.is-in .mf-dots i:nth-child(n+6) { animation-delay: .4s; }
  html.js .mf-sol.is-in .mf-dots i:nth-child(n+11) { animation-delay: .6s; }
  html.js .mf-sol.is-in .mf-dots i:nth-child(n+16) { animation-delay: .8s; }
  html.js .mf-sol.is-in .mf-dots div + div i { animation-delay: 1.1s; }
  html.js .mf-sol.is-in .mf-dots div + div i:nth-child(n+6) { animation-delay: 1.3s; }
  html.js .mf-sol.is-in .mf-dots div + div i:nth-child(n+11) { animation-delay: 1.5s; }
  html.js .mf-sol.is-in .mf-dots div + div i:nth-child(n+16) { animation-delay: 1.7s; }
  html.js .mf-sol.is-in .mf-dots div + div i.is-ng { animation: mf-pop .3s var(--ease-out) 1.3s both, mf-beat .8s ease-in-out 2.1s 2; }
  html.js .mf-sol.is-in .mf-dots div + div i.is-ng:nth-child(n+11) { animation-delay: 1.5s, 2.1s; }
  html.js .mf-sol.is-in .mf-fig .mf-chip--stop { animation: mf-flag .9s ease-in-out 1.3s 2; }
  html.js .mf-sol.is-in .mf-fig li.is-flag { animation: mf-rise .45s var(--ease-out) .6s both, mf-flag .9s ease-in-out 1.4s 2; }
  html.js .mf-sol.is-in .mf-kpi li.is-flag:first-child { animation-delay: .15s, 1.4s; }
  html.js .mf-sol.is-in .mf-kpi li.is-flag:nth-child(2) { animation-delay: .3s, 1.4s; }
}

/* --- 5. what the plant can count on ----------------------------------------- */
.mf-sure { margin-top: var(--sp-tight); padding: 22px 26px 24px; background: var(--white); border: 1px solid var(--line-strong); border-left: 6px solid var(--green); }
.mf-sure__t { margin: 0 0 16px; font-size: 18px; font-weight: 700; line-height: 1.5; color: var(--navy); }
.mf-sure ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }
.mf-sure li { position: relative; display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 4px; padding-left: 34px; }
.mf-sure li::before { content: ""; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--mf-green-text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.8 7.4-8.3' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px no-repeat; }
.mf-sure b { font-size: 16px; line-height: 1.55; color: var(--navy); }
.mf-sure span { font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.8; color: var(--ink); }
.mf-sure__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 22px 0 0; }
.mf-sure__cta span { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* --- 6. who NAL is, the client's words, the survey button after the proof ---- */
.mf-who { margin: 18px 0 0; font-size: 15px; line-height: 1.75; color: var(--muted); }
.mf-feat__q { margin: 18px 0 6px; padding: 14px 18px 14px 20px; background: var(--surface-2); border-left: 4px solid var(--amber); }
.mf-feat__q p { margin: 0; font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.85; color: var(--ink); }
.mf-feat__q footer { margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.mf-cta { margin: 28px 0 0; }

@media (max-width: 760px) {
  .mf-sure ul { grid-template-columns: 1fr; gap: 16px; }
  .mf-sure li { grid-row: auto; grid-template-rows: none; }
}
@media (max-width: 600px) {
  .mf-model__leg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .mf-model__n { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 13px; }
  .mf-float { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mfm *, .mf-model *, .mf-fig * { animation: none !important; }
}
