/* ============================================================
   THE GILDED ORRERY — the hub: ground, station bar, hero,
   orrery stage and ephemeris.
   The index itself lives in hub/css/plates.css.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { min-height: 100vh; }

body {
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ivory);
  background-color: var(--ink-void);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Warm bloom under the instrument, cold wash opposite it. The ground
     is lit from where the orrery sits, not evenly. */
  background-image:
    radial-gradient(ellipse 55% 45% at 76% 12%, rgba(198, 151, 73, 0.10), transparent 68%),
    radial-gradient(ellipse 60% 40% at 8% 78%, rgba(63, 158, 139, 0.055), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% -12%, #12100d 0%, transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-void) 62%, #08090b 100%);
  background-attachment: fixed;
}

body.is-sighting { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* engine-turned engraving over the whole ground, barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--engrave);
  opacity: 0.5;
}

.station {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(22px, 4vw, 54px) calc(var(--feed-h) + 40px);
}

/* ── STATION BAR ────────────────────────────────────────────
   A single hairline rail: who this is, whether it is up, and
   the way in for people who would rather type. */

.station-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--rule-faint);
}

.station-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.station-mark .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdigris-lit);
  box-shadow: 0 0 9px rgba(111, 208, 186, 0.8);
  animation: pip 3.2s ease-in-out infinite;
}
@keyframes pip { 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }

.station-bar-meta {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  flex-wrap: wrap;
}

.sight-key {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: var(--r-chip);
  background: rgba(198, 151, 73, 0.04);
  color: var(--brass-pale);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.sight-key:hover { border-color: var(--rule-strong); background: rgba(198, 151, 73, 0.09); color: var(--brass-lit); }
.sight-key kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ash);
}

/* ── HERO ───────────────────────────────────────────────────
   Asymmetric: the plate's title block on the left, the
   instrument on the right, bleeding past the column. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  min-height: min(84vh, 800px);
  padding: clamp(20px, 4vw, 40px) 0 clamp(28px, 5vw, 56px);
}

.hero-copy { max-width: 34rem; }

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-kicker .rule-h { flex: 1; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-5);
  font-optical-sizing: auto;
  line-height: 0.9;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ivory);
}
.wordmark em {
  display: block;
  font-style: italic;
  font-weight: 600;
  padding-right: 0.06em;   /* Bodoni's italic overhang needs the room */
  background: var(--foil);
  background-size: 260% 100%;
  background-position: 30% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 1.4s var(--ease);
}
.hero-copy:hover .wordmark em { background-position: 92% 0; }

.hero-lede {
  margin-top: 22px;
  max-width: 34ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ivory-soft);
  text-wrap: pretty;
}
.hero-lede b {
  font-weight: 500;
  color: var(--brass-pale);
}

/* ── EPHEMERIS ──────────────────────────────────────────────
   The instrument's readout: what is aboard, and what time it
   is where you are. Real values, live. */

.ephemeris {
  margin-top: clamp(26px, 4vw, 40px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-faint);
}
.eph {
  padding: 13px 14px 12px;
  border-left: 1px solid var(--rule-faint);
}
.eph:first-child { border-left: 0; padding-left: 0; }
.eph-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash-dim);
}
.eph-v {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--brass-pale);
}
/* word values (the watch) sit a step down from the numerals so the
   column still reads as a row of figures */
.eph-v.is-word {
  font-size: var(--step-0);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 3px;
}

.hero-cue {
  margin-top: clamp(22px, 3vw, 34px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ash);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.hero-cue:hover { color: var(--brass-pale); }
.hero-cue .arrow {
  display: inline-block;
  animation: cue 3.4s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ── THE ORRERY STAGE ───────────────────────────────────────
   Square, and allowed past the content column on the right so
   the outermost ring runs off the plate. */

.orrery-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: 78vh;
  margin-right: clamp(-140px, -6vw, 0px);
  justify-self: center;
}
.orrery-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* the sighting label that rides a body */
.orrery-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px 6px 14px;
  margin: -14px 0 0 16px;
  border-left: 1px solid var(--brass);
  background: linear-gradient(90deg, rgba(10, 11, 12, 0.94), rgba(10, 11, 12, 0.7));
  pointer-events: none;
  white-space: nowrap;
}
.orrery-label[hidden] { display: none; }
.orrery-label.is-flipped {
  margin-left: 0;
  transform-origin: right center;
  border-left: 0;
  border-right: 1px solid var(--brass);
  translate: -100% 0;
  margin-right: 16px;
  text-align: right;
  padding: 6px 14px 6px 10px;
}
.orrery-label-id {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--brass);
}
.orrery-label-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: var(--ivory);
}

/* ── HERO RESPONSIVE ────────────────────────────────────────
   On a phone the instrument leads and the title block follows
   it — the same order, stacked. */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 10px;
  }
  .orrery-stage {
    order: -1;
    margin: 0 calc(clamp(22px, 4vw, 54px) * -1);
    width: auto;
    aspect-ratio: 4 / 3;
    max-height: 46vh;
  }
  .hero-copy { max-width: none; }
  .hero-lede { max-width: 46ch; }
}

@media (max-width: 560px) {
  .ephemeris { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eph { padding-left: 14px; border-left: 1px solid var(--rule-faint); }
  .eph:nth-child(odd) { border-left: 0; padding-left: 0; }
  .eph:nth-child(n + 3) { border-top: 1px solid var(--rule-faint); }
  .station-bar { padding-top: 14px; }
  .station-bar-meta .readout[data-clock-cell] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .station-mark .pip,
  .hero-cue .arrow { animation: none; }
}
