/* =====================================================================
   OSE · Station and voyage · styles/components/station.css
   ---------------------------------------------------------------------
   The home page after the launch is a voyage through deep space with
   five stops. A stop (.station) is a made-up world with a small station
   beside it, drawn as one complete object (scripts/make-stations.mjs,
   the hero O's flat language), and the stop's message beside it. The
   voyage (.voyage, js/motion/scenes/voyage.js) holds them on one screen
   and flies between them. Component tokens only: --station-*, --voyage-*.

   Markup
     <div class="voyage" data-scene="voyage" data-surface="night">
       <div class="voyage__stage">
         <canvas class="voyage__stars" aria-hidden="true"></canvas>
         <section class="station station--left" id="vi-sao-chon-ose" data-surface="night"
                  aria-labelledby="station-1-title">
           <div class="container station__inner">
             <div class="station__art"><!-- station:ring-world --> … <!-- /station --></div>
             <div class="station__card">
               <p class="station__label">Trạm 01 · …</p>
               <h2 class="station__title" id="station-1-title">…</h2>
               <p class="station__text">…</p>
               <ul class="station__facts" role="list"><li class="station__fact">…</li> …</ul>
             </div>
           </div>
         </section>
         …
       </div>
     </div>
   The world   .station__art: a square box, its column's width at most,
               capped in rem (so browser zoom shrinks it with the text) and
               by the screen's height: --station-art-size. Never cut off.
   Sides       .station--left: the world in the left column, the message
               in the right; .station--right: the other way round (the
               art's own drawing side must match).
   Stacked     phones, reduced motion and no JS: the stations follow one
               another. Phones: the world above the message, the facts as
               tags. ≥ 48em (the station's own width, a container query):
               two columns, one screen per station.
   The voyage  ≥ 48em with the scene running: the stage is one whole screen
               (--voyage-height), reaching up under the header so its glass
               shows the stars; the stations sit below the header
               (--voyage-under-nav). Deep space with the stars' canvas, the
               stations lie on top of each other and the scene shows them
               as the ship flies past; each fact sits at its leader line's
               end (data-dir up | down, placed by the scene) and the lines
               show.
   Motion      the station's core breathes (full motion only); everything
               else is the scene's (transform and opacity).
   ===================================================================== */

