/* METHOD constellation — stable layout (no label detach bugs) */

.method-wrap {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(4rem, 10vh, 6rem);
  overflow: hidden;
}

.ms-space {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.ms-vignette {
  position: absolute;
  inset: -15% -10%;
  background: radial-gradient(
    ellipse 55% 45% at 50% 45%,
    rgba(124, 58, 237, 0.18),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

.ms-dust {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ms-dust i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 0 6px #a78bfa;
  animation: msDust 6s linear infinite;
  opacity: 0.35;
}
@keyframes msDust {
  0% { transform: translateY(30px); opacity: 0; }
  20% { opacity: 0.6; }
  100% { transform: translateY(-280px); opacity: 0; }
}

.ms-giant {
  position: absolute;
  right: 0;
  top: 0;
  font-family: var(--mono);
  font-size: clamp(7rem, 22vw, 14rem);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.9;
  color: rgba(167, 139, 250, 0.07);
  pointer-events: none;
  z-index: 0;
  user-select: none;
  /* locked box — never layout-shift when text 01→04 */
  width: 2.2ch;
  text-align: right;
  transform: none !important;
  will-change: opacity;
}

.ms-head {
  position: relative;
  z-index: 2;
  max-width: 36rem;
  margin-bottom: 0.5rem;
}
.ms-head .method-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.ms-head h2 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.65rem;
}
.ms-head p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34ch;
}
.ms-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ok);
}
.ms-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pipeBlink 1.3s ease-in-out infinite;
}

/* ---- field: fixed stage, nodes absolutely placed ---- */
.ms-field {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 340px;
  margin: 1rem 0 2rem;
}

.ms-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ms-path {
  fill: none;
  stroke-dasharray: 6 12;
  animation: msDash 18s linear infinite;
}
@keyframes msDash {
  to { stroke-dashoffset: -360; }
}

/*
  Node positions (match SVG path anchors roughly):
  01 12% 62% | 02 38% 28% | 03 64% 72% | 04 88% 42%
*/
.ms-node {
  position: absolute;
  left: var(--nx);
  top: var(--ny);
  /* ONLY positioning transform — never animated by GSAP */
  transform: translate(-50%, -50%);
  z-index: 3;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  -webkit-tap-highlight-color: transparent;
}

/* floating wrapper = orb only */
.msn-float {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  animation: msnBob 5.5s ease-in-out infinite;
}
.ms-node:nth-of-type(1) .msn-float { animation-duration: 5.5s; }
.ms-node:nth-of-type(2) .msn-float { animation-duration: 6.5s; animation-delay: -1s; }
.ms-node:nth-of-type(3) .msn-float { animation-duration: 5.8s; animation-delay: -2s; }
.ms-node:nth-of-type(4) .msn-float { animation-duration: 7s; animation-delay: -0.5s; }

.ms-node.is-on .msn-float {
  animation: none;
}

@keyframes msnBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.msn-halo {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(167, 139, 250, 0.35);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s, transform 0.45s;
  pointer-events: none;
}
.ms-node.is-on .msn-halo {
  opacity: 1;
  transform: scale(1);
  animation: sealSpin 14s linear infinite;
}

.msn-orb {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: rgba(233, 213, 255, 0.75);
  background: rgba(8, 6, 18, 0.65);
  border: 1px solid rgba(167, 139, 250, 0.4);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.2);
  transition: color 0.35s, border-color 0.35s, background 0.35s, box-shadow 0.4s, transform 0.35s;
  position: relative;
  z-index: 1;
}

.ms-node:hover .msn-orb,
.ms-node:focus-visible .msn-orb {
  border-color: rgba(233, 213, 255, 0.55);
  color: #fff;
  /* glow only — no scale (scale caused ghost double-number) */
  box-shadow: 0 0 28px rgba(167, 139, 250, 0.45);
}

.ms-node.is-on .msn-orb {
  color: #fff;
  border-color: rgba(233, 213, 255, 0.7);
  background: radial-gradient(circle at 35% 30%, rgba(167, 139, 250, 0.5), rgba(10, 6, 24, 0.9));
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.35),
    0 0 40px rgba(124, 58, 237, 0.75),
    0 0 80px rgba(124, 58, 237, 0.35);
  transform: none;
}

.msn-name {
  display: block;
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: rgba(233, 213, 255, 0.5);
  text-align: center;
  width: 100%;
  transition: color 0.3s, text-shadow 0.3s;
}
.msn-sub {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(233, 213, 255, 0.28);
  text-align: center;
  width: 100%;
}
.ms-node.is-on .msn-name {
  color: #e9d5ff;
  text-shadow: 0 0 18px rgba(167, 139, 250, 0.7);
}
.ms-node.is-on .msn-sub {
  color: var(--accent);
}

