/* ============================================================
   Veil 3D Cutaway Viewer — embedded on veil.html
   Solid + X-ray modes. No gas flow.
   Scoped under .p-cutaway to avoid collision with other product CSS.
   ============================================================ */

.p-cutaway {
  background: var(--ink);
  color: var(--text-inv);
  padding: 56px 48px 80px;
  position: relative;
  overflow: hidden;
}

/* Subtle blueprint grid backdrop — matches technology page */
.p-cutaway::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.p-cutaway-inner {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
}

.p-cutaway-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.p-cutaway-head .eyebrow {
  color: var(--text-inv-dim);
}

.p-cutaway-head h2 {
  color: var(--text-inv);
  max-width: 640px;
}

.p-cutaway-head-lede {
  color: var(--text-inv-dim);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 380px;
}

/* Two-column layout: viewer left, component index + controls right */
.p-cutaway-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 48px;
  align-items: start;
}

/* ============================================================
   Viewer stage (left column)
   ============================================================ */

.v-wrap {
  --v-hot: #7ac0e8; /* brighter teal, scoped only inside the viewer */
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(122, 192, 232, 0.06), transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(255, 180, 100, 0.04), transparent 55%),
    linear-gradient(180deg, #0d0d10 0%, #17171a 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.v-wrap model-viewer {
  width: 100%;
  flex: 1;
  min-height: 560px;
  --poster-color: transparent;
  background: transparent;
}

/* Scan line — sweeps across viewer in x-ray mode */
.v-scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(122, 192, 232, 0.35) 20%, rgba(122, 192, 232, 0.85) 50%, rgba(122, 192, 232, 0.35) 80%, transparent 100%);
  box-shadow: 0 0 20px rgba(122, 192, 232, 0.5);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.v-scan-line.is-active {
  opacity: 1;
  animation: v-scan-sweep 3.6s ease-in-out infinite;
}

@keyframes v-scan-sweep {
  0%   { left: 0%; }
  50%  { left: calc(100% - 2px); }
  100% { left: 0%; }
}

/* Mode indicator badge — bottom-left */
.v-mode-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 6;
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--v-hot);
  background: rgba(11, 11, 12, 0.7);
  border: 1px solid rgba(122, 192, 232, 0.35);
  border-radius: 2px;
  padding: 8px 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}
.v-mode-badge.is-visible { opacity: 1; }
.v-mode-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--v-hot);
  box-shadow: 0 0 8px var(--v-hot);
  animation: v-badge-pulse 1.4s ease-in-out infinite;
}

@keyframes v-badge-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Hotspot markers on the model */
.v-hotspot {
  --hotspot-size: 22px;
  width: var(--hotspot-size);
  height: var(--hotspot-size);
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.85);
  border: 2px solid var(--text-inv);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease-out, border-color 0.2s;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--text-inv);
}
.v-hotspot::before {
  content: attr(data-callout);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-inv);
  font-weight: 500;
}
.v-hotspot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(122, 192, 232, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}
.v-hotspot:hover { transform: scale(1.15); }
.v-hotspot[data-active="true"] {
  border-color: var(--v-hot);
  background: rgba(122, 192, 232, 0.2);
}
.v-hotspot[data-active="true"]::after { opacity: 1; }

.v-hs-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--text-inv);
  background: rgba(11, 11, 12, 0.85);
  padding: 4px 8px;
  border-radius: 2px;
  border-left: 1px solid var(--v-hot);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.v-hotspot:hover .v-hs-label,
.v-hotspot[data-active="true"] .v-hs-label {
  opacity: 1;
}

/* ============================================================
   Component index + controls (right column)
   ============================================================ */

.v-panel {
  display: flex;
  flex-direction: column;
  gap: 32px;
  color: var(--text-inv);
}

.v-panel-tag {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--v-hot);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.v-panel-lede {
  color: var(--text-inv-dim);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.v-callouts-heading {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.v-callouts {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.v-callout {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 0.2s;
}
.v-callout:hover { background: rgba(255,255,255,0.02); }
.v-callout[data-active="true"] {
  background: rgba(122, 192, 232, 0.06);
}

.v-callout-num {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-mute);
  letter-spacing: 0.08em;
}
.v-callout[data-active="true"] .v-callout-num {
  color: var(--v-hot);
}

.v-callout-body h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-inv);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.v-callout-body p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-inv-dim);
}

/* View mode toggle */
.v-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.v-controls-label {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.v-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.v-mode-btn {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-inv-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s ease-out;
  border-radius: 2px;
}
.v-mode-btn:hover {
  color: var(--text-inv);
  border-color: rgba(255,255,255,0.2);
}
.v-mode-btn.is-active {
  background: var(--v-hot);
  color: var(--ink);
  border-color: var(--v-hot);
  font-weight: 600;
}

.v-camera-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.v-cam-btn {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--text-inv-dim);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 10px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
  border-radius: 2px;
}
.v-cam-btn:hover {
  color: var(--text-inv);
  border-color: rgba(255,255,255,0.2);
}

/* ============================================================
   Mobile: collapse to single column
   ============================================================ */
@media (max-width: 900px) {
  .p-cutaway {
    padding: 64px 20px 80px;
  }
  .p-cutaway-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .v-wrap {
    min-height: 480px;
  }
  .v-wrap model-viewer {
    min-height: 440px;
  }
  .v-hs-label {
    display: none; /* hover-only labels are useless on touch */
  }
}
