/**
 * Vertex Field Lab — glTF POSITION · Three.js r170
 */

.doc-gltf-vf {
  --vf-cyan: #3db8c4;
  --vf-violet: #9a7ec8;
  --vf-v0: #ffc84d;
  --vf-v1: #3db8c4;
  --vf-v2: #9a7ec8;
  --vf-v3: #5ecf7a;
  --vf-border: rgba(255, 255, 255, 0.08);
  --vf-surface: rgba(255, 255, 255, 0.025);
  margin: 1rem 0 1.25rem;
  padding: 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--vf-border);
  background: linear-gradient(165deg, #080b12 0%, #0a1018 48%, #0c0e16 100%);
}

.doc-gltf-vf__hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--vf-border);
}

.doc-gltf-vf__tag {
  display: inline-flex;
  padding: 0.16rem 0.48rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vf-cyan);
  background: rgba(61, 184, 196, 0.1);
  border: 1px solid rgba(61, 184, 196, 0.28);
}

.doc-gltf-vf__hint { margin: 0; font-size: 0.8rem; color: rgba(160, 172, 190, 0.82); }

.doc-gltf-vf__grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.doc-gltf-vf__col {
  border-radius: 10px;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface);
  overflow: hidden;
  width: 100%;
}

.doc-gltf-vf__col-title {
  margin: 0;
  padding: 0.52rem 0.62rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(160, 172, 190, 0.85);
  border-bottom: 1px solid var(--vf-border);
  background: rgba(0, 0, 0, 0.22);
}

.doc-gltf-vf__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
}

.doc-gltf-vf__mode {
  flex: 1 1 calc(33% - 0.4rem);
  min-width: 7rem;
  margin: 0;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font: 0.68rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  color: rgba(180, 195, 220, 0.88);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.doc-gltf-vf__mode strong {
  display: block;
  font-size: 0.74rem;
  color: rgba(220, 230, 245, 0.95);
  margin-bottom: 0.1rem;
}

.doc-gltf-vf__mode-sub {
  display: block;
  font-size: 0.6rem;
  color: rgba(160, 172, 190, 0.65);
  letter-spacing: 0.02em;
}

.doc-gltf-vf__mode.is-active {
  color: #e8f8fc;
  border-color: rgba(61, 184, 196, 0.45);
  background: rgba(61, 184, 196, 0.12);
}

.doc-gltf-vf__mode.is-active .doc-gltf-vf__mode-sub {
  color: rgba(160, 220, 230, 0.75);
}

.doc-gltf-vf__body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.doc-gltf-vf__col--scene {
  min-width: 0;
}

.doc-gltf-vf__data-stack {
  padding: 0.65rem 0.75rem 0.75rem;
}

.doc-gltf-vf__panel-title {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(154, 126, 200, 0.9);
}

.doc-gltf-vf__vertex-list {
  margin: 0 0 0.55rem;
  padding: 0;
  list-style: none;
  font: 0.66rem/1.5 "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-vf__vertex-list li {
  padding: 0.28rem 0.4rem;
  margin: 0.12rem 0;
  border-radius: 5px;
  border-left: 3px solid transparent;
  cursor: default;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.doc-gltf-vf__vertex-item--v0 { color: var(--vf-v0); border-left-color: rgba(255, 200, 77, 0.35); }
.doc-gltf-vf__vertex-item--v1 { color: var(--vf-v1); border-left-color: rgba(61, 184, 196, 0.35); }
.doc-gltf-vf__vertex-item--v2 { color: var(--vf-v2); border-left-color: rgba(154, 126, 200, 0.35); }
.doc-gltf-vf__vertex-item--v3 { color: var(--vf-v3); border-left-color: rgba(94, 207, 122, 0.35); }

.doc-gltf-vf__vertex-list li.is-tri {
  background: rgba(255, 255, 255, 0.04);
}

.doc-gltf-vf__vertex-list li.is-hovered {
  background: rgba(61, 184, 196, 0.14);
  box-shadow: 0 0 0 1px rgba(61, 184, 196, 0.25);
}

.doc-gltf-vf__position-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(61, 184, 196, 0.32);
  background: rgba(61, 184, 196, 0.08);
  font: 0.62rem/1.4 "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-vf__position-name {
  font-size: 0.66rem;
  font-weight: 600;
  color: #e8f8fc;
  letter-spacing: 0.03em;
}

.doc-gltf-vf__position-meta {
  color: rgba(160, 200, 210, 0.82);
  font-size: 0.58rem;
}

.doc-gltf-vf__index-teaser {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px dashed rgba(255, 110, 180, 0.35);
  background: rgba(255, 110, 180, 0.06);
  font: 0.6rem/1.45 "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-vf__index-teaser[hidden] { display: none; }

.doc-gltf-vf__index-title {
  margin: 0 0 0.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 150, 200, 0.9);
}

.doc-gltf-vf__index-formula {
  margin: 0 0 0.35rem;
  color: rgba(220, 230, 245, 0.88);
}

.doc-gltf-vf__index-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(195, 232, 141, 0.9);
}

