/* ===========================================================================
   ServicesModernization — 提供内容 (three pillars), 詳細 01–03 (+ 現行 / 刷新後 switch, AVATAR flow),
   特徴・強み, 導入効果, 対応技術 (logo row), team photo band.
   FAQ and 関連リンク use the shared .faq / .rel3 blocks of home-prototype.css, unchanged.
   =========================================================================== */

/* spacing by how related two neighbours are (site tokens, design-qa-gate "nhịp"): steps → pillars and
   strengths → outcomes read as one thought (tight); topic changes get the base gap */
.md-pil { --pt: var(--sp-base); --pb: var(--sp-tight); }
.md-blk { --pt: var(--sp-base); --pb: var(--sp-base); }
.md-why { --pt: var(--sp-base); --pb: var(--sp-tight); }
.md-out { --pt: var(--sp-tight); --pb: var(--sp-base); }
.md-tech { --pt: var(--sp-tight); --pb: var(--sp-base); }

/* 提供内容: three pillars as link cards that jump to 詳細 01–03. Rows line up tier by tier (subgrid) whatever the
   title length. */
.md-pil__lead { max-width: 880px; margin-top: 4px; }
.md-pil3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 20px; margin: 32px 0 0; padding: 0; list-style: none; }
.md-pil3 li { display: contents; }
.md-pil3 a { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; margin-bottom: 20px; text-decoration: none; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--white); transition: box-shadow .25s, transform .25s; }
@media (hover: hover) and (pointer: fine) { .md-pil3 a:hover { box-shadow: 0 12px 32px rgba(16, 42, 67, .1); transform: translateY(-2px); } }
.md-pil3 a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.md-pil3__hd { position: relative; padding: 16px 44px 16px 20px; background: var(--navy); color: var(--white); }
.md-pil3__hd::after { content: "↓"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--blue-pale); }
.md-pil3__hd small { display: block; font-size: 13px; letter-spacing: .14em; color: var(--blue-pale); }
.md-pil3__hd b { display: block; margin-top: 4px; font-size: 16px; line-height: 1.5; }
.md-pil3__bd { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 18px; font-size: 15px; color: var(--ink); }
.md-pil3__bd span { display: flex; align-items: center; gap: 10px; }
.md-pil3__bd span::before { content: ""; flex: none; width: 12px; height: 2px; border-radius: 1px; background: var(--blue); }

