/*
  services page styles. Owned by P3 (Engineer 2).
  Loaded only on that page (BG and EN). Use the tokens and classes from base.css;
  do not override header/footer styles here.
*/

.service-eg {
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-top: var(--s-3);
}
.service-list { display: grid; gap: var(--s-3); padding-left: 1.1rem; color: var(--c-text-muted); }
.service-list li::marker { color: var(--c-accent); }

/* Keep long words inside the cards: grid items may shrink, headings wrap and are smaller here. */
.grid > .card { min-width: 0; }
.grid > .card h2 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.grid > .card p, .grid > .card li { overflow-wrap: break-word; }

/* ---------- Animated service icons (THR-46) ----------
   Inline SVG in each card, decoration only. Static by default (JS off, reduced motion).
   With JS the icon plays once when the card gets .is-visible; hover replays a gentle move. */
.svc-icon { display: block; width: 64px; height: 64px; margin-bottom: var(--s-3); color: var(--c-accent); }
.svc-icon .d { stroke-dasharray: 1; stroke-dashoffset: 0; }
.svc-icon g, .svc-icon .spark, .svc-icon .f { transform-box: fill-box; transform-origin: center; }
.svc-icon--auto .g2 { color: var(--c-accent-2); }
.svc-icon--int .spark { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  /* websites: the window draws itself */
  .js .card:not(.is-visible) .svc-icon--web .d { stroke-dashoffset: 1; }
  .js .card:not(.is-visible) .svc-icon--web .f { opacity: 0; }
  .js .card.is-visible .svc-icon--web .d { animation: svc-draw 0.9s ease-out backwards; }
  .js .card.is-visible .svc-icon--web .l1 { animation-delay: 0.5s; }
  .js .card.is-visible .svc-icon--web .l2 { animation-delay: 0.65s; }
  .js .card.is-visible .svc-icon--web .l3 { animation-delay: 0.8s; }
  .js .card.is-visible .svc-icon--web .f { animation: svc-fade 0.5s ease-out 0.9s backwards; }
  .card.card:hover .svc-icon--web .d { animation: svc-draw-h 0.9s ease-out backwards; }
  .card.card:hover .svc-icon--web .l1 { animation-delay: 0.15s; }
  .card.card:hover .svc-icon--web .l2 { animation-delay: 0.3s; }
  .card.card:hover .svc-icon--web .l3 { animation-delay: 0.45s; }

  /* automations: two gears turn, one each way */
  .js .card.is-visible .svc-icon--auto .g1 { animation: svc-spin 4s ease-out; }
  .js .card.is-visible .svc-icon--auto .g2 { animation: svc-spin-back 4s ease-out; }
  .card.card:hover .svc-icon--auto .g1 { animation: svc-spin-h 6s linear infinite; }
  .card.card:hover .svc-icon--auto .g2 { animation: svc-spin-back-h 6s linear infinite; }

  /* integrations: two plugs slide together, then a small spark */
  .js .card.is-visible .svc-icon--int .p1 { animation: svc-plug-l 0.9s cubic-bezier(.3,1.3,.5,1) backwards; }
  .js .card.is-visible .svc-icon--int .p2 { animation: svc-plug-r 0.9s cubic-bezier(.3,1.3,.5,1) backwards; }
  .js .card.is-visible .svc-icon--int .spark { animation: svc-spark 0.8s ease-out 0.8s; }
  .card.card:hover .svc-icon--int .p1 { animation: svc-plug-l-h 0.9s cubic-bezier(.3,1.3,.5,1) backwards; }
  .card.card:hover .svc-icon--int .p2 { animation: svc-plug-r-h 0.9s cubic-bezier(.3,1.3,.5,1) backwards; }
  .card.card:hover .svc-icon--int .spark { animation: svc-spark-h 0.8s ease-out 0.8s; }
}
@keyframes svc-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes svc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes svc-spin { to { transform: rotate(180deg); } }
@keyframes svc-spin-back { to { transform: rotate(-180deg); } }
@keyframes svc-plug-l { from { transform: translateX(-10px); } to { transform: none; } }
@keyframes svc-plug-r { from { transform: translateX(10px); } to { transform: none; } }
@keyframes svc-spark { 0%, 100% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; transform: scale(1); } }
/* hover runs use their own names so they restart even after the scroll-in run (same name never restarts) */
@keyframes svc-draw-h { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes svc-spin-h { to { transform: rotate(360deg); } }
@keyframes svc-spin-back-h { to { transform: rotate(-360deg); } }
@keyframes svc-plug-l-h { from { transform: translateX(-10px); } to { transform: none; } }
@keyframes svc-plug-r-h { from { transform: translateX(10px); } to { transform: none; } }
@keyframes svc-spark-h { 0%, 100% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; transform: scale(1); } }
