/* ==========================================================================
   Blok „Tonery: zbiórka zużytych kaset” (.band.band--plain.t-back): pętla na granacie z siatką.
   Źródło (prototyp): assets/css/podstrona.css (Navy photo band – tło, nagłówek, lead)
   + podstrony/tonery.css (Zbiórka kaset). Reguły pasma pod .t-back, żeby nie dublować
   wspólnego bloku „Granatowe pasmo”, gdy oba stoją na jednej stronie.
   ========================================================================== */

.band.t-back {
  --section-y: clamp(3.5rem, 6.5vw, 6rem);
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background: url("../../assets/img/siatka-granat.svg") center / cover no-repeat, var(--navy-ground);
}
.t-back h2 { color: #fff; max-width: 18ch; }
.t-back .band__lead { color: #c9d4e2; font-size: 1.0625rem; max-width: 56ch; }
.t-back .link-more { margin-top: 1.5rem; }

.t-back__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem clamp(2rem, 5vw, 4.5rem);
  align-items: center; padding: var(--section-y) 0;
}
.t-back__body h2 { max-width: 14ch; }
.t-back__body .band__lead { margin-bottom: 0; }
.t-loop { position: relative; width: 100%; max-width: 640px; aspect-ratio: 640 / 460; justify-self: end; }
.t-loop__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.t-loop__ring .track { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.t-loop__ring .draw { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.t-loop__ring .heads path { fill: var(--orange); }
.t-loop.is-armed .t-loop__ring .draw { stroke-dashoffset: 100; }
.t-loop.is-armed .t-loop__ring .heads path { opacity: 0; }
.t-loop.is-armed.is-on .t-loop__ring .draw { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s cubic-bezier(.45, 0, .2, 1); }
.t-loop.is-armed.is-on .t-loop__ring .heads path { opacity: 1; transition: opacity .3s ease; }
.t-loop.is-on .heads path:nth-child(1) { transition-delay: .55s; }
.t-loop.is-on .heads path:nth-child(2) { transition-delay: 1.15s; }
.t-loop.is-on .heads path:nth-child(3) { transition-delay: 1.75s; }
.t-loop.is-on .heads path:nth-child(4) { transition-delay: 2.3s; }
.t-loop__core {
  position: absolute; left: 50%; top: 50%; width: 8.5rem; margin: 0; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: .2rem; text-align: center;
}
.t-loop__disc {
  width: 56px; height: 56px; margin-bottom: .45rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; box-shadow: 0 0 0 8px rgba(248, 120, 49, .16), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.t-loop__disc .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2; }
.t-loop__core b { color: #fff; font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.t-loop__core small { color: var(--on-navy-soft, #c9d4e2); font-size: .9375rem; line-height: 1.3; }
.t-loop__steps { list-style: none; margin: 0; padding: 0; }
.t-loop__n {
  position: absolute; z-index: 1; width: 31%; transform: translate(-50%, -50%);
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .15rem .7rem; align-items: start;
  padding: .8rem .95rem .85rem .75rem; border-radius: 18px; background: #fff; color: var(--navy-900);
  box-shadow: 0 2px 4px rgba(10, 22, 40, .18), 0 18px 34px -16px rgba(10, 22, 40, .6);
}
/* on the ellipse (rx 200, ry 165 in a 640 x 460 box): top, right, bottom, left */
.t-loop__n--1 { left: 50%; top: 14.1%; }
.t-loop__n--2 { left: 81.25%; top: 50%; }
.t-loop__n--3 { left: 50%; top: 85.9%; }
.t-loop__n--4 { left: 18.75%; top: 50%; }
.t-loop__ico { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); }
.t-loop__ico .icon { width: 1.05rem; height: 1.05rem; }
.t-loop__n b { font-size: 1rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.t-loop__n small { font-size: .9375rem; line-height: 1.35; color: var(--muted); }

@media (max-width: 1100px) {
  .t-back__grid { grid-template-columns: minmax(0, 1fr); }
  .t-back__body { max-width: 40rem; }
  .t-loop { justify-self: center; }
}

@media (max-width: 700px) {
  /* the loop becomes a list on one orange thread, the core above it */
  .t-loop { aspect-ratio: auto; max-width: none; display: grid; gap: 1.25rem; }
  .t-loop__ring { display: none; }
  .t-loop__core { position: static; transform: none; width: auto; grid-template-columns: 56px minmax(0, 1fr); justify-items: start; align-items: center; gap: 0 1rem; text-align: left; }
  .t-loop__disc { grid-row: 1 / 3; margin: 0; }
  .t-loop__steps { position: relative; display: grid; gap: .75rem; padding-left: 1.75rem; }
  .t-loop__steps::before { content: ""; position: absolute; left: .5rem; top: 1.75rem; bottom: 1.75rem; width: 2px; border-radius: 2px; background: var(--orange); }
  .t-loop__n { position: relative; left: auto; top: auto; width: auto; transform: none; }
  .t-loop__n::before {
    content: ""; position: absolute; left: calc(-1.25rem - 6px); top: 1.55rem; width: 12px; height: 12px; border-radius: 50%;
    background: var(--orange); box-shadow: 0 0 0 4px rgba(248, 120, 49, .2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-loop.is-armed .t-loop__ring .draw { stroke-dashoffset: 0; }
  .t-loop.is-armed .t-loop__ring .heads path { opacity: 1; }
}
