/* The temporary drawing sits in the same photographic plane as the original
   poster, below the site's existing tint, lettering and controls. */
.window-assembly {
  --assembly-ease: cubic-bezier(.32, .72, 0, 1);
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background: rgba(34, 48, 51, .90);
  animation: assembly-handoff 170ms ease 1210ms both;
}

.assembly-drawing,
.assembly-profile {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: square;
}

.assembly-drawing { stroke: #cebea2; stroke-width: .82; }
.assembly-construction { opacity: .43; stroke-width: .55; }

.assembly-plane {
  animation: assembly-fit var(--time) var(--assembly-ease) var(--delay) both;
}

.assembly-slab  { --x: 0px;   --y: 23px;  --time: 780ms; --delay: 55ms; }
.assembly-shell { --x: -20px; --y: -6px;  --time: 860ms; --delay: 110ms; }
.assembly-far   { --x: 25px;  --y: -5px;  --time: 840ms; --delay: 205ms; }
.assembly-near  { --x: -9px;  --y: -12px; --time: 840ms; --delay: 290ms; }
.assembly-frame { --x: 13px;  --y: 4px;   --time: 880ms; --delay: 390ms; }

.assembly-profile {
  stroke: #e9d6b2;
  stroke-width: .72;
  animation: assembly-pencil var(--time) ease-out var(--delay) both;
}

@keyframes assembly-fit {
  from { opacity: 0; transform: translate(var(--x), var(--y)); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes assembly-pencil {
  0%, 32% { opacity: .78; }
  100% { opacity: 0; }
}
@keyframes assembly-handoff {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 760px) {
  .assembly-slab  { --y: 16px; }
  .assembly-shell { --x: -12px; }
  .assembly-far   { --x: 16px; }
  .assembly-near  { --x: -7px; --y: -9px; }
  .assembly-frame { --x: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .window-assembly { display: none; }
}
@media (scripting: none) {
  .hero-home { height: auto; min-height: 0; }
  .hero-scroll-meter { display: none; }
}

/* A deferred or blocked script cannot flash the finished photo and then
   rewind it. The CSS veil releases itself when enhancement arrives late. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .hero-home:not([data-assembly]) .hero-sequence-poster::after,
  .hero-home.assembly-already-visible .hero-sequence-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(34, 48, 51, .90);
    animation: assembly-handoff 180ms ease 170ms both;
  }
}

.window-assembly.assembly-drawing-only { animation: none; }
.assembly-drawing-only .assembly-plane { visibility: hidden; animation: none; }
.assembly-drawing-only .assembly-profile { animation: none; }
.assembly-late-poster { background: transparent; }
.assembly-late-poster img { opacity: 0; transition: opacity 220ms ease; }
.assembly-late-poster.assembly-photo-arrived img { opacity: 1; }
