:root {
  color-scheme: dark;
  --black: #000;
  --white: #f2f2ef;
  --dim: rgba(242, 242, 239, 0.62);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--black);
  color: var(--white);
}

body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }

.instrument {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100svh;
  min-height: 32rem;
  overflow: hidden;
  background: var(--black);
}

h1 {
  position: absolute;
  z-index: 2;
  top: max(1.5rem, env(safe-area-inset-top));
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.listen {
  position: absolute;
  z-index: 5;
  top: max(1.15rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.listen:hover, .listen:focus-visible { color: var(--white); }
.listen:focus-visible { outline: 1px solid var(--white); outline-offset: 0.2rem; }
.listen svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.listen .sound-off { display: none; }
.listen[aria-pressed="true"] .sound-on { display: none; }
.listen[aria-pressed="true"] .sound-off { display: block; }

.hemisphere {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 4.5rem 1.5rem 3.25rem;
}

.hemisphere.lower { padding: 3.25rem 1.5rem max(4.5rem, env(safe-area-inset-bottom)); }

.place {
  min-height: 8.75rem;
  width: min(90vw, 32rem);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.place p { margin: 0; }

.city {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 7vw, 3.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.country {
  margin-top: 0.45rem !important;
  font-size: clamp(0.72rem, 2.2vw, 0.86rem);
  letter-spacing: 0.1em;
}

.population, .event-time {
  color: var(--dim);
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  letter-spacing: 0.045em;
}

.population { margin-top: 0.8rem !important; }
.event-time { margin-top: 0.28rem !important; }

.horizon {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.line {
  position: absolute;
  inset: 0;
  display: block;
  height: 1px;
  background: var(--white);
}

.arrow {
  position: absolute;
  z-index: 1;
  left: 50%;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  transform: translateX(-50%);
  place-items: center;
  background: var(--black);
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 300;
}

.rise-arrow { bottom: 0.55rem; }
.set-arrow { top: 0.55rem; }

.credit {
  position: absolute;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  margin: 0;
  color: rgba(242, 242, 239, 0.28);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-height: 600px) {
  .hemisphere { padding-top: 3rem; padding-bottom: 2rem; }
  .hemisphere.lower { padding-top: 2rem; padding-bottom: 3rem; }
  .place { min-height: 6.75rem; }
  .city { font-size: clamp(1.45rem, 6vw, 2.5rem); }
}
