/* ============================================================
   solar.css — page styles for the computed solar system.
   Loads after styles.css and leans on its tokens, rails,
   headline and sub styles; everything here is stage-specific.
   ============================================================ */

/* ---------- stage ---------------------------------------------- */

.stage {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding: calc(var(--rail-h) + 2rem) var(--gutter);
  overflow: hidden;
}

.stage__chart {
  --chart-opacity: 1;
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: var(--chart-opacity);
  animation: chart-in 1100ms var(--ease) both;
}

#system {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;   /* the canvas owns the drag; the page cannot scroll */
}
#system:active { cursor: grabbing; }

/* Sideways dusk over the copy, gone by mid-frame — the same move as the
   sky page, held lighter because this scene is mostly void already. */
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(97deg,
    rgba(5, 6, 13, 0.82) 0%,
    rgba(5, 6, 13, 0.55) 28%,
    rgba(5, 6, 13, 0.18) 48%,
    rgba(5, 6, 13, 0) 64%);
}

.stage__copy {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  pointer-events: none;
}
.stage__copy a { pointer-events: auto; }

/* Subordinate to the front page's name — this is a room, not the front
   door. Same face, same expansion, one step down. */
.stage .headline__name { font-size: clamp(1.35rem, 3.9vw, 3.7rem); }
.stage .headline__lede { max-width: 26ch; }
.stage .sub { max-width: 26rem; }

/* ---------- bottom-rail instrument cluster --------------------- */

.rail__tools {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  flex: none;
}

/* Status text and controls hold AA contrast at rail size (--dim = 5.9:1). */
.rail__meta--scale { color: var(--dim); }
.rail__meta--speed { color: var(--dim); min-width: 8.5ch; text-align: right; }

.tctl {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.tctl__btn {
  padding: 0.35rem 0.42rem;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 220ms var(--ease);
}
.tctl__btn:hover { color: var(--blue); }
.tctl__btn[aria-pressed='true'] { color: var(--amber); }

#earthlink { white-space: nowrap; }

.noscript {
  position: fixed;
  left: var(--gutter);
  bottom: calc(var(--rail-h) + 1rem);
  z-index: 20;
  max-width: 34rem;
  margin: 0;
  color: var(--dim);
  font-size: 0.95rem;
}

/* ---------- narrow screens ------------------------------------- */

@media (max-width: 900px) {
  .stage { align-content: start; }

  /* Top-down scrim like the front page; the pole of interest (the Sun)
     is placed in the lower half by solar.js on narrow screens. */
  .stage::before {
    inset: 0 0 auto 0;
    height: 58%;
    background: linear-gradient(to bottom,
      rgba(5, 6, 13, 0.90) 0%,
      rgba(5, 6, 13, 0.80) 44%,
      rgba(5, 6, 13, 0.45) 72%,
      rgba(5, 6, 13, 0) 100%);
  }

  .stage__copy { max-width: none; }
  .stage .headline__name { font-size: clamp(1.2rem, 5.4vw, 2.3rem); }

  .rail__meta--scale { display: none; }

  /* The date line is this page's evidence that the sky is computed live;
     it stays on mobile (the front page hides its readout here). */
  .rail__group .rail__readout { display: block; }
}

@media (max-width: 560px) {
  .rail__meta--speed { display: none; }
}

@media (max-width: 560px) {
  .rail__tools { gap: 0.8rem; }
}

/* ---------- short viewports ------------------------------------ */

@media (max-height: 620px) {
  .stage { padding: calc(var(--rail-h) + 0.9rem) var(--gutter); }
  .stage .headline__name { font-size: clamp(1.2rem, 5.4vh, 2.1rem); }
}
