/* Earth introduction is a separate post-launch scene. Existing landing and Mars styling stay intact. */
.earth-scene { position: absolute; inset: 0; overflow: hidden; z-index: 5; background: #030812; opacity: 0; }
.earth-scene[hidden] { display: none; }
.earth-space-haze { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 64% 42%, #17375b55, transparent 55%), radial-gradient(ellipse at 48% 58%, #17466f18, transparent 48%); }
.earth-viewport { position: absolute; inset: 0; }
.earth-viewport canvas { display: block; width: 100%; height: 100%; }
.earth-edge-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, #03081299, transparent 20%, transparent 82%, #03081233); }

.earth-information {
  position: absolute; z-index: 6; top: 21%; left: 6.5%; width: min(390px, 34vw); height: clamp(430px, 58vh, 560px); max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); padding: 24px 25px 22px;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid #d8c29625; border-left-color: #edc57e77; border-radius: 2px;
  background: linear-gradient(145deg, #07101ad9, #050b14b8); box-shadow: 0 25px 90px #00000038;
  backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  opacity: 0; transform: translate3d(-14px, 8px, 0); pointer-events: none;
  transition: opacity .75s ease, transform .9s cubic-bezier(.2,.75,.2,1);
}
.earth-information.is-visible { opacity: 1; transform: translate3d(0,0,0); pointer-events: auto; }
.earth-scene.is-leaving .earth-information { opacity: 0; transform: translate3d(-8px, 5px, 0); pointer-events: none; transition-duration: .45s; }
.earth-information-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid #d8e0ea14; }
.earth-kicker, .earth-sequence { color: #d5be91; font-size: 7px; letter-spacing: 2.4px; text-transform: uppercase; }
.earth-sequence { color: #8f9aaa; letter-spacing: 1.7px; }
.earth-information h2 { margin: 20px 0 5px; color: #f9f4e8; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 4.8vw, 68px); line-height: 1; font-weight: 400; letter-spacing: -2px; outline: none; }
.earth-information h2 span { color: #edc57e; }
.earth-subtitle { margin: 0 0 17px; color: #d8bf91; font-size: 8px; line-height: 1.5; letter-spacing: 2.1px; text-transform: uppercase; }
.earth-information-topline, .earth-information h2, .earth-subtitle, .earth-source, .earth-controls { flex: 0 0 auto; }
.earth-information-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; padding-right: 14px; scrollbar-width: thin; scrollbar-color: #aa90696e transparent; }
.earth-information-scroll::-webkit-scrollbar { width: 5px; }
.earth-information-scroll::-webkit-scrollbar-track { background: transparent; }
.earth-information-scroll::-webkit-scrollbar-thumb { background: #aa90696e; border-radius: 999px; }
.earth-information-scroll::-webkit-scrollbar-thumb:hover { background: #c7aa768f; }
.earth-summary { margin: 0; color: #c0c9d4; font-size: 12px; line-height: 1.65; letter-spacing: .12px; }
.earth-facts { display: grid; gap: 9px; margin: 18px 0 17px; padding: 0; list-style: none; }
.earth-facts li { position: relative; padding-left: 15px; color: #9eabb9; font-size: 10px; line-height: 1.55; }
.earth-facts li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 1px; background: #edc57eaa; }
.earth-source { display: inline-flex; align-self: flex-start; align-items: center; gap: 7px; margin-top: 12px; color: #768595; font-size: 7px; letter-spacing: 1.25px; text-decoration: none; text-transform: uppercase; transition: color .22s ease; }
.earth-source:hover { color: #d8c293; }
.earth-controls {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 19px;
}
.earth-nav {
  min-height: 46px; display: flex; align-items: center; gap: 7px; padding: 0 2px; border: 0;
  border-top: 1px solid #d5dce821; border-bottom: 1px solid #d5dce821; border-radius: 0;
  background: transparent; color: #929daa; text-align: left;
  transition: color .25s ease, border-color .25s ease, opacity .25s ease;
}
.earth-nav svg { flex: 0 0 auto; width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.25; }
.earth-nav span { display: grid; gap: 3px; min-width: 0; }
.earth-nav small, .earth-nav strong { display: block; font-weight: 500; text-transform: uppercase; }
.earth-nav small { color: #6f7c8b; font-size: 5.5px; letter-spacing: 1.15px; white-space: nowrap; }
.earth-nav strong { color: inherit; font-size: 6.6px; line-height: 1.3; letter-spacing: .8px; }
.earth-prev { justify-content: flex-start; }
.earth-next { justify-content: flex-end; text-align: right; }
.earth-nav:hover:not(:disabled) { color: #dfc38f; border-color: #edc57e62; }
.earth-nav:disabled { opacity: .46; cursor: default; }
.earth-explore-button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 12px; border-radius: 2px; border: 1px solid #d9bd88a6;
  background: linear-gradient(120deg, #cfb47f, #b99359); color: #171b24;
  font-size: 7.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 6px 22px #b9792e12, inset 0 1px #fff0c899;
}
.earth-explore-button svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.45; }
.earth-explore-button.is-locked:disabled { opacity: .78; cursor: not-allowed; filter: saturate(.72); }

.earth-emergency-sphere {
  position: absolute; left: 64%; top: 47%; width: 380px; height: 380px; transform: translate(-50%, -50%) rotate(-10.3deg);
  border-radius: 50%; background: #0a2440 url("assets/textures/earth-blue-marble-4k.jpg") center / auto 100%;
  box-shadow: inset -76px -22px 95px #000d, inset 8px 4px 14px #b9ddff1f, 0 0 20px #438fd73a, 0 0 68px #1d64a51b;
}

.is-earth .masthead, .is-mars .masthead { opacity: 1; transition: opacity 2s; }
.is-earth .preparation { opacity: 0; }

@media (max-width: 900px) and (min-width: 701px) {
  .earth-information { left: 4.5%; width: min(350px, 43vw); padding: 20px; }
  .earth-information h2 { font-size: 54px; }
  .earth-summary { font-size: 11px; }
}

@media (max-width: 700px) {
  .earth-information {
    top: auto; left: 5%; right: 5%; bottom: 5.5%; width: auto;
    height: min(46vh, 330px); height: min(46dvh, 330px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
    overflow: hidden; padding: 16px 17px 14px; background: linear-gradient(145deg, #06101bed, #040b14dc);
  }
  .earth-information-topline { padding-bottom: 11px; }
  .earth-information h2 { margin-top: 12px; font-size: 34px; letter-spacing: -1px; }
  .earth-subtitle { margin-bottom: 9px; font-size: 7px; }
  .earth-summary { font-size: 9.5px; line-height: 1.5; }
  .earth-facts { gap: 5px; margin: 10px 0 9px; }
  .earth-facts li { font-size: 8px; line-height: 1.4; }
  .earth-source { margin-top: 8px; }
  .earth-controls { gap: 6px; margin-top: 12px; }
  .earth-nav { min-height: 42px; gap: 4px; }
  .earth-nav svg { width: 12px; height: 12px; }
  .earth-nav small { font-size: 4.5px; letter-spacing: .75px; }
  .earth-nav strong { font-size: 5.5px; letter-spacing: .55px; }
  .earth-explore-button { min-height: 42px; padding: 0 9px; gap: 6px; font-size: 6.5px; }
  .earth-explore-button svg { width: 11px; height: 11px; }
  .earth-information-scroll { padding-right: 12px; }
}

@media (max-height: 650px) and (max-width: 700px) {
  .earth-information { height: min(48vh, 300px); height: min(48dvh, 300px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); bottom: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  .earth-information, .earth-nav, .earth-explore-button { transition-duration: .01ms !important; }
}

/* Earth reuses the Mars caption, card, arrows, scroll and typography components. */
.earth-caption { transition: opacity .65s ease, transform .8s ease; }
.earth-caption.is-visible { opacity: 1; transform: none; }
.earth-scene.is-exploring .earth-caption,
.earth-scene.is-leaving .earth-caption { opacity: 0; transform: translateY(14px); pointer-events: none; }
.earth-scene.is-exploring .earth-exploration { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: .18s, .18s, 0s; }
.earth-scene.is-leaving .earth-exploration { opacity: 0; pointer-events: none; }
#earth-topic-progress button { position: relative; height: 30px; min-width: 0; border: 0; padding: 0; background: transparent; color: #edc57e; }
#earth-topic-progress button::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #8793a155; }
#earth-topic-progress button.is-active::after { background: #edc57e; height: 2px; }
.earth-scene button:focus-visible { outline: 1px solid #edc57e; outline-offset: 4px; }
.earth-location-dot { position: absolute; z-index: 5; width: 6px; height: 6px; border-radius: 50%; background: #edc57e; box-shadow: 0 0 0 5px #edc57e22; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity .4s ease; }
@media (max-height: 700px) and (min-width: 701px) {
  .earth-scene .earth-exploration { top: 16%; height: calc(100dvh - 145px); max-height: calc(100dvh - 145px); padding-top: 18px; padding-bottom: 16px; }
  .earth-exploration h3 { margin-top: 14px; }
  .earth-exploration .mars-exploration-controls { margin-top: 12px; }
  .earth-exploration .mars-exploration-close { margin-top: 8px; }
}
@media (max-width: 700px) {
  .earth-scene .earth-exploration { height: min(46dvh, 370px); bottom: 75px; }
  .earth-exploration h3 { margin-top: 10px; }
  .earth-exploration .mars-exploration-topline { padding-bottom: 9px; }
  .earth-exploration .mars-topic-subtitle { margin-bottom: 8px; }
  .earth-exploration .mars-exploration-controls { margin-top: 8px; }
  .earth-exploration .mars-exploration-close { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .earth-caption, .earth-location-dot { transition-duration: .01ms; }
}

/* Earth Rekor & Ekstrem: restrained scientific context and geographic callouts. */
.earth-topic-meta { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 17px; }
.earth-topic-meta .mars-topic-subtitle { margin: 0; }
.earth-context[hidden], .earth-content-heading[hidden] { display: none; }
.earth-exploration .earth-content-heading { margin: 19px 0 8px; font-size: 8px; font-weight: 500; letter-spacing: 1.8px; color: #d5be91; text-transform: uppercase; }
.earth-exploration .earth-content-heading + .mars-topic-facts { margin-top: 0; }
.earth-location-dot { box-shadow: none; }
.earth-location-dot.is-relocating { opacity: 0 !important; transition: none; }
.earth-location-ring { position: absolute; inset: -7px; border: 1px solid #edc57e88; border-radius: 50%; }
.earth-location-line { position: absolute; left: 15px; top: 3px; width: 35px; height: 1px; background: #edc57e70; }
.earth-location-label { position: absolute; left: 58px; top: -6px; width: 172px; display: grid; gap: 6px; text-transform: uppercase; text-shadow: 0 1px 4px #030812; }
.earth-location-title { font-size: 9px; font-weight: 500; line-height: 1.5; letter-spacing: 1.3px; color: #e4cd9f; }
.earth-location-region { font-size: 7px; line-height: 1.5; letter-spacing: 2px; color: #a4adba; }
.earth-location-dot.is-left .earth-location-line { left: auto; right: 15px; }
.earth-location-dot.is-left .earth-location-label { left: auto; right: 58px; text-align: right; }
@media (max-width: 700px) {
  .earth-topic-meta { gap: 7px; margin-bottom: 8px; }
  .earth-exploration .earth-content-heading { margin-top: 14px; font-size: 7px; }
  .earth-location-line { left: 3px; top: auto; bottom: 15px; width: 1px; height: 23px; }
  .earth-location-label { left: calc(3px + var(--label-shift, 0px)); top: auto; bottom: 45px; width: min(200px, calc(100vw - 32px)); transform: translateX(-50%); text-align: center; gap: 3px; }
  .earth-location-title { font-size: 8px; letter-spacing: 1px; }
  .earth-location-region { font-size: 7px; letter-spacing: 1.6px; }
}

/* Marker-linked visual preview: text stays in the board, imagery stays with the globe. */
.earth-location-dot .exploration-marker-media {
  left: 58px;
  bottom: 34px;
}
.earth-location-dot.is-left .exploration-marker-media {
  left: auto;
  right: 58px;
}
.earth-location-dot.is-below .exploration-marker-media {
  top: 34px;
  bottom: auto;
}
@media (max-width: 700px) {
  .earth-location-dot .exploration-marker-media,
  .earth-location-dot.is-left .exploration-marker-media {
    left: calc(3px + var(--label-shift, 0px));
    right: auto;
    bottom: 78px;
    transform: translateX(-50%) translateY(7px) scale(.985);
  }
  .earth-location-dot:not(.is-relocating) .exploration-marker-media { transform: translateX(-50%); }
  .earth-location-dot.is-below .exploration-marker-media {
    top: 44px;
    bottom: auto;
  }
}

/* Launch-to-Earth continuity: Earth renderer fades in softly under the cockpit limb reveal. */
.mission.is-preparing.is-earth .earth-scene { background:radial-gradient(ellipse at 50% 88%,#0b2948 0%,#061425 38%,#030812 72%); }
.mission.is-preparing.is-earth .earth-space-haze { opacity:.82; transition:opacity 1.3s ease; }

/* 2026-10-03: Earth card readability + overflow hardening. */
.earth-exploration,
.earth-exploration * { box-sizing:border-box; }
.earth-exploration { width:min(430px,38vw); }
.earth-exploration .mars-exploration-topline,
.earth-exploration h3,
.earth-exploration .earth-topic-meta,
.earth-exploration .mars-topic-scroll,
.earth-exploration .mars-topic-source,
.earth-exploration .exploration-photo-source,
.earth-exploration .mars-exploration-controls,
.earth-exploration .mars-exploration-close { min-width:0; max-width:100%; }
.earth-exploration .mars-topic-kicker,
.earth-exploration .mars-topic-count { font-size:8.5px; letter-spacing:1.7px; }
.earth-exploration h3 { font-size:clamp(34px,3.4vw,47px); overflow-wrap:anywhere; }
.earth-topic-meta { width:100%; min-width:0; }
.earth-topic-meta .mars-topic-subtitle {
  width:100%; min-width:0; max-width:100%;
  font-size:10.5px; line-height:1.48; letter-spacing:1px;
  white-space:normal; overflow-wrap:anywhere; word-break:normal;
}
.earth-exploration .mars-topic-summary { font-size:13.5px; line-height:1.7; overflow-wrap:anywhere; }
.earth-exploration .earth-content-heading { font-size:9.5px; line-height:1.45; letter-spacing:1.35px; overflow-wrap:anywhere; }
.earth-exploration .mars-topic-facts li { font-size:11.5px; line-height:1.62; overflow-wrap:anywhere; }
.earth-exploration .mars-topic-source,
.earth-exploration .exploration-photo-source { font-size:8px; line-height:1.5; letter-spacing:.85px; white-space:normal; overflow-wrap:anywhere; }
.earth-exploration .mars-exploration-close { font-size:8.5px; line-height:1.4; }
.earth-exploration .mars-topic-nav { width:42px; height:42px; }

@media (max-width:1100px) and (min-width:701px) {
  .earth-scene .earth-exploration { left:3.5%; width:min(410px,47vw); height:clamp(450px,66vh,610px); max-height:calc(100dvh - 120px); }
  .earth-topic-meta .mars-topic-subtitle { font-size:10px; }
  .earth-exploration .mars-topic-summary { font-size:12.5px; }
  .earth-exploration .mars-topic-facts li { font-size:10.8px; }
}

@media (max-width:700px) {
  .earth-scene .earth-exploration {
    left:12px; right:12px; width:auto; bottom:72px;
    height:min(58dvh,500px); max-height:calc(100dvh - 96px);
    padding:17px 18px 15px;
  }
  .earth-exploration .mars-topic-kicker,
  .earth-exploration .mars-topic-count { font-size:7.8px; }
  .earth-exploration h3 { font-size:32px; }
  .earth-topic-meta { margin-bottom:10px; }
  .earth-topic-meta .mars-topic-subtitle { font-size:9.4px; line-height:1.5; letter-spacing:.75px; }
  .earth-exploration .mars-topic-summary { font-size:11.3px; line-height:1.65; }
  .earth-exploration .earth-content-heading { font-size:8.7px; }
  .earth-exploration .mars-topic-facts li { font-size:9.8px; line-height:1.55; }
  .earth-exploration .mars-topic-source,
  .earth-exploration .exploration-photo-source,
  .earth-exploration .mars-exploration-close { font-size:7.5px; }
}
