:root {
  color-scheme: dark;
  background: #182021;
  color: #f1e9da;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }

body { margin: 0; }

main {
  width: min(56rem, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(2rem, 8vw, 6rem);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: .12em;
}

figure { margin: 0; }

.view {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 4;
  border: 1px solid #53605f;
  border-bottom: 4px solid #695e50;
}

.sky { fill: #303e4c; }
.stars { fill: #c7c9bc; }
.moon, #meteor { fill: #f0dfb7; }
.far-roofs { fill: #273239; }
.near-roofs { fill: #1e262a; }
.balcony { fill: #191f21; }
.rail { fill: none; stroke: #171e22; stroke-width: 4; }
.cloth { fill: #a4a79e; }
.hem { fill: none; stroke: #777e79; stroke-width: 1.4; }
.sill { fill: #14191a; }

#meteor { opacity: 0; }

#meteor.visible {
  opacity: 1;
  transform: translate(58px, 19px);
}

@media (prefers-reduced-motion: no-preference) {
  #meteor.visible {
    animation: pass 850ms ease-out both;
  }

  @keyframes pass {
    0%   { opacity: 0; transform: translate(0, 0); }
    18%  { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translate(142px, 47px); }
  }
}

figcaption {
  margin-top: .85rem;
  color: #d8d5c8;
  font-size: .95rem;
  line-height: 1.8;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin-top: 1.5rem;
}

button {
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid #a6a79a;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:hover { background: #303939; }

button:focus-visible {
  outline: 3px solid #f0dfb7;
  outline-offset: 4px;
}

#status {
  color: #c4c9bd;
  font: .875rem/1.6 system-ui, sans-serif;
}

@media (max-width: 36rem) {
  .view { aspect-ratio: 1 / 1; }
}
