/* The still scene remains the fallback for reduced motion and other pages. */
.atlas-foliage { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .home .atlas-art::before,
  .home .atlas-drafting,
  .home .atlas-foliage,
  .home .atlas-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .home .atlas-art::before {
    content: '';
    background: #f1e5d7;
    animation: atlas-reveal 1.55s ease-out both;
  }

  .home .atlas-drafting, .home .atlas-shade { background: inherit; }
  .home .atlas-drafting {
    mask-image: linear-gradient(transparent 65%, #000 78%, #000 96%, transparent);
    animation: atlas-draw 1.4s cubic-bezier(.25, .7, .3, 1) both;
  }

  /* The moving ink is isolated from the fixed facade and the paper below it. */
  .home .atlas-foliage {
    display: block;
    opacity: 0;
    animation: atlas-details-appear .18s 1.4s linear both;
  }
  .home .atlas-living { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .home .atlas-drawing-trees { transform-box: view-box; transform-origin: 282px 911px; animation: atlas-drawing-wind 9s 1.5s ease-in-out infinite; }
  .home .atlas-model-tree { transform-box: view-box; transform-origin: 860px 690px; animation: atlas-model-wind 6.8s 1.5s ease-in-out infinite; }

  .home .atlas-walker { transform-box: view-box; }
  .home .atlas-walker-1 { animation: atlas-walk-a 8.2s 1.5s ease-in-out infinite; }
  .home .atlas-walker-2 { animation: atlas-walk-b 7.1s 1.5s ease-in-out infinite; }
  .home .atlas-walker-3 { animation: atlas-walk-c 9.3s 1.5s ease-in-out infinite; }
  .home .atlas-walker-4 { animation: atlas-walk-d 6.9s 1.5s ease-in-out infinite; }
  .home .atlas-step { transform-box: fill-box; transform-origin: center top; }
  .home .atlas-step-left { animation: atlas-step 1.15s 1.5s ease-in-out infinite alternate; }
  .home .atlas-step-right { animation: atlas-step 1.15s 1.5s ease-in-out infinite alternate-reverse; }

  /* This shadow mask remains entirely in the sky, away from the building. */
  .home .atlas-shade {
    mask-image: radial-gradient(ellipse 22% 28% at 25% 0%, #000 42%, transparent);
    transform-origin: 3% 0;
    animation: atlas-canopy-shadow 8.6s 1.55s ease-in-out infinite alternate;
    opacity: 0;
  }

  .home:has(.atlas-motion-toggle input:checked) :is(
    .atlas-foliage, .atlas-shade, .atlas-drawing-trees, .atlas-model-tree, .atlas-walker, .atlas-step
  ) { animation-play-state: paused; }
}

@keyframes atlas-reveal {
  0%, 10% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes atlas-draw {
  0% { clip-path: inset(0 100% 0 0); opacity: .9; }
  78% { clip-path: inset(0); opacity: 1; }
  100% { clip-path: inset(0); opacity: 0; }
}
@keyframes atlas-details-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes atlas-drawing-wind {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(.7deg); }
  70% { transform: rotate(-.6deg); }
}
@keyframes atlas-model-wind {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(1.8deg); }
  70% { transform: rotate(-1.4deg); }
}
@keyframes atlas-walk-a { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
@keyframes atlas-walk-b { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
@keyframes atlas-walk-c { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-10px); } }
@keyframes atlas-walk-d { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-6px); } }
@keyframes atlas-step { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes atlas-canopy-shadow {
  from { opacity: 1; transform: translate(0) rotate(0deg); }
  to { opacity: 1; transform: translate(.18%, .1%) rotate(.3deg); }
}