@layer components {
  .station {
    position: relative;
    isolation: isolate;
    container-type: inline-size;
    background-color: var(--station-bg);
    color: var(--station-color);
  }

  .station__inner {
    position: relative;
    z-index: var(--station-content-z);
    display: grid;
    gap: var(--station-card-gap);
    padding-block: var(--station-pad-block-phone);
  }

  .station__art {
    position: relative;
    justify-self: center;
    inline-size: var(--station-art-size-phone);
    aspect-ratio: var(--station-art-ratio);
    overflow: clip; /* stacked: the close-up world stays in its box */
  }

  .station__svg {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    overflow: visible;
  }

  .station__card {
    display: grid;
    gap: var(--station-card-gap);
    max-inline-size: var(--station-card-width);
  }

  .station__label {
    color: var(--station-label-color);
    font: var(--station-label-font);
    letter-spacing: var(--station-label-tracking);
    text-transform: var(--station-label-case);
  }

  .station__title {
    font: var(--station-title-font);
    letter-spacing: var(--station-title-tracking);
    text-wrap: balance;
  }

  .station__text {
    color: var(--station-text-color);
    font: var(--station-text-font);
  }

  .station__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--station-facts-gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .station__fact {
    padding: var(--station-fact-pad-block) var(--station-fact-pad-inline);
    border: var(--station-fact-line) solid var(--station-fact-edge);
    border-radius: var(--station-fact-radius);
    background-color: var(--station-fact-bg);
    color: var(--station-fact-color);
    font: var(--station-fact-font);
    letter-spacing: var(--station-fact-tracking);
  }

  /* Trạm 01's six reasons: HUD panels (dark glass, mint corner brackets).
     One column on phones, two from 30em. On the voyage they light up one by
     one as the ship docks (voyage.js). */
  .station__reasons {
    display: grid;
    gap: var(--station-reasons-gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  @media (min-width: 30em) {
    .station__reasons {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .station--reasons .station__card {
    max-inline-size: var(--station-reasons-width);
  }

  .station__reason,
  .station__manifest,
  .station__photo {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--station-reason-inner-gap);
    padding: var(--station-reason-pad);
    border: var(--station-reason-line) solid var(--station-reason-edge);
    border-radius: var(--station-reason-radius);
    background-color: var(--station-reason-bg);
    backdrop-filter: blur(var(--station-reason-blur));
  }

  /* Light mode (a slow machine): no glass blur behind the panels. */
  .perf-light .station__reason,
  .perf-light .station__manifest,
  .perf-light .station__photo {
    backdrop-filter: none;
  }

  .station__reason::before,
  .station__reason::after,
  .station__manifest::before,
  .station__manifest::after,
  .station__photo::before,
  .station__photo::after {
    content: "";
    position: absolute;
    inline-size: var(--station-reason-bracket);
    block-size: var(--station-reason-bracket);
    border: var(--station-reason-bracket-line) solid var(--station-reason-accent);
  }

  .station__reason::before,
  .station__manifest::before,
  .station__photo::before {
    inset-block-start: calc(var(--station-reason-line) * -1);
    inset-inline-start: calc(var(--station-reason-line) * -1);
    border-inline-end: 0;
    border-block-end: 0;
  }

  .station__reason::after,
  .station__manifest::after,
  .station__photo::after {
    inset-block-end: calc(var(--station-reason-line) * -1);
    inset-inline-end: calc(var(--station-reason-line) * -1);
    border-inline-start: 0;
    border-block-start: 0;
  }

  .station__reason-no {
    color: var(--station-reason-accent);
    font: var(--station-reason-no-font);
  }

  .station__reason-title {
    font: var(--station-reason-title-font);
    letter-spacing: var(--station-reason-title-tracking);
  }

  .station__reason-text {
    color: var(--station-reason-text-color);
    font: var(--station-reason-text-font);
  }

  /* ---- Trạm 02 · the supply bay ------------------------------------- */
  /* A whole hangar (scripts/bay-art.mjs): the class ship lands, the drone
     brings the welcome kit from the supply locker to six pads, and the
     visitor picks an item to see its photo, projected by the drone
     (components/bay.js; the arrival: motion/scenes/bay.js). Stacked, the
     hangar is a 16:9 picture above the message. */
  .station--bay .station__art {
    inline-size: 100%;
    aspect-ratio: var(--station-bay-ratio);
  }

  .station__manifest {
    display: grid;
    align-content: start;
    gap: var(--station-reason-inner-gap);
    max-inline-size: var(--station-bay-panel);
  }

  .station__manifest-label,
  .station__photo-label,
  .station__manifest-hint {
    color: var(--station-reason-accent);
    font: var(--station-label-font);
    letter-spacing: var(--station-label-tracking);
    text-transform: var(--station-label-case);
  }

  .station__manifest-list {
    display: grid;
    gap: var(--station-bay-row-gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .station__manifest-item {
    display: flex;
    align-items: center;
    gap: var(--station-bay-row-inner-gap);
    inline-size: 100%;
    min-block-size: var(--station-bay-row-height);
    padding: var(--station-bay-row-pad);
    border: var(--station-reason-line) solid transparent;
    border-radius: var(--station-reason-radius);
    background-color: var(--station-bay-row-bg);
    color: inherit;
    font: var(--station-bay-row-font);
    text-align: start;
    cursor: pointer;
    transition: border-color var(--station-bay-quick) var(--station-reveal-ease), opacity var(--station-bay-quick) var(--station-reveal-ease);
  }

  .station__manifest-item:hover,
  .station__manifest-item[aria-expanded="true"] {
    border-color: var(--station-bay-row-edge);
  }

  .station__manifest-item:focus-visible,
  .station__photo-close:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
  }

  .station__manifest-no {
    color: var(--station-reason-accent);
    font: var(--station-reason-no-font);
  }

  .station__manifest-tick {
    margin-inline-start: auto;
    color: var(--station-reason-accent);
  }

  /* While the drone unloads, a line waits dimmed until its item is on its pad. */
  .station--bay[data-bay] .station__manifest-item:not(.is-loaded) {
    opacity: var(--station-bay-row-pending);
  }

  .station--bay[data-bay] .station__manifest-item:not(.is-loaded) .station__manifest-tick,
  .station--bay[data-bay="unloading"] .station__manifest-hint,
  .station--bay[data-bay="dark"] .station__manifest-hint {
    visibility: hidden;
  }

  .station__photo {
    display: grid;
    gap: var(--station-reason-inner-gap);
    margin: 0;
    max-inline-size: var(--station-bay-photo);
    clip-path: inset(100% 0 0 0);
    transition: clip-path var(--station-bay-open) var(--station-reveal-ease);
  }

  .station__photo.is-open {
    clip-path: inset(0 0 0 0);
  }

  .station__photo[hidden] {
    display: none;
  }

  .station__photo-frame {
    position: relative;
    aspect-ratio: var(--station-bay-photo-ratio);
    overflow: hidden;
    border-radius: var(--station-bay-photo-radius);
    background-color: var(--station-bay-photo-bg);
  }

  .station__photo-frame img {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }

  .station__photo-frame [hidden] {
    display: none;
  }

  /* The projection: mint and scan-lined at first, then the real photo. */
  .station__photo-tint,
  .station__photo-lines {
    position: absolute;
    inset: 0;
    transition: opacity var(--station-bay-resolve) var(--station-reveal-ease);
  }

  .station__photo-tint {
    background-color: var(--station-reason-accent);
    mix-blend-mode: color;
    opacity: var(--station-bay-tint);
  }

  .station__photo-lines {
    background-image: var(--station-bay-scanlines);
  }

  .station__photo.is-resolved .station__photo-tint,
  .station__photo.is-resolved .station__photo-lines {
    opacity: 0;
  }

  .station__photo-todo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: var(--station-reason-pad);
    border: var(--station-reason-bracket-line) dashed var(--station-bay-todo-edge);
    border-radius: var(--station-bay-photo-radius);
    color: var(--station-bay-todo);
    font: var(--station-reason-no-font);
    text-align: center;
  }

  .station__photo-caption {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: var(--station-bay-row-inner-gap);
  }

  .station__photo-caption > div {
    display: grid;
    gap: var(--station-reason-inner-gap);
  }

  .station__photo-name {
    font: var(--station-reason-title-font);
    letter-spacing: var(--station-reason-title-tracking);
  }

  .station__photo-close {
    display: grid;
    place-items: center;
    inline-size: var(--station-bay-close);
    block-size: var(--station-bay-close);
    padding: 0;
    border: var(--station-reason-line) solid var(--station-bay-row-edge);
    border-radius: var(--station-bay-close-radius);
    background-color: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color var(--station-bay-quick) var(--station-reveal-ease);
  }

  .station__photo-close:hover {
    background-color: var(--station-bay-close-hover);
  }

  .station__photo-close svg {
    inline-size: var(--station-bay-close-icon);
    block-size: var(--station-bay-close-icon);
  }

  /* The hangar's art. */
  .station__bay-1 {
    fill: var(--station-bay-1);
  }

  .station__bay-2 {
    fill: var(--station-bay-2);
  }

  .station__bay-3 {
    fill: var(--station-bay-3);
  }

  .station__bay-4 {
    fill: var(--station-bay-4);
  }

  .station__bay-5 {
    fill: var(--station-bay-5);
  }

  .station__bay-lamp {
    fill: var(--station-bay-lamp);
  }

  .station__bay-mint {
    fill: var(--station-bay-mint);
  }

  .station__bay-steel {
    fill: var(--station-bay-steel);
  }

  .station__bay-soft {
    fill: var(--station-bay-soft);
  }

  .station__bay-locker {
    fill: var(--station-bay-locker);
  }

  .station__bay-screen {
    fill: var(--station-bay-screen);
  }

  .station__bay-line-4,
  .station__bay-line-5,
  .station__bay-line-mint,
  .station__bay-line-cream,
  .station__bay-line-soft,
  .station__bay-line-ring,
  .station__bay-line-grid {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .station__bay-line-4 {
    stroke: var(--station-bay-4);
  }

  .station__bay-line-5 {
    stroke: var(--station-bay-5);
  }

  .station__bay-line-mint {
    stroke: var(--station-bay-mint);
  }

  .station__bay-line-cream {
    stroke: var(--station-cream);
  }

  .station__bay-line-soft {
    stroke: var(--station-bay-soft);
  }

  .station__bay-line-ring {
    stroke: var(--station-soft);
  }

  .station__bay-line-grid {
    stroke: var(--station-bay-mint);
    stroke-opacity: var(--station-bay-faint);
    stroke-linecap: butt;
  }

  .station__bay-tail-a {
    stop-color: var(--station-cream);
  }

  .station__bay-tail-b {
    stop-color: var(--station-cream);
    stop-opacity: 0;
  }

  .station__bay-lane {
    opacity: var(--station-bay-faint);
  }

  .station__bay-guide {
    opacity: var(--station-bay-guide);
  }

  .station__bay-strip {
    opacity: var(--station-bay-strip);
  }

  .station__bay-halo {
    opacity: var(--station-bay-halo);
  }

  .station__bay-wash {
    opacity: var(--station-bay-wash);
  }

  .station__bay-padlight {
    opacity: var(--station-bay-padlight);
  }

  .station__bay-shadow {
    opacity: var(--station-bay-shadow);
  }

  .station__bay-ring {
    opacity: var(--station-bay-ring);
  }

  .station__bay-hover {
    opacity: var(--station-bay-halo);
  }

  .station__bay-dim {
    fill: var(--station-bay-dark);
    opacity: 0;
  }

  /* Space behind the hangar (seen through its opening; flown into on the exit). */
  .station__bay-void {
    fill: var(--station-bay-dark);
  }

  .station__bay-band {
    opacity: var(--station-bay-band);
  }

  .station__bay-night {
    opacity: var(--station-bay-faint);
  }

  .station__bay-crater-shade {
    opacity: var(--station-bay-shadow);
  }

  .station__bay-warp,
  .station__bay-moon {
    opacity: 0;
  }

  /* The exit (scenes/bay.js): its own ship flies out (the parked one hides), and the message's backdrop goes. */
  .station__bay-exit-ship {
    display: none;
  }

  .station--bay.is-leaving .station__bay-exit-ship {
    display: inline;
  }

  .station--bay.is-leaving .station__bay-ship {
    visibility: hidden;
  }

  /* Only the pads and the kit take the pointer: the drone, its light and the
     overlays never do (the beam passing under the cursor made the drone
     jitter between an item and back, John). */
  .station__bay-dim,
  .station__bay-void,
  .station__bay-cam,
  .station__bay-exit-ship,
  .station__bay-drone,
  .station__bay-cone,
  .station__bay-ripple,
  .station__bay-room {
    pointer-events: none;
  }

  .station__bay-puff,
  .station__bay-ripple,
  .station__bay-cone,
  .station__bay-beam,
  .station__bay-lens,
  .station__bay-meteor {
    opacity: 0;
  }

  .station__bay-item,
  .station__bay-float,
  .station__bay-ring,
  .station__bay-bob {
    transform-box: fill-box;
    transform-origin: center;
  }

  .station__bay-item {
    transform-origin: 50% 100%; /* it grows up from where it stands, never into the sled */
    transition: scale var(--station-bay-quick) var(--station-reveal-ease);
  }

  .station__bay-drone {
    transition: transform var(--station-bay-drone) var(--station-bay-drone-ease);
  }

  .station__bay-layer {
    transition: transform var(--station-bay-lean) var(--station-reveal-ease);
  }

  .station__bay-drone.is-flying,
  .station__bay-item.is-flying {
    transition: none;
  }

  /* Each item's hit zone: a column, touching its neighbours (invisible). */
  .station__bay-hit {
    fill: transparent;
    pointer-events: all;
  }

  .station--bay.is-ready .station__bay-pad,
  .station--bay.is-ready .station__bay-item,
  .station--bay.is-ready .station__bay-hit {
    cursor: pointer;
  }

  .station__bay-beam,
  .station__bay-lens {
    transition: opacity var(--station-bay-quick) var(--station-reveal-ease);
  }

  /* The projector's beam (drawn by the picks as it rises and sinks): a
     faint cone, a brighter core, and the glowing edge travelling at its top. */
  .station__bay-cone {
    opacity: 0;
    pointer-events: none;
  }

  .station__bay-cone.is-on {
    opacity: var(--station-bay-on);
  }

  .station__bay-cone-outer {
    opacity: var(--station-bay-cone);
  }

  .station__bay-cone-core {
    opacity: var(--station-bay-halo);
  }

  .station__bay-cone-edge {
    opacity: var(--station-bay-strip);
  }

  /* The drone points (its beam on the item, the item a little larger) or projects (its lens lit, a cone of light up to the photo). */
  .station__bay-beam.is-on {
    opacity: var(--station-bay-faint);
  }

  .station__bay-lens.is-on,
  .station__bay-plens.is-on {
    opacity: var(--station-bay-on);
  }

  /* The projector's lens, idle: faintly lit. */
  .station__bay-plens {
    opacity: var(--station-bay-faint);
    transition: opacity var(--station-bay-quick) var(--station-reveal-ease);
  }

  .station__bay-item.is-picked {
    scale: var(--station-bay-pick);
  }

  /* The bay lives while the ship is docked there (full motion only): lights
     blink in three rhythms, the guide lights chase in to the pad, each pad's
     ring pulses, the kit floats, the drone bobs, a satellite drifts across
     the opening (the scene drops a rare shooting star). */
  /* on for the first half, off for the second (a stepped timing) */
  @keyframes station-bay-blink {
    0% {
      opacity: var(--station-bay-on);
    }

    50%,
    100% {
      opacity: var(--station-bay-off);
    }
  }

  /* a flash that dies away, then rests: the rows, each a step later, chase in */
  @keyframes station-bay-chase {
    0% {
      opacity: var(--station-bay-on);
    }

    50%,
    100% {
      opacity: var(--station-bay-guide);
    }
  }

  @keyframes station-bay-pulse {
    0%,
    100% {
      opacity: var(--station-bay-pulse-low);
      scale: var(--station-bay-pulse-small);
    }

    50% {
      opacity: var(--station-bay-pulse-high);
      scale: var(--station-bay-pulse-large);
    }
  }

  @keyframes station-bay-depth-far {
    to {
      translate: var(--station-bay-drift-far);
    }
  }

  @keyframes station-bay-depth-mid {
    to {
      translate: var(--station-bay-drift-mid);
    }
  }

  @keyframes station-bay-depth-near {
    to {
      translate: var(--station-bay-drift-near);
    }
  }

  @keyframes station-bay-twinkle {
    50% {
      opacity: var(--station-bay-twinkle-low);
    }
  }

  @keyframes station-bay-float {
    50% {
      translate: 0 var(--station-bay-float);
    }
  }

  @keyframes station-bay-drift {
    from {
      translate: 0 0;
      rotate: var(--station-bay-sat-tilt-from);
    }

    to {
      translate: var(--station-bay-sat-travel);
      rotate: var(--station-bay-sat-tilt-to);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .motion .station--bay.is-here .station__bay-blink {
      animation: station-bay-blink var(--station-bay-blink) var(--station-bay-step) infinite;
    }

    .motion .station--bay.is-here .station__bay-blink--b {
      animation-duration: var(--station-bay-blink-b);
    }

    .motion .station--bay.is-here .station__bay-blink--c {
      animation-duration: var(--station-bay-blink-c);
    }

    .motion .station--bay.is-here .station__bay-guide {
      animation: station-bay-chase var(--station-bay-chase) var(--station-bay-fade) infinite;
      animation-delay: calc(var(--_i, 0) * var(--station-bay-chase-step));
    }

    .motion .station--bay.is-here .station__bay-ring {
      animation: station-bay-pulse var(--station-bay-pulse) var(--station-bay-sway) infinite;
      animation-delay: calc(var(--_i, 0) * var(--station-bay-pulse-step));
    }

    .motion .station--bay.is-here .station__bay-bob {
      animation: station-bay-float var(--station-bay-bob) var(--station-bay-sway) infinite;
    }

    .motion .station--bay.is-leaving .station__bay-depth--far,
    .motion .station--bay.is-here .station__bay-depth--far {
      animation: station-bay-depth-far var(--station-bay-drift-far-time) var(--station-bay-sway) infinite alternate;
    }

    .motion .station--bay.is-leaving .station__bay-depth--mid,
    .motion .station--bay.is-here .station__bay-depth--mid {
      animation: station-bay-depth-mid var(--station-bay-drift-mid-time) var(--station-bay-sway) infinite alternate;
    }

    .motion .station--bay.is-leaving .station__bay-depth--near,
    .motion .station--bay.is-here .station__bay-depth--near {
      animation: station-bay-depth-near var(--station-bay-drift-near-time) var(--station-bay-sway) infinite alternate;
    }

    .motion .station--bay.is-here .station__bay-tw--a {
      animation: station-bay-twinkle var(--station-bay-twinkle-a) var(--station-bay-sway) infinite;
    }

    .motion .station--bay.is-here .station__bay-tw--b {
      animation: station-bay-twinkle var(--station-bay-twinkle-b) var(--station-bay-sway) infinite;
    }

    .motion .station--bay.is-here .station__bay-tw--c {
      animation: station-bay-twinkle var(--station-bay-twinkle-c) var(--station-bay-sway) infinite;
    }

    /* Light mode (a slow machine, html.perf-light): the bay's loops rest (each one repaints the
       whole hangar every frame: at a 6× slower CPU they halved the frame rate; the picks still move). */
    .perf-light.motion .station--bay.is-here .station__svg * {
      animation: none;
    }

    .motion .station--bay.is-here .station__bay-satellite {
      animation: station-bay-drift var(--station-bay-sat) var(--station-bay-even) infinite;
    }
  }


  /* The class ship (js/art/ship.js): five tones per material, lit → shadow; each face edged in its own colour so no seams show. */
  .station__ship-hull-0 {
    fill: var(--station-ship-hull-0);
    stroke: var(--station-ship-hull-0);
  }

  .station__ship-hull-1 {
    fill: var(--station-ship-hull-1);
    stroke: var(--station-ship-hull-1);
  }

  .station__ship-hull-2 {
    fill: var(--station-ship-hull-2);
    stroke: var(--station-ship-hull-2);
  }

  .station__ship-hull-3 {
    fill: var(--station-ship-hull-3);
    stroke: var(--station-ship-hull-3);
  }

  .station__ship-hull-4 {
    fill: var(--station-ship-hull-4);
    stroke: var(--station-ship-hull-4);
  }

  .station__ship-trim-0 {
    fill: var(--station-ship-trim-0);
    stroke: var(--station-ship-trim-0);
  }

  .station__ship-trim-1 {
    fill: var(--station-ship-trim-1);
    stroke: var(--station-ship-trim-1);
  }

  .station__ship-trim-2 {
    fill: var(--station-ship-trim-2);
    stroke: var(--station-ship-trim-2);
  }

  .station__ship-trim-3 {
    fill: var(--station-ship-trim-3);
    stroke: var(--station-ship-trim-3);
  }

  .station__ship-trim-4 {
    fill: var(--station-ship-trim-4);
    stroke: var(--station-ship-trim-4);
  }

  .station__ship-glass-0 {
    fill: var(--station-ship-glass-0);
    stroke: var(--station-ship-glass-0);
  }

  .station__ship-glass-1 {
    fill: var(--station-ship-glass-1);
    stroke: var(--station-ship-glass-1);
  }

  .station__ship-glass-2 {
    fill: var(--station-ship-glass-2);
    stroke: var(--station-ship-glass-2);
  }

  .station__ship-glass-3 {
    fill: var(--station-ship-glass-3);
    stroke: var(--station-ship-glass-3);
  }

  .station__ship-glass-4 {
    fill: var(--station-ship-glass-4);
    stroke: var(--station-ship-glass-4);
  }

  .station__ship-accent-0 {
    fill: var(--station-ship-accent-0);
    stroke: var(--station-ship-accent-0);
  }

  .station__ship-accent-1 {
    fill: var(--station-ship-accent-1);
    stroke: var(--station-ship-accent-1);
  }

  .station__ship-accent-2 {
    fill: var(--station-ship-accent-2);
    stroke: var(--station-ship-accent-2);
  }

  .station__ship-accent-3 {
    fill: var(--station-ship-accent-3);
    stroke: var(--station-ship-accent-3);
  }

  .station__ship-accent-4 {
    fill: var(--station-ship-accent-4);
    stroke: var(--station-ship-accent-4);
  }

  .station__ship-nozzle-0 {
    fill: var(--station-ship-nozzle-0);
    stroke: var(--station-ship-nozzle-0);
  }

  .station__ship-nozzle-1 {
    fill: var(--station-ship-nozzle-1);
    stroke: var(--station-ship-nozzle-1);
  }

  .station__ship-nozzle-2 {
    fill: var(--station-ship-nozzle-2);
    stroke: var(--station-ship-nozzle-2);
  }

  .station__ship-nozzle-3 {
    fill: var(--station-ship-nozzle-3);
    stroke: var(--station-ship-nozzle-3);
  }

  .station__ship-nozzle-4 {
    fill: var(--station-ship-nozzle-4);
    stroke: var(--station-ship-nozzle-4);
  }

  .station__ship-flame-0 {
    fill: var(--station-ship-flame-0);
    stroke: var(--station-ship-flame-0);
  }

  .station__ship-flame-1 {
    fill: var(--station-ship-flame-1);
    stroke: var(--station-ship-flame-1);
  }

  .station__ship-flame-2 {
    fill: var(--station-ship-flame-2);
    stroke: var(--station-ship-flame-2);
  }

  .station__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--station-actions-gap);
  }

  /* ---- The art ------------------------------------------------------- */
  .station__cream {
    fill: var(--station-cream);
  }

  .station__soft {
    fill: var(--station-soft);
  }

  .station__shade {
    fill: var(--station-shade);
    stroke: var(--station-shade);
  }

  .station__navy {
    fill: var(--station-navy);
    stroke: var(--station-navy);
  }

  .station__rock-a {
    fill: var(--station-rock-a);
    stroke: var(--station-rock-a);
  }

  .station__rock-b {
    fill: var(--station-rock-b);
    stroke: var(--station-rock-b);
  }

  .station__rock-c {
    fill: var(--station-rock-c);
    stroke: var(--station-rock-c);
  }

  .station__rim,
  .station__ring {
    stroke: var(--station-cream);
  }

  .station__orbit {
    stroke: var(--station-cream);
    stroke-opacity: var(--station-orbit-opacity);
  }

  .station__guide {
    stroke: var(--station-soft);
    stroke-opacity: var(--station-guide-opacity);
  }

  .station__stop-a {
    stop-color: var(--station-ring-a);
  }

  .station__stop-b {
    stop-color: var(--station-ring-b);
  }

  .station__core {
    fill: var(--station-core);
  }

  .station__lead {
    fill: none;
    stroke: var(--station-lead);
    stroke-opacity: var(--station-lead-opacity);
    vector-effect: non-scaling-stroke;
  }

  .station__lead-dot {
    fill: var(--station-lead);
  }

  /* Surface detail, close up. */
  .station__light {
    fill: var(--station-light);
    opacity: var(--station-light-opacity);
  }

  .station__light--mint {
    fill: var(--station-light-mint);
  }

  .station__light--low {
    opacity: var(--station-light-low);
  }

  .station__ring-shadow {
    stroke: var(--station-ring-shadow);
    stroke-opacity: var(--station-ring-shadow-opacity);
  }

  .station__seam {
    stroke: var(--station-seam);
    stroke-opacity: var(--station-seam-opacity);
  }

  .station__lamp {
    fill: var(--station-lamp);
  }

  .station__mast {
    stroke: var(--station-mast);
  }

  .station__storm-eye {
    fill: var(--station-soft);
    opacity: var(--station-eye-opacity);
  }

  .station__dusk {
    fill: var(--station-shade);
    opacity: var(--station-dusk-opacity);
  }

  /* The leader lines show only where the facts sit at their ends. */
  .station__leads {
    display: none;
  }

  @keyframes station-pulse {
    to {
      opacity: var(--station-pulse-low);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .motion .station__core {
      animation: station-pulse var(--station-pulse) var(--station-reveal-ease) infinite alternate;
    }
  }

  /* ---- ≥ 48em wide, stacked: two columns, one screen per station ----- */
  /* The station's own width decides (a container query), so it lays out
     the same in any column (the styleguide's demo included). */
  @container (min-width: 48em) {
    .station__inner {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: var(--station-gap);
      align-items: center;
      min-block-size: var(--station-min-height);
      padding-block: var(--station-pad-block);
    }

    .station__art {
      inline-size: var(--station-art-size);
    }

    .station--right .station__art {
      order: 2;
    }

    .station--bay .station__art {
      grid-column: 1 / -1;
      order: 0;
    }

    .station__title {
      font: var(--station-title-font-lg);
      letter-spacing: var(--station-title-tracking-lg);
    }
  }

  /* ---- The voyage ---------------------------------------------------- */
  .voyage {
    position: relative;
    background-color: var(--voyage-bg);
  }

  .voyage__stars {
    display: none;
  }

  /* An anchor's landing point at a station's dock (placed by the scene). */
  .voyage__mark {
    position: absolute;
    inset-inline-start: 0;
    inline-size: var(--voyage-mark-size);
    block-size: var(--voyage-mark-size);
    pointer-events: none;
  }

  @media (min-width: 48em) {
    /* The held screen reaches up under the header (its glass shows the
       stars), so the voyage starts a header's height higher. */
    .voyage[data-scene-state="running"] {
      margin-block-start: calc(var(--voyage-under-nav) * -1);
    }

    .voyage[data-scene-state="running"] .voyage__stage {
      position: relative;
      block-size: var(--voyage-height);
      overflow: clip;
    }

    .voyage[data-scene-state="running"] .voyage__stars {
      display: block;
      position: absolute;
      inset: 0;
      inline-size: 100%;
      block-size: 100%;
    }

    .voyage[data-scene-state="running"] .station {
      position: absolute;
      inset: var(--voyage-under-nav) 0 0;
      visibility: hidden;
      background-color: transparent;
    }

    .voyage[data-scene-state="running"] .station__inner {
      position: static; /* the world places itself on the whole station */
      block-size: 100%;
      min-block-size: 0;
      padding-block: 0;
    }

    /* Close up: the world's box is larger than the screen is tall, its centre
       off the side, so the world fills about half the screen from there. */
    .voyage[data-scene-state="running"] .station__art {
      position: absolute;
      inset-block-start: 50%;
      inset-inline-start: var(--station-art-close-offset);
      inline-size: var(--station-art-close);
      margin-block-start: var(--station-art-close-lift);
      overflow: visible;
    }

    .voyage[data-scene-state="running"] .station--right .station__art {
      inset-inline: auto var(--station-art-close-offset);
    }

    .voyage[data-scene-state="running"] .station__card {
      position: relative;
      z-index: var(--station-content-z);
    }

    .voyage[data-scene-state="running"] .station--left .station__card {
      grid-column: 2;
    }

    .voyage[data-scene-state="running"] .station--right .station__card {
      grid-column: 1;
      grid-row: 1;
    }

    /* Trạm 02: the hangar is the whole screen, reaching up under the header's
       glass; the message sits top left on a dark backdrop (the scene's, so the
       header itself stays the shared one), the photo on the right, clear of
       the page map. */
    .voyage[data-scene-state="running"] .station--bay .station__art {
      inset: calc(var(--voyage-under-nav) * -1) 0 0;
      justify-self: stretch;
      align-self: stretch;
      inline-size: auto;
      aspect-ratio: auto;
      margin: 0;
    }

    .voyage[data-scene-state="running"] .station--bay .station__inner::before {
      content: "";
      position: absolute;
      inset: 0 auto auto 0;
      inline-size: var(--station-bay-backdrop-width);
      block-size: var(--station-bay-backdrop-height);
      z-index: var(--station-content-z);
      background-image: var(--station-bay-backdrop);
      pointer-events: none;
      transition: opacity var(--station-bay-quick) var(--station-reveal-ease);
    }

    .voyage[data-scene-state="running"] .station--bay.is-leaving .station__inner::before {
      opacity: 0;
    }

    .voyage[data-scene-state="running"] .station--bay .station__card {
      position: absolute;
      inset-block-start: var(--station-bay-top);
      inset-inline-start: var(--station-bay-side);
      inline-size: var(--station-bay-panel);
    }

    .voyage[data-scene-state="running"] .station--bay .station__photo {
      position: absolute;
      inset-block-end: var(--_photo-bottom, var(--station-bay-photo-bottom));
      inset-inline-end: var(--station-bay-photo-right);
      inline-size: var(--_photo-width, var(--station-bay-photo));
      max-inline-size: none;
    }

    /* Trạm 01: the panels keep clear of the page map's lane on the right. */
    .voyage[data-scene-state="running"] .station--reasons .station__card {
      position: absolute;
      inset-block-start: 50%;
      inset-inline-end: var(--station-reasons-right);
      inline-size: var(--station-reasons-width);
      translate: 0 -50%;
    }

    .voyage[data-scene-state="running"] .station--reasons .station__art {
      inset-inline-start: var(--station-reasons-art-offset);
    }

    .voyage[data-scene-state="running"] .station__title {
      font: var(--station-title-font);
      letter-spacing: var(--station-title-tracking);
    }

    .voyage[data-scene-state="running"] .station__leads {
      display: inline;
    }

    .voyage[data-scene-state="running"] .station__fact {
      position: absolute;
      white-space: nowrap;
      translate: -50% var(--station-fact-gap);
    }

    .voyage[data-scene-state="running"] .station__fact[data-dir="up"] {
      translate: -50% calc(-100% - var(--station-fact-gap));
    }
  }

  /* Between 48em and 64em the contact bar sits at the bottom: the stations stay above it. */
  @media (min-width: 48em) and (width < 64em) {
    .voyage[data-scene-state="running"] .station {
      inset-block-end: var(--voyage-under-bar);
    }
  }

  @media (min-width: 48em) {
    /* Trạm 02 when the hangar can't fit beside the message (a short laptop, a tablet held wide: bay.js
       measures it and sets .is-across): the message runs across the top (its words on the left, the
       manifest on the right) and the hangar, centred, shows its ship and its sled below. */
    .voyage[data-scene-state="running"] .station--bay.is-across .station__card {
      inset-inline-end: var(--station-bay-photo-right);
      inline-size: auto;
      max-inline-size: none;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: auto auto 1fr;
      column-gap: var(--station-card-gap);
      align-items: start;
    }

    .voyage[data-scene-state="running"] .station--bay.is-across .station__card > :not(.station__manifest) {
      grid-column: 1;
    }

    .voyage[data-scene-state="running"] .station--bay.is-across .station__manifest {
      grid-column: 2;
      grid-row: 1 / span 3;
      max-inline-size: none;
    }

    .voyage[data-scene-state="running"] .station--bay.is-across .station__manifest-list {
      grid-template-columns: none;
    }
  }

  /* A short window (a laptop zoomed to 150 %): the ticking countdown makes
     room for the actions; the date stays in the title. */
  @media (min-width: 48em) and (max-height: 48em) {
    .voyage[data-scene-state="running"] .station .countdown {
      display: none;
    }

    .voyage[data-scene-state="running"] .station__card {
      gap: var(--station-card-gap-short);
    }
  }

  @media (min-width: 48em) {
    /* Trạm 02 when its message would run off the bottom (bay.js measures it: .is-compact): wider, the
       manifest in two columns. */
    .voyage[data-scene-state="running"] .station--bay.is-compact .station__card {
      inline-size: var(--station-bay-card-short);
    }

    .voyage[data-scene-state="running"] .station--bay.is-compact .station__manifest {
      max-inline-size: none;
    }

    .voyage[data-scene-state="running"] .station--bay.is-compact .station__manifest-list {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}
