#ocular[data-lunar-ready] {
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(ellipse at 32% 45%, #162027 0%, #0a1115 42%, #080d0e 78%);
}

#ocular[data-lunar-ready]:not([hidden]) ~ .detail-title { display: none; }

.lunar-observation {
  min-height: 100%;
  max-width: 1200px;
  padding: clamp(24px, 4vh, 54px) clamp(30px, 6vw, 95px);
  margin: auto;
  display: grid;
  align-content: center;
  align-items: center;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.88fr);
  gap: clamp(28px, 6vw, 96px);
}

.lunar-instrument { min-width: 0; display: grid; justify-items: center; gap: 21px; }

.lunar-lens {
  display: block;
  position: relative;
  isolation: isolate;
  width: min(100%, 58vh);
  width: min(100%, 58dvh);
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 5px solid #333831;
  background: #000;
  box-shadow: 0 0 0 1px #817658, 0 0 0 4px #141818, 0 0 0 5px #43443a, 0 12px 42px #0008;
  cursor: zoom-in;
}

.lunar-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 8px 3px #000a;
}

.lunar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  transition: transform .65s cubic-bezier(.22, .72, .22, 1);
}

/* In the 800 px source, the southern terminator crosses the crater field near (260, 575). */
#ocular[data-lunar-mode="relief"] .lunar-image { transform: translate(52.5%, -65.625%) scale(3); }
#ocular[data-lunar-mode="relief"] .lunar-lens { cursor: zoom-out; }
.lunar-mark {
  position: absolute;
  left: 32.5%;
  top: 71.875%;
  width: 6%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #f6dd9e;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #1b160b9c;
  transition: opacity .2s ease;
}
#ocular[data-lunar-mode="relief"] .lunar-mark { opacity: 0; }

.lunar-zoom { display: inline-flex; border: 1px solid #6c6654; border-radius: 3px; overflow: hidden; }
.lunar-zoom button {
  min-height: 44px;
  padding: 6px 12px;
  line-height: 1.2;
  color: #d8d2c1;
  background: #131a1c;
  font-size: 14px;
}
.lunar-zoom button span { margin-inline-start: 4px; }
.lunar-zoom button + button { border-left: 1px solid #6c6654; }
.lunar-zoom button[aria-pressed="true"] { color: #251f15; background: #d6bc89; }
.lunar-zoom button:focus-visible { outline-offset: -4px; outline-color: #f8e7b6; }
.lunar-zoom button[aria-pressed="true"]:focus-visible { outline-color: #564522; }
.lunar-notes h2 {
  margin: 12px 0;
  font: 400 clamp(33px, 3.6vw, 60px)/1.03 Georgia, "Times New Roman", serif;
  color: var(--ivory, #f1ead9);
  letter-spacing: -.035em;
}
.lunar-notes p { margin: 0; font-size: 16px; line-height: 1.55; color: #dbdacf; }
.lunar-reading { border-top: 1px solid #474a43; margin-top: 22px; padding-top: 14px; }
.lunar-reading h3 { margin: 0 0 6px; font: 400 21px/1.2 Georgia, serif; color: #ece1cc; }
.lunar-reading h3 span { font: 13px Arial, sans-serif; color: #c8af7a; margin-left: 6px; }
.lunar-reading a, .lunar-credit a { color: #d9c39a; text-underline-offset: .2em; }
.lunar-reading a { display: inline-block; margin-top: 8px; padding-block: 4px; font-size: 14px; }
.lunar-notes .lunar-credit { margin-top: 13px; font-size: 13px; color: #aaa99e; }

@media (max-width: 660px) and (orientation: portrait) {
  .lunar-observation {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: min(100%, 510px);
    padding: 18px clamp(18px, 6vw, 32px);
    gap: 19px;
  }
  .lunar-instrument { gap: 10px; }
  .lunar-lens { width: min(65vw, 33vh); width: min(65vw, 33dvh); }
  .lunar-notes h2 { margin: 7px 0; font-size: 31px; }
  .lunar-notes p { line-height: 1.4; }
  .lunar-reading { margin-top: 12px; padding-top: 10px; }
  .lunar-notes .lunar-credit { margin-top: 7px; }
}

@media (max-height: 545px) and (orientation: landscape) {
  .lunar-observation { grid-template-columns: minmax(135px, .8fr) minmax(255px, 1.2fr); padding: 15px 5vw; gap: 25px; }
  .lunar-lens { width: min(100%, 49vh); width: min(100%, 49dvh); }
  .lunar-instrument { gap: 10px; }
  .lunar-notes h2 { font-size: 30px; margin: 5px 0; }
  .lunar-notes p { line-height: 1.35; }
  .lunar-reading { margin-top: 10px; padding-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .lunar-image, .lunar-mark { transition: none; }
}
