/* Act 03 · Segments, the notochord, and the map of all phyla */

/* the train of segments */
.b4-train svg, .b4-rod svg { width: 100%; height: auto; display: block; }
.b4-train { max-width: 560px; }
.b4-tr-coach rect { fill: color-mix(in srgb, var(--xp-ecto) 10%, transparent); stroke: var(--xp-ecto); stroke-width: 1.4; }
.b4-tr-nerve { stroke: var(--bone); stroke-opacity: .55; stroke-width: 1.4; fill: none; }
.b4-tr-gang circle { fill: var(--bone); }
.b4-tr-neph path { fill: none; stroke: var(--xp-meso); stroke-width: 1.6; stroke-linecap: round; }
.b4-tr-mus path { stroke: var(--xp-meso); stroke-opacity: .35; stroke-width: 1.2; }

/* the bending rod */
.b4-rod { max-width: 520px; }
.b4-rod-body { fill: none; stroke: var(--xp-ecto); stroke-opacity: .22; stroke-width: 34; stroke-linecap: round; }
.b4-rod-noto { fill: none; stroke: var(--xp-noto); stroke-width: 4; stroke-linecap: round; }
.b4-rod-mus path { fill: none; stroke: var(--xp-meso); stroke-width: 2; stroke-linejoin: round; }

/* every phylum on one page: glyph matrix */
.b4-matrix { width: 100%; max-width: 880px; --mc: 30px; }
.b4-matrix .m-key, .b4-matrix .m-rows > li { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, var(--mc)); align-items: center; column-gap: 4px; }
.b4-matrix .m-key { padding: 0 0 8px 10px; border-bottom: 1px solid var(--hairline-strong); }
.b4-matrix .m-key::before { content: ""; }
.b4-matrix .m-key span { writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; font-size: 13px; line-height: 1; letter-spacing: .06em; color: var(--mix-4); white-space: nowrap; }
.b4-matrix .m-rows { list-style: none; margin: 0; padding: 0; }
.b4-matrix .m-rows > li { margin: 0; padding: 7px 0 7px 10px; border-bottom: 1px solid var(--hairline); }
.b4-matrix .m-rows > li > span { justify-self: center; }
.b4-matrix .m-rows > li > .m-n { justify-self: stretch; min-width: 0; }
.b4-matrix .m-n b { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--mix-2); line-height: 1.25; }
.b4-matrix .m-n small { display: block; font-size: 13px; line-height: 1.3; color: var(--mix-4); }
.b4-matrix li.m-seg { box-shadow: inset 2px 0 0 var(--xp-accent); }
.b4-matrix li.m-seg .m-n b { color: var(--bone); }
/* level: four steps */
.m-lv { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.m-lv i { width: 4px; background: var(--hairline-strong); border-radius: 1px; }
.m-lv i:nth-child(1) { height: 5px; } .m-lv i:nth-child(2) { height: 8px; } .m-lv i:nth-child(3) { height: 11px; } .m-lv i:nth-child(4) { height: 14px; }
.m-lv[style*="--n:1"] i:nth-child(-n+1), .m-lv[style*="--n:2"] i:nth-child(-n+2), .m-lv[style*="--n:3"] i:nth-child(-n+3), .m-lv[style*="--n:4"] i { background: var(--bone); }
/* symmetry */
.m-sym { position: relative; display: inline-block; width: 14px; height: 14px; border: 1.4px solid var(--bone); border-radius: 50%; opacity: .85; }
.m-sym::before, .m-sym::after { content: ""; position: absolute; background: var(--bone); }
.m-rad::before { left: -1px; right: -1px; top: 50%; height: 1px; margin-top: -.5px; }
.m-rad::after { top: -1px; bottom: -1px; left: 50%; width: 1px; margin-left: -.5px; }
.m-bil { border-radius: 7px 7px 5px 5px; width: 12px; }
.m-bil::after { top: -3px; bottom: -3px; left: 50%; width: 1px; margin-left: -.5px; }
.m-var { border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; border-style: dashed; }
/* coelom */
.m-coe { position: relative; display: inline-block; width: 18px; height: 18px; border-radius: 50%; }
.m-coe::after { content: ""; position: absolute; left: 6.5px; top: 6.5px; width: 5px; height: 5px; border-radius: 50%; background: var(--xp-endo); }
.m-coe.m-none { background: color-mix(in srgb, var(--xp-meso) 70%, transparent); }
.m-coe.m-pseudo { box-shadow: inset 0 0 0 2px var(--xp-meso); }
.m-coe.m-true { box-shadow: inset 0 0 0 2px var(--xp-meso); }
.m-coe.m-true::after { box-shadow: 0 0 0 1.5px var(--void), 0 0 0 3px var(--xp-meso); }
/* booleans and the gut */
.m-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mix-5); }
.m-dot.on { background: var(--bone); box-shadow: none; }
.m-gut { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--mix-5); }
.m-gut.m-inc { background: linear-gradient(to top, var(--bone) 50%, transparent 50%); box-shadow: inset 0 0 0 1px var(--bone); }
.m-gut.m-com { background: var(--bone); }
.b4-matrix .m-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px !important; font-size: 13px; line-height: 1.3; color: var(--mix-4); }
.b4-matrix .m-legend > span { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 900px) {
  .b4-matrix { --mc: 76px; }
  .b4-matrix .m-key span { writing-mode: horizontal-tb; transform: none; }
  .b4-matrix .m-n { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: 16px; align-items: baseline; }
}

/* the salmon fillet is portrait: narrower on phones so it never runs under the caption (never cropped) */
@media (max-width: 899px) { .b4-levels .b4-lv.b4-tall { width: max(72%, min(100%, calc(44svh * var(--r)))); justify-self: center; } }
