/* system: koło Systemu i sześć obszarów. Wspólne klocki i zmienne są w ../podstawy.css.
   Koło to jeden mechanizm (wieniec, wycinki z medalionami, piasta z napędem) generowany do sekcje/czesci/kolo-systemu.html;
   tutaj jego wygląd, wejście w kadr i stan „wybrany”. */
#system .sys-head { max-width: none; padding-bottom: 38px; border-bottom: 1px solid var(--line); }
#system .sys-head h2 { max-width: 20em; }
#system .sys-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
#system .sys-brand { font-size: 21px; letter-spacing: -.01em; white-space: nowrap; }
#system .sys-brand small { font-size: .84em; }
#system .sys-brand b { font-weight: 700; }
#system .sys-brand i { font-style: normal; color: var(--brand); }
#system .sys-brand sup { font-size: .5em; }

#system .sys-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(28px, 4.4vw, 72px); align-items: center; }

/* --- koło --- */
#system .sys-wheel { position: relative; width: 100%; max-width: 560px; margin-inline: auto; aspect-ratio: 1; }
#system .scene-wheel { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }
#system .z-q { opacity: .34; transition: opacity .45s; }
#system .z142-o { pointer-events: all; cursor: pointer; transition: stroke .3s, stroke-width .3s; }   /* cały wycinek łapie kursor, nie tylko kontur */
#system .wheel-label, #system .wheel-imprint { pointer-events: none; }
#system .wheel-label text { fill: var(--ink); text-anchor: middle; font: 600 26px Barlow, Arial, sans-serif; letter-spacing: .5px; transition: fill .3s; }   /* nazwa obszaru biegnie po łuku wycinka */
#system .seg { transition: transform .45s var(--ease); }
#system .seg:has(.is-current) { transform: translate(var(--tx), var(--ty)); }                      /* wybrany wycinek wysuwa się o kilka pikseli na zewnątrz */
#system .seg-div { fill: none; stroke: var(--ink); stroke-width: .9; opacity: .55; transition: stroke .3s, opacity .3s; pointer-events: none; }
#system .wheel-medal { fill: var(--paper); stroke: var(--ink); stroke-width: 1.100; pointer-events: none; transition: stroke .3s, stroke-width .3s; }
#system .wheel-hub { fill: none; stroke: var(--ink); stroke-width: 1.100; opacity: .6; }
#system .wheel-bezel circle { fill: none; stroke: var(--ink); stroke-width: .9; opacity: .6; }
#system .wheel-bezel .knurl { stroke-width: 9; stroke-dasharray: 1.100 4.800; opacity: .42; animation: sysTurn 1.8s linear infinite; }   /* kreski wędrują po obwodzie (bez obrotu elementu, więc obrys koła nie rośnie) */
#system .sys-geo * { fill: none; stroke: var(--sepia); stroke-width: .6; vector-effect: non-scaling-stroke; opacity: calc(var(--kop) * .24); }
@keyframes sysTurn { to { stroke-dashoffset: -5.900; } }
@media (prefers-reduced-motion: reduce) { #system .wheel-bezel .knurl { animation: none; } }
#system .wico { overflow: visible; }
#system .wico .d { fill: none; stroke: var(--ink); stroke-width: 1.700; stroke-linecap: round; stroke-linejoin: round; }
#system .wico .hot { stroke: var(--brand); }
#system .wico .hot-fill { fill: var(--brand); }
#system .wico .dot { fill: var(--ink); }
#system .wico .teeth { fill: none; stroke: var(--ink); stroke-width: 3.200; stroke-dasharray: 3.800 3.420; }
#system .wico .teeth.hot-stroke { stroke: var(--brand); stroke-dasharray: 3.100 2.790; stroke-width: 2.600; }
/* wybrany obszar: karmazynowy kontur i gęstsze, czerwone kreskowanie wycinka */
#system .z142-o.is-current { stroke: var(--brand); stroke-width: 2.600; }
#system .z-q.is-current { fill: var(--hot); opacity: .85; }
#system .z142-o.is-current ~ .wheel-medal { stroke: var(--brand); stroke-width: 1.600; }
#system .z142-o.is-current ~ .seg-div { stroke: var(--brand); opacity: 1; }
#system .z142-o.is-current ~ .wheel-label text { fill: var(--brand); }

/* wejście w kadr: kontury wycinków rysują się po kolei, potem kreskowanie i etykiety, na końcu czerwony napęd w środku */
#system .sys-wheel .z142-o, #system .sys-wheel .zb-dr { stroke-dasharray: 1; stroke-dashoffset: 1; }
#system .sys-wheel.in .z142-o { animation: sysInk 1.1s cubic-bezier(.45, 0, .2, 1) var(--d) forwards; }
#system .sys-wheel.in .scene-rotor .zb-dr { animation: sysInk var(--t) ease calc(var(--d) + 1.5s) forwards; }
#system .sys-wheel.in .scene-drive .zb-dr { animation: sysInk var(--t) ease calc(var(--d) * .5 + .4s) forwards; }
#system .sys-wheel:not(.in) :is(.z-q, .zb-in, .wheel-label, .wheel-imprint, .z142-r, .wheel-medal, .seg-div, .wheel-bezel, .wheel-hub, .sys-geo) { opacity: 0; }
#system .sys-wheel.in :is(.wheel-bezel, .wheel-hub, .sys-geo) { animation: sysFade 1.1s ease .2s backwards; }
#system .sys-wheel.in :is(.wheel-medal, .seg-div) { animation: sysFade .7s ease 1.2s backwards; }
#system .sys-wheel.in .z142-r { animation: sysFade .9s ease .1s backwards; }
#system .sys-wheel.in .z-q { animation: sysFade .9s ease 1.3s backwards; }
#system .sys-wheel.in .wheel-label { animation: sysFade .7s ease 1.1s backwards; }
#system .sys-wheel.in .wheel-imprint { animation: sysFade .8s ease 1.9s backwards; }
#system .sys-wheel.in .scene-rotor .zb-in { animation: sysFade .4s ease calc(var(--d) + 2s) backwards; }
#system .sys-wheel.in .scene-drive .zb-in { animation: sysFade .4s ease calc(var(--d) * .5 + .4s) backwards; }
@keyframes sysInk { to { stroke-dashoffset: 0; } }
@keyframes sysFade { from { opacity: 0; } }

/* --- sześć obszarów obok koła --- */
#system .sys-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; }
#system .area { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 18px; align-content: start; padding: 22px 26px 24px 0; border-right: 0; border-top: 1px solid var(--line); }
#system .area:nth-child(even) { padding: 22px 0 24px 26px; border-left: 1px solid var(--line); }
#system .area .ico { grid-row: 1 / span 3; }
#system .area h3 { margin: 3px 0 6px; }
#system .area p { grid-column: 2; }
#system .area.is-current::before { transform: none; }
#system .area.is-current h3 { color: var(--brand); }
#system .area h3 { transition: color .3s; }

/* --- efekt --- */
#system .sys-result { margin-top: clamp(40px, 4.4vw, 64px); padding-top: 34px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(28px, 4.4vw, 72px); align-items: start; }
#system .sys-result h3 { margin: 14px 0 0; font-size: clamp(24px, 2.300vw, 33px); line-height: 1.2; font-weight: 500; letter-spacing: -.02em; }
#system .sys-result li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; color: #4A433F; }
#system .sys-result li:first-child { padding-top: 2px; }
#system .chk { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .6s var(--ease); transition-delay: calc(var(--d, 0) * 110ms + .35s); }
#system .sys-result.in .chk { stroke-dashoffset: 0; }

/* --- tablet i telefon: koło nad obszarami --- */
@media (max-width: 999.98px) {
  #system .sys-grid, #system .sys-result { grid-template-columns: minmax(0, 1fr); }
  #system .sys-wheel { max-width: 440px; }
  #system .sys-head { padding-bottom: 28px; }
}
@media (max-width: 619.98px) {
  #system .sys-areas { grid-template-columns: minmax(0, 1fr); }
  #system .area, #system .area:nth-child(even) { padding: 20px 0 22px; border-left: 0; }
  #system .sys-brand { font-size: 19px; }
}
