/* Logo intro: the CTS network connects cell by cell from the centre, the letters and dots appear, the rule grows
   from the middle, COMPTRUSENCE rises in letter by letter, then one glow and radar rings. The hero logo is an
   inline SVG made of the logo's own pieces (index.html); assets/js/page/logo-intro.js adds the classes. It ends
   identical to the original logo. No inline styles (strict CSP). Off for reduced motion. Generated by
   build_logo_anim.py. */

/* the finished logo (also what people see without JavaScript or with reduced motion) */
.cts-logo .cts-body, .cts-logo .cts-rule, .cts-logo .cts-letter { fill: #fff; }
.cts-logo .cts-cell { fill: none; stroke: none; }
.cts-logo .cts-rule, .cts-logo .cts-letter, .cts-logo .cts-body { transform-box: fill-box; }

/* ---- the intro ---- */
.brand-mark.cts-draw .cts-cell {
  stroke: #8FB6FF; stroke-width: .7; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 1;
  animation: cts-trace .75s cubic-bezier(.5, 0, .3, 1) both, cts-fade-out .5s ease-out both;
}
.brand-mark.cts-draw .cts-cell:nth-child(1) { animation-delay: 0.15s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(2) { animation-delay: 0.26s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(3) { animation-delay: 0.37s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(4) { animation-delay: 0.48s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(5) { animation-delay: 0.59s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(6) { animation-delay: 0.70s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(7) { animation-delay: 0.81s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(8) { animation-delay: 0.92s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(9) { animation-delay: 1.03s, 1.85s; }
.brand-mark.cts-draw .cts-cell:nth-child(10) { animation-delay: 1.14s, 1.85s; }
.brand-mark.cts-draw .cts-body {
  transform-origin: center; animation: cts-body-in .8s cubic-bezier(.2, .7, .2, 1) 1.15s both;
}
.brand-mark.cts-draw .cts-rule {
  transform-origin: center; animation: cts-rule-in .55s cubic-bezier(.2, .7, .2, 1) 1.6s both;
}
.brand-mark.cts-draw .cts-letter { animation: cts-letter-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.brand-mark.cts-draw .cts-letter:nth-child(1) { animation-delay: 1.850s; }
.brand-mark.cts-draw .cts-letter:nth-child(2) { animation-delay: 1.905s; }
.brand-mark.cts-draw .cts-letter:nth-child(3) { animation-delay: 1.960s; }
.brand-mark.cts-draw .cts-letter:nth-child(4) { animation-delay: 2.015s; }
.brand-mark.cts-draw .cts-letter:nth-child(5) { animation-delay: 2.070s; }
.brand-mark.cts-draw .cts-letter:nth-child(6) { animation-delay: 2.125s; }
.brand-mark.cts-draw .cts-letter:nth-child(7) { animation-delay: 2.180s; }
.brand-mark.cts-draw .cts-letter:nth-child(8) { animation-delay: 2.235s; }
.brand-mark.cts-draw .cts-letter:nth-child(9) { animation-delay: 2.290s; }
.brand-mark.cts-draw .cts-letter:nth-child(10) { animation-delay: 2.345s; }
.brand-mark.cts-draw .cts-letter:nth-child(11) { animation-delay: 2.400s; }
.brand-mark.cts-draw .cts-letter:nth-child(12) { animation-delay: 2.455s; }
.brand-mark.cts-draw .cts-logo { animation: cts-glow 1.6s ease-out 2.55s both; }
.brand-mark.cts-draw::before {              /* radar rings once the logo is complete */
  content: ""; position: absolute; left: 50%; top: 45%; width: 72%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(91, 147, 255, .55); transform: translate(-50%, -50%) scale(.4); opacity: 0; z-index: 3;
  animation: cts-ring 1.8s ease-out 2.65s 2 both; pointer-events: none;
}

/* ---- header logo (first page of a visit): a quick left-to-right reveal ---- */
.site-nav .logo.cts-intro img { animation: cts-reveal .9s cubic-bezier(.45, .05, .55, .95) .1s both; }
.site-nav .logo img { transition: filter .35s ease; }
.site-nav .logo:hover img { filter: drop-shadow(0 0 6px rgba(91, 147, 255, .55)); }

@keyframes cts-trace    { to { stroke-dashoffset: 0; } }
@keyframes cts-fade-out { to { opacity: 0; } }
@keyframes cts-body-in  { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes cts-rule-in  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cts-letter-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cts-reveal   { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes cts-glow {
  0%   { filter: drop-shadow(0 0 0 rgba(91, 147, 255, 0)); }
  35%  { filter: drop-shadow(0 0 20px rgba(91, 147, 255, .85)); }
  100% { filter: drop-shadow(0 0 0 rgba(91, 147, 255, 0)); }
}
@keyframes cts-ring {
  0%   { opacity: .8; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark.cts-draw .cts-cell, .brand-mark.cts-draw .cts-body, .brand-mark.cts-draw .cts-rule,
  .brand-mark.cts-draw .cts-letter, .brand-mark.cts-draw .cts-logo, .site-nav .logo.cts-intro img { animation: none; }
  .brand-mark.cts-draw .cts-cell { stroke: none; }
  .brand-mark.cts-draw::before { display: none; }
}
