/* Gateway 4C: the teledrive station in live 3D (goes with station-3d.js). Colours from the site's design tokens. */

/* The block stays out of the layout until the script has checked for WebGL (it then adds .is-active).
   Without WebGL, or if loading fails, it is removed again and the 2D station view stays. */
.station3d { display: none; }
.station3d.is-active { display: block; }

/* nothing is pinned any more: these two are plain wrappers */
.station3d__pin, .station3d__sticky { position: relative; }

/* the stage: same size and edge bleed as the 2D station view it replaces */
.station3d__stage { position: relative; aspect-ratio: 2.15 / 1; margin: 0 calc(-1 * var(--station3d-bleed, clamp(16px, 2.4vw, 32px))); }
@media (width < 56rem) { .station3d__stage { aspect-ratio: 1.35 / 1; } }
.station3d__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y;
  opacity: 0; transition: opacity .6s ease; }
.station3d.is-ready .station3d__canvas { opacity: 1; }
/* a still of the opening frame, shown until the 3D has faded in (the script sizes it like the canvas and picks the image) */
.station3d__poster { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; pointer-events: none;
  background: center / auto 100% no-repeat; transition: opacity .3s ease .6s; }
.station3d.is-ready .station3d__poster { opacity: 0; }
/* the bottom edge fades into the page (the sides don't) */
.station3d__fade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to bottom, transparent 70%, var(--background, #0c1419) 100%); }

/* the feed buttons under the station: one row, swipes sideways on narrow screens */
.station3d__tabs { display: flex; gap: 8px 28px; margin: 14px 0 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.station3d__tabs::-webkit-scrollbar { display: none; }
.station3d__tab { all: unset; flex: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px;
  border-bottom: 2px solid transparent; }
.station3d__tab b { font-weight: 500; font-size: 14px; line-height: 20px; color: var(--muted-foreground, #a9b3bb); transition: color .2s; }
.station3d__tab:hover b, .station3d__tab[aria-selected="true"] b { color: var(--foreground, #eef2f5); }
.station3d__tab[aria-selected="true"] { border-color: var(--foreground, #eef2f5); }
.station3d__tab:focus-visible { outline: 2px solid var(--ring, #2dd4bf); outline-offset: 4px; }

/* The buttons are the site's own (.button.primary, .button.outline, .button): colours, size, type and focus ring come
   from the design system. This file only places them, plus the picker, the hint and the dots (in the site's tokens). */

/* "Take a seat": over the empty space under the desk; clicking the station works too */
.station3d.is-ready .station3d__stage .station3d__canvas { cursor: pointer; }
.station3d__take { position: absolute; z-index: 2; left: 50%; bottom: clamp(16px, 10%, 72px);
  opacity: 0; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity .5s ease .35s, transform .5s ease .35s, background-color .15s ease; }
.station3d.is-ready .station3d__take { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.station3d.is-seated .station3d__take { opacity: 0; pointer-events: none; transition-delay: 0s; }

/* the seat: a full-screen layer (the script moves the canvas in, grows it from the section and shrinks it back) */
.station3d__seat { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: var(--background, #0c1419); }
.station3d__seat[hidden] { display: none; }
.station3d__seat:focus { outline: none; }
.station3d__seat .station3d__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; transition: none; touch-action: none; cursor: grab; }
.station3d__seat .station3d__canvas:active { cursor: grabbing; }
.station3d__ui { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .45s ease; color: var(--foreground, #eef2f5); }
.station3d__seat.is-seated .station3d__ui { opacity: 1; }
.station3d__seat.is-seated .station3d__stand, .station3d__seat.is-seated .station3d__picker { pointer-events: auto; }
.station3d__ofade { position: absolute; pointer-events: none; }
.station3d__stand { position: absolute; top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }

/* the hint and the picker: the site's popover surface, border and type */
.station3d__picker, .station3d__hint {
  background: color-mix(in oklch, var(--popover, #1c2830) 86%, transparent); border: 1px solid var(--border, #33424c);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); }
.station3d__hint { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 0 .75rem;
  height: 2.25rem; display: flex; align-items: center; border-radius: 8px; font: 400 .8125rem/1.25rem var(--font-body, inherit);
  color: var(--muted-foreground, #a9b3bb); white-space: nowrap; opacity: 0; transition: opacity .6s ease; }
.station3d__hint.is-on { opacity: 1; }

/* the vessel picker: one vessel at a time, arrows either side, a dot per vessel (the current dot fills while a switch is under way) */
.station3d__picker { position: absolute; left: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px)); transform: translateX(-50%);
  display: grid; grid-template-columns: auto auto auto; align-items: center; column-gap: 2px; row-gap: 2px;
  padding: .375rem .375rem .5rem; border-radius: 12px; }
.station3d__picker .station3d__nav.button { width: 2.25rem; padding: 0; padding-inline: 0;   /* square icon button: beats the site's .button:has(> .icon) end padding */
  background: transparent; border-color: transparent; color: var(--foreground, #eef2f5); box-shadow: none; }
.station3d__picker .station3d__nav.button:hover { background: var(--control-surface-hover, #24343a); }
.station3d__now { display: flex; align-items: center; justify-content: center; padding: 0 .25rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.station3d__label { position: relative; display: block; width: 10.5em; height: 1.25rem; overflow: hidden; }
.station3d__nm { display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 500 .875rem/1.25rem var(--font-body, inherit); color: var(--foreground, #eef2f5); }
.station3d__nm.is-leaving { position: absolute; left: 0; top: 0; width: 100%; }
.station3d__dots { grid-column: 1 / -1; display: flex; justify-content: center; gap: 2px; }
.station3d__dot { all: unset; box-sizing: content-box; position: relative; width: 6px; height: 6px; padding: 5px 3px; cursor: pointer; border-radius: 6px;
  background: color-mix(in oklch, var(--foreground, #eef2f5) 26%, transparent); background-clip: content-box;
  transition: width .35s cubic-bezier(.2, .7, .2, 1), background-color .2s; }
.station3d__dot:hover { background-color: color-mix(in oklch, var(--foreground, #eef2f5) 50%, transparent); }
.station3d__dot.is-on { width: 20px; background-color: color-mix(in oklch, var(--foreground, #eef2f5) 26%, transparent); }
.station3d__dot.is-on::after { content: ""; position: absolute; inset: 5px 3px; border-radius: 6px; background: var(--foreground, #eef2f5);
  transform-origin: left center; transform: scaleX(var(--p, 1)); transition: transform .12s linear; }
.station3d__dot:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring, #2dd4bf) 70%, transparent) inset; }
@media (width < 56rem) { .station3d__label { width: 9em; } }

@media (prefers-reduced-motion: reduce) { .station3d__canvas, .station3d__poster, .station3d__take, .station3d__ui, .station3d__hint { transition: none; } }
