/* Дорожная карта: дерево на roadmap.html и короткий срез на главной.
   Ствол — программа, листья — модули и библиотеки из data/registry-index.json (assets/roadmap.js). */
@keyframes rise{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
.rm-legend{display:flex;flex-wrap:wrap;gap:10px 22px;margin-top:28px;font:500 13px 'IBM Plex Mono',monospace;color:#5b6170}
.rm-legend span{display:inline-flex;align-items:center;gap:8px}
.rm-legend i{display:inline-block;width:10px;height:10px;border-radius:50%}
.rm-legend .l-done{background:#1e4fd8}
.rm-legend .l-now{background:linear-gradient(90deg,#1e4fd8 50%,#fff 50%);border:2px solid #1e4fd8;width:12px;height:12px}
.rm-legend .l-here{background:#fff;border:3px solid #1e4fd8;width:12px;height:12px}
.rm-legend .l-next{background:#fff;border:2px dashed #9aa0ac}
.rm-legend .l-leaf{border-radius:0 100% 0 100%;background:#2f9e6b}
.rm-legend .l-lib{border-radius:0 100% 0 100%;background:#c08a2e}

.rm{list-style:none;margin:56px 0 0;padding:0}
.rm>li{display:grid;grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);grid-template-areas:"leaves axis body"}
.rm-leaves{grid-area:leaves;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-start;gap:10px;padding:22px 0}
.rm-axis{grid-area:axis;position:relative;display:flex;justify-content:center;align-items:flex-start;padding-top:48px}
.rm-stage .rm-axis{padding-top:0}
.rm>li:not([data-ver]):not(.rm-major) .rm-axis{padding-top:30px}
.rm-body{grid-area:body;padding:22px 0 22px 8px}

/* ствол */
.rm-axis::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:4px;margin-left:-2px;border-radius:2px;background:#1e4fd8;transform-origin:top}
.is-now .rm-axis::before{background:linear-gradient(#1e4fd8 50%,#bcc6dd)}
.is-next .rm-axis::before{background:#9fb4ec}
.is-later .rm-axis::before{width:0;margin-left:-1px;background:none;border-left:2px dashed #b8bdc8}
.rm-root .rm-axis::before{top:50%}
.rm-tip .rm-axis::before{bottom:50%}

/* узлы */
.rm-node{position:relative;z-index:1;width:16px;height:16px;border-radius:50%;background:#1e4fd8;box-shadow:0 0 0 6px #f5f6f8}
.is-now .rm-node{width:20px;height:20px;background:#fff;border:4px solid #1e4fd8}
.is-now .rm-node::after{content:"";position:absolute;inset:-10px;border-radius:50%;border:2px solid #1e4fd8;opacity:0;animation:rmPulse 2.4s ease-out infinite}
.is-next .rm-node{background:linear-gradient(90deg,#1e4fd8 50%,#fff 50%);border:2px solid #1e4fd8}
.is-later .rm-node{background:#fff;border:2px dashed #9aa0ac}
.rm-major .rm-axis{padding-top:46px}
.rm-major .rm-node{width:26px;height:26px;border:3px solid #1e4fd8;background:#fff;box-shadow:0 0 0 6px #f5f6f8,inset 0 0 0 5px #fff,inset 0 0 0 20px #dfe7fb}
@keyframes rmPulse{0%{transform:scale(.6);opacity:.7}100%{transform:scale(1.5);opacity:0}}

/* этапы */
.rm-stage .rm-body{padding:56px 0 6px 8px}
.rm-stage .rm-axis::before{display:block}
.rm-stage-t{margin:0;font:500 14px 'IBM Plex Mono',monospace;color:#8a6a2c}
.rm-stage-t b{display:inline-block;padding:4px 12px;margin-right:6px;border-radius:999px;background:#1c1f24;color:#fff!important}
.rm-stage.is-later .rm-stage-t b{background:#fff;color:#1c1f24!important;border:1px solid #d9dce3}
.rm-stage.is-next .rm-stage-t b{background:#1e4fd8}
.rm-stage-t b{color:#1c1f24;font-weight:500}

/* вехи */
.rm-ver{font:500 13px 'IBM Plex Mono',monospace;color:#1e4fd8}
.is-next .rm-ver,.is-later .rm-ver{color:#8b909c}
.rm-body h3{margin:6px 0 6px;font-size:24px;line-height:1.2;letter-spacing:-0.015em}
.rm-body p{margin:0;font-size:16px;line-height:1.55;color:#4a5060;max-width:460px}
.is-later .rm-body h3{color:#4a5060}
.rm-here{display:inline-flex;align-items:center;margin-left:10px;padding:2px 9px;border-radius:999px;background:#1e4fd8;color:#fff;font:500 12px 'IBM Plex Mono',monospace;vertical-align:2px}
.rm-major .rm-body h3{font-size:30px}

/* листья — модули и библиотеки */
.rm-leaf{position:relative;display:flex;align-items:center;gap:12px;max-width:320px;padding:11px 16px 11px 14px;border-radius:16px;background:#fff;border:1px solid #e3e5ea;text-decoration:none;color:#1c1f24;transition:transform .25s ease,border-color .25s ease}
a.rm-leaf:hover{transform:translateX(-3px);border-color:#bfe3d0;color:#1c1f24}
.rm-leaf::after{content:"";position:absolute;top:50%;right:-33px;width:33px;height:2px;margin-top:-1px;background:#2f9e6b}
.rm-leaf i{flex:none;width:14px;height:14px;border-radius:0 100% 0 100%;background:#2f9e6b}
.rm-leaf.lib i,.rm-leaf.lib::after{background:#c08a2e}
.rm-leaf.plan{background:transparent;border-style:dashed;border-color:#c3c7d0}
.rm-leaf.plan i{background:none;border:2px dashed #9aa0ac}
.rm-leaf.plan::after{background:none;height:0;border-top:2px dashed #b8bdc8}
.rm-leaf b{display:block;font-size:15px;font-weight:600;line-height:1.25}
.rm-leaf small{display:block;margin-top:2px;font:400 12px 'IBM Plex Mono',monospace;color:#8b909c}
.rm-note{margin:44px 0 0;font-size:15px;color:#8b909c}

/* появление при прокрутке */
@supports (animation-timeline: view()){
.rm-axis::before{animation:rmGrow linear both;animation-timeline:view();animation-range:entry 0% cover 50%}
.rm-node,.rm-leaf{animation:rmPop linear both;animation-timeline:view();animation-range:entry 10% cover 35%}
.rm-body{animation:rise linear both;animation-timeline:view();animation-range:entry 0% cover 30%}
}
@keyframes rmGrow{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes rmPop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){.rm *,.rm *::before,.rm *::after{animation:none!important}}

/* телефон: ствол слева, листья под вехой */
@media (max-width:760px){
.rm>li{grid-template-columns:36px minmax(0,1fr);grid-template-areas:"axis body" "axis leaves"}
.rm-body{padding:18px 0 6px 6px}
.rm-leaves{align-items:flex-start;padding:4px 0 16px 6px;gap:8px}
.rm-leaves:empty{display:none}
.rm-axis{padding-top:24px}
.rm>li:not([data-ver]):not(.rm-major) .rm-axis{padding-top:22px}
.rm-major .rm-axis{padding-top:22px}
.rm-stage .rm-axis{padding-top:0}
.rm-leaf{max-width:none}
.rm-leaf::after{right:auto;left:-31px;width:24px}
a.rm-leaf:hover{transform:translateX(3px)}
.rm-body h3{font-size:20px}
.rm-major .rm-body h3{font-size:24px}
.rm-stage .rm-body{padding-top:40px}
.rm-root .rm-axis::before{top:58px}
.rm-tip .rm-axis::before{bottom:auto;height:34px}
}

/* ===== срез на главной ===== */
.rmt{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:48px}
.rmt-col{position:relative;padding-top:40px}
.rmt-col::before{content:"";position:absolute;top:9px;left:0;right:-24px;height:4px;border-radius:2px;background:#1e4fd8}
.rmt-col.now::before{background:#9fb4ec}
.rmt-col.next::before{height:0;top:10px;background:none;border-top:2px dashed #b8bdc8;right:0}
.rmt-col>.rm-node{position:absolute;top:2px;left:0;width:18px;height:18px;box-shadow:0 0 0 6px #f5f6f8}
.rmt-col.here>.rm-node{background:#fff;border:4px solid #1e4fd8;width:20px;height:20px;top:1px}
.rmt-col.now>.rm-node{background:linear-gradient(90deg,#1e4fd8 50%,#fff 50%);border:2px solid #1e4fd8}
.rmt-col.next>.rm-node{background:#fff;border:2px dashed #9aa0ac}
.rmt-card{height:100%;background:#fff;border:1px solid #e3e5ea;border-radius:24px;padding:26px 28px}
.rmt-t{margin:0;font:500 13px 'IBM Plex Mono',monospace;color:#8a6a2c}
.rmt-card h3{margin:12px 0 8px;font-size:22px;line-height:1.2;letter-spacing:-0.015em}
.rmt-card p{margin:0;color:#4a5060;line-height:1.55}
.rmt-card ul{margin:12px 0 0;padding:0;list-style:none}
.rmt-card li{position:relative;padding:7px 0 7px 18px;font-size:17px;line-height:1.4;font-weight:500}
.rmt-card li::before{content:"";position:absolute;left:0;top:15px;width:7px;height:7px;border-radius:50%;background:#9fb4ec}
.rmt-col.next li::before{background:#fff;border:1.5px dashed #9aa0ac}
.rmt-card li.goal{color:#1e4fd8}
.rmt-col.next li.goal::before{border:2px solid #1e4fd8;width:9px;height:9px;left:-1px;top:14px}
.rmt-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:20px;margin-top:32px}
.rmt-fresh{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.rmt-fresh .rmt-t{margin-right:6px}
.rmt-fresh .rm-leaf{padding:8px 14px 8px 12px;border-radius:14px}
.rmt-fresh .rm-leaf::after{display:none}
.rmt-fresh .rm-leaf b{font-size:14px}
@media (max-width:980px){
.rmt{grid-template-columns:minmax(0,1fr);gap:0}
.rmt-col{padding:0 0 20px 40px}
.rmt-col::before{top:0;bottom:0;left:7px;right:auto;width:4px;height:auto}
.rmt-col.next::before{top:0;left:8px;width:0;height:auto;border-top:0;border-left:2px dashed #b8bdc8}
.rmt-col>.rm-node{top:26px}
.rmt-col.here>.rm-node{top:25px;left:-1px}
.rmt-col:last-child{padding-bottom:0}
}
