/* ==========================================================================
   Collab OS Ecosystem · v2.1 · page layer over Trellis + the Collab OS layer
   The first map's composition, made responsive.
   POSTER (screens that hold the whole map): a 160 × 90 cell stage scaled to
   fit, the title stacked in its top-left corner, the studio, the stack and the
   status legend inline along its bottom. --d is the stage's cell in px, set by
   ecosystem.js, and --k (the size of the title and the bottom row) follows it.
   FLOW (smaller screens): the same pieces in order down the page; the map
   flows past the screen's edges and --k is the Trellis cell.
   ========================================================================== */

:root {
  --d: var(--u);
  --k: var(--u);
  --st-integrated: #9370db;
  --st-live: #1e90ff;
  --st-proto: #32cd32;
  --st-plan: #ffd700;
  --st-concept: #add8e6;
  --eco-teal: #279daf;
  --eco-gold: #d4ae5a;
  --eco-tf: #48cdbd;
}
html[data-layout="poster"] { --k: var(--d); }
html[data-layout="poster"], html[data-layout="poster"] body { height: 100%; overflow: hidden; }

.eco-page { position: relative; }
html[data-layout="poster"] .eco-page { height: 100dvh; overflow: hidden; }

/* ---- Shared type: the first map's ---------------------------------------- */
.eb { font-size: calc(var(--k) * .875); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); line-height: 1.2; }

/* ---- Title: stacked, top left -------------------------------------------- */
.eco-title { display: flex; flex-direction: column; gap: calc(var(--k) * 1.17); position: relative; z-index: 2; }
.eco-title h1 { margin: 0; font-weight: inherit; font-size: inherit; line-height: 1; }
.eco-title .wm.xl { display: inline-flex; flex-direction: column; gap: .02em; align-items: flex-start; line-height: .98; font-size: calc(var(--k) * 4.67); letter-spacing: -.02em; white-space: nowrap; }
.eco-title .wm.xl b { font-weight: 600; }
.eco-title .wm.xl i { font-style: normal; font-weight: 200; }
.eco-title p { margin: 0; max-width: calc(var(--k) * 27.5); font-family: var(--font-serif); font-weight: 500; font-size: calc(var(--k) * 1.29); line-height: 1.45; color: var(--text-secondary); }
html[data-layout="poster"] .eco-title {
  position: absolute; width: calc(var(--d) * 27.5); margin: 0; padding: 0;
  left: calc(var(--d) * 5.33);
  top: calc(var(--d) * 4.67);
}
/* Pinned to the screen's top-left corner; back to the map's own corner only
   if the screen's corner would put it on the diagram (ecosystem.js checks). */
html[data-layout="poster"][data-pin="stage"] .eco-title {
  left: calc(50% - var(--d) * 80 + var(--d) * 5.33);
  top: calc(50% - var(--d) * 45 + var(--d) * 4.67);
}
html[data-layout="flow"] .eco-title { padding-block: var(--sp-6) var(--sp-2); }

/* ---- The map --------------------------------------------------------------- */
.eco-map { position: relative; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; outline-offset: calc(var(--line) * -2); }
.eco-map::-webkit-scrollbar { display: none; }
html[data-layout="flow"] .eco-map { cursor: grab; }
.eco-map.is-dragging { cursor: grabbing; user-select: none; }
.eco-map.is-dragging a { pointer-events: none; }
html[data-layout="poster"] .eco-map { position: absolute; inset: 0; overflow: hidden; }

.eco-stage {
  --ox: 80; --oy: 42; --sh: 90;
  position: relative;
  width: calc(var(--d) * var(--ox) * 2);
  height: calc(var(--d) * var(--sh));
  margin-inline: auto;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1;
  background: radial-gradient(ellipse 60% 55% at 50% 47%, #12181a 0%, transparent 70%);
}
html[data-layout="poster"] .eco-stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.eco-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; max-width: none; }

.eco-hint { margin: 0; text-align: center; font-size: var(--fs-control-xs); color: var(--text-faint); height: var(--sp-2); display: none; }
html[data-layout="flow"] .eco-map.is-wide + .eco-hint { display: block; }

