/* Swarm cursors intro — overlay styles (design-tool / blueprint look) */
.swarm-layer {
  --sw-guide: rgba(240, 122, 34, .62);
  --sw-snap: #ff3d71;
  --sw-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* blueprint grid */
.sw-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(246, 244, 240, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(246, 244, 240, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: calc(50% + .5px) 0;
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 46%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 46%, #000 35%, transparent 100%);
}

/* registration marks */
.sw-plus {
  position: absolute;
  width: 13px;
  height: 13px;
}
.sw-plus::before,
.sw-plus::after {
  content: "";
  position: absolute;
  background: rgba(246, 244, 240, .6);
}
.sw-plus::before { left: 6px; top: 0; width: 1px; height: 13px; }
.sw-plus::after { top: 6px; left: 0; width: 13px; height: 1px; }

/* construction guides */
.sw-guide { position: absolute; }
.sw-guide--h {
  left: 0;
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--sw-guide) 0 6px, transparent 6px 11px);
  transform-origin: left center;
}
.sw-guide--v {
  top: 0;
  height: 100%;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--sw-guide) 0 6px, transparent 6px 11px);
  transform-origin: center top;
}
.sw-coord {
  position: absolute;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(10, 10, 10, .78);
  color: #f6a464;
  font: 500 10.5px/1.5 var(--sw-mono);
  letter-spacing: .02em;
  white-space: nowrap;
}
.sw-guide--h .sw-coord { right: 18px; top: -19px; }
.sw-guide--v .sw-coord { left: 7px; top: 74px; }

/* selection (Figma-like) */
.sw-sel { position: absolute; }
.sw-sel-frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--c);
  box-shadow: 0 0 0 1px rgba(10, 10, 10, .35), inset 0 0 0 9999px rgba(255, 255, 255, .025);
}
.sw-h {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
  border: 1px solid var(--c);
  transform: translate(-50%, -50%);
}
.sw-h--nw { left: 0; top: 0; }
.sw-h--n { left: 50%; top: 0; }
.sw-h--ne { left: 100%; top: 0; }
.sw-h--e { left: 100%; top: 50%; }
.sw-h--se { left: 100%; top: 100%; }
.sw-h--s { left: 50%; top: 100%; }
.sw-h--sw { left: 0; top: 100%; }
.sw-h--w { left: 0; top: 50%; }
.sw-sel-name,
.sw-sel-size {
  position: absolute;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--c);
  color: var(--ink);
  font: 600 10.5px/1.55 var(--sw-mono);
  white-space: nowrap;
}
.sw-sel-name { left: -1px; bottom: calc(100% + 5px); }
.sw-sel-size { left: 50%; top: calc(100% + 7px); transform: translateX(-50%); }

/* smart guides + redline measurement */
.sw-snap {
  position: absolute;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--sw-snap);
  box-shadow: 0 0 8px rgba(255, 61, 113, .55);
}
.sw-snap-tag,
.sw-measure-tag {
  position: absolute;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--sw-snap);
  color: #fff;
  font: 600 10.5px/1.55 var(--sw-mono);
  white-space: nowrap;
}
.sw-snap-tag { left: 7px; }
.sw-measure {
  position: absolute;
  width: 1px;
  background: var(--sw-snap);
}
.sw-measure::before,
.sw-measure::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--sw-snap);
}
.sw-measure::before { top: 0; }
.sw-measure::after { bottom: 0; }
.sw-measure-tag { left: 9px; top: 50%; transform: translateY(-50%); }

/* typing caret */
.sw-caret {
  position: absolute;
  width: 2px;
  background: var(--c);
  animation: sw-blink 1s steps(1) infinite;
}
@keyframes sw-blink { 50% { opacity: 0; } }

/* cursors */
.swarm-cursor {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
}
.swarm-cursor svg { display: block; }
.swarm-tag {
  position: absolute;
  left: 14px;
  top: 16px;
  padding: 2px 7px;
  border-radius: 2px 7px 7px 7px;
  background: var(--c);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  white-space: nowrap;
}
.swarm-say {
  position: absolute;
  left: 14px;
  top: 37px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(10, 10, 10, .82);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--c);
  font: 500 10.5px/1.5 var(--sw-mono);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
}
.swarm-cursor.is-saying .swarm-say { opacity: 1; }
.swarm-ripple {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
}

/* multiplayer status pill */
.sw-hud {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(16, 13, 11, .74);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: rgba(246, 244, 240, .84);
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.sw-avatars { display: flex; }
.sw-avatar {
  width: 20px;
  height: 20px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid #100d0b;
  background: var(--c);
  color: var(--ink);
  font: 700 9px/16px var(--sw-mono);
  text-align: center;
}
.sw-avatar:first-child { margin-left: 0; }
.sw-hud-text b { color: #fff; font-weight: 650; }
.sw-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2bd193;
  box-shadow: 0 0 0 3px rgba(43, 209, 147, .18);
  animation: sw-pulse 1.2s ease-in-out infinite;
}
@keyframes sw-pulse { 50% { box-shadow: 0 0 0 5px rgba(43, 209, 147, .05); } }
.sw-hud-bar {
  position: relative;
  width: 72px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.sw-hud-bar i {
  position: absolute;
  inset: 0;
  background: #f07a22;
  transform-origin: left center;
}

@media (max-width: 640px) {
  .sw-hud { left: auto; right: 14px; bottom: auto; top: 112px; transform: none; padding: 6px 10px 6px 7px; gap: 8px; }
  .sw-hud-text, .sw-hud-bar { display: none; }
  .sw-guide--h .sw-coord { right: 10px; }
  .sw-sel-size { display: none; }
}

/* HAO: outline during the swarm, filled in sync with PORTFOLIO afterwards */
.cover-hao.swarm-ghost {
  position: relative;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(240, 122, 34, .8);
}
.cover-hao.swarm-ghost::after {
  content: attr(data-swarm-text);
  position: absolute;
  inset: 0;
  color: #fff;
  -webkit-text-stroke: 0;
  clip-path: inset(0 100% 0 0);
}
.cover-hao.swarm-fill::after {
  animation: sw-hao-wipe .8s cubic-bezier(.455, .03, .515, .955) forwards;
}
@keyframes sw-hao-wipe { to { clip-path: inset(0 0 0 0); } }