/* The fixed paper set stays below the application and never receives input. */
body { isolation: isolate; }

.art-background,
.art-background * { pointer-events: none !important; }

.art-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict;
  opacity: .3;
}

.art-background-parallax {
  position: absolute;
  inset: -32px;
  transform: translate3d(calc(var(--art-pointer-x, 0) * -4px), calc(var(--art-pointer-y, 0) * -3px), 0);
  transition: transform .42s cubic-bezier(.2,.7,.3,1);
}

.art-background-drawing,
.art-background-mobile { display: block; width: 100%; height: 100%; }
.art-background-mobile { display: none; }
.art-background-orbit { opacity: .52; }

.art-background-depth {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .55s cubic-bezier(.16,.75,.25,1);
}
.art-background-depth-house {
  transform: translate(calc(var(--art-pointer-x, 0) * -20px), calc(var(--art-pointer-y, 0) * -14px)) rotate(calc(var(--art-pointer-x, 0) * -3deg));
  transform-origin: 50% 90%;
}
.art-background-depth-map {
  transform: translate(calc(var(--art-pointer-x, 0) * 28px), calc(var(--art-pointer-y, 0) * 21px)) rotate(calc(var(--art-pointer-x, 0) * 4deg));
  transition-duration: .7s;
}
.art-background-depth-paper {
  transform: translate(calc(var(--art-pointer-x, 0) * -10px), calc(var(--art-pointer-y, 0) * -7px)) rotate(calc(var(--art-pointer-x, 0) * -.5deg));
  transition-duration: .9s;
}

/* Placement transforms stay on outer SVG groups; only their contents move. */
.art-background-house {
  transform-box: fill-box;
  transform-origin: 50% 90%;
  animation: art-background-house-sway 13s ease-in-out infinite;
}
.art-background-map {
  transform-box: fill-box;
  transform-origin: 50% 60%;
  animation: art-background-map-drift 17s ease-in-out infinite;
}
.art-background-pin {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: art-background-pin-lift 6s ease-in-out infinite;
}
.art-background-route { animation: art-background-route-flow 18s linear infinite; }
.art-background-wash { animation: art-background-wash-drift 23s ease-in-out infinite; }
.art-background-wash-mint { animation-duration: 29s; animation-direction: reverse; }

@keyframes art-background-house-sway {
  0%, 100% { rotate: -1deg; }
  50% { rotate: 1.5deg; }
}
@keyframes art-background-map-drift {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: -4px -8px; rotate: -2deg; }
}
@keyframes art-background-pin-lift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
@keyframes art-background-route-flow {
  to { stroke-dashoffset: -90; }
}
@keyframes art-background-wash-drift {
  0%, 100% { translate: 0 0; }
  50% { translate: -14px 12px; }
}

.hero-art[data-art-scene="ready"] { gap: 5px; }

.art-city-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 520 / 330;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 330px;
  isolation: isolate;
}