/* lines: one device pixel wide at any zoom; they are planes, not drawings */
.l { fill: none; vector-effect: non-scaling-stroke; }
.l-orbit { stroke: #2a2a2a; stroke-width: 1.2; }
.l-orbit.part { stroke: #2e2e2e; stroke-dasharray: 2 6; stroke-linecap: round; }
.l-thread { stroke: var(--eco-gold); stroke-width: 1.1; opacity: .5; }
.l-thread.b { opacity: .32; }
.l-thread.solo { opacity: .75; stroke-width: 1.3; }
.l-spoke { stroke: #383838; stroke-width: 1; stroke-dasharray: 1.5 5; stroke-linecap: round; }
.l-link { stroke: #d9d4ce; stroke-width: 1.3; opacity: .42; }
.l-link.holos { stroke: var(--eco-teal); stroke-width: 1.7; opacity: .85; stroke-dasharray: .1 5.5; stroke-linecap: round; }
.l-mcp { stroke: var(--eco-teal); stroke-width: 1.3; opacity: .75; }
.l-commons { stroke: #8f8a84; stroke-width: 1.1; opacity: .5; }
.l-tree { stroke: #6b665f; stroke-width: 1; }
.l-dot { fill: #8f8a84; }
.l-dot.teal { fill: var(--eco-teal); }
.l-dot.gold { fill: var(--eco-gold); }
.l-dot.tf { fill: var(--eco-tf); }
/* SVG user units are cells, so these sizes are in cells */
.l-label { font: 600 .875px var(--font-sans); letter-spacing: .22em; fill: var(--text-faint); paint-order: stroke; stroke: var(--bg); stroke-width: .5px; stroke-linejoin: round; }
.l-label.dpl { fill: var(--eco-gold); letter-spacing: .24em; }

/* Wings: in the map when it is wide enough to hold them, below it otherwise */
.eco-stage[data-mode="orbit"] [data-wing] { display: none; }

/* ---- Nodes: every one sits on a crossing of the lattice ------------------ */
.n {
  position: absolute;
  left: calc((var(--x) + var(--ox)) * var(--d));
  top: calc((var(--y) + var(--oy)) * var(--d));
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: inherit; text-decoration: none;
  transition: opacity var(--dur-in) var(--ease-out), filter .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.n.at-r { transform: translate(-100%, -50%); align-items: flex-end; text-align: right; }
.n.at-l { transform: translate(0, -50%); align-items: flex-start; text-align: left; }
.n.at-tr { transform: translate(-100%, 0); align-items: flex-end; text-align: right; }
.n.at-tl { transform: translate(0, 0); align-items: flex-start; text-align: left; }
a.n:focus-visible { outline: calc(var(--line) * 2) solid var(--focus); outline-offset: calc(var(--d) * .33); border-radius: calc(var(--d) * .8); }

.wm { display: inline-flex; gap: .26em; align-items: baseline; white-space: nowrap; line-height: 1; letter-spacing: -.01em; }
.wm b { font-weight: 600; }
.wm i { font-style: normal; font-weight: 200; }
.wm.st2 { flex-direction: column; gap: .02em; align-items: center; line-height: .98; }
.n.at-r .wm.st2 { align-items: flex-end; }
.n.at-l .wm.st2, .n.at-tl .wm.st2 { align-items: flex-start; }

.desc { display: inline-flex; align-items: center; gap: calc(var(--d) * .5); font-size: calc(var(--d) * 1.04); font-weight: 400; color: var(--text-tertiary); white-space: nowrap; letter-spacing: .01em; line-height: 1.2; }
.st { width: calc(var(--d) * .92); height: calc(var(--d) * .92); flex: none; overflow: visible; }
.st-integrated { color: var(--st-integrated); } .st-live { color: var(--st-live); } .st-proto { color: var(--st-proto); } .st-plan { color: var(--st-plan); } .st-concept { color: var(--st-concept); }
.eco-stage .eb { font-size: calc(var(--d) * .875); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); }

/* core */
.n-core { width: calc(var(--d) * 18); height: calc(var(--d) * 18); border-radius: 50%; justify-content: center; gap: calc(var(--d) * .75);
  background: radial-gradient(circle at 50% 38%, #191919, #101010 70%); border: 1px solid #3c3c3c;
  box-shadow: 0 0 0 calc(var(--d) * .67) rgba(14, 14, 14, .9), 0 0 calc(var(--d) * 5) rgba(39, 157, 175, .18); }
.n-core .mark { width: calc(var(--d) * 5); height: calc(var(--d) * 5); }
.n-core .wm { font-size: calc(var(--d) * 2.75); }
.n-core .wm i { font-weight: 400; }
.n-core .cap { font-size: calc(var(--d) * .875); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--text-tertiary); }
a.n-core:hover { box-shadow: 0 0 0 calc(var(--d) * .67) rgba(14, 14, 14, .9), 0 0 calc(var(--d) * 7) rgba(39, 157, 175, .34); }

/* satellites: tangent to the core */
.n-sat { width: calc(var(--d) * 8); height: calc(var(--d) * 8); border-radius: 50%; justify-content: center; gap: calc(var(--d) * .25);
  background: #121212; border: 1px solid #3c3c3c; box-shadow: 0 0 0 calc(var(--d) * .42) var(--bg); }
.n-sat .eb { font-size: calc(var(--d) * .75); font-weight: 500; letter-spacing: .16em; color: var(--text-tertiary); }
.n-sat .t { display: flex; flex-direction: column; font-size: calc(var(--d) * 1.21); line-height: 1.02; }
.n-sat .t b { font-weight: 600; } .n-sat .t i { font-style: normal; font-weight: 200; }
.n-sat .t.big { font-size: calc(var(--d) * 1.67); }
.n-sat.ap { border-color: #2a2a2a; }
.n-sat .ring { position: absolute; left: 50%; top: 50%; width: calc(var(--d) * 10); height: calc(var(--d) * 10); transform: translate(-50%, -50%); overflow: visible; max-width: none; }
.n-sat.iris { border-color: transparent; background: #101010; }
.n-sat.iris .ring { width: calc(var(--d) * 9); height: calc(var(--d) * 9); }
.n-sat.iris .t { flex-direction: row; gap: calc(var(--d) * .4); position: relative; font-size: calc(var(--d) * 1.42); }
a.n-sat:hover { border-color: #5a5a5a; background: #181818; }

/* toolsets */
.n-suite .wm { font-size: calc(var(--d) * 2.08); padding: calc(var(--d) * .42) calc(var(--d) * .83); background: var(--bg); border-radius: calc(var(--d) * .67); }
.n-suite .wm.st2 { font-size: calc(var(--d) * 1.92); }
.n-suite .desc { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: calc(var(--d) * .25); padding: calc(var(--d) * .17) calc(var(--d) * .58); background: var(--bg); border-radius: calc(var(--d) * .42); }
a.n-suite:hover .wm { background: #1b1b1b; box-shadow: 0 0 0 1px #444; }

/* community */
.n-comm { width: calc(var(--d) * 16); height: calc(var(--d) * 16); border-radius: 50%; border: 1.3px dashed #4a4a4a; background: var(--bg); justify-content: center; gap: calc(var(--d) * .83); box-shadow: 0 0 0 calc(var(--d) * .5) var(--bg); }
.n-comm .wm { font-size: calc(var(--d) * 1.67); }
.n-comm .feats { display: grid; grid-template-columns: auto auto; gap: calc(var(--d) * .25) calc(var(--d) * 1.17); font-size: calc(var(--d) * .96); color: var(--text-tertiary); line-height: 1.2; }

/* partners */
.n-partner { padding: calc(var(--d) * .5) calc(var(--d) * .83); background: var(--bg); border-radius: calc(var(--d) * .83); }
.n-partner img { display: block; width: calc(var(--d) * var(--w)); height: auto; max-width: none; }
.n-partner.text { flex-direction: row; gap: calc(var(--d) * .83); align-items: center; text-align: left; }
.n-partner .ib-icon { width: calc(var(--d) * 3.17); height: calc(var(--d) * 3.17); border-radius: calc(var(--d) * .75); }
.n-partner .pt { display: flex; flex-direction: column; font-size: calc(var(--d) * 1.42); font-weight: 400; line-height: 1.05; color: #efe6d6; letter-spacing: .01em; }
.n-partner .pt.one { font-size: calc(var(--d) * 1.75); font-weight: 500; color: #f3ecdf; white-space: nowrap; }
.n-partner .tf-mark { width: calc(var(--d) * 3.83); height: calc(var(--d) * 2.33); }
.n-partner.holos { background: transparent; }
a.n-partner:hover { background: #181818; box-shadow: 0 0 0 1px #3a3a3a; }

/* wings */
.n-whead { gap: calc(var(--d) * .5); max-width: calc(var(--d) * 16); }
.n-whead .wh, .n-chead .wh { font-family: var(--font-serif); font-weight: 500; font-size: calc(var(--d) * 1.21); color: var(--text-tertiary); line-height: 1.35; white-space: normal; }
.n-app { gap: calc(var(--d) * .42); }
.n-app .app { display: inline-flex; align-items: center; gap: calc(var(--d) * .67); font-size: calc(var(--d) * 1.83); font-weight: 500; letter-spacing: -.005em; white-space: nowrap; }
.n-app .app .wm { font-size: calc(var(--d) * 1.67); }
.n-app .app-icon { width: calc(var(--d) * 2.5); height: calc(var(--d) * 2.5); border-radius: calc(var(--d) * .58); box-shadow: 0 0 0 1px #2c2a28; }
.n-chead { gap: calc(var(--d) * .5); }
.n-chead .wm { font-size: calc(var(--d) * 2.5); }
.n-com { gap: calc(var(--d) * .33); }
.n-com .cn { display: inline-flex; align-items: center; gap: calc(var(--d) * .5); font-size: calc(var(--d) * 1.5); font-weight: 500; white-space: nowrap; }
.n-com .cn svg { width: calc(var(--d) * 1.5); height: calc(var(--d) * 1.5); flex: none; color: #c9e7c1; }
.n-com.dpl .cn { color: var(--eco-gold); }
.n-com.dpl .desc { color: #a08c63; }
.n-com.new .cn::after { content: "New"; font-size: calc(var(--d) * .67); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--eco-tf); padding: calc(var(--d) * .17) calc(var(--d) * .42); border: 1px solid color-mix(in oklab, var(--eco-tf) 45%, transparent); border-radius: calc(var(--d) * .25); }
.n-tfm { font-size: calc(var(--d) * 1.17); color: var(--text-secondary); white-space: nowrap; }
.n-tfh { padding: calc(var(--d) * .17) 0; background: var(--bg); font-size: calc(var(--d) * .79); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
a.n-app:hover .app, a.n-com:hover .cn, a.n-chead:hover .wm { filter: brightness(1.25); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: calc(var(--d) * .4); text-decoration-color: #6b665f; }

/* ---- Highlight by status ------------------------------------------------- */
html[data-focus] .eco-stage .n:not([data-status]),
html[data-focus] .eco-stage svg .l:not(.l-orbit) { opacity: .16; }
html[data-focus] .eco-stage svg .l-label { opacity: .3; }
html[data-focus="integrated"] .n[data-status]:not([data-status="integrated"]),
html[data-focus="live"] .n[data-status]:not([data-status="live"]),
html[data-focus="proto"] .n[data-status]:not([data-status="proto"]),
html[data-focus="plan"] .n[data-status]:not([data-status="plan"]),
html[data-focus="concept"] .n[data-status]:not([data-status="concept"]) { opacity: .16; }
html[data-focus="integrated"] .list-item:not([data-status="integrated"]),
html[data-focus="live"] .list-item:not([data-status="live"]),
html[data-focus="proto"] .list-item:not([data-status="proto"]),
html[data-focus="plan"] .list-item:not([data-status="plan"]),
html[data-focus="concept"] .list-item:not([data-status="concept"]) { opacity: .3; }

/* ---- Lists: the wings below a narrow map, or everything in List view ----- */
.eco-lists { container-type: inline-size; padding-block: var(--sp-4) var(--sp-2); }
.eco-lists:empty { display: none; }
.eco-groups { --cols: 1; --cols-gap: var(--sp-4); row-gap: var(--sp-6); }
@container (width > 40rem) { .eco-groups { --cols: 2; } }
@container (width > 72rem) { .eco-groups { --cols: 3; } }
.eco-group { --stack-gap: var(--sp-2); min-width: 0; }
.eco-group-head { --stack-gap: var(--sp-1); }
.eco-group-head .t-h4 b { font-weight: 600; }
.eco-group-head .t-h4 i { font-style: normal; font-weight: 200; }
.eco-li-mark { flex: none; width: var(--sp-3); height: var(--sp-2); display: flex; align-items: center; justify-content: center; }
.eco-li-mark img { width: var(--sp-2); height: var(--sp-2); border-radius: var(--r-h); object-fit: contain; }
.eco-li-mark .st { width: var(--sp-1); height: var(--sp-1); }
.eco-li-mark .dotmark { width: var(--sp-h); height: var(--sp-h); border-radius: 50%; background: var(--text-faint); }
.eco-li-mark svg.tm { width: var(--sp-2); height: var(--sp-2); color: #c9e7c1; }
.list-item.cc-logo .eco-li-mark { width: var(--sp-8); justify-content: flex-start; }
.list-item.cc-logo .eco-li-mark img { width: auto; max-width: var(--sp-8); height: var(--sp-2); border-radius: 0; }
.eco-li-end { display: inline-flex; align-items: center; gap: var(--sp-h); white-space: nowrap; }
.eco-li-end .st { width: var(--sp-1); height: var(--sp-1); }
.list-item { transition: opacity var(--dur-in) var(--ease-out); }

/* ---- Along the bottom: studio · built with · status ------------------------ */
.eco-bottom { position: relative; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: calc(var(--k) * 2); }
html[data-layout="poster"] .eco-bottom {
  position: absolute; width: auto; margin: 0; padding: 0;
  left: calc(var(--d) * 5.33);
  right: calc(var(--d) * 5.33);
  bottom: calc(var(--d) * 3);
}
/* Pinned to the screen's bottom edge, with the same fallback as the title. */
html[data-layout="poster"][data-pin="stage"] .eco-bottom {
  left: calc(50% - var(--d) * 80 + var(--d) * 5.33);
  right: calc(50% - var(--d) * 80 + var(--d) * 5.33);
  bottom: calc(50% - var(--d) * 45 + var(--d) * 3);
}
html[data-layout="flow"] .eco-bottom { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: var(--sp-4); padding-block: var(--sp-4) var(--sp-6); }

.eco-studio { display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--k) * .83); color: inherit; text-decoration: none; justify-self: start; }
.eco-studio img { height: calc(var(--k) * 3.33); width: auto; max-width: none; margin-left: calc(var(--k) * -.33); }
.eco-studio:hover img { filter: brightness(1.25); }

.eco-tech { display: flex; flex-direction: column; align-items: center; gap: calc(var(--k) * .58); justify-self: center; }
.eco-tech ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: calc(var(--k) * 1.83); }
.eco-tech li { width: calc(var(--k) * 4.67); }
.eco-tech a { display: flex; flex-direction: column; align-items: center; gap: calc(var(--k) * .58); padding: calc(var(--k) * .5) 0; color: #9b968f; border-radius: calc(var(--k) * .67); text-decoration: none; transition: color .18s ease, background-color .18s ease; }
.eco-tech svg { width: calc(var(--k) * 1.83); height: calc(var(--k) * 1.83); }
.eco-tech span { font-size: calc(var(--k) * .875); color: var(--text-tertiary); white-space: nowrap; }
.eco-tech a:hover { color: var(--text); background: #161616; }
.eco-tech a:hover span { color: var(--text-secondary); }
html[data-layout="flow"] .eco-tech { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
html[data-layout="flow"] .eco-tech ul { gap: var(--sp-1); }

.eco-legend { display: flex; flex-direction: column; align-items: flex-end; gap: calc(var(--k) * .83); justify-self: end; }
.eco-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: calc(var(--k) * .5); }
html[data-layout="poster"] .eco-legend ul { flex-wrap: nowrap; margin-right: calc(var(--k) * -.42); }
.eco-legend button { white-space: nowrap; }
.eco-legend button {
  display: inline-flex; align-items: center; gap: calc(var(--k) * .5);
  margin: 0; padding: calc(var(--k) * .25) calc(var(--k) * .42); border: 0; border-radius: calc(var(--k) * .42);
  background: none; color: var(--text-tertiary); font: inherit; font-size: calc(var(--k) * 1); line-height: 1.2; cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}
.eco-legend .st { width: calc(var(--k) * .92); height: calc(var(--k) * .92); }
.eco-legend button:hover { color: var(--text-secondary); background: #161616; }
.eco-legend button[aria-pressed="true"] { color: var(--text); background: #1b1b1b; box-shadow: 0 0 0 1px #3a3a3a; }
html[data-layout="flow"] .eco-legend { align-items: flex-start; justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  .n, .list-item { transition: none; }
}
