/* Change these variables to tune the whole page. */
:root {
  color-scheme: dark;
  --background: #222326;
  --text: #ededea;
  --body-text: #c6c7c9;
  --muted: #a3a5a9;
  --accent: #b6cbd8;
  --line: #3d3e42;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: #fff; }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
p { margin: 0 0 1.15rem; color: var(--body-text); }
h1, h2, h3 { line-height: 1.2; font-weight: 550; }
h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); letter-spacing: -.045em; margin: .9rem 0 1.7rem; }
h2 { font-size: 1.6rem; letter-spacing: -.025em; margin: 0 0 1.3rem; }
h3 { font-size: 1.35rem; margin: .4rem 0 .7rem; }
.page { width: min(100% - 64px, 960px); margin: 0 auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--text); font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.wordmark span { color: var(--accent); }
nav { display: flex; gap: 24px; align-items: center; margin-left: auto; }
nav > a { color: var(--body-text); font-size: .9rem; text-decoration: none; }
.intro { display: grid; grid-template-columns: 1fr 230px; gap: 65px; align-items: start; padding: 80px 0 60px; }
.eyebrow { color: var(--muted); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; margin: 0 0 .7rem; }
.portrait { width: 230px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.portrait-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; background: #2b2c30; border: 1px solid #44464b; color: var(--muted); font-size: .8rem; }
.portrait-placeholder svg { stroke: #8d9098; stroke-width: 1.3; }
.profile-links { display: flex; gap: 24px; font-size: .9rem; margin-top: 1.7rem; }
.profile-links a { text-decoration: none; }
.profile-links span { margin-left: 4px; }
.text-section { padding: 40px 0; border-top: 1px solid var(--line); }
.text-section > p, .research-questions { max-width: 690px; }
.research-questions { padding-left: 20px; margin: 0; color: var(--body-text); }
.research-questions li { padding-left: 6px; margin-bottom: 9px; }
.research-questions li::marker { color: #879da9; }
.elsewhere h2 { font-size: 1.25rem; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; }
.site-footer p { color: var(--muted); font-size: .78rem; margin-bottom: 5px; }
.skip-link { position: absolute; top: -80px; left: 20px; background: var(--background); padding: 8px; z-index: 3; }
.skip-link:focus { top: 10px; }

/* Keep the caption to the right, with a small speech-bubble pointer. */
.astronomy { display: flex; align-items: center; gap: 14px; flex: 0 0 390px; min-width: 0; }
.space-button { flex: 0 0 88px; width: 88px; height: 88px; padding: 0; border: 1px solid #585c65; border-radius: 12px; overflow: hidden; background: #141518; }
.space-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.space-button:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px #b6cbd81a; }
.space-button:disabled { cursor: default; }
.space-button[aria-busy="true"] { cursor: progress; opacity: .7; }
.space-bubble { position: relative; flex: 1; min-width: 0; height: 180px; border: 1px solid #44464b; border-radius: 10px; background: #2b2c30; padding: 12px 14px; }
/* Reserve a fixed frame; only the details scroll, leaving the star tooltip free. */
#space-caption { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.space-details { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overflow-wrap: anywhere; }
.space-bubble::before { content: ""; position: absolute; left: -6px; top: calc(50% - 6px); width: 10px; height: 10px; background: #2b2c30; border-left: 1px solid #44464b; border-bottom: 1px solid #44464b; transform: rotate(45deg); }
.space-bubble h2 { font-size: .85rem; margin: 0 0 5px; letter-spacing: 0; }
.space-bubble p { font-size: .75rem; line-height: 1.5; margin: 0 0 6px; }
.space-bubble .space-instrument, .space-bubble .space-credit { font-size: .62rem; color: var(--muted); }
.space-credit a { white-space: nowrap; }
.space-bubble .space-hint { font-size: .65rem; color: var(--accent); margin: 7px 0 0; }
@media (max-width: 800px) {
  /* Give the photo its own header row before the navigation gets crowded. */
  .site-header { flex-wrap: wrap; }
  .astronomy { flex-basis: 100%; max-width: 420px; margin-left: auto; }
}
@media (max-width: 680px) {
  .page { width: calc(100% - 40px); }
  .site-header { padding: 20px 0; }
  nav { gap: 16px; }
  .astronomy { max-width: none; }
  .space-button { flex-basis: 72px; width: 72px; height: 72px; }
  .intro { grid-template-columns: 1fr; gap: 26px; padding: 48px 0 38px; }
  .portrait { width: 160px; margin: 0; }
  .text-section { padding: 32px 0; }
}

/* A quiet gold star, with a note revealed only on hover, focus, or tap. */
.space-title-row { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.space-title-row h2 { margin-bottom: 5px; }
.favorite-note { position: relative; display: inline-flex; align-self: start; }
#favorite-star { padding: 0 3px; border: 0; background: transparent; color: #dec38a; font-size: .85rem; line-height: 1.2; cursor: help; }
.favorite-tooltip { visibility: hidden; position: absolute; z-index: 2; top: 100%; right: -8px; width: max-content; max-width: 180px; padding: 8px 10px; border: 1px solid #5b5549; border-radius: 6px; background: #34312b; color: #f0e5cc; box-shadow: 0 4px 14px #0005; font-size: .72rem; line-height: 1.5; }
.favorite-note:not(.dismissed):hover .favorite-tooltip,
.favorite-note:not(.dismissed):focus-within .favorite-tooltip { visibility: visible; }
