/* The site remains in its finished state until a real section enters the viewport. */
@media screen and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing {
    --iw-seat: cubic-bezier(.17,.78,.22,1);
    --iw-open: cubic-bezier(.32,.05,.19,1);
  }

  /* Short titles settle in reading order. Keep their real spaces, font and
     punctuation so the Hebrew and English editions retain their own rhythm. */
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=words] > .iw-motion-word {
    display: inline-block;
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    transform-origin: 50% 85%;
    animation: iw-seat-word .64s var(--iw-seat) var(--iw-word-delay,0s) backwards;
  }
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=heading] {
    animation: iw-lift-heading .72s var(--iw-seat) both;
  }
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=copy] {
    animation: iw-set-copy .68s var(--iw-seat) .07s backwards;
  }

  /* The two sides of the aperture register against a slightly offset joint,
     echoing the opening of the actual logo leaves. Only the local photo is
     clipped. Its caption, neighbours and the page itself keep their geometry. */
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=plate] {
    --iw-left: 35%;
    --iw-right: 66%;
    --iw-joint: 52%;
    animation: iw-open-plate .94s var(--iw-open) both;
  }
  html[dir=rtl]:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=plate] {
    --iw-left: 34%;
    --iw-right: 65%;
    --iw-joint: 48%;
  }
  html:not([data-iw-reduced-motion=true]) .iw-about-sequence figure:nth-child(2) .iw-motion-playing[data-iw-motion=plate] {
    animation-delay: .08s;
  }

  /* A cabinet elevation is read from its outline to its inset profile. */
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=drawing] path[pathLength="1"] {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: iw-draw-profile .8s var(--iw-open) var(--iw-profile-delay,0s) both;
  }
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=drawing] path + path {
    --iw-profile-delay: .14s;
  }
  /* The accent travels along the chapter's existing printed rule. */
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=rule] { position: relative; }
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=rule]::before {
    content: "";
    position: absolute;
    inset: -1px 0 auto;
    block-size: 1px;
    background: #816c4b;
    pointer-events: none;
    transform-origin: left center;
    animation: iw-mark-rule .84s var(--iw-open) both;
  }
  html[dir=rtl]:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=rule]::before {
    transform-origin: right center;
  }
  /* Open the service and reading indexes in order from the binding edge. */
  html:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=index] > a {
    --iw-index-start: -.55rem;
    animation: iw-set-index .57s var(--iw-seat) var(--iw-entry-delay,0s) backwards;
  }
  html[dir=rtl]:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=index] > a { --iw-index-start: .55rem; }
  .iw-motion-playing[data-iw-motion=index] > a:nth-child(2) { --iw-entry-delay: .04s; }
  .iw-motion-playing[data-iw-motion=index] > a:nth-child(3) { --iw-entry-delay: .08s; }
  .iw-motion-playing[data-iw-motion=index] > a:nth-child(4) { --iw-entry-delay: .12s; }
  .iw-motion-playing[data-iw-motion=index] > a:nth-child(n+5) { --iw-entry-delay: .16s; }
  @keyframes iw-seat-word {
    from { opacity: .22; clip-path: inset(0 -.14em 62%); transform: perspective(14em) translateY(.32em) rotateX(-14deg); }
    74% { clip-path: inset(-.3em -.14em -.3em); }
    to { opacity: 1; clip-path: inset(-.3em -.14em -.3em); transform: none; }
  }
  @keyframes iw-lift-heading {
    from { opacity: .42; translate: 0 .23em; clip-path: inset(0 -.18em 45%); }
    to { opacity: 1; translate: none; clip-path: inset(-.3em -.18em -.3em); }
  }
  @keyframes iw-set-copy {
    from { opacity: .65; translate: 0 .45rem; }
    to { opacity: 1; translate: none; }
  }
  @keyframes iw-open-plate {
    from { clip-path: polygon(var(--iw-left) 8%,var(--iw-joint) 8%,var(--iw-joint) 0,var(--iw-right) 0,var(--iw-right) 89%,var(--iw-joint) 89%,var(--iw-joint) 100%,var(--iw-left) 100%); }
    68% { clip-path: polygon(3% 1%,var(--iw-joint) 1%,var(--iw-joint) 0,96% 0,96% 99%,var(--iw-joint) 99%,var(--iw-joint) 100%,3% 100%); }
    to { clip-path: polygon(0 0,var(--iw-joint) 0,var(--iw-joint) 0,100% 0,100% 100%,var(--iw-joint) 100%,var(--iw-joint) 100%,0 100%); }
  }
  @keyframes iw-draw-profile { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes iw-set-index {
    from { opacity: .62; translate: var(--iw-index-start) .12rem; }
    to { opacity: 1; translate: none; }
  }
  @keyframes iw-mark-rule {
    0% { transform: scaleX(.06); opacity: .85; }
    72% { transform: scaleX(1); opacity: .8; }
    100% { transform: scaleX(1); opacity: 0; }
  }
}
@media screen and (max-width: 48rem) and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  html[dir]:not([data-iw-reduced-motion=true]) .iw-motion-playing[data-iw-motion=plate] {
    animation-duration: .73s;
    --iw-left: 22%;
    --iw-right: 79%;
  }
}
