/* Keep the diagrams and their animation runtime intact. Lay out the original
   controls, drawing and live caption as a single explorable figure. */
body[data-expression-redesign] :is(.model-section, .ecosystem-section) {
  --figure-gutter: var(--review-gutter, clamp(1.25rem, 5vw, 6rem));
  --figure-ink: #102438;
  --figure-muted: #455b6a;
  --figure-line: #c6d1d7;
  --figure-cyan: #0085ba;
  padding: clamp(3.75rem, 7vw, 7rem) max(var(--figure-gutter), calc((100% - 94rem) / 2));
}
body[data-expression-redesign] .model-section {
  background: #fbfcfb;
  color: var(--figure-ink);
}
body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .72fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: end;
  margin: 0 0 clamp(2rem, 4vw, 4.25rem);
}
body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) .eyebrow {
  margin: 0 0 clamp(.9rem, 1.8vw, 1.55rem);
  color: var(--figure-cyan);
  font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .065em;
  text-transform: uppercase;
}
body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) h2 {
  max-width: 21ch;
  margin: 0;
  color: inherit;
  font: 400 clamp(2.55rem, 4.9vw, 5.2rem)/1.01 FK, Arial, sans-serif;
  letter-spacing: -.052em;
}
body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) > p {
  max-width: 35ch;
  margin: 0;
  padding: 0;
  color: var(--figure-muted);
  font: 400 clamp(1.06rem, 1.42vw, 1.45rem)/1.45 FK, Arial, sans-serif;
  text-wrap: pretty;
}
body.spatial-site[data-expression-redesign] .model-section > .step-controls {
  position: sticky;
  top: var(--portfolio-sticky-offset, calc(5.35rem + 3.5rem));
  z-index: 13;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(.8rem, 2.5vw, 2.25rem);
  border: 0;
  border-bottom: 1px solid var(--figure-line);
  background: #fbfcfb;
}
body[data-expression-redesign] .model-section .step-controls button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(.45rem, .8vw, .9rem);
  min-width: 0;
  min-height: 3.85rem;
  margin: 0 0 -1px;
  padding: .9rem clamp(.65rem, 1.2vw, 1.25rem);
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--figure-muted);
  font: 400 clamp(1rem, 1.45vw, 1.4rem)/1.25 FK, Arial, sans-serif;
  letter-spacing: -.025em;
}
body[data-expression-redesign] .model-section .step-controls button span {
  color: #526a7a;
  font: .79rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
body[data-expression-redesign] .model-section .step-controls button i {
  margin-left: auto;
  color: inherit;
  font-size: .9rem;
}
body[data-expression-redesign] .model-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(16rem, .74fr);
  grid-template-rows: auto 1fr;
  align-items: stretch;
  margin: clamp(1.2rem, 2.15vw, 2.5rem) 0 0;
  padding: 0;
  overflow: visible;
  background: #edf3f6;
}
body[data-expression-redesign] .model-canvas :is(.canvas-tag, .canvas-note, .motion-toggle) {
  position: static;
  inset: auto;
  grid-area: 1 / 1;
  align-self: center;
  z-index: 1;
  box-sizing: border-box;
  margin-top: clamp(.85rem, 1.5vw, 1.5rem);
}
body[data-expression-redesign] .model-canvas .canvas-tag,
body[data-expression-redesign] .model-canvas .canvas-note {
  max-width: 52%;
  justify-self: start;
  margin-left: clamp(.85rem, 2vw, 2rem);
  color: #415a6c;
  font: .75rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .045em;
}
body[data-expression-redesign] .model-canvas .canvas-note {
  justify-self: end;
  margin-inline: 0 clamp(.85rem, 2vw, 2rem);
}
body[data-expression-redesign] .model-canvas .motion-toggle {
  justify-self: end;
  min-height: 2.75rem;
  margin-right: clamp(.85rem, 1.7vw, 1.75rem);
  padding: .55rem .95rem;
  border: 1px solid #839aaa;
  border-radius: 2rem;
  background: #f7fafb;
  color: var(--figure-ink);
  font: 400 .9rem/1.2 FK, Arial, sans-serif;
  letter-spacing: 0;
}
body[data-expression-redesign] .model-canvas .motion-toggle:hover { border-color: #28799b; background: #fff; }
body[data-expression-redesign] .model-canvas .scene {
  grid-area: 2 / 1;
  align-self: center;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  overflow: auto;
}
body[data-expression-redesign] .model-section .model-canvas .scene :is(svg, img) {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
}
body[data-expression-redesign] .model-canvas .scene svg text {
  fill: #1f4157;
}
body[data-expression-redesign] .model-canvas .scene svg text[fill="#00A1F2"] { fill: #00739e; }
body[data-expression-redesign] .model-canvas .scene svg text.small {
  fill: #314e60;
}
body[data-expression-redesign] .model-caption {
  grid-area: 1 / 2 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(.85rem, 1.45vw, 1.5rem);
  min-width: 0;
  margin: 0;
  padding: clamp(1.5rem, 3.3vw, 3.65rem);
  border: 0;
  border-left: 1px solid var(--figure-line);
  background: #f3f7f8;
}
body[data-expression-redesign] .model-caption .caption-index {
  padding: 0;
  color: #006c99;
  font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .055em;
}
body[data-expression-redesign] .model-caption h3 {
  margin: 0 0 .8rem;
  color: var(--figure-ink);
  font: 400 clamp(1.75rem, 2.5vw, 3rem)/1.04 FK, Arial, sans-serif;
  letter-spacing: -.04em;
  text-wrap: balance;
}
body[data-expression-redesign] .model-caption p {
  max-width: 38em;
  min-height: 0;
  margin: 0;
  color: var(--figure-muted);
  font: 400 clamp(1rem, 1.15vw, 1.2rem)/1.55 FK, Arial, sans-serif;
}
body[data-expression-redesign] .model-caption .state-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
  padding: 0;
  color: #41586b;
  font: .81rem/1.4 FK, Arial, sans-serif;
}
body[data-expression-redesign] .model-caption .state-legend i {
  width: .72rem;
  height: .72rem;
  border: 1px solid #32819d;
  background: #edf8fc;
}

body[data-expression-redesign] .ecosystem-section {
  --figure-muted: #c0d1dd;
  color: #f4f9fc;
  background: #102438;
}
body[data-expression-redesign] .ecosystem-intro .eyebrow { color: #8cd8f5; }
body[data-expression-redesign] .ecosystem-map {
  margin-top: clamp(2rem, 4.7vw, 5rem);
  padding-bottom: clamp(2.75rem, 5vw, 5.25rem);
}
body[data-expression-redesign] .ecosystem-label {
  color: #a3c7db;
  font: .77rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .045em;
}
body[data-expression-redesign] .ecosystem-input h3,
body[data-expression-redesign] .ecosystem-choices strong {
  color: #f4f9fc;
  font: 400 clamp(1.08rem, 1.4vw, 1.55rem)/1.2 FK, Arial, sans-serif;
  letter-spacing: -.025em;
}
body[data-expression-redesign] .ecosystem-input p,
body[data-expression-redesign] .ecosystem-choices small,
body[data-expression-redesign] .ecosystem-core-caption,
body[data-expression-redesign] .ecosystem-environments,
body[data-expression-redesign] .ecosystem-hint { color: #b9cfde; font-size: .94rem; line-height: 1.45; }
body[data-expression-redesign] .ecosystem-connector > span,
body[data-expression-redesign] .ecosystem-core-note { color: #b7d0e0; font-size: .79rem; }
body[data-expression-redesign] .ecosystem-plane {
  border-color: #4981a0;
  background: linear-gradient(145deg, #1c415c, #142e46);
}
body[data-expression-redesign] .ecosystem-choices button[aria-pressed="true"] {
  border-color: transparent;
  border-left-color: #79d9f5;
  border-bottom-color: #55768b;
  background: #1e4057;
}
body[data-expression-redesign] .ecosystem-choices button[aria-pressed="true"] :is(strong, i) {
  color: #b5ebff;
}
body[data-expression-redesign] .ecosystem-example h3 {
  margin: 0 0 .8rem;
  color: #fff;
  font: 400 clamp(1.75rem, 2.65vw, 3.05rem)/1.08 FK, Arial, sans-serif;
  letter-spacing: -.04em;
}
body[data-expression-redesign] .ecosystem-example [data-ecosystem-copy] { color: #cadbe6; font-size: 1.08rem; }
body[data-expression-redesign] .model-canvas :focus-visible {
  outline: 2px solid #00668a;
  outline-offset: -4px;
}
body[data-expression-redesign] .ecosystem-choices button:focus-visible {
  outline: 2px solid #b2ecff;
  outline-offset: -4px;
}
@media (forced-colors: active) {
  body[data-expression-redesign] .ecosystem-choices button[aria-pressed="true"] {
    border-bottom: 3px solid Highlight;
    text-decoration: underline;
  }
}

@media (max-width: 800px) {
  body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) { grid-template-columns: 1fr; gap: .95rem; }
  body[data-expression-redesign] :is(.model-section .section-title, .ecosystem-intro) > p { max-width: 51ch; }
  body[data-expression-redesign] .model-canvas { grid-template-columns: minmax(0, 1fr); }
  body[data-expression-redesign] .model-caption {
    grid-area: 3 / 1;
    border-left: 0;
    border-top: 1px solid var(--figure-line);
    padding: 1.55rem clamp(1.1rem, 4vw, 2.15rem);
    gap: .65rem;
  }
  body[data-expression-redesign] .model-caption h3 { margin-bottom: .6rem; }
  body[data-expression-redesign] .ecosystem-map { margin-top: 2rem; }
  body[data-expression-redesign] .ecosystem-connector > span { background: #102438; }
  body[data-expression-redesign] .ecosystem-choices button[aria-pressed="true"] {
    border-left: 0;
    border-top-color: #79d9f5;
  }
}
@media (max-width: 620px) {
  body[data-expression-redesign] .model-section .step-controls { gap: .6rem; }
  body[data-expression-redesign] .model-section .step-controls button {
    flex-flow: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .35rem;
    padding: .65rem clamp(.35rem, 1.5vw, .65rem);
    overflow-wrap: anywhere;
    font-size: .97rem;
  }
  body[data-expression-redesign] .model-section .step-controls button span { margin: 0; font-size: .75rem; }
  body[data-expression-redesign] .model-section .model-canvas .scene svg {
    width: max(100%, 52rem);
    min-width: 52rem;
  }
  body[data-expression-redesign] .model-canvas .scene {
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #60899e #dee9ef;
  }
  body[data-expression-redesign] .ecosystem-input { padding-inline: .55rem; }
  body[data-expression-redesign] .ecosystem-input h3,
  body[data-expression-redesign] .ecosystem-choices strong { font-size: 1rem; }
  body[data-expression-redesign] .ecosystem-choices button { padding-inline: .55rem; }
  body[data-expression-redesign] .ecosystem-choices small,
  body[data-expression-redesign] .ecosystem-input p { font-size: .86rem; }
  body[data-expression-redesign] .ecosystem-example [data-ecosystem-copy] { min-height: 0; }
}