.doc-gltf-vf__flow {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font: 0.64rem "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-vf__flow-node {
  padding: 0.22rem 0.42rem;
  border-radius: 4px;
  color: rgba(140, 155, 180, 0.55);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.doc-gltf-vf__flow-node.is-dim {
  opacity: 0.45;
}

.doc-gltf-vf__flow-node.is-active {
  color: rgba(200, 230, 245, 0.92);
  border-color: rgba(61, 184, 196, 0.3);
  background: rgba(61, 184, 196, 0.08);
  animation: vf-flow-pulse 2.4s ease-in-out infinite;
  animation-delay: var(--vf-delay, 0s);
}

.doc-gltf-vf__flow-node.is-hi {
  color: #e8f8fc;
  border-color: rgba(61, 184, 196, 0.5);
  background: rgba(61, 184, 196, 0.14);
  box-shadow: 0 0 12px rgba(61, 184, 196, 0.15);
}

.doc-gltf-vf__flow-node.is-teaser {
  border-color: rgba(255, 110, 180, 0.4);
  background: rgba(255, 110, 180, 0.1);
  color: rgba(255, 200, 230, 0.95);
  box-shadow: 0 0 10px rgba(255, 110, 180, 0.12);
}

.doc-gltf-vf__flow-arrow {
  color: rgba(160, 172, 190, 0.4);
  padding: 0.05rem 0 0.05rem 0.35rem;
  line-height: 1;
}

@keyframes vf-flow-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; box-shadow: 0 0 14px rgba(61, 184, 196, 0.22); }
}

.doc-gltf-vf__scene-wrap {
  position: relative;
  height: 100%;
  min-height: 420px;
  background: rgba(0, 0, 0, 0.42);
}

@media (min-width: 900px) {
  .doc-gltf-vf__col--scene {
    min-height: 480px;
  }

  .doc-gltf-vf__scene-wrap {
    min-height: 440px;
  }
}

.doc-gltf-vf__scene-wrap [data-vf-mount] {
  position: absolute;
  inset: 0;
}

.doc-gltf-vf__label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.doc-gltf-vf__vertex-label {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font: 600 0.62rem "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}

.doc-gltf-vf__vertex-label--v0 { color: var(--vf-v0); border-color: rgba(255, 200, 77, 0.45); }
.doc-gltf-vf__vertex-label--v1 { color: var(--vf-v1); border-color: rgba(61, 184, 196, 0.45); }
.doc-gltf-vf__vertex-label--v2 { color: var(--vf-v2); border-color: rgba(154, 126, 200, 0.45); }
.doc-gltf-vf__vertex-label--v3 { color: var(--vf-v3); border-color: rgba(154, 207, 122, 0.45); }

.doc-gltf-vf__vertex-label.is-hovered {
  transform: translate(-50%, -110%) scale(1.08);
  box-shadow: 0 0 14px rgba(61, 184, 196, 0.35);
  z-index: 3;
}

.doc-gltf-vf__mount { width: 100%; height: 100%; display: block; cursor: crosshair; }

.doc-gltf-vf__scene-hud {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  padding: 0.28rem 0.45rem;
  border-radius: 5px;
  font: 0.62rem "JetBrains Mono", ui-monospace, monospace;
  color: rgba(195, 232, 141, 0.88);
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 3;
}

.doc-gltf-vf__caption {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(160, 172, 190, 0.88);
}

@media (max-width: 820px) {
  .doc-gltf-vf__body { grid-template-columns: 1fr; }
  .doc-gltf-vf__scene-wrap { min-height: 360px; }
  .doc-gltf-vf__mode { flex: 1 1 calc(50% - 0.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .doc-gltf-vf__flow-node.is-active { animation: none; opacity: 1; }
}
