/* The coloured planes belong to the section itself. Links, figures and text stay on top. */
.flow-scene { position: relative; isolation: isolate; --flow-progress: 1; --flow-travel: 0; }
.home :is(.cut-panel,.cut-switches > button,#practice-publishing,#desk-title,#workflow-title,#dawnlands-map-title) {
  scroll-margin-top: 67px;
}
.home .exhibit-map-wrap {
  width: 100%;
  background-color: #e7f2f7;
}
.home .exhibit-map-wrap > .evidence { width: min(88%, 1280px); margin-inline: auto; }
.home .creator-desk { background-color: #101d45; }
.home .workflow { background-color: #eff7fa; }
.home .profile { background-color: #dceaf7; }

.home .flow-scene::before, .home .flow-scene::after,
.case-intro.flow-scene::before, :is(.detail-section-heading,.case-row,.piece).flow-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.home .exhibit-map-wrap::before {
  background: linear-gradient(145deg, #f7faf7 44%, #cfe6ef);
  clip-path: polygon(0 0, calc(22% + 68% * var(--flow-progress)) 0,
    calc(3% + 58% * var(--flow-progress)) 100%, 0 100%);
}
.home .exhibit-map-wrap::after {
  background: linear-gradient(155deg, #b4dce9, #d5e9ef 57%, transparent);
  clip-path: polygon(calc(73% - 11% * var(--flow-progress)) 0,
    calc(83% - 10% * var(--flow-progress)) 0, 35% 100%, 32% 100%);
}
.home .creator-desk::before {
  background: linear-gradient(119deg, #123892 0%, #203f91 45%, #142957 95%);
  clip-path: polygon(0 0, calc(18% + 83% * var(--flow-progress)) 0,
    calc(5% + 63% * var(--flow-progress)) 100%, 0 100%);
}
.home .creator-desk::after {
  background: linear-gradient(125deg, #416bd5, #3255a7 55%, #284783);
  --plane-shift: calc(-14% * var(--flow-travel));
  clip-path: polygon(calc(43% + 45% * var(--flow-progress) + var(--plane-shift)) 0,
    calc(48% + 47% * var(--flow-progress) + var(--plane-shift)) 0,
    calc(18% + 40% * var(--flow-progress) + var(--plane-shift)) 100%,
    calc(16% + 39% * var(--flow-progress) + var(--plane-shift)) 100%);
}
.home .workflow::before {
  background: linear-gradient(120deg, #c3e3f4, #e0eef7);
  clip-path: polygon(calc(84% - 17% * var(--flow-progress)) 0, 100% 0, 100% 100%,
    calc(64% - 21% * var(--flow-progress)) 100%);
}
.home .workflow::after {
  background: #bddfed;
  clip-path: polygon(calc(98% - 25% * var(--flow-progress)) 0,
    calc(100% - 25% * var(--flow-progress)) 0, 49% 100%, 47% 100%);
}
.home .profile::before {
  background: linear-gradient(115deg, #bdd7f4, #e3edf9);
  clip-path: polygon(0 0, calc(14% + 49% * var(--flow-progress)) 0,
    calc(1% + 34% * var(--flow-progress)) 100%, 0 100%);
}
.case-intro.flow-scene::before {
  background: linear-gradient(132deg, #163c9f, #1067c1);
  clip-path: polygon(calc(98% - 26% * var(--flow-progress)) 0, 100% 0, 100% 100%,
    calc(69% - 30% * var(--flow-progress)) 100%);
}
:is(.detail-section-heading,.case-row,.piece).flow-scene::after {
  inset: auto auto -2px 0;
  z-index: 0;
  height: 4px;
  width: clamp(56px, 23%, 210px);
  transform-origin: left;
  transform: scaleX(var(--flow-progress));
  background: linear-gradient(90deg, #163ba0 0 75%, #57cbdc 75%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
:is(.case-row,.piece).flow-scene::after { height: 2px; width: 21%; opacity: .58; inset-block-end: -1px; }

/* Each text run stays in the normal document flow; only the ink moves inside its mask. */
.flow-typeset { position: relative; }
flow-source { display: block; }
flow-visual { display: none; position: absolute; inset: 0; pointer-events: none; user-select: none; }
.flow-word::before, .flow-row-ink::before { content: attr(data-ink); }
[data-chapter-flow] .flow-typeset:not(.flow-read) > flow-source { opacity: 0; }
[data-chapter-flow] .flow-typeset > flow-visual { display: block; }
[data-chapter-flow] .flow-read > flow-visual { visibility: hidden; }
.flow-title flow-run { display: contents; }
.flow-title .flow-token { position: absolute; display: block; width: max-content; }
.flow-title :is(.flow-token,.flow-word,flow-probe) {
  text-align: left; white-space: pre; margin: 0;
}
.flow-title .flow-word { display: block; }
.flow-title flow-probe { position: absolute; display: block; left: 0; top: 0; width: max-content; }
.flow-row, .flow-row-ink { display: block; }
[data-chapter-flow] .flow-title .flow-token,
[data-chapter-flow] .flow-row { clip-path: inset(-.16em -.35em -.13em -.35em); }
[data-chapter-flow] :is(.flow-title .flow-word,.flow-line,.flow-row-ink,.flow-copy:not(.flow-typeset)) { opacity: 0; }
[data-chapter-flow] .flow-title.flow-in .flow-word {
  animation: title-ink 1080ms var(--beat,0ms) both;
}
[data-chapter-flow] .flow-copy.flow-in .flow-row-ink {
  animation: reading-ink 880ms calc(var(--copy-wait,0ms) + var(--beat,0ms)) both;
}
[data-chapter-flow] .flow-line.flow-in,
[data-chapter-flow] .flow-copy:not(.flow-typeset).flow-in {
  animation: detail-ink 740ms 55ms both;
}
[data-chapter-flow] .flow-work-enter { animation: detail-ink 780ms both; }
@keyframes title-ink {
  0% { opacity: 0; transform: translateY(calc(.96em + 8px)); }
  18% { opacity: .09; transform: translateY(.77em); }
  58% { opacity: .72; transform: translateY(.20em); }
  84% { opacity: .97; transform: translateY(.027em); }
  100% { opacity: 1; transform: none; }
}
@keyframes reading-ink {
  0% { opacity: 0; transform: translateY(104%); }
  25% { opacity: .16; transform: translateY(73%); }
  70% { opacity: .88; transform: translateY(11%); }
  100% { opacity: 1; transform: none; }
}
@keyframes detail-ink {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes quiet-ink {
  0% { opacity: 0; } 28% { opacity: .17; } 72% { opacity: .86; } 100% { opacity: 1; }
}
[data-chapter-flow="gentle"] :is(.flow-title.flow-in .flow-word,.flow-copy.flow-in .flow-row-ink,.flow-work-enter,.flow-line.flow-in,.flow-copy:not(.flow-typeset).flow-in) {
  animation-name: quiet-ink; animation-duration: 850ms;
}
[data-chapter-flow="full"] .stage-nameblock {
  translate: calc(-14px * var(--hero-leave,0)) calc(-56px * var(--hero-leave,0));
  opacity: calc(1 - .48 * var(--hero-leave,0));
}
[data-chapter-flow] .flow-art { opacity: 0; }
[data-chapter-flow="full"] .flow-art.flow-in {
  animation: photo-enter 940ms var(--photo-delay,0ms) both;
}
[data-chapter-flow="gentle"] .flow-art.flow-in {
  animation: quiet-ink 740ms var(--photo-delay,0ms) both;
}
@keyframes photo-enter {
  0% { opacity: 0; translate: 0 26px; clip-path: inset(6% 0 0); }
  34% { opacity: .34; translate: 0 15px; clip-path: inset(3% 0 0); }
  75% { opacity: .90; translate: 0 2px; clip-path: inset(.5% 0 0); }
  100% { opacity: 1; translate: none; clip-path: inset(0); }
}
@media (min-width: 35.01rem) {
  .dawn-poster + .dawn-poster:nth-child(even) .flow-art { --photo-delay: 105ms; }
}
[data-chapter-flow="full"] .cycle-track i { transform: scaleX(var(--flow-progress, 1)); }
[data-chapter-flow] :is(.flow-line,.flow-copy):focus-within,
[data-chapter-flow] .flow-line:focus-visible {
  animation: none; opacity: 1; transform: none;
}
[data-chapter-flow] .flow-art.flow-read,
[data-chapter-flow] .flow-art.flow-image-error, [data-chapter-flow] a:focus-visible .flow-art {
  opacity: 1; animation: none; clip-path: none; translate: none;
}
@media (max-width: 620px) {
  [data-chapter-flow="full"] .stage-nameblock {
    translate: calc(-5px * var(--hero-leave,0)) calc(-26px * var(--hero-leave,0));
  }
}
@media (max-width: 620px) {
  .home .exhibit-map-wrap > .evidence { width: 90%; }
  .home .creator-desk::after {
    clip-path: polygon(calc(65% + 25% * var(--flow-progress) + var(--plane-shift)) 0,
      calc(69% + 28% * var(--flow-progress) + var(--plane-shift)) 0,
      calc(5% + 29% * var(--flow-progress) + var(--plane-shift)) 100%,
      calc(6% + 24% * var(--flow-progress) + var(--plane-shift)) 100%);
  }
}
@media print {
  [data-chapter-flow] .flow-typeset > flow-source { opacity: 1 !important; }
  [data-chapter-flow] .flow-typeset > flow-visual { display: none !important; }
  [data-chapter-flow] :is(.flow-word,.flow-token,.flow-row,.flow-row-ink,.flow-line,.flow-copy,.flow-art,.stage-nameblock),
  [data-chapter-flow] .cycle-track i {
    opacity: 1 !important; translate: none !important; clip-path: none !important;
    transform: none !important; transition: none !important; animation: none !important;
  }
}