.art-city-wash {
  position: absolute;
  z-index: -1;
  inset: 11% 6% 4%;
  border-radius: 48% 52% 46% 54%;
  background: radial-gradient(ellipse at 25% 28%, #e2dced99, transparent 65%), radial-gradient(ellipse at 76% 65%, #d8e9e080, transparent 64%);
  transform: rotate(-9deg);
}

.art-city-parallax {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(calc(var(--art-pointer-y, 0) * -2deg)) rotateY(calc(var(--art-pointer-x, 0) * 2deg));
  transition: transform .42s cubic-bezier(.2,.7,.3,1);
}

.art-city { display: block; width: 100%; height: 100%; overflow: visible; }
.art-city * { vector-effect: non-scaling-stroke; }
.art-window { fill: #9daca5; }
.art-moon-cut { opacity: 0; transition: opacity .5s ease; }
.art-sun-disc { transition: fill .5s ease, stroke .5s ease; }
.art-sun-halo { transition: fill .5s ease; }

.art-unfold-piece { transform-box: fill-box; transform-origin: 50% 100%; }

.art-scene-note {
  position: absolute;
  top: 4%;
  left: 5%;
  color: #626b5f;
  font-size: 13px;
  letter-spacing: 2px;
  line-height: 1.6;
  writing-mode: vertical-rl;
  white-space: nowrap;
  pointer-events: none;
}

.art-scene-note::before {
  content: "";
  display: inline-block;
  height: 22px;
  margin-bottom: 9px;
  border-right: 1px solid #abb39e;
}

.art-scene-controls {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.art-scene-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #c9c8b8;
  border-radius: 20px 20px 20px 5px;
  background: #fcf8edeb;
  box-shadow: 0 2px 0 #d9d2c05c;
  color: #465b50;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.art-scene-button[aria-pressed="true"] {
  color: #594f45;
  border-color: #cba87e;
  background: #f5e2bd;
}

.art-scene-button:disabled {
  opacity: .7;
  cursor: default;
}
.art-scene-button:disabled .art-pause-icon { display: none; }

.art-scene-button:focus-visible {
  outline: 3px solid #6d8172;
  outline-offset: 3px;
}

.art-control-icon { position: relative; display: inline-block; flex: 0 0 12px; width: 12px; height: 12px; }
.art-unfold-icon::before,
.art-unfold-icon::after { content: ""; position: absolute; inset: 1px; border: 1.3px solid currentColor; border-radius: 1px; }
.art-unfold-icon::before { transform: translate(-2px, -2px) rotate(-18deg); }
.art-unfold-icon::after { transform: translate(2px, 2px) rotate(12deg); background: #fffaf0; }
.art-light-icon { border: 1.3px solid currentColor; border-radius: 50%; }
.art-light-icon::after { content: ""; position: absolute; inset: 2px -3px -3px 3px; border-bottom: 1px solid currentColor; transform: rotate(-30deg); }
.art-pause-icon::before,
.art-pause-icon::after { content: ""; position: absolute; top: 1px; bottom: 1px; width: 2px; border-radius: 1px; background: currentColor; }
.art-pause-icon::before { left: 2px; }
.art-pause-icon::after { right: 2px; }
[aria-pressed="true"] .art-pause-icon::before { top: 0; bottom: 0; left: 3px; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 8px solid currentColor; border-radius: 0; background: none; }
[aria-pressed="true"] .art-pause-icon::after { display: none; }

.art-scene-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.art-float { animation: art-paper-drift 10s ease-in-out infinite; }
.art-float-slow { animation: art-paper-drift 16s ease-in-out infinite reverse; }
.art-float-map { animation: art-map-drift 12s ease-in-out infinite; }
.art-spark { animation: art-paper-glimmer 7s ease-in-out infinite; }

@keyframes art-paper-drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

@keyframes art-map-drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -2px; }
}

@keyframes art-paper-glimmer {
  0%, 100% { opacity: .45; }
  50% { opacity: .95; }
}

body[data-art-light="dusk"] .art-background { opacity: .23; }
body[data-art-light="dusk"] .art-city-wash { background: radial-gradient(ellipse at 25% 28%, #c5b5d1a6, transparent 65%), radial-gradient(ellipse at 76% 65%, #b5c9cd80, transparent 64%); }
body[data-art-light="dusk"] .art-sun-disc { fill: #fff0c7; stroke: #cebb99; }
body[data-art-light="dusk"] .art-sun-halo { fill: #fff0c7; }
body[data-art-light="dusk"] .art-moon-cut { opacity: 1; }
body[data-art-light="dusk"] .art-scene-note { color: #696778; }
body[data-art-light="dusk"] .art-scene-button { color: #514d62; background: #f1eaf4ed; border-color: #c4b5ce; }
body[data-art-light="dusk"] .art-scene-button[aria-pressed="true"] { color: #654d35; background: #f3dbac; border-color: #c6a77b; }

/* Stop at the resting geometry, rather than freezing a floating pose. */
body:not([data-art-motion="running"]) :is(.art-background, .hero-art[data-art-scene="ready"]) *,
.hero-art[data-art-scene="ready"]:not([data-art-scene-motion="running"]) * {
  animation: none !important;
  transition: none !important;
}
body:not([data-art-motion="running"]) :is(.art-city-parallax, .art-background-parallax, .art-background-depth),
.hero-art:not([data-art-scene-motion="running"]) .art-city-parallax { transform: none; }

@media (hover: hover) {
  .art-scene-button:hover:not(:disabled) { background: #eaf0e3; border-color: #91a28d; }
  .art-scene-button[aria-pressed="true"]:hover:not(:disabled) { background: #f6dba5; border-color: #b39166; }
}

@media (max-width: 800px) {
  .art-background-drawing { display: none; }
  .art-background-mobile { display: block; }
  .art-city-stage { max-height: 260px; }
  .art-scene-note { top: 5%; left: 9%; }
}

@media (max-width: 560px) {
  .art-background { opacity: .2; }
  .art-city-stage { max-height: none; min-height: 150px; }
  .art-city { width: 100%; height: 100%; }
  .art-scene-controls { gap: 5px; }
  .art-scene-button { padding: 7px 9px; gap: 5px; }
  .art-scene-note { top: 6%; left: 8%; letter-spacing: 1px; }
  .art-scene-note::before { height: 14px; margin-bottom: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .art-background *,
  .hero-art[data-art-scene="ready"] * { animation: none !important; transition: none !important; }
  .art-city-parallax,
  .art-background-parallax,
  .art-background-depth { transform: none !important; }
}

@media (forced-colors: active) {
  .art-background,
  .art-city-wash { display: none; }
  .art-scene-button { border: 1px solid ButtonText; }
  .art-scene-button[aria-pressed="true"] { border: 2px solid Highlight; }
}
