/* ==========================================================================
   What it catches — threat marquee, shield-dome illustration, explainers
   ========================================================================== */

#threats { overflow: hidden; }

/* ---------- Marquee ---------- */
.threats__marquee {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding-block: 6px 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.threats__row {
  display: flex;
  width: max-content;
}
.threats__track {
  display: flex;
  flex: none;
  gap: 12px;
  margin: 0;
  padding: 0 12px 0 0;
  list-style: none;
  animation: threats-marquee 44s linear infinite;
}
.threats__row--reverse .threats__track {
  animation-duration: 50s;
  animation-direction: reverse;
}
.threats__marquee:hover .threats__track,
.threats__marquee:focus-within .threats__track,
#threats.is-paused .threats__track,
#threats:not(.is-playing) .threats__track { animation-play-state: paused; }

/* Pause / play control for the scrolling chips (WCAG 2.2.2) */
.threats__pause-wrap {
  display: flex;
  justify-content: center;
  margin: -6px 0 0;
}
.threats__pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: border-color 0.2s, color 0.2s;
}
.threats__pause:hover { border-color: var(--navy); color: var(--navy); }
.threats__pause svg { width: 14px; height: 14px; }
.threats__pause .threats__play,
#threats.is-paused .threats__pause .threats__pause-icon { display: none; }
#threats.is-paused .threats__pause .threats__play { display: block; }

.threats__chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 0 var(--navy);
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.threats__chip::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  border: 1.5px solid var(--navy);
  border-radius: 2px;
  transform: rotate(45deg);
}
.threats__chip--red { background: var(--red-100); }
.threats__chip--red::before { background: var(--red); }
.threats__chip--yellow { background: var(--yellow-100); }
.threats__chip--yellow::before { background: var(--yellow); }
.threats__chip--blue { background: var(--blue-100); }
.threats__chip--blue::before { background: var(--blue); }
.threats__chip--green { background: var(--green-100); }
.threats__chip--green::before { background: var(--green); }

/* ---------- Split: illustration + explainers ---------- */
.threats__split {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}
.threats__art {
  width: 100%;
  max-width: 580px;
  justify-self: center;
}
.threats__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Attacks bouncing off the dome */
.threats__shot,
.threats__burst,
.threats__flash,
.threats__twinkle {
  animation-duration: 3.6s;
  animation-iteration-count: infinite;
}
.threats__shot { animation-name: threats-shot; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.6); opacity: 0; }
.threats__burst,
.threats__flash,
.threats__twinkle {
  transform-box: fill-box;
  transform-origin: center;
}
.threats__burst { animation-name: threats-burst; opacity: 0; }
.threats__flash { animation-name: threats-flash; opacity: 0; }
.threats__shot--2,
.threats__burst--2,
.threats__flash--2 { animation-delay: 0.9s; }
.threats__shot--3,
.threats__burst--3,
.threats__flash--3 { animation-delay: 1.8s; }
.threats__shot--4,
.threats__burst--4,
.threats__flash--4 { animation-delay: 2.7s; }
.threats__twinkle { animation-name: threats-twinkle; animation-duration: 3s; }
.threats__twinkle--b { animation-delay: -1.5s; }
#threats:not(.is-playing) .threats__svg * { animation-play-state: paused; }

/* Explainers */
.threats__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.threats__item {
  padding: 24px 0;
  border-bottom: 1.5px solid var(--hairline);
}
.threats__item:first-child { padding-top: 0; }
.threats__item:last-child { border-bottom: 0; padding-bottom: 0; }
.threats__item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 10px;
}
.threats__item-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.threats__pill--high { background: #ffe4d1; }
.threats__item p {
  margin-top: 4px;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--muted);
}
.threats__item b { color: var(--navy); }
.threats__item code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-alt);
  font-size: 0.85em;
  color: var(--navy);
}

/* ---------- Keyframes ---------- */
@keyframes threats-marquee { to { transform: translateX(-100%); } }
@keyframes threats-shot {
  0% { opacity: 0; transform: translateX(-200px); }
  6% { opacity: 1; }
  32% { opacity: 1; transform: translateX(-3px); }
  42% { opacity: 0; transform: translateX(-46px) rotate(-14deg); }
  100% { opacity: 0; transform: translateX(-200px); }
}
@keyframes threats-burst {
  0%, 30% { opacity: 0; transform: scale(0) rotate(0); }
  34% { opacity: 1; transform: scale(1.3) rotate(20deg); }
  48% { opacity: 0; transform: scale(0.6) rotate(40deg); }
  100% { opacity: 0; transform: scale(0); }
}
@keyframes threats-flash {
  0%, 30% { opacity: 0; transform: scale(0.3); }
  33% { opacity: 1; transform: scale(0.6); }
  52% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(0.3); }
}
@keyframes threats-twinkle {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.65) rotate(45deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .threats__split { grid-template-columns: minmax(0, 1fr); }
  .threats__art { max-width: 460px; }
}
@media (max-width: 640px) {
  .threats__chip { padding: 8px 14px 8px 12px; font-size: 0.9rem; }
}

/* ---------- No JS: static chip cloud (nothing would ever start the marquee) ---------- */
.no-js .threats__marquee { -webkit-mask-image: none; mask-image: none; }
.no-js .threats__row { width: auto; justify-content: center; padding-inline: 16px; }
.no-js .threats__track { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: center; padding: 0; animation: none; }
.no-js .threats__track[aria-hidden="true"],
.no-js .threats__pause-wrap { display: none; }

/* ---------- Reduced motion: static chip cloud, frozen illustration ---------- */
@media (prefers-reduced-motion: reduce) {
  .threats__marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .threats__row { width: auto; justify-content: center; padding-inline: 16px; }
  .threats__track { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: center; padding: 0; animation: none; }
  .threats__pause { display: none; }
  .threats__track[aria-hidden="true"] { display: none; }
  .threats__svg * { animation: none !important; }
  .threats__burst--1,
  .threats__flash--1 { opacity: 1; }
}
