.hero { --hero-tilt-x: 0px; --hero-tilt-y: 0px; }
.hero .orbit-stage::before {
  inset: -19% -14%;
  background:
    radial-gradient(ellipse at 47% 52%, #a8a0ff40 0%, #886bcd25 24%, transparent 56%),
    radial-gradient(ellipse at 62% 32%, #87d5d526 0%, transparent 49%);
  animation: aurora-halo 11.5s ease-in-out infinite alternate;
}
.hero .orbit-stage::after {
  content: "";
  z-index: -2;
  position: absolute;
  inset: -5% -7% 9% -3%;
  mask-image: radial-gradient(ellipse, black 25%, transparent 70%);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 24% 57%, #a473d42e 0%, #945eaf15 22%, transparent 55%),
    radial-gradient(ellipse at 78% 45%, #e095c621 0%, transparent 53%);
  animation: aurora-parallax 13s ease-in-out -6s infinite alternate;
}
@keyframes aurora-halo {
  from { transform: rotate(-10deg) scale(.95); opacity: .78; }
  to { transform: rotate(1deg) scale(1.08); opacity: 1; }
}
@keyframes aurora-parallax {
  from { transform: translate(-2%, 3%) rotate(-13deg); }
  to { transform: translate(2%, -2%) rotate(-6deg); }
}
.hero.sky-at-rest .orbit-stage::before,
.hero.sky-at-rest .orbit-stage::after,
.motion-off .hero .orbit-stage::before,
.motion-off .hero .orbit-stage::after {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .hero .orbit-stage::before, .hero .orbit-stage::after { animation: none; }
  .hero .cat-duet { translate: none; }
  #motion-toggle:disabled { cursor: default; }
}

.player {
  --phosphor: #c4afff;
}

.player .player-visual {
  display: block;
  margin-bottom: clamp(.95rem, 2.4vw, 1.5rem);
}

.player .scope-screen {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: clamp(3.75rem, 7vw, 5rem);
  overflow: hidden;
  color: var(--phosphor);
  border: 1px solid #73638a;
  border-color: color-mix(in srgb, var(--phosphor) 42%, #332940);
  border-radius: .65rem;
  background-color: #0d10218c;
  background-image:
    linear-gradient(0deg, transparent calc(50% - .5px), #b9a8ed30 50%, transparent calc(50% + .5px)),
    repeating-linear-gradient(0deg, transparent 0 11px, #c7b7ff10 11px 12px),
    repeating-linear-gradient(90deg, transparent 0 17px, #c7b7ff12 17px 18px),
    radial-gradient(ellipse at 50% 56%, #25244040, transparent 76%);
  box-shadow: inset 0 0 15px #02081299, 0 1px 0 #fff1;
}

/* Inset calibration ticks stay fixed while the trace moves under the glass. */
.scope-screen::before,
.scope-screen::after {
  position: absolute;
  z-index: 2;
  left: .7rem;
  right: .7rem;
  height: 3px;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 9px);
  opacity: .45;
}
.scope-screen::before { top: 4px; }
.scope-screen::after { bottom: 4px; }

.scope-strip {
  position: absolute;
  top: 32%;
  left: 0;
  width: 200%;
  max-width: none;
  height: 36%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .78;
  transition: top .3s ease-out, height .3s ease-out, opacity .3s;
  filter: drop-shadow(0 0 3px currentColor);
  animation: scope-travel 4s linear infinite;
  animation-play-state: paused;
}
.scope-afterglow { opacity: .17; }
.player.signal-live .scope-strip {
  top: 4%;
  height: 92%;
  opacity: 1;
  animation-play-state: running;
}
.scope-sweep {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 28%;
  border-right: 1px solid currentColor;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, currentColor 19%, transparent));
  box-shadow: 5px 0 12px -7px currentColor;
  opacity: 0;
  pointer-events: none;
  animation: scope-tune .72s cubic-bezier(.16,.52,.34,1) both;
}
.player .play {
  background: var(--phosphor);
}
.player .progress input {
  accent-color: var(--phosphor);
}
@keyframes scope-travel {
  to { transform: translateX(-50%); }
}
@keyframes scope-tune {
  0% { transform: translateX(-100%); opacity: 0; }
  12% { opacity: .9; }
  76% { opacity: .68; }
  100% { transform: translateX(360%); opacity: 0; }
}
@media (max-width: 760px) {
  .player .scope-screen { height: 3.4rem; }
}
.motion-off .player .scope-strip { animation: none; transition: none; }
.motion-off .scope-sweep { display: none; }
@media (prefers-reduced-motion: reduce) {
  .player .scope-strip { animation: none; transition: none; }
  .scope-sweep { display: none; }
}

/* Interactive telescope optics. Each photograph keeps its own focus and colour. */
.observatory {
  --scope-accent: #f5bc98;
  --scope-lamp: #c96553;
  --scope-stop: 0%;
  --scope-x: 46%;
  --scope-y: 36%;
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.observatory[data-view="ring"] {
  --scope-accent: #bfe8d4;
  --scope-lamp: #9278d1;
  --scope-stop: 100%;
  --scope-x: 50%;
  --scope-y: 48%;
}
.observatory[data-view="whirlpool"] {
  --scope-accent: #b5d4ff;
  --scope-lamp: #487eb6;
  --scope-stop: 200%;
  --scope-x: 55%;
  --scope-y: 45%;
}
.observatory::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 85% 47%, var(--scope-lamp), transparent 59%);
  opacity: .18;
  pointer-events: none;
}
.scope-header h2 span { color: var(--scope-accent); transition: color .36s; }
.scope-header .scope-engraving { position: relative; }
.scope-engraving::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--scope-accent));
}
.sky-photo { transition: none; }
.sky-photo.is-previous { opacity: 1; z-index: 0; }
.sky-photo.is-active { z-index: 1; }
.sky-photo.is-arriving {
  animation: open-aperture .79s cubic-bezier(.32,.05,.18,1) both;
}
@keyframes open-aperture {
  from { clip-path: circle(0% at var(--scope-x) var(--scope-y)); }
  to   { clip-path: circle(120% at var(--scope-x) var(--scope-y)); }
}
.sky-selector { position: relative; }
.sky-selector::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / 3);
  height: 3px;
  pointer-events: none;
  background: var(--scope-accent);
  box-shadow: 0 1px 16px color-mix(in srgb, var(--scope-accent) 40%, transparent);
  transform: translateX(var(--scope-stop));
  transition: transform .55s cubic-bezier(.23,.83,.24,1), background .35s;
}
.sky-target[aria-pressed="true"] { box-shadow: none; }
.sky-field.is-zoomed::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: clamp(46px, 7vw, 92px);
  aspect-ratio: 1;
  border: 1px solid #fff4e1b3;
  box-shadow: 0 0 0 5px #21152d33, inset 0 0 0 1px #21152d88;
  border-radius: 19%;
  pointer-events: none;
  opacity: 0;
  animation: lens-focus .85s ease-out both;
}
@keyframes lens-focus {
  0%   { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  28%  { opacity: .9; }
  72%  { transform: translate(-50%, -50%) scale(.86); opacity: .65; }
  100% { transform: translate(-50%, -50%) scale(.86); opacity: 0; }
}

.mast nav a { position: relative; }
.mast nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 1px;
  background: linear-gradient(90deg, var(--lilac), var(--mint));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease-out;
}
.mast nav a:is(:hover, :focus-visible)::after { transform: scaleX(1); }
.logo-star { transition: transform .4s cubic-bezier(.2,.75,.25,1); }
.logo:is(:hover, :focus-visible) .logo-star { transform: rotate(-12deg); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body:not(.motion-off) :is(.section-head, .scope-header) {
      animation: section-arrives auto linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 18%;
    }
  }
}
@keyframes section-arrives {
  from { transform: translateY(17px); opacity: .72; }
  to   { transform: none; opacity: 1; }
}
body.motion-off { scroll-behavior: auto; }
html:has(body.motion-off) { scroll-behavior: auto; }
.motion-off .sky-photo.is-arriving,
.motion-off .sky-field.is-zoomed::before { animation: none; }
.motion-off .sky-selector::after,
.motion-off .scope-header h2 span,
.motion-off .mast nav a::after,
.motion-off .logo-star { transition: none; }
