/* Atlas illustrations only: the inline SVG retains its original geometry. */
.story-layers :is([class^="art-map-"], .art-galley-sails, [class^="art-stars-"], [class^="art-route-"], [class^="art-passport-"], [class^="art-decree-"]) { transform-box: fill-box; transform-origin: center; }

/* The shipyard marker rings; a little boat follows a sea route to the tower. */
.story-layers[data-action="0"] .art-map-marker { animation: atlas-marker 1.8s ease-in-out infinite; filter: drop-shadow(0 0 7px #f9d15d); }
.story-layers[data-action="1"] .art-map-voyage { opacity: 1; }
.story-layers[data-action="1"] .art-map-route { stroke-dasharray: 7 8; animation: atlas-route 3.2s linear infinite; }
.story-layers[data-action="1"] .art-map-boat { animation: atlas-map-sail 3.2s ease-in-out infinite; }

.story-layers .art-chart-window { width: 42px; transition: width 950ms cubic-bezier(.28,.76,.23,1); }
.story-layers .art-chart-roll { transform: translateX(0); transition: transform 950ms cubic-bezier(.28,.76,.23,1); }
.story-layers[data-chart-open] .art-chart-window { width: 504px; }
.story-layers[data-chart-open] .art-chart-roll { transform: translateX(468px); }
.story-layers .art-galley-sails { transform-origin: center bottom; transform: scale(.82,.5); }
.story-layers[data-action="1"] .art-galley-sails { transform: none; animation: atlas-hoist-sail 1.25s ease-out both; }
.story-layers[data-action="1"] .art-route-sails { transform-origin: center bottom; animation: atlas-raise 2.6s ease-in-out infinite; filter: drop-shadow(0 0 4px #fff0b1); }

/* Polaris and the Big Dipper are the actual stars from the chart. */
.story-layers[data-action="0"] .art-stars-polaris { animation: atlas-star 1.8s ease-in-out infinite; filter: drop-shadow(0 0 9px #ffd167); }
.story-layers[data-action="0"] .art-stars-guide { stroke: #ffe493; stroke-width: 5; }
.story-layers[data-action="1"] .art-stars-dipper { animation: atlas-constellation 2.4s ease-in-out infinite; filter: drop-shadow(0 0 7px #ffd574); }
.story-layers[data-action="1"] .art-stars-dipper circle { fill: #fff6c4; }

.story-layers[data-action="0"] .art-route-steamer { animation: atlas-steam 3.6s ease-in-out infinite; }
.story-layers .art-passport-seal { opacity: 0; }
.story-layers[data-passport-sealed] .art-passport-seal { opacity: 1; }
.story-layers[data-passport-sealed][data-action="0"] .art-passport-seal { animation: atlas-stamp .6s ease-out both; }
.story-layers[data-names-shown] .art-passport-name { opacity: 1; transition: opacity .5s ease-out; }
.story-layers[data-action="0"] .art-decree-door { fill: #719776; }
.story-layers[data-action="0"] .art-decree-voyage { opacity: 1; transform: translate(66px,24px); animation: atlas-launch 2.6s ease-in-out both; }

@keyframes atlas-marker { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.35); } }
@keyframes atlas-route { 0% { stroke-dashoffset: 120; opacity: .2; } 70%,100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes atlas-map-sail { 0%,100% { transform: translate(131px, 113px) rotate(8deg); } 62%,82% { transform: translate(0, 0) rotate(0); } }
@keyframes atlas-hoist-sail { from { transform: scale(.82,.5); } to { transform: none; } }
@keyframes atlas-raise { 0%,100% { transform: scaleY(.12); } 42%,74% { transform: scaleY(1); } }
@keyframes atlas-star { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes atlas-constellation { 50% { filter: drop-shadow(0 0 13px #ffd574); } }
@keyframes atlas-steam { 0%,100% { transform: translateX(0); } 55% { transform: translate(36px, -3px); } }
@keyframes atlas-stamp {
  0% { opacity: 0; transform: translateY(-23px) scale(1.25); }
  58% { opacity: 1; transform: scale(.94); }
  100% { opacity: 1; transform: none; }
}
@keyframes atlas-launch {
  0% { opacity: 0; transform: translate(0,-9px) scale(.65); }
  20% { opacity: 1; transform: scale(.75); }
  60% { opacity: 1; transform: translate(29px,16px) scale(.9); }
  100% { opacity: 1; transform: translate(66px,24px); }
}

/* Keep each selected result visible without movement. */
@media (prefers-reduced-motion: reduce) {
  .story-layers[data-action] :is([class^="art-map-"], .art-galley-sails, [class^="art-stars-"], [class^="art-route-"], [class^="art-passport-"], [class^="art-decree-"]) { animation: none !important; }
  .story-layers[data-action="1"] .art-map-voyage { opacity: 1; }
  .story-layers :is(.art-chart-window,.art-chart-roll,.art-passport-name) { transition: none !important; }
  .story-layers[data-action="1"] :is(.art-galley-sails, .art-route-sails) { transform: scaleY(1); }
  .story-layers[data-action="0"] .art-route-steamer { transform: translateX(36px); }
}
