/* ==========================================================================
   Blok „Co monitorujemy” (.mo-sect + .mo-what): urządzenie, nitki, karty danych.
   Źródło (prototyp): assets/css/podstrony/monitoring.css (bez .p-monitoring).
   Spoczynkowy CSS to stan końcowy; view.js tylko uzbraja rysowanie (.is-armed → .is-on).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Klocki strony Monitoringu (monitoring.css: .p-monitoring → .mo-sect): sekcja,
   separator z kropką, nagłówek w dwóch kolumnach, kafelek ikony. Te same reguły
   mają wszystkie bloki monitoring-* (każdy blok działa sam, bez innych).
   -------------------------------------------------------------------------- */

.mo-sect { --mo-y: clamp(3.75rem, 7vw, 6.5rem); --mo-gap: clamp(.75rem, 1.6vw, 1.25rem); position: relative; padding: var(--mo-y) 0; }
.mo-sect--tint { background: var(--paper-2); }

/* between two sections on the same ground: a hairline fading out at both ends with an
   orange dot in a white gap (the home page's .stairs separator), centred on the seam */
.mo-sep { position: relative; border-top: 0; }
.mo-sep::before {
  content: ""; position: absolute; left: 50%; top: 0; z-index: 1;
  width: min(100% - 2 * var(--gutter), var(--container)); height: 26px; transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, var(--orange) 0 4px, var(--orange-50) 4.5px 7px, #fff 7.5px 12px, transparent 12.5px) center / 26px 26px no-repeat,
    linear-gradient(90deg, rgba(203, 213, 224, 0), var(--line-strong) 28%, var(--line-strong) 72%, rgba(203, 213, 224, 0)) center / 100% 1px no-repeat;
}

/* two-column head: the prefix on its own row, then the title left and the lead right,
   both top-aligned so the lead never starts above the title */
.mo-head {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 1.25rem clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: clamp(2rem, 4vw, 3rem);
}
.mo-head > .eyebrow.eyebrow { grid-column: 1 / -1; margin: 0; }
.mo-head h2 { margin: 0; max-width: 21ch; }
.mo-head__lead { margin: 0; padding-top: .4rem; color: var(--muted); font-size: 1.0625rem; max-width: 56ch; }

.mo-ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy);
}
.mo-ico .icon { width: 1.15rem; height: 1.15rem; }

@media (max-width: 900px) {
  .mo-head { grid-template-columns: minmax(0, 1fr); }
  .mo-head__lead { padding-top: 0; }
}

/* two SVG layers in one box: the pale track and the orange draw; the draw is revealed
   with a clip-path on its own box, so non-scaling strokes stay crisp at any size */
.mo-wires { position: relative; }
.mo-wires svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mo-wires path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.mo-wires__track path { stroke: var(--orange-100); stroke-width: 2; }
.mo-wires__draw path { stroke: var(--orange); stroke-width: 2.5; }

/* --------------------------------------------------------------------------
   Co monitorujemy: jedno urządzenie, nitki, rodzaje danych
   -------------------------------------------------------------------------- */

.mo-what {
  display: grid; grid-template-columns: minmax(0, 4.2fr) minmax(56px, 1.4fr) minmax(0, 6.4fr);
  align-items: center;
}
.mo-what__dev {
  position: relative; display: grid; justify-items: center; gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.4vw, 2rem);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle, rgba(35, 66, 105, .14) 1px, transparent 1.6px) 0 0 / 16px 16px, var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
/* the port where the threads leave the device */
.mo-what__dev::after {
  content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50), 0 0 0 5px var(--orange-100);
}
.mo-mfp { display: block; width: 100%; max-width: 270px; height: auto; overflow: visible; }
.mo-mfp__shadow { fill: rgba(22, 42, 67, .08); }
.mo-mfp__face { fill: #fff; stroke: var(--navy-700); stroke-width: 1.6; }
.mo-mfp__soft { fill: var(--navy-50); stroke: var(--navy-700); stroke-width: 1.4; stroke-linejoin: round; }
.mo-mfp__line { fill: none; stroke: var(--navy-700); stroke-width: 1.6; stroke-linecap: round; }
.mo-mfp__screen { fill: var(--navy-900); }
.mo-mfp__pulse { fill: none; stroke: var(--orange-400); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mo-mfp__wave { fill: none; stroke: var(--orange); stroke-width: 2.2; stroke-linecap: round; }
.mo-what__cap { margin: 0; max-width: 26ch; text-align: center; font-family: var(--font-ui); font-size: .875rem; font-weight: 500; line-height: 1.4; color: var(--navy); }

.mo-what__wires { align-self: stretch; }
.mo-what__list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 1fr; }
.mo-what__list li { position: relative; display: grid; padding: 6px 0 6px 1.25rem; }
/* each thread lands on a dot at the card's edge */
.mo-what__list li::before {
  content: ""; position: absolute; left: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50);
}
.mo-what__card {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1.05rem 1.35rem 1.1rem 1.1rem; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -26px rgba(22, 42, 67, .45);
}
.mo-what__card h3 { margin: .45rem 0 .2rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; color: var(--navy-900); }
.mo-what__card p { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--muted); max-width: 52ch; }

/* --------------------------------------------------------------------------
   Rysowanie nitek: uzbrojone przez view.js, tylko bez ograniczenia ruchu
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .mo-what.is-armed .mo-what__wires .mo-wires__draw { clip-path: inset(0 100% 0 0); }
  .mo-what.is-armed .mo-what__list li::before { transform: scale(.4); opacity: .3; }
  .mo-what.is-armed .mo-what__card { opacity: 0; transform: translateX(14px); }
  .mo-what.is-on .mo-what__wires .mo-wires__draw { clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease) .15s; }
  .mo-what.is-on .mo-what__list li::before { transform: none; opacity: 1; transition: transform .5s var(--ease), opacity .3s; transition-delay: calc(.85s + var(--i) * .08s); }
  .mo-what.is-on .mo-what__card { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease); transition-delay: calc(.7s + var(--i) * .08s); }
}

/* --------------------------------------------------------------------------
   Układ na mniejszych ekranach
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .mo-what { grid-template-columns: minmax(0, 4fr) minmax(44px, 1fr) minmax(0, 6.6fr); }
}

@media (max-width: 900px) {
  .mo-what { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .mo-what__dev::after, .mo-what__wires, .mo-what__list li::before { display: none; }
  .mo-what__dev { padding: 1.5rem 1.25rem 1.25rem; }
  .mo-mfp { max-width: 220px; }
  .mo-what__list { grid-auto-rows: auto; gap: .6rem; }
  .mo-what__list li { padding: 0; }
}