/* holo projection */
.ms-holo {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1.35rem 1.1rem;
  border-radius: 20px;
  background: rgba(8, 6, 18, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.15);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  /* fixed height band — step changes must NOT reflow nodes above */
  min-height: 248px;
  box-sizing: border-box;
}
.msh-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(167, 139, 250, 0.06),
    transparent
  );
  background-size: 100% 40%;
  animation: icScanH 5s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
}
.msh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-bottom: 0.9rem;
  position: relative;
}
.msh-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ok);
}
.msh-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pipeBlink 1.2s ease-in-out infinite;
}
.msh-name {
  margin-left: auto;
  color: var(--accent);
}

.msh-body {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.1rem;
  align-items: center;
  position: relative;
}
.msh-viz {
  position: relative;
  height: 110px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(167, 139, 250, 0.12);
  overflow: hidden;
}
.msh-viz .pdv {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
}
.msh-viz .pdv.is-show {
  opacity: 1;
  visibility: visible;
}

/* --- VIZ 0: RADAR --- */
.pdv-radar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.45);
  box-shadow:
    0 0 20px rgba(124, 58, 237, 0.35),
    inset 0 0 16px rgba(124, 58, 237, 0.15);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 65%);
}
.pdv-radar > span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.22);
  inset: 18%;
}
.pdv-radar > span:nth-child(2) { inset: 34%; }
.pdv-radar > span:nth-child(3) { inset: 50%; }
.pdv-radar .sweep {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 2px;
  margin: 0;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.95), transparent);
  transform-origin: left center;
  animation: sealSpin 2.4s linear infinite;
  box-shadow: 0 0 10px var(--accent);
  border: 0;
  display: block;
}
.pdv-radar .blip {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 0 8px #a78bfa;
  animation: pipeBlink 1.6s ease-in-out infinite;
}
.pdv-radar .b1 { left: 68%; top: 28%; }
.pdv-radar .b2 { left: 30%; top: 62%; animation-delay: 0.4s; background: #fb7185; box-shadow: 0 0 8px #fb7185; }
.pdv-radar .b3 { left: 58%; top: 70%; animation-delay: 0.8s; }

/* --- VIZ 1: SURFACE MAP --- */
.pdv-nodes {
  position: relative;
  width: 86%;
  height: 72%;
}
.pdv-nodes > i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pipeBlink 2s ease-in-out infinite;
  display: block;
  margin: 0;
  border: 0;
}
.pdv-nodes .n1 { left: 10%; top: 42%; }
.pdv-nodes .n2 { left: 36%; top: 14%; animation-delay: 0.2s; }
.pdv-nodes .n3 { left: 68%; top: 26%; animation-delay: 0.35s; background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.pdv-nodes .n4 { left: 40%; top: 68%; animation-delay: 0.15s; }
.pdv-nodes .n5 { left: 76%; top: 60%; animation-delay: 0.45s; }
.pdv-nodes .n6 { left: 18%; top: 72%; animation-delay: 0.55s; }
.pdv-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(167, 139, 250, 0.55);
  fill: none;
  stroke-width: 1.2;
  overflow: visible;
}

/* --- VIZ 2: TERMINAL --- */
.pdv-term {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: 0.03em;
  text-align: left;
  width: 90%;
  color: #c4b5fd;
}
.pdv-term .dim { color: rgba(196, 181, 253, 0.55); }
.pdv-term .ok { color: #34d399; text-shadow: 0 0 8px rgba(52, 211, 153, 0.4); }
.pdv-term .warn { color: #fb7185; text-shadow: 0 0 8px rgba(251, 113, 133, 0.4); }

/* --- VIZ 3: REPORT DOC --- */
.pdv-doc {
  width: 78%;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(124, 58, 237, 0.1);
  display: grid;
  gap: 0.4rem;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}
.pdv-doc span {
  display: block;
  height: 5px;
  width: 72%;
  border-radius: 3px;
  background: rgba(167, 139, 250, 0.35);
}
.pdv-doc span:nth-child(2) { width: 90%; }
.pdv-doc span:nth-child(3) { width: 58%; }
.pdv-doc span.wide {
  width: 100%;
  height: 22px;
  background: rgba(124, 58, 237, 0.25);
  margin: 0.15rem 0;
}
.pdv-doc b {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 500;
}

.msh-copy {
  min-height: 140px;
}
.msh-copy h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  min-height: 1.3em;
}
.msh-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 0.7rem;
  min-height: 2.8em;
}
.msh-copy .pd-bullets {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}
.msh-copy .pd-bullets li {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(233, 213, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.msh-copy .pd-bullets li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.msh-bar {
  margin-top: 1rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.msh-bar i {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--hot));
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 720px) {
  .ms-field { height: 300px; }
  .msn-orb, .msn-float { width: 56px; height: 56px; }
  .msn-orb { font-size: 13px; }
  .ms-node { width: 84px; }
  .ms-giant { font-size: 6rem; opacity: 0.5; }
  .msh-body { grid-template-columns: 1fr; }
  .msh-viz { height: 90px; }
}

html.reduced .msn-float,
html.reduced .ms-path,
html.reduced .ms-dust i,
html.reduced .ms-live i,
html.reduced .msh-live i,
html.reduced .msn-halo,
html.reduced .msh-scan {
  animation: none !important;
}