/* 詳細 01–03 */
.md-blk__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 32px clamp(32px, 5vw, 72px); align-items: start; }
.md-items { margin: 24px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--navy); }
.md-items li { padding: 18px 0; border-bottom: 1px solid var(--line-strong); }
.md-items h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.md-items h3::before { content: ""; flex: none; width: 12px; height: 2px; border-radius: 1px; background: var(--blue); }
.md-items p { margin: 0 0 0 22px; font-family: 'Noto Sans JP', sans-serif; font-size: 16px; line-height: 1.9; color: var(--muted); }
@media (max-width: 1180px) { .md-blk__grid { grid-template-columns: 1fr; } .md-ba { max-width: 640px; } }
.md-blk2__hd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(32px, 5vw, 72px); align-items: start; }
.md-items3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 32px 0 0; padding: 0; list-style: none; }
.md-items3 li { padding: 20px 0 0; border-top: 2px solid var(--navy); }
.md-items3 h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.55; color: var(--navy); }
.md-items3 p { margin: 0; font-family: 'Noto Sans JP', sans-serif; font-size: 16px; line-height: 1.9; color: var(--muted); }
@media (max-width: 900px) { .md-blk2__hd { grid-template-columns: 1fr; } .md-items3 { grid-template-columns: 1fr; gap: 24px 0; } }
.md-linkrow { margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line-strong); font-family: 'Noto Sans JP', sans-serif; font-size: 16px; line-height: 1.95; color: var(--muted); }
.md-linkrow a { color: var(--blue); font-weight: 700; text-decoration: none; border-bottom: 1px solid #C6D3E0; }
.md-linkrow a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* 01: 現行 / 刷新後. Without JS both explanations are printed and the picture shows 現行; with JS (html.md-ba-live)
   the switch appears and one explanation shows at a time. */
.md-ba { margin: 0; }
.md-ba__say { display: grid; margin: 0 0 12px; }
.md-ba__say p { grid-area: 1 / 1; align-self: start; margin: 0 0 8px; font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.8; color: var(--ink); }
.md-ba__say p:last-child { margin-bottom: 0; }
.md-ba.is-live .md-ba__say p { grid-area: 1 / 1; margin: 0; }
.md-ba.is-live .md-ba__say p:not(.is-on) { visibility: hidden; }
.md-ba:not(.is-live) .md-ba__say { display: block; }
.md-ba__stage { border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); padding: 12px; }
.md-ba__stage svg { display: block; width: 100%; height: auto; font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; }
@media (max-width: 639px) { .md-ba svg text { display: none; } }   /* labels would render at ~7px: the line above says it */
.md-ba .md-bnr { stroke: #8A9AAB; transition: stroke .6s; }
.md-ba.is-after .md-bnr { stroke: #1B6FB3; }
.md-ba .md-bn { transition: transform .9s cubic-bezier(.65, 0, .35, 1); }
.md-ba .md-bn1 { transform: translate(140px, 80px); } .md-ba .md-bn2 { transform: translate(276px, 80px); }
.md-ba .md-bn3 { transform: translate(140px, 192px); } .md-ba .md-bn4 { transform: translate(276px, 192px); }
.md-ba.is-after .md-bn1 { transform: translate(24px, 120px); } .md-ba.is-after .md-bn2 { transform: translate(144px, 120px); }
.md-ba.is-after .md-bn3 { transform: translate(264px, 120px); } .md-ba.is-after .md-bn4 { transform: translate(384px, 120px); }
.md-ba .md-b-in, .md-ba .md-b-tangle { transition: opacity .6s; }
.md-ba .md-b-out { opacity: 0; transition: opacity .6s .35s; }
.md-ba.is-after .md-b-in { opacity: 0; }
.md-ba.is-after .md-b-out { opacity: 1; }
.md-ba .md-bsub { opacity: 0; transition: opacity .5s .5s; }
.md-ba.is-after .md-bsub { opacity: 1; }
.md-ba .md-bbar { transition: opacity .6s .4s; }

/* 03: the AVATAR flow — engineer's judgement above, four steps, the base underneath */
.md-flow { margin-top: 32px; }
.md-flow__eng { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); }
.md-flow__eng .md-flow__k { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.md-flow__eng b { font-size: 16px; color: var(--navy); }
.md-flow__steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; margin: 0; padding: 24px 0 12px; list-style: none; }
.md-flow__steps::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 0; height: 24px; border: 2px solid var(--line-strong); border-bottom: 0; border-radius: 12px 12px 0 0; }
.md-flow__steps li { position: relative; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; margin-bottom: 12px; padding: 16px 16px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); }
.md-flow__steps li::after { content: ""; position: absolute; left: 50%; top: -24px; height: 24px; border-left: 2px solid var(--line-strong); }
.md-flow__steps li:not(:last-child)::before { content: ""; position: absolute; right: -12px; top: 50%; width: 12px; border-top: 2px solid var(--blue); }
.md-flow__steps small { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--blue); }
.md-flow__steps b { font-size: 16px; color: var(--navy); }
.md-flow__steps span { font-size: 14px; color: var(--muted); }
.md-flow__base { border-radius: 14px; background: var(--navy); color: var(--white); padding: 20px 20px 22px; }
.md-flow__k { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--blue-pale); }
.md-flow__t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 2px 0 14px; }
.md-flow__t b { font-size: 22px; }
.md-flow__mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.md-flow__mods div { padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.md-flow__mods h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--white); }
.md-flow__mods p { margin: 0; font-family: 'Noto Sans JP', sans-serif; font-size: 13px; line-height: 1.8; color: var(--on-dark-muted); }
@media (max-width: 900px) { .md-flow__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md-flow__steps::before, .md-flow__steps li::after, .md-flow__steps li::before { display: none; } .md-flow__mods { grid-template-columns: 1fr; } }
html.js .md-flow:not(.is-in) .md-flow__steps li { opacity: 0; }
html.js .md-flow.is-in .md-flow__steps li { animation: md-rise .5s both; }
html.js .md-flow.is-in .md-flow__steps li:nth-child(2) { animation-delay: .12s; }
html.js .md-flow.is-in .md-flow__steps li:nth-child(3) { animation-delay: .24s; }
html.js .md-flow.is-in .md-flow__steps li:nth-child(4) { animation-delay: .36s; }

