/* moon.css - the /moon/ section.
   Deliberately its own stylesheet, like lunar-aspect.css and moon.css (the
   store-page one) are theirs. These pages are editorial, not a product page,
   and they should not inherit a game's furniture. */

:root {
  --bg:      #05060b;
  --panel:   #0b0e18;
  --ink:     #dfe6f2;
  --dim:     #93a0b8;
  --rule:    #1c2334;
  --accent:  #8fb7ff;
  --value:   #ffd79a;   /* every computed number wears this, everywhere */
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 ui-serif, Georgia, "Times New Roman", serif;
  padding: 0 16px 4rem;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #05060b; padding: .6rem 1rem; border-radius: 4px;
}
.skip:focus { left: 16px; top: 12px; z-index: 10; }

a { color: var(--accent); }
a:hover { color: #b9d2ff; }

.crumbs {
  max-width: var(--measure); margin: 0 auto; padding: 1.4rem 0 0;
  font: 13px/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--dim); letter-spacing: .02em;
}
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { opacity: .5; margin: 0 .35rem; }

main { max-width: var(--measure); margin: 0 auto; }

.lede { margin: 2rem 0 2.5rem; }

h1 {
  font-size: clamp(1.75rem, 5.2vw, 2.6rem);
  line-height: 1.15; margin: 0 0 .75rem; font-weight: 600;
  letter-spacing: -.015em; text-wrap: balance;
}

.lede .sub {
  margin: 0; color: var(--dim); font-size: 1.05rem; line-height: 1.55;
  text-wrap: pretty;
}

h2 {
  font-size: 1.28rem; font-weight: 600; letter-spacing: -.01em;
  margin: 2.6rem 0 .8rem; text-wrap: balance;
}

p { margin: 0 0 1.1rem; text-wrap: pretty; }

.answer {
  font-size: 1.16rem; line-height: 1.55;
  border-left: 2px solid var(--accent);
  padding-left: 1rem; margin-bottom: 1.6rem;
}

/* A computed value. One colour across the whole section, so a reader learns in
   about four seconds which parts of a page came out of the ephemeris. */
.v {
  color: var(--value);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .94em; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- figures ---- */

figure { margin: 2rem 0; }

.hero .frame {
  position: relative; width: 100%;
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  background: #000;
}
.hero img, .hero canvas { display: block; width: 100%; height: auto; }
.hero canvas {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .45s ease;
}
/* Revealed only once a frame has really landed. If the engine's API moves
   under us, the PNG underneath is still correct and still shown. */
.hero canvas.ready { opacity: 1; }

.detail img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 8px;
}

figcaption {
  margin-top: .7rem; color: var(--dim);
  font: 14px/1.55 ui-sans-serif, system-ui, sans-serif;
  text-wrap: pretty;
}

/* ---- tables ---- */

table {
  width: 100%; border-collapse: collapse;
  font: 14px/1.5 ui-sans-serif, system-ui, sans-serif;
}
caption {
  text-align: left; color: var(--dim); padding-bottom: .6rem;
  font-size: 13px;
}
th, td {
  text-align: left; padding: .5rem .7rem;
  border-bottom: 1px solid var(--rule);
}
th { color: var(--dim); font-weight: 600; font-size: 12.5px;
     text-transform: uppercase; letter-spacing: .06em; }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }

.track table { background: var(--panel); border-radius: 8px; }
.track { margin: 1.6rem 0 2rem; }

/* ---- methods ---- */

.methods {
  margin: 3.5rem 0 0; padding: 1.5rem; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 10px;
}
.methods h2 { margin-top: 0; font-size: 1.1rem; }
.methods p { font-size: .95rem; color: var(--dim); }
.methods code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em; color: var(--ink); background: #141a28;
  padding: .12em .4em; border-radius: 3px;
}
.methods td:first-child { color: var(--value); white-space: nowrap; }
.stamp { font-size: .82rem !important; margin-bottom: 0 !important; opacity: .85; }

/* ---- call to action ---- */

