/* Holodepth — Custom BufferGeometry etkileşimli demolar (primitive demo ile uyumlu yüzey) */

.doc-cbuffer-demo {
  margin: 1.1rem 0 0;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(94, 200, 255, 0.16);
  background: linear-gradient(
    165deg,
    rgba(10, 12, 22, 0.98) 0%,
    rgba(4, 6, 14, 0.99) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    0 16px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.doc-cbuffer-demo__hud {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 6, 12, 0.72);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.78rem;
}

.doc-cbuffer-demo__hud-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.doc-cbuffer-demo__tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(140, 200, 255, 0.88);
}

.doc-cbuffer-demo__debug {
  display: block;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.6rem;
  line-height: 1.4;
  color: rgba(150, 175, 210, 0.88);
  text-align: right;
  max-width: min(100%, 22rem);
  margin-left: auto;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.doc-cbuffer-demo__debug-label {
  display: inline;
  margin-right: 0.35rem;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(110, 150, 195, 0.75);
}

.doc-cbuffer-demo__debug-sep {
  margin: 0 0.2rem;
  opacity: 0.35;
  user-select: none;
}

.doc-cbuffer-demo__debug-bit {
  font-weight: 600;
  opacity: 0.38;
  transition: opacity 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
}

.doc-cbuffer-demo__debug-bit.is-on {
  opacity: 1;
  color: rgba(120, 220, 255, 0.98);
  text-shadow: 0 0 12px rgba(46, 200, 255, 0.35);
}

.doc-cbuffer-demo__readout {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(180, 220, 245, 0.95);
  font-size: 0.72rem;
  max-width: 22rem;
  text-align: right;
}

.doc-cbuffer-demo__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.2rem;
}

.doc-cbuffer-demo__group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 8.5rem;
}

.doc-cbuffer-demo__group--grow {
  flex: 1 1 12rem;
}

.doc-cbuffer-demo__group-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(160, 175, 205, 0.88);
}

.doc-cbuffer-demo__range {
  width: 100%;
  max-width: 22rem;
  accent-color: #5ec8ff;
}

.doc-cbuffer-demo__select {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 22, 0.85);
  color: rgba(220, 225, 240, 0.95);
  font-size: 0.8rem;
  min-width: 9.5rem;
}

.doc-cbuffer-demo__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.doc-cbuffer-demo__checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  color: rgba(200, 210, 230, 0.92);
}

.doc-cbuffer-demo__checks input {
  accent-color: #5ec8ff;
}

.doc-cbuffer-demo__checks label.is-muted {
  opacity: 0.55;
  cursor: default;
}

.doc-cbuffer-demo__toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.doc-cbuffer-demo__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.75);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(200, 215, 240, 0.95);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.doc-cbuffer-demo__pill.is-active {
  border-color: rgba(94, 200, 255, 0.45);
  background: rgba(16, 28, 48, 0.92);
  box-shadow:
    0 0 0 1px rgba(46, 180, 255, 0.12),
    0 0 18px rgba(46, 160, 255, 0.18);
}

.doc-cbuffer-demo__pill.is-active::after {
  content: "";
  position: absolute;
  bottom: 0.1rem;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #5ec8ff;
  box-shadow: 0 0 10px rgba(94, 200, 255, 0.85);
}

.doc-cbuffer-demo__pill input {
  accent-color: #b56cff;
}

.doc-cbuffer-demo__viewport-wrap {
  position: relative;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  background: #05060c;
}

.doc-cbuffer-demo__viewport-wrap--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  min-height: 280px;
}

.doc-cbuffer-demo__split-pane {
  position: relative;
  min-height: 240px;
  background: #05060c;
  overflow: hidden;
}

.doc-cbuffer-demo__indexed-count {
  position: absolute;
  top: 2rem;
  right: 0.45rem;
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(6, 12, 24, 0.88);
  border: 1px solid rgba(94, 200, 255, 0.22);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(160, 215, 255, 0.95);
  pointer-events: none;
}

.doc-cbuffer-demo__stack-hint {
  position: absolute;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 80, 140, 0.12);
  border: 1px solid rgba(255, 120, 180, 0.35);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 180, 210, 0.95);
  pointer-events: none;
  box-shadow: 0 0 18px rgba(255, 100, 160, 0.25);
  animation: cbuffer-stack-pulse 2.2s ease-in-out infinite;
}

@keyframes cbuffer-stack-pulse {
  0%,
  100% {
    opacity: 0.75;
    box-shadow: 0 0 12px rgba(255, 100, 160, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 22px rgba(255, 120, 180, 0.45);
  }
}

.doc-cbuffer-demo__viewport {
  position: absolute;
  inset: 0;
}

.doc-cbuffer-demo__viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.doc-cbuffer-demo__pane-label {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(4, 6, 12, 0.82);
  border: 1px solid rgba(94, 200, 255, 0.2);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(180, 210, 245, 0.95);
  pointer-events: none;
}

.doc-cbuffer-demo__indexed-hover {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  z-index: 3;
  max-width: calc(100% - 0.8rem);
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.88);
  border: 1px solid rgba(94, 200, 255, 0.22);
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.58rem;
  line-height: 1.35;
  color: rgba(190, 220, 250, 0.96);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.doc-cbuffer-demo__indexed-hover.is-visible {
  opacity: 1;
}

.doc-cbuffer-demo__indexed-hover .doc-cbuffer-demo__hover-stack {
  display: block;
  margin-top: 0.38rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.55rem;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(200, 225, 250, 0.9);
}

.doc-cbuffer-demo__indexed-hover kbd {
  display: inline-block;
  padding: 0.05rem 0.25rem;
  margin: 0 0.1rem;
  border-radius: 4px;
  background: rgba(40, 70, 110, 0.65);
  font-size: 0.95em;
}

.doc-cbuffer-demo__memory {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(170, 190, 220, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(6, 8, 14, 0.55);
  display: grid;
  gap: 0.35rem;
}

.doc-cbuffer-demo__memory strong {
  color: rgba(120, 220, 255, 0.95);
  font-weight: 700;
}

.doc-cbuffer-demo__attr-hints {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(94, 200, 255, 0.14);
  background: rgba(4, 8, 16, 0.75);
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(185, 205, 235, 0.96);
}

.doc-cbuffer-demo__attr-hints code {
  font-size: 0.88em;
  color: rgba(150, 220, 255, 0.95);
}

.doc-cbuffer-demo__hint-line {
  margin: 0.4rem 0 0;
}

.doc-cbuffer-demo__hint-line:first-child {
  margin-top: 0;
}

.doc-cbuffer-demo__caption {
  margin: 0;
  padding: 0.7rem 0.85rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(170, 190, 220, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(6, 8, 14, 0.45);
}

@media (max-width: 720px) {
  .doc-cbuffer-demo__viewport-wrap--split {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }

  .doc-cbuffer-demo__split-pane {
    min-height: 200px;
  }
}

@media (max-width: 640px) {
  .doc-cbuffer-demo__viewport-wrap:not(.doc-cbuffer-demo__viewport-wrap--split) {
    min-height: 220px;
    aspect-ratio: 4 / 3;
  }
}

/* Demo altı: sabit tablosu + kod kesiti */
.doc-cbuffer-demo + .doc-h3 {
  margin-top: 1.35rem;
}
