:root { --bg:#fff; --fg:#1f2937; --muted:#6b7280; --line:#e5e7eb; --accent:#b91c1c; --serif: Georgia, serif; --sans: system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 64rem; padding: 0 1.5rem; background: var(--bg); color: var(--fg); font: 1.0625rem/1.7 var(--sans); }
a { color: inherit; text-decoration: none; }
.site-header { display:flex; justify-content:space-between; align-items:center; padding:1rem 0; }
.brand, .site-header nav { font-family: var(--serif); } .site-header nav { display:flex; gap:1.25rem; }
h1,h2 { font-family: var(--serif); font-weight: 500; line-height: 1.3; }
/* the journey page: a fixed 3D scene behind a column of text panels */
.journey-page { --bg: #04050a; --fg: #e5e7eb; --muted: #9ca3af; --line: #1f2937; --accent: #f87171; color-scheme: dark; }
.journey-page { background: #04050a; }
.journey-page body { position: relative; background: transparent; }
.journey-page .site-header, .journey-page .site-footer { position: relative; z-index: 1; }
.journey-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; opacity: 0; transition: opacity 0.9s ease; }
.journey-canvas.ready { opacity: 1; }
.journey { position: relative; z-index: 1; }
.journey-step { min-height: 110vh; display: flex; align-items: center; }
.journey-step:nth-of-type(even) { justify-content: flex-end; }
.journey-step:first-of-type { min-height: 85vh; }
.journey-card {
  max-width: 24rem; padding: 1.25rem 1.5rem; border-radius: 0.8rem;
  background: rgb(4 5 10 / 0.62); border: 1px solid rgb(255 255 255 / 0.08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.journey-card h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.journey-card h2 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.journey-card p { margin: 0.6rem 0; color: var(--muted); }
.journey-card a { color: var(--accent); }
.journey-hint { font-size: 0.85rem; letter-spacing: 0.05em; }
.journey-card .credit { font-size: 0.75rem; }
html.no-webgl.journey-page { background: radial-gradient(ellipse at 30% 20%, #111827, #04050a 70%) fixed; }
.no-webgl .journey-canvas { display: none; }
/* phones: split screen. The scene is a window in the top part of the screen, and
   the captions scroll in the bottom part, sliding under the scene as they leave. */
@media (max-width: 48rem) {
  .journey-page .site-header { z-index: 3; background: #04050a; }
  .journey-canvas { height: 56vh; height: 56svh; z-index: 2; }
  .journey-canvas::after { content: none; }
  .journey-shade { display: block; }
  .journey-step, .journey-step:nth-of-type(even), .journey-step:first-of-type {
    min-height: 100vh; min-height: 100svh;
    align-items: flex-start; justify-content: flex-start;
    padding-top: 58vh; padding-top: 58svh;
  }
  .journey-card { max-width: none; padding: 0.25rem 0.25rem 1rem; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .journey-card h1 { font-size: 1.6rem; }
  .journey-card h2 { font-size: 1.35rem; }
}
/* a soft edge where captions slide under the scene */
.journey-shade { display: none; position: fixed; left: 0; right: 0; top: calc(56svh - 1px); height: 2.5rem; z-index: 2; pointer-events: none; background: linear-gradient(#04050a, rgb(4 5 10 / 0)); }
.journey-card .note { font-size: 0.85rem; font-style: italic; }
.journey-card .counter { font-variant-numeric: tabular-nums; color: var(--fg); font-family: var(--serif); }
/* the ocean's response: a schematic curve with a sweeping marker */
.response { margin: 0.9rem 0 0.4rem; }
.response svg { display: block; width: 100%; height: auto; overflow: visible; }
.response .axis { stroke: rgb(255 255 255 / 0.25); stroke-width: 1; }
.response polyline { fill: none; stroke: #f59e4c; stroke-width: 1.6; stroke-linejoin: round; }
.response [data-sweep] { stroke: #e5f2ff; stroke-width: 1.2; stroke-dasharray: 3 3; }
.response figcaption { margin-top: 0.4rem; font-size: 0.75rem; color: var(--muted); }
/* chapters: a quiet bar at the bottom of the scene, the current chapter lit */
html.journey-page { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.journey-page { scroll-behavior: auto; } }
.journey-chapters {
  position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 4;
  display: flex; gap: 0.15rem; padding: 0.3rem; border-radius: 999px;
  background: rgb(4 5 10 / 0.55); border: 1px solid rgb(255 255 255 / 0.08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 0.8rem; letter-spacing: 0.02em;
}
.journey-chapters a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: 0.3rem 0.75rem; border-radius: 999px; transition: color 0.3s, background-color 0.3s; }
.journey-chapters a:hover { color: var(--fg); }
.journey-chapters .narrow { display: none; }
.journey-chapters a[aria-current="true"] { color: #0b0d14; background: #e5e7eb; }
.journey-chapters a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.no-webgl .journey-chapters { display: none; }
/* the parts of the current act, unfolding beside it */
.journey-parts {
  display: inline-flex; gap: 0.1rem; max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap;
  transition: max-width 0.45s ease, opacity 0.3s ease;
}
.journey-parts.open { max-width: 22rem; opacity: 1; padding-right: 0.15rem; }
.journey-parts a { font-size: 0.92em; padding-left: 0.6rem; padding-right: 0.6rem; }
.journey-parts a[aria-current="true"] { color: var(--fg); background: rgb(255 255 255 / 0.12); }
/* a small line above the first card of each act */
.journey-act { margin: 0 0 0.35rem !important; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
/* things drawn over the scene: the distance readout and map labels (same box as the canvas) */
.journey-overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.journey-date {
  position: absolute; left: 50%; bottom: 4.2rem; transform: translateX(-50%); margin: 0;
  font-family: var(--serif); font-size: 1.05rem; color: var(--fg); white-space: nowrap;
  font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.4s; text-shadow: 0 0 12px #04050a;
}
.journey-date span:first-child { font-size: 1.35rem; }
.journey-date .sep { color: var(--muted); margin: 0 0.35rem; }
.journey-labels span {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -170%);
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg);
  white-space: nowrap; text-shadow: 0 0 8px #04050a; will-change: transform, opacity;
}
@media (max-width: 48rem) {
  .journey-overlay { bottom: auto; height: 56vh; height: 56svh; z-index: 3; }
  .journey-date { bottom: auto; top: 3.6rem; font-size: 0.9rem; }
  .journey-date span:first-child { font-size: 1.1rem; }
  .journey-chapters { bottom: auto; top: calc(56svh - 2.6rem); font-size: 0.72rem; z-index: 4; }
  .journey-chapters a { padding: 0.25rem 0.55rem; }
  .journey-parts a { padding-left: 0.45rem; padding-right: 0.45rem; }
  /* (on phones the act is just "Missions": its parts beside it say which kind) */
  .journey-chapters .wide { display: none; }
  .journey-chapters .narrow { display: inline; }
}
/* extra scroll before the long flights, so they unfold calmly */
.journey-gap { height: 70vh; }
@media (max-width: 48rem) { .journey-gap { height: 45vh; height: 45svh; } }
/* JUICE's tour plays out over this stretch of scrolling */
.journey-gap-tour { height: 400vh; }
@media (max-width: 48rem) { .journey-gap-tour { height: 300vh; height: 300svh; } }
.journey-labels span.moon { font-size: 0.66rem; letter-spacing: 0.08em; color: rgb(229 231 235 / 0.72); }

/* JUICE's tour: a side trip, its cards scrolled sideways over the scene */
.journey-tour-open {
  font: inherit; font-size: 0.9rem; color: #0b0d14; background: #e5e7eb; border: 0; border-radius: 999px;
  padding: 0.45rem 0.95rem; cursor: pointer;
}
.journey-tour-open:hover { background: #fff; }
.journey-tour-open:focus-visible, .journey-tour-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.journey-touring { overflow: hidden; }
html.journey-touring .journey, html.journey-touring .journey-chapters { opacity: 0; pointer-events: none; }
.journey, .journey-chapters { transition: opacity 0.5s; }
.journey-tour { position: fixed; inset: auto 0 0 0; z-index: 5; padding: 0 max(1.5rem, 8vw) 1rem; }
.journey-tour[hidden] { display: none; }
.journey-tour-close {
  position: fixed; top: 1rem; left: 1rem; font: inherit; font-size: 0.85rem; color: var(--fg);
  background: rgba(11, 13, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px;
  padding: 0.4rem 0.9rem; cursor: pointer; backdrop-filter: blur(6px);
}
/* milestones: one at a time, above its dot on the track */
.journey-tour-milestones { position: relative; height: 9.5rem; }
.journey-tour-milestone {
  position: absolute; bottom: 0.6rem; left: 0; width: min(19rem, 84vw); transform: translateX(-50%);
  background: rgba(11, 13, 20, 0.78); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem; padding: 0.75rem 1rem; opacity: 0; visibility: hidden; transition: opacity 0.25s;
}
.journey-tour-milestone h3 { margin: 0 0 0.3rem; font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.journey-tour-milestone p { margin: 0.3rem 0 0; font-size: 0.86rem; color: var(--muted); }
/* the track: a thin line, a round handle, years and milestone dots underneath */
.journey-tour-track { position: relative; padding-bottom: 1.4rem; }
.journey-tour-range { width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; height: 1.6rem; cursor: pointer; }
.journey-tour-range::-webkit-slider-runnable-track { height: 2px; background: rgba(229, 231, 235, 0.35); border-radius: 1px; }
.journey-tour-range::-moz-range-track { height: 2px; background: rgba(229, 231, 235, 0.35); border-radius: 1px; }
.journey-tour-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.05rem; height: 1.05rem; margin-top: calc(-0.525rem + 1px); border-radius: 50%;
  background: #e5e7eb; border: 0; box-shadow: 0 0 0 4px rgba(150, 190, 255, 0.25);
}
.journey-tour-range::-moz-range-thumb { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #e5e7eb; border: 0; box-shadow: 0 0 0 4px rgba(150, 190, 255, 0.25); }
.journey-tour-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.journey-tour-marks { position: absolute; left: 0; right: 0; top: 0.8rem; pointer-events: none; }
.journey-tour-marks .dot {
  position: absolute; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: rgba(150, 190, 255, 0.55); transition: background 0.25s, transform 0.25s;
}
.journey-tour-marks .dot.near { background: #cfe0ff; transform: scale(1.4); }
.journey-tour-marks .year {
  position: absolute; top: 0.55rem; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.journey-tour-marks .year::before {
  content: ""; position: absolute; left: 50%; top: -0.6rem; width: 1px; height: 0.4rem; background: rgba(229, 231, 235, 0.35);
}
.journey-tour-hint { margin: 0; font-size: 0.72rem; font-style: italic; color: var(--muted); text-align: center; }
/* while touring, the date sits at the top */
html.journey-touring .journey-date { bottom: auto; top: 1.1rem; }
@media (max-width: 48rem) {
  .journey-tour { padding: 0 1.2rem 0.8rem; }
  html.journey-touring .journey-date { top: 3.6rem; }
}

/* the cut between chapters (chapter buttons): a brief fade through black */
.journey-veil { position: fixed; inset: 0; z-index: 6; background: #04050a; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.journey-veil.on { opacity: 1; transition-duration: 0.3s; }

/* the dissolve between a spacecraft close-up and a far view (its opacity set by the scroll) */
.journey-dissolve { position: fixed; inset: 0; z-index: 0; background: #04050a; opacity: 0; pointer-events: none; }
@media (max-width: 48rem) { .journey-dissolve { bottom: auto; height: 56vh; height: 56svh; z-index: 2; } }

/* (last, so it wins over the rules above) Wide screens: a text column on the left, the scene framed in
   the rest (nothing ever covers it). The captions don't scroll: the one for where the scene is sits in
   the middle of the column, and hands over to the next with a fade (set from the script). The steps
   are left as stretches of scroll that drive the story. */
@media (min-width: 48.0625rem) {
  .journey-page { --col: clamp(20rem, 30vw, 28rem); }
  .journey-page body { max-width: none; margin: 0; padding: 0; }
  .journey-page .site-header { padding: 1rem 2.5rem; }
  .journey-canvas { left: var(--col); width: calc(100vw - var(--col)); }
  .journey-overlay, .journey-dissolve, .journey-tour { left: var(--col); }
  .journey-page body::before {
    content: ""; position: fixed; top: 0; bottom: 0; left: 0; width: var(--col); z-index: 0;
    background: #080a11; border-right: 1px solid rgb(255 255 255 / 0.06);
  }
  .journey { width: var(--col); }
  .journey-step, .journey-step:nth-of-type(even) { min-height: 160vh; align-items: flex-start; justify-content: flex-start; }
  .journey-step:first-of-type { min-height: 120vh; }
  .journey-step:last-of-type { min-height: 110vh; }
  .journey-card {
    position: fixed; top: 50vh; left: 0; width: var(--col); transform: translateY(-50%);
    max-width: none; padding: 0 2.25rem 0 2.5rem; opacity: 0; visibility: hidden; will-change: opacity, transform;
    background: none !important; border: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .journey-chapters { left: calc(var(--col) + (100vw - var(--col)) / 2); }
  .journey-gap { display: none; }
}

/* resonance locking: a drifting peak and the moon's tide caught on its side */
.lock polyline { stroke: #8fc7ff; }
.lock .moon { stroke: #f59e4c; stroke-width: 1.2; stroke-dasharray: 3 3; }
.lock circle { fill: #f59e4c; }
.lock .label { fill: var(--muted); font-size: 8px; }
.lock .mode { fill: #8fc7ff; }
.lock .tide { fill: #f59e4c; }
.lock .state.on { fill: #e5f2ff; }

/* exoplanets are named with lower-case letters (b, c, ...) */
.journey-labels span.letter { text-transform: none; font-size: 0.8rem; }
