/* Version 1 «Поток»: dark, the order travels through the system; warehouse cells light up behind the hero. */

/* ---------- hero background: warehouse cells ---------- */
.hero { overflow: hidden; }
.cells {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  grid-auto-rows: 56px;
  gap: 6px; padding: 6px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 20%, transparent 75%);
  opacity: 0.9;
}
.cells i {
  display: block; border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(148, 163, 184, 0.025);
  transition: background-color 1.2s var(--ease), border-color 1.2s var(--ease), box-shadow 1.2s var(--ease);
}
.cells i.on {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.3);
}
.hero .container { position: relative; z-index: 1; }

@media (max-width: 767px) {
  .cells { opacity: 0.45; }
  .flow { display: none; }  /* the order-flow card is for wide screens; on a phone the form comes first */
}

/* ---------- flow card ---------- */
.flow {
  position: relative;
  padding: 16px 24px 24px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flow-head { display: flex; align-items: center; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.flow-head .dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--line-strong); }
.flow-title { margin-left: 8px; font-size: 0.75rem; line-height: 1rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.flow-steps { position: relative; z-index: 1; display: grid; gap: 8px; padding-top: 16px; }
.flow-step {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px;
  border: 1px solid transparent;
  opacity: 0.45;
  transition: opacity 0.5s var(--ease), background-color 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.flow-step.is-done { opacity: 0.8; }
.flow-step.is-active { opacity: 1; background: var(--surface-2); border-color: var(--line); transform: translateX(4px); }
.flow-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.1); color: var(--muted);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.flow-icon svg { width: 20px; height: 20px; }
.flow-step.is-active .flow-icon, .flow-step.is-done .flow-icon { background: var(--brand-soft); color: var(--brand-2); }
.flow-step b { display: block; font-weight: 600; font-size: 0.875rem; line-height: 1.25rem; }
.flow-step div > span { display: block; color: var(--muted); font-size: 0.75rem; line-height: 1rem; }
.flow-step .kbd { display: inline-block; padding: 0 6px; font-size: 0.75rem; line-height: 1rem; color: var(--text); }
.flow-badge {
  font-style: normal; font-size: 0.75rem; line-height: 1rem; font-weight: 600;
  padding: 2px 8px; border-radius: 9999px;
  background: rgba(148, 163, 184, 0.1); color: var(--dim);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.flow-step.is-active .flow-badge { background: var(--brand); color: var(--brand-ink); }
.flow-step.is-done .flow-badge { background: var(--brand-soft); color: var(--brand-2); }
.flow-line {
  position: absolute; left: 43px; top: 88px; bottom: 56px; width: 2px;
  background: var(--line); border-radius: 2px; z-index: 0;
}
.flow-packet {
  position: absolute; left: -3px; top: 0; width: 8px; height: 8px; border-radius: 9999px;
  background: var(--brand-2); box-shadow: 0 0 16px var(--brand);
  transform: translateY(var(--packet-y, 0));
  transition: transform 1.1s var(--ease);
}

/* ---------- supplier strip as a ticker ---------- */
.strip { border-block: 1px solid var(--line); overflow: hidden; }
.strip .container { justify-content: flex-start; flex-wrap: nowrap; }
.strip .label { width: auto; flex: none; }
.ticker { display: flex; gap: 40px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker ul { display: flex; gap: 40px; flex: none; animation: ticker 52s linear infinite; }
.ticker li { font-weight: 700; font-size: 1.125rem; line-height: 1.75rem; color: var(--muted); white-space: nowrap; }
@keyframes ticker { to { transform: translateX(calc(-100% - 40px)); } }

/* ---------- neighbor radar ---------- */
.radar { position: relative; width: 100%; aspect-ratio: 1; max-width: 420px; margin-inline: auto; border-radius: 9999px; border: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.radar::before, .radar::after { content: ''; position: absolute; inset: 20%; border-radius: 9999px; border: 1px solid var(--line); }
.radar::after { inset: 40%; }
.radar .sweep { position: absolute; inset: 0; border-radius: 9999px; background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.35), transparent 60deg); animation: sweep 4s linear infinite; }
.radar .me { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 9999px; background: var(--brand); box-shadow: 0 0 0 6px var(--brand-soft); }
.radar .dot { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 9999px; background: var(--text); opacity: 0.35; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.radar .dot.on { opacity: 1; transform: scale(1.4); background: var(--brand-2); }
.radar .tag {
  position: absolute; padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  font-size: 0.75rem; line-height: 1rem; color: var(--muted); white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.radar .tag.on { opacity: 1; transform: none; }
.radar .tag b { color: var(--text); }
@keyframes sweep { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ticker ul { animation: none; }
  .radar .sweep { animation: none; }
  .flow-step { opacity: 1; }
}

/* mobile: the ticker goes under its label (overrides the one-row strip above) */
@media (max-width: 767px) {
  .strip .container { flex-wrap: wrap; justify-content: flex-start; gap: 8px 0; }
  .strip .label { width: 100%; text-align: left; font-size: 0.75rem; line-height: 1rem; }
  .ticker { width: 100%; }
  .ticker li { font-size: 1rem; line-height: 1.5rem; }
}
