/* TOQUIA Cinematic — Scene 07 · Ecosistema conectado. Warm beige, emerald connections.
   Available today = solid emerald; complementary products = gold-ink; coming soon = dashed. */

.eco-stage { aspect-ratio: auto; height: clamp(340px, calc(100svh - 390px), 560px); max-width: 1100px; margin: var(--space-sm) auto 0; perspective: none; }
#ecosistema .scene-copy.centered h2 { font-size: clamp(1.6rem, 2.4vw + .5rem, 2.6rem); }
#ecosistema .scene-copy.centered .lead { font-size: var(--fs-body); max-width: 40rem; }
.eco-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eco-link { fill: none; stroke-linecap: round; }
.eco-link.eco-now   { stroke: var(--tq-emerald); stroke-width: 1.6; opacity: .55; }
.eco-link.eco-extra { stroke: var(--tq-gold-ink); stroke-width: 1.4; opacity: .55; }
.eco-link.eco-soon  { stroke: var(--tq-gold-ink); stroke-width: 1.4; stroke-dasharray: .012 .014; opacity: .7; }
.eco-flow { fill: none; stroke: var(--tq-emerald); stroke-width: 3; stroke-linecap: round; stroke-dasharray: .05 .95; stroke-dashoffset: 1; opacity: 0; }
.eco-stage.is-flowing .eco-flow { opacity: .9; animation: eco-flow 3.2s linear infinite; animation-delay: calc(var(--i) * -.45s); }
@keyframes eco-flow { to { stroke-dashoffset: 0; } }

.eco-nodes { position: absolute; inset: 0; }
.eco-node {
  position: absolute;
  left: var(--x); top: var(--y);
  translate: -50% -50%;
  display: grid; justify-items: center; gap: .1rem;
  padding: .6em 1.05em;
  border-radius: 99px;
  font-size: var(--fs-small); font-weight: 600; line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  background: var(--tq-cream);
  color: var(--tq-charcoal);
  border: 1px solid rgba(20,92,70,.22);
  box-shadow: 0 1px 2px rgba(17,20,18,.05), 0 18px 30px -20px rgba(60,44,20,.5);
}
.eco-node small { font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tq-gold-ink); }
.eco-now::before { content: ""; position: absolute; left: .7em; top: 50%; width: .45em; height: .45em; margin-top: -.225em; border-radius: 50%; background: var(--tq-emerald); }
.eco-now { padding-left: 1.6em; }
.eco-extra { border-color: rgba(122,92,42,.35); background: linear-gradient(160deg, #fff, var(--tq-beige)); }
.eco-soon { background: transparent; border: 1.5px dashed rgba(122,92,42,.55); box-shadow: none; color: var(--ink-muted); }
.eco-hub {
  padding: 1.1em 1.4em .9em;
  border-radius: 28px;
  background: var(--tq-charcoal);
  color: var(--tq-beige);
  border: 1px solid rgba(197,164,109,.45);
  box-shadow: 0 0 0 10px rgba(20,92,70,.07), 0 0 0 22px rgba(20,92,70,.04), 0 30px 50px -24px rgba(17,20,18,.6);
  font-size: var(--fs-body); letter-spacing: .14em;
}
.eco-hub img { width: 52px; height: 52px; }

/* Desktop constellation */
[data-node="hub"]       { --x: 50%; --y: 52%; }
[data-node="pos"]       { --x: 50%; --y: 7%; }
[data-node="nfc"]       { --x: 11%; --y: 12%; }
[data-node="gbp"]       { --x: 89%; --y: 12%; }
[data-node="loyalty"]   { --x: 26%; --y: 32%; }
[data-node="wallet"]    { --x: 74%; --y: 32%; }
[data-node="menu"]      { --x: 13%; --y: 62%; }
[data-node="attention"] { --x: 87%; --y: 62%; }
[data-node="staff"]     { --x: 32%; --y: 87%; }
[data-node="toki"]      { --x: 68%; --y: 87%; }

.eco-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-top: var(--space-md); font-size: var(--fs-small); color: var(--ink-muted); }
.eco-legend li { display: inline-flex; align-items: center; gap: .5rem; }
.eco-legend i { width: 22px; height: 0; border-top: 2px solid; }
.k-now { border-color: var(--tq-emerald) !important; }
.k-extra { border-color: var(--tq-gold-ink) !important; }
.k-soon { border-top-style: dashed !important; border-color: var(--tq-gold-ink) !important; }

/* Phones: a taller map, same story */
@media (max-width: 767px) {
  .eco-stage { height: clamp(330px, calc(100svh - 340px), 560px); }
  .eco-node { font-size: .74rem; padding: .5em .8em; white-space: normal; max-width: 9.5rem; }
  .eco-now { padding-left: 1.4em; }
  .eco-hub { font-size: .8rem; padding: .8em 1em .7em; }
  .eco-hub img { width: 40px; height: 40px; }
  [data-node="hub"]       { --x: 50%; --y: 50%; }
  [data-node="pos"]       { --x: 50%; --y: 5%; }
  [data-node="nfc"]       { --x: 20%; --y: 17%; }
  [data-node="gbp"]       { --x: 80%; --y: 17%; }
  [data-node="loyalty"]   { --x: 24%; --y: 32%; }
  [data-node="wallet"]    { --x: 76%; --y: 32%; }
  [data-node="menu"]      { --x: 20%; --y: 68%; }
  [data-node="attention"] { --x: 80%; --y: 68%; }
  [data-node="staff"]     { --x: 27%; --y: 86%; }
  [data-node="toki"]      { --x: 73%; --y: 85%; }
}
[data-tier="mid"] .eco-stage.is-flowing .eco-flow { animation: none; opacity: 0; }

/* Scroll-drawn lines (motion only). pathLength="1" makes the dash maths unit-free. */
.eco-stage.is-drawing .eco-link.eco-now   { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw-now)); }
.eco-stage.is-drawing .eco-link.eco-extra { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw-extra)); }
.eco-stage.is-drawing .eco-link.eco-soon  { opacity: calc(.7 * var(--draw-soon)); }
