/* One short drafting gesture per chapter. Nothing is hidden before first paint. */
@media (prefers-reduced-motion: no-preference) {
  [data-heading-mark] { position:relative; --draft-gold:#f3cb87; }
  [data-heading-mark]::before, [data-heading-mark]::after {
    position:absolute; box-sizing:border-box; pointer-events:none; opacity:0;
  }
  /* The dimension line grows from the Hebrew reading edge; the small end
     bars and subdivisions appear at their actual spacing rather than stretch. */
  [data-heading-mark="dimension"] {
    --draft-gold:#946e37;
    animation:draft-settle .65s cubic-bezier(.2,.8,.2,1) both;
  }
  [data-heading-mark="dimension"]::after {
    content:""; inset-inline-start:0; inset-block-end:-.08em;
    inline-size:min(5.4em,80%); block-size:9px;
    background:linear-gradient(var(--draft-gold),var(--draft-gold)) center/100% 1px no-repeat,
      linear-gradient(var(--draft-gold),var(--draft-gold)) left/1px 100% no-repeat,
      linear-gradient(var(--draft-gold),var(--draft-gold)) right/1px 100% no-repeat,
      repeating-linear-gradient(to left,var(--draft-gold) 0 1px,transparent 1px 12px) center/100% 4px no-repeat;
    animation:draft-dimension 1.05s ease-out both;
  }
  /* Scan the width of the lettering, not the empty grid column. The heading
     stays readable as the warm edge travels across it. */
  #interiors-title, #office-title { inline-size:fit-content; max-inline-size:100%; }
  [data-heading-mark="scan"] { animation:draft-ink .78s ease-out both; }
  [data-heading-mark="scan"]::after {
    content:""; inset:0; transform-origin:center;
    background:linear-gradient(90deg,transparent,rgba(246,204,131,.13) 68%,var(--draft-gold) 90%,transparent) right center / 8px 76% no-repeat;
    animation:draft-scan .95s cubic-bezier(.25,.58,.34,1) both;
  }
  /* Two registration corners close in and lock to the two-line title. */
  [data-heading-mark="register"] { animation:draft-settle .65s ease-out both; }
  [data-heading-mark="register"]::before, [data-heading-mark="register"]::after {
    content:""; inline-size:.24em; block-size:.24em; border:0 solid var(--draft-gold);
    animation:draft-register .9s ease-out both;
  }
  [data-heading-mark="register"]::before {
    inset-block-start:0; inset-inline-start:-.07em;
    border-block-start-width:1px; border-inline-start-width:1px;
    --mark-x:.12em; --mark-y:-.08em;
  }
  [data-heading-mark="register"]::after {
    inset-block-end:0; inset-inline-end:-.07em;
    border-block-end-width:1px; border-inline-end-width:1px;
    --mark-x:-.12em; --mark-y:.08em;
  }
  @keyframes draft-settle {
    from { opacity:.68; transform:translateY(.06em); }
    to { opacity:1; transform:none; }
  }
  @keyframes draft-ink { from { color:#e7c998; } to { color:inherit; } }
  @keyframes draft-dimension {
    0% { opacity:0; clip-path:inset(0 0 0 100%); }
    14% { opacity:1; } 68% { clip-path:inset(0); opacity:1; }
    100% { clip-path:inset(0); opacity:0; }
  }
  @keyframes draft-scan {
    0% { opacity:0; background-position:100% center; } 14%,72% { opacity:1; }
    100% { opacity:0; background-position:0% center; }
  }
  @keyframes draft-register {
    0% { opacity:0; transform:translate(var(--mark-x),var(--mark-y)); }
    26% { opacity:1; } 57%,72% { transform:none; opacity:1; }
    100% { opacity:0; transform:none; }
  }
}