.cta {
  margin: 3rem 0 0; padding: 1.75rem; border-radius: 10px;
  border: 1px solid var(--rule);
  background: linear-gradient(160deg, #0d1424, #080a12);
}
.cta h2 { margin-top: 0; }
.cta p { font-size: .98rem; }
.buttons { margin-bottom: 0 !important; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.get {
  display: inline-block; background: var(--accent); color: #05060b;
  text-decoration: none; font: 600 15px/1 ui-sans-serif, system-ui, sans-serif;
  padding: .8rem 1.1rem; border-radius: 7px;
}
.get:hover { background: #b9d2ff; color: #05060b; }
.alt { font: 14px/1 ui-sans-serif, system-ui, sans-serif; }

footer {
  max-width: var(--measure); margin: 3rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font: 14px/1.6 ui-sans-serif, system-ui, sans-serif; color: var(--dim);
}
footer p { margin: 0; }

/* ---- the hub ---- */

.hub-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.hub-list li { border-top: 1px solid var(--rule); }
.hub-list li:last-child { border-bottom: 1px solid var(--rule); }
.hub-list a {
  display: grid; grid-template-columns: 116px 1fr; gap: 1.1rem;
  align-items: center; padding: 1rem 0; text-decoration: none; color: inherit;
}
.hub-list a:hover { background: #0a0d16; }
/* Deliberately NOT the source 1200x630 aspect. At that ratio the thumbnail is
   the whole frame shrunk, and most of these frames are correctly mostly black
   sky - measured mean luminance 6 to 20 out of 255, which reads as a row of
   empty rectangles. A squarer box crops the empty sides instead and lets the
   subject fill the card. Nothing is faked; less of the nothing is shown. */
.hub-list img {
  width: 116px; height: 92px; object-fit: cover; object-position: center;
  border-radius: 5px; display: block; background: #05060b;
}
.hub-list h2 { margin: 0 0 .2rem; font-size: 1.02rem; }
.hub-list p { margin: 0; color: var(--dim); font-size: .88rem; line-height: 1.45; }

.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;
}

.filter {
  width: 100%; margin-top: 1.5rem; padding: .75rem .9rem;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 7px;
  font: 15px/1.4 ui-sans-serif, system-ui, sans-serif;
}
.filter:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.count { color: var(--dim); font: 13px/1.5 ui-sans-serif, system-ui, sans-serif; margin-top: .75rem; }

@media (max-width: 460px) {
  .hub-list a { grid-template-columns: 1fr; gap: .6rem; }
  .hub-list img { width: 100%; height: auto; }
}

/* ---- the hero as a door into the sim ---- */

.hero a.frame { display: block; text-decoration: none; cursor: pointer; }
.hero a.frame:hover .takeover,
.hero a.frame:focus-visible .takeover { opacity: 1; transform: translateY(0); }
.hero a.frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.takeover {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 2.2rem 1rem .9rem;
  background: linear-gradient(to top, rgba(3,5,10,.92), rgba(3,5,10,0));
  color: #fff; font: 600 14px/1.35 ui-sans-serif, system-ui, sans-serif;
  text-align: center; opacity: 0; transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
/* Touch has no hover, so the invitation would never appear. Show it there. */
@media (hover: none) { .takeover { opacity: 1; transform: none; } }

.engine-line {
  margin: .75rem 0 0 !important;
  font: 13.5px/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--dim);
}
.badge {
  display: inline-block; vertical-align: 1px; margin-right: .4rem;
  background: #1d3a22; color: #7fe39a; border: 1px solid #2c5c36;
  font: 700 10px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .09em; text-transform: uppercase;
  padding: .3em .5em; border-radius: 3px;
}
.detail a { display: block; }

/* ---- playback controls ----
   Hidden in the markup and revealed by script only once a frame has really
   rendered, so a reader whose engine failed never sees buttons that cannot
   work. The still image stays correct underneath either way. */

.player {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  margin-top: .75rem; padding: .5rem .6rem;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
}
.player[hidden] { display: none; }

.pp {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 1px solid var(--rule); background: #141a28; color: var(--ink);
  font-size: .78rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.pp:hover { border-color: var(--accent); color: var(--accent); }
.pp:focus-visible, .rates button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rates { display: flex; flex-wrap: wrap; gap: .3rem; }
.rates button {
  border: 1px solid var(--rule); background: transparent; color: var(--dim);
  font: 12px/1 ui-sans-serif, system-ui, sans-serif;
  padding: .45rem .6rem; border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.rates button:hover { color: var(--ink); border-color: var(--accent); }
.rates button[aria-pressed="true"] {
  background: #1b2740; color: var(--ink); border-color: var(--accent);
}

.clock {
  margin-left: auto; color: var(--value);
  font: 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

@media (max-width: 440px) {
  .clock { margin-left: 0; width: 100%; padding-top: .2rem; }
}
