/* Hallmark · Sapphire studio · Modern D100 and inference fallback visuals */
/* One visual per host: the modern fallback remains until a frame renders. */
:is(#chipStage, #archScene, #productChip) {
  position: relative;
  isolation: isolate;
}

:is(#chipStage, #archScene, #productChip) > .modern-chip-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.modern-chip-fallback > img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  object-fit: contain;
}

body[data-page="home"] #chipStage > .modern-chip-fallback > img { transform:scale(1.1); }
@media(max-width:760px) {
  body[data-page="home"] #chipStage > .modern-chip-fallback > img { transform:none; }
}

:is(#chipStage, #archScene, #productChip) > .three-hero-canvas {
  visibility: hidden;
}

:is(#chipStage, #archScene, #productChip).has-three > .three-hero-canvas {
  visibility: visible;
}

:is(#chipStage, #archScene, #productChip).has-three > .modern-chip-fallback {
  visibility: hidden;
}

#pipeViz > .modern-pipeline-fallback {
  position: absolute;
  inset: 48px 0 132px;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

#pipeViz.sim-stage > .modern-pipeline-fallback { inset: 48px 0; }

.modern-pipeline-fallback > img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  object-fit: contain;
}

#pipeViz > .three-pipeline-canvas { visibility: hidden; }
#pipeViz.has-three > .three-pipeline-canvas { visibility: visible; }
#pipeViz.has-three > .modern-pipeline-fallback { visibility: hidden; }

/* Keep the same readout layout with and without a working GPU context. */
#pipeline #pipeViz { display: block; padding: 24px; }
#pipeline #pipeViz > .pv-badge { position: absolute; inset: 22px 24px auto; }
#pipeline #pipeViz > .pv-readout {
  position: absolute;
  inset: auto 24px 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 680px) {
  .modern-chip-fallback > img { padding: 12px; }
  .modern-pipeline-fallback > img { padding: 4px; }
}
