.pin { position: relative; }
.pin__sticky {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: center;
  width: min(var(--wide), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 1rem) 0 1.5rem;
}
.pin--tall { height: 620vh; }
.pin--mid { height: 420vh; }
.pin--tall .pin__sticky,
.pin--mid .pin__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.story h2 { font-size: clamp(2.3rem, 4vw, 3.5rem); }
.story .lead { font-size: 1.02rem; }
.steps { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.steps li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
}
.steps li.is-active {
  background: rgba(250, 248, 244, 0.7);
  border-left-color: var(--primary);
}
.pin--violet .steps li.is-active { border-left-color: var(--purple); }
.steps .num {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding-top: 0.2rem;
}
.steps h3 { font-size: 0.98rem; }
.steps p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
.steps li.is-active p {
  max-height: 8rem;
  opacity: 1;
  margin-top: 0.2rem;
}
.stage-progress {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}
.stage-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: #5EEAD4;
}
.pin--violet .stage-progress i { background: #C4B5FD; }

.stage {
  position: relative;
  height: min(74vh, 740px);
  min-height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 50% 40%, #243044 0%, #151b24 72%);
  border: 1px solid rgba(28, 25, 23, 0.12);
  box-shadow: 0 24px 50px -28px rgba(28, 25, 23, 0.45);
}
.pin--violet .stage {
  background: radial-gradient(80% 70% at 50% 38%, #2c2824 0%, #171411 74%);
}
.stage-col { position: relative; min-width: 0; }
.stage canvas { width: 100%; height: 100%; }
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(8, 10, 14, 0.28) 100%);
}
.stage__caption, .stage__card, .mini-dash { pointer-events: none; }
.stage__caption {
  position: absolute;
  z-index: 2;
  left: 0.9rem;
  bottom: 0.85rem;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 17, 16, 0.72);
  color: #F5F5F4;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.stage__card {
  position: absolute;
  z-index: 2;
  top: 0.9rem;
  left: 0.9rem;
  width: min(250px, 70%);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 0.7rem 0.75rem 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}
.stage__card.is-on { opacity: 1; visibility: visible; transform: none; }
.stage__card strong { display: block; font-size: 0.92rem; letter-spacing: -0.02em; }
.stage__card span { display: block; margin-top: 0.15rem; color: var(--text-muted); font-size: 0.8rem; }
.stage__card.is-alert { border-color: rgba(239, 68, 68, 0.45); }
.stage__card.is-alert strong { color: var(--danger); }
.stage-col .mini-dash { position: absolute; }
.mini-dash {
  position: absolute;
  z-index: 2;
  top: 0.9rem;
  right: 0.9rem;
  width: min(230px, 46%);
  background: rgba(250, 248, 244, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.75rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.mini-dash header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.45rem;
}
.mini-dash header b { color: var(--primary-dark); letter-spacing: 0.08em; }
.mini-dash ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.mini-dash li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  background: var(--bg);
  opacity: 0.35;
}
.mini-dash li.is-on { opacity: 1; }
.mini-dash li em { font-style: normal; font-weight: 650; color: var(--text); }
.swatch { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 2px; margin-right: 0.25rem; vertical-align: middle; }

.stage.is-fallback::before {
  content: "3D view unavailable on this browser.";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(247, 244, 239, 0.7);
  font-size: 0.9rem;
  z-index: 1;
}

@media (max-width: 900px) {
  .pin--tall, .pin--mid { height: auto; }
  .pin--tall .pin__sticky,
  .pin--mid .pin__sticky {
    position: relative;
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }
  .stage { order: -1; height: 68vw; min-height: 260px; max-height: 420px; }
  .stage-progress { display: none; }
  .steps p { max-height: none; opacity: 1; margin-top: 0.15rem; }
  .steps li.is-active { background: transparent; }
  .mini-dash, .stage-col .mini-dash { position: relative; top: auto; right: auto; width: auto; margin: 0.75rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .steps li.is-active p, .stage__card { transition: none; }
}
