/* Nothing is hidden while waiting for the observer, a link, or a page restore. */
html:is([data-motion="on"], [data-section-motion-native]):not([data-motion="off"]) {
  --section-ease: cubic-bezier(.19, .72, .24, 1);

  & [data-section-entrance="title"] {
    animation: section-heading-rise 700ms var(--section-ease) backwards;
  }

  /* The outer photographic mount moves independently of the selectable image. */
  & [data-section-entrance="print"] .atlas-stage {
    animation: section-print-uncover 980ms var(--section-ease) backwards;
  }
  & [data-section-entrance="print"] figcaption {
    animation: section-margin-note 540ms var(--section-ease) 160ms backwards;
  }
  & [data-section-entrance="index"] .atlas-label > span:nth-child(2) {
    animation: section-index-set 580ms var(--section-ease) var(--section-lag, 0ms) backwards;
  }
  & [data-section-entrance="index"] .atlas-row:nth-of-type(2) { --section-lag: 65ms; }
  & [data-section-entrance="index"] .atlas-row:nth-of-type(3) { --section-lag: 130ms; }
  & [data-section-entrance="index"] .atlas-row:nth-of-type(4) { --section-lag: 195ms; }
  & [data-section-entrance="index"] .atlas-row:nth-of-type(5) { --section-lag: 260ms; }

  /* The drawn mount leads the portrait. The photograph inside retains its scroll zoom. */
  & [data-section-entrance="portrait"]::before {
    animation: section-frame-outline 810ms var(--section-ease) backwards;
  }
  & [data-section-entrance="portrait"] .portrait-frame {
    animation: section-portrait-mount 1050ms var(--section-ease) 40ms backwards;
  }
  & [data-section-entrance="signature"] h2 {
    animation: section-heading-rise 720ms var(--section-ease) backwards;
  }
  & [data-section-entrance="signature"] h2 em {
    animation: section-signature 840ms var(--section-ease) 90ms backwards;
  }
  & [data-section-entrance="signature"] blockquote {
    animation: section-margin-note 640ms var(--section-ease) 180ms backwards;
  }

  /* Reading list and appointment details arrive like entries on a printed page. */
  & [data-section-entrance="cases"] h2 {
    animation: section-heading-rise 720ms var(--section-ease) backwards;
  }
  & [data-section-entrance="reading"] a > span {
    animation: section-index-set 680ms var(--section-ease) backwards;
  }
  & [data-section-entrance="reading"] a:last-child > span { animation-delay: 100ms; }
  & [data-section-entrance="consultation"] h2 em {
    animation: section-signature 870ms var(--section-ease) backwards;
  }
  & .visit:has([data-section-entrance="consultation"]) .visit-lines g {
    animation: section-contour 1400ms cubic-bezier(.32, .48, .22, 1) backwards;
  }
  & [data-section-entrance="address"] h3,
  & [data-section-entrance="address"] address {
    animation: section-margin-note 650ms var(--section-ease) backwards;
  }
  & [data-section-entrance="address"] address { animation-delay: 90ms; }
  & [data-section-entrance="questions"] {
    position: relative;
  }
  & [data-section-entrance="questions"]::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px;
    height: 1px;
    background: #9d7666;
    pointer-events: none;
    opacity: 0;
    transform-origin: left;
    animation: section-fine-rule 750ms var(--section-ease) both;
  }
}

@keyframes section-heading-rise {
  from { clip-path: inset(0 0 65% 0); transform: translateY(15px); }
  to { clip-path: inset(0 0 -4% 0); transform: translateY(0); }
}
@keyframes section-print-uncover {
  from { clip-path: polygon(0 0, 15% 0, 3% 100%, 0 100%); }
  to { clip-path: polygon(0 0, 112% 0, 100% 100%, 0 100%); }
}
@keyframes section-index-set {
  from { transform: translate(14px, 3px); opacity: .5; }
  to { transform: translate(0, 0); opacity: 1; }
}
@keyframes section-frame-outline {
  from { clip-path: inset(0 0 85% 0); }
  to { clip-path: inset(0); }
}
@keyframes section-portrait-mount {
  from { clip-path: inset(9% 6% 12% 7%); transform: translate(-11px, 9px) rotate(-1.4deg); }
  to { clip-path: inset(0); transform: translate(0, 0) rotate(0); }
}
@keyframes section-signature {
  from { transform: translateX(-16px); clip-path: inset(0 44% -5% 0); }
  to { transform: translateX(0); clip-path: inset(0 0 -5% 0); }
}
@keyframes section-margin-note {
  from { opacity: .55; transform: translateX(11px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes section-contour {
  from { clip-path: inset(0 0 92% 0); }
  to { clip-path: inset(0); }
}
@keyframes section-fine-rule {
  0% { transform: scaleX(.01); opacity: .9; }
  70% { transform: scaleX(1); opacity: .8; }
  100% { transform: scaleX(1); opacity: 0; }
}