/* 特徴・強み: two big points with a small diagram each, two short points below */
.md-why__big { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));   /* 360: one column below ~800px, so each small diagram keeps ≥340px and its labels ≥13px */ margin-top: 32px; border-top: 2px solid var(--navy); }
.md-why__big > div { display: flex; flex-direction: column; padding: 28px 32px 28px 0; }   /* pictures sit at the cell bottom: the two stay level when the texts differ in length */
.md-why__big > div + div { padding-left: 32px; border-left: 1px solid var(--line-strong); }
.md-why__vis { display: block; width: 100%; max-width: 340px; height: auto; margin: auto 0 0; padding-top: 18px; font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; }
/* 日本品質 diagram: a line through the four phases... drawn left to right, then the ticks appear in turn */
.md-q-dot { transform-box: fill-box; transform-origin: center; }
.md-q-dot:nth-of-type(1) { --d: .5s; } .md-q-dot:nth-of-type(2) { --d: .9s; } .md-q-dot:nth-of-type(3) { --d: 1.3s; }
html.js .md-q-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.js .md-why__big > .is-in .md-q-line { animation: md-draw 1s .3s cubic-bezier(.4, 0, .2, 1) forwards; }
html.js .md-why__big > .is-in .md-q-dot { animation: md-pop .4s calc(.3s + var(--d, 0s)) both; }
.md-why__small { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 32px; margin-top: 8px; }
.md-why__small > div { padding: 20px 0; border-top: 1px solid var(--line-strong); }
.md-why__small h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--navy); }
@media (max-width: 760px) { .md-why__big > div { padding-right: 0; } .md-why__big > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-strong); } }

/* 導入効果: result + a tiny picture of it */
.md-out__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin-top: 32px; border-top: 1px solid var(--line-strong); }
.md-out__it { display: grid; grid-template-columns: minmax(0, 1fr) 188px; gap: 24px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line-strong); }
.md-vis { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.md-vis__k { font-weight: 700; color: var(--navy); }
.md-vis__bar { display: flex; height: 12px; overflow: hidden; border-radius: 6px; background: #E9EEF3; }
.md-vis__bar i { display: block; height: 100%; width: var(--w); transform-origin: left; }
.md-vis__bar .md-vm, .md-vis__lg .md-vm i { background: var(--muted); } .md-vis__bar .md-vb, .md-vis__lg .md-vb i { background: var(--blue); }
.md-vis__row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; }
.md-vis__lg { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.md-vis__lg > span { display: inline-flex; align-items: center; }
.md-vis__lg i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }   /* square swatch, same colour as its bar */
.md-vis__sq { display: flex; gap: 10px; align-items: center; }
.md-vis__sq div { display: flex; align-items: center; justify-content: center; width: 72px; height: 56px; border-radius: 8px; border: 1.5px solid #C6D3E0; background: var(--white); font-size: 13px; font-weight: 700; color: var(--navy); }
.md-vis__sq .md-vblur { filter: blur(2.2px); color: #3F4F5F; }
.md-vis__sq .md-vsm { width: 44px; }
.md-vis__sq .md-vadd { border-style: dashed; color: var(--blue); }
html.js .md-out__it.is-in .md-vis__bar i { animation: md-grow .6s calc(.3s + var(--d, 0s)) cubic-bezier(.4, 0, .2, 1) backwards; }
@media (max-width: 1000px) { .md-out__grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .md-out__it { grid-template-columns: 1fr; } }

/* 対応技術: official logos first, then the rows */
.md-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 44px; margin: 28px 0 8px; padding: 24px 28px; border-radius: 12px; background: var(--white); }
.md-logos img { display: block; width: auto; }
.md-logos > img:nth-child(1) { height: 40px; } .md-logos > img:nth-child(2) { height: 30px; } .md-logos > img:nth-child(3) { height: 34px; }
.md-logos > img:nth-child(5) { height: 26px; } .md-logos > img:nth-child(6), .md-logos > img:nth-child(7) { height: 32px; } .md-logos > img:nth-child(8) { height: 34px; }
.md-logos__tf { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #7B42BC; }
.md-logos__tf img { height: 30px; }
.md-tech__rows { margin-top: 8px; }
.md-tech__row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line-strong); }
.md-tech__row:last-child { border-bottom: 1px solid var(--line-strong); }
.md-tech__k { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--blue); }
.md-tech__v { display: block; font-size: 16px; line-height: 1.9; color: var(--ink); }
@media (max-width: 640px) { .md-tech__row { grid-template-columns: 1fr; gap: 6px; } }

/* team photo band: decoration only, near the end; wipes in when reached */
.md-band { position: relative; height: clamp(260px, 33vw, 480px); overflow: hidden; }
.md-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 10%; }
html.js .md-band img { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(.65, 0, .35, 1); }
html.js .md-band.is-in img { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { html.js .md-q-line { stroke-dasharray: none; stroke-dashoffset: 0; } html.js .md-band img { clip-path: none; } }
