.cx-product {
  --cx-diagram-surface: #211e1b;
  --cx-diagram-paper: #fbf3e5;
  --cx-diagram-muted: #d3c6b3;
  --cx-diagram-copper: #f3bd90;
  --cx-diagram-line: #806750;
}

.cx-product .cx-hero-inner { align-items: center; }

.cx-product .cx-orbit-hero {
  align-self: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 8 / 5;
  border-radius: 5px;
  background: var(--cx-diagram-surface);
  color: var(--cx-diagram-paper);
}

.cx-orbit-hero video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cx-orbit-hero figcaption {
  position: absolute;
  inset: 4.3% 5.5% auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  text-transform: uppercase;
  font: 600 clamp(.68rem, 1.08vw, .94rem)/1.3 "Rekon Sans", sans-serif;
  letter-spacing: .11em;
  pointer-events: none;
}

.cx-orbit-hero figcaption span:nth-child(2) { text-align: center; color: var(--cx-diagram-copper); }
.cx-orbit-hero figcaption span:last-child { text-align: end; }

.cx-orbit-control {
  position: absolute;
  inset: auto 9px 9px auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ad8e71;
  border-radius: 50%;
  color: var(--cx-diagram-paper);
  background: #211e1be8;
  cursor: pointer;
}

.cx-orbit-control:hover { background: #543c2d; }

.cx-orbit-control-icon {
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border-block: 5px solid transparent;
  border-inline-start: 8px solid currentColor;
}

.cx-orbit-hero[data-playing] .cx-orbit-control-icon {
  width: 9px;
  height: 11px;
  margin: 0;
  border: 0;
  border-inline: 2px solid currentColor;
}

.cx-product .cx-anatomy {
  padding-block: clamp(48px, 7vw, 102px);
  background: var(--cx-canvas);
}

.cx-product .cx-anatomy .cx-chapter-head {
  max-width: none;
  text-align: start;
  margin-bottom: clamp(22px, 3.4vw, 44px);
}

.cx-product .cx-anatomy .cx-chapter-head h2 {
  font-family: var(--cx-editorial);
  font-size: clamp(2.65rem, 5.35vw, 6.4rem);
  font-weight: 500;
}

.cx-product .cx-anatomy .cx-chapter-head > p:last-child {
  margin-inline: 0;
  max-width: 62ch;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}

.cx-product .cx-main .cx-flow {
  padding: clamp(16px, 3.5vw, 52px);
  border-radius: 5px;
  color: var(--cx-diagram-paper);
  background:
    linear-gradient(#f6d3af0b 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg,#f6d3af0b 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(ellipse at 49% 40%, #392b23, var(--cx-diagram-surface) 74%);
}

.cx-flow-stages {
  display: grid;
  grid-template-columns: minmax(0,1.12fr) minmax(34px,.26fr) minmax(0,1fr) minmax(34px,.24fr) minmax(0,1fr);
  align-items: center;
}

.cx-flow-sources {
  display: grid;
  align-self: stretch;
  gap: 10px;
}

.cx-flow-stage {
  min-width: 0;
  padding: clamp(12px, 2vw, 23px);
  background: #29211c;
  border: 1px solid var(--cx-diagram-line);
  border-radius: 4px;
  transition: border-color 240ms, background-color 240ms;
}

.cx-flow-stage[data-cx-stage="prototype"], .cx-flow-stage[data-cx-stage="review"] { padding-block: clamp(17px, 2.6vw, 34px); }

.cx-product .cx-flow-stage h3 {
  font-family: var(--cx-editorial);
  font-size: clamp(1.25rem, 2.08vw, 2.22rem);
  font-weight: 500;
  letter-spacing: -.024em;
  text-wrap: initial;
}

.cx-product .cx-flow-stage p {
  margin-top: 7px;
  font-size: clamp(.84rem, 1.13vw, 1rem);
  color: var(--cx-diagram-muted);
  line-height: 1.48;
}

.cx-flow-wire {
  display: grid;
  align-items: center;
  position: relative;
  min-width: 0;
}

.cx-flow-wire > span {
  width: 100%;
  height: 1px;
  background: var(--cx-diagram-line);
}

.cx-flow-wire::after,
.cx-flow-feedback span::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: calc(50% - 3px);
  right: 1px;
  border: solid var(--cx-diagram-copper);
  border-width: 1px 1px 0 0;
  transform: rotate(45deg);
}

.cx-flow-merge { height: 46%; }
.cx-flow-merge::before {
  content: "";
  position: absolute;
  inset: 0 48% 0 0;
  border: 1px solid var(--cx-diagram-line);
  border-inline-start: 0;
}
.cx-flow-merge > span { width: 48%; justify-self: end; }

.cx-flow-feedback {
  position: relative;
  margin: 14px 5% 8px;
  height: 27px;
  border: 1px solid var(--cx-diagram-line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.cx-flow-feedback span::before {
  top: -1px;
  left: -4px;
  right: auto;
  transform: rotate(-45deg);
}

.cx-flow-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: .89rem;
  line-height: 1.5;
  color: var(--cx-diagram-muted);
}

.cx-flow-caption > span::before {
  content: "↳";
  margin-inline-end: 8px;
  color: var(--cx-diagram-copper);
}

.cx-flow-replay {
  min-height: 44px;
  border: 0;
  padding: 5px 0;
  color: var(--cx-diagram-paper);
  background: transparent;
  font: 600 .86rem/1.3 var(--cx-font);
  text-underline-offset: 4px;
  text-decoration: underline;
  cursor: pointer;
}
.cx-flow-replay span { color: var(--cx-diagram-copper); margin-inline-end: 3px; }

.cx-product :is(.cx-flow, .cx-orbit-hero) button:focus-visible {
  outline: 2px solid var(--cx-diagram-copper);
  outline-offset: 3px;
}

.cx-flow[data-step="sources"] .cx-flow-sources .cx-flow-stage,
.cx-flow[data-step="prototype"] [data-cx-stage="prototype"],
.cx-flow[data-step="review"] [data-cx-stage="review"] {
  border-color: var(--cx-diagram-copper);
  background-color: #50382a;
}

.cx-flow[data-step="prototype"] .cx-flow-merge > span,
.cx-flow[data-step="review"] .cx-flow-forward > span {
  background-color: var(--cx-diagram-copper);
}

.cx-flow[data-step="return"] .cx-flow-feedback {
  border-color: var(--cx-diagram-copper);
}

@media (prefers-reduced-motion: no-preference) {
  .cx-flow[data-step="prototype"] .cx-flow-merge > span,
  .cx-flow[data-step="review"] .cx-flow-forward > span {
    animation: cx-flow-trace 480ms cubic-bezier(.2,.75,.2,1) both;
    transform-origin: left;
  }

  @keyframes cx-flow-trace { from { transform: scaleX(.07); } to { transform: scaleX(1); } }
}

@media (max-width: 760px) {
  .cx-product .cx-orbit-hero { margin-bottom: 18px; }
  .cx-flow-stages { grid-template-columns: minmax(0,1fr); justify-items: stretch; }
  .cx-flow-sources { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .cx-flow-wire { height: 25px; justify-self: center; width: 1px; }
  .cx-flow-wire > span { width: 1px; height: 100%; }
  .cx-flow-wire::after { top: auto; bottom: 2px; right: -2.5px; transform: rotate(135deg); }
  .cx-flow-merge::before { display: none; }
  .cx-flow-feedback { margin-inline: 8%; height: 20px; }
  .cx-flow-replay { margin-top: 0; }

  @media (prefers-reduced-motion: no-preference) {
    .cx-flow[data-step="prototype"] .cx-flow-merge > span,
    .cx-flow[data-step="review"] .cx-flow-forward > span {
      animation-name: cx-flow-trace-vertical;
      transform-origin: top;
    }
    @keyframes cx-flow-trace-vertical { from { transform: scaleY(.07); } to { transform: scaleY(1); } }
  }
}

@media (min-width: 701px) and (max-width: 930px) {
  .cx-product .cx-hero-copy { padding-inline-end: 24px; }
}

@media (max-width: 700px) {
  .cx-product .cx-hero-copy { padding-bottom: 21px; }
  .cx-product .cx-orbit-hero { width: 100%; }
}
