:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  overscroll-behavior: none;
}

#scene {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.thing {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  touch-action: none;
  will-change: transform;
  transform-origin: center center;
  filter: none;
}

.thing img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.thing.dragging {
  cursor: grabbing;
}

.thing.pop-in {
  animation: pop-in 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  60% {
    opacity: 1;
  }
}

.thing.pop-out {
  animation: pop-out 180ms ease-in forwards;
  pointer-events: none;
}

@keyframes pop-out {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thing.pop-in,
  .thing.pop-out {
    animation: none;
  }
}

/* The wordmark and sound button form a top "nav bar". The bar spans
   the width and centers both controls on one vertical line; it lets
   taps fall through to the garden except on the controls themselves. */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2147483647;
}

#topbar > * {
  pointer-events: auto;
}

#wordmark {
  display: block;
  padding: 4px;
  opacity: 0.85;
  transition: opacity 150ms ease, transform 150ms ease;
}

#wordmark:hover {
  opacity: 1;
  transform: scale(1.04);
}

#wordmark img {
  display: block;
  width: 164px;
  height: auto;
  -webkit-user-drag: none;
  user-drag: none;
}

/* Icon buttons render their artwork at the same 0.28 scale as the
   garden so every line on the page has identical weight. */
#sound {
  width: 54px;
  height: 46px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 1;
  transition: transform 150ms ease;
}

#sound:hover {
  transform: scale(1.08);
}

#sound img {
  display: block;
  width: 38px;
  height: 30px;
  object-fit: contain;
  -webkit-user-drag: none;
  user-drag: none;
}

#sound .icon-on {
  display: none;
}

#sound[aria-pressed="true"] .icon-on {
  display: block;
}

#sound[aria-pressed="true"] .icon-off {
  display: none;
}

@media (prefers-color-scheme: dark) {
  html, body {
    background: #17181a;
  }

  .thing img,
  #sound img,
  #wordmark img {
    filter: invert(1) brightness(0.92);
  }
}
