/* Full-width navigation, with all four destinations visible on every device. */
.header { display: grid; grid-template-columns: max-content 1fr; column-gap: clamp(38px, 8vw, 150px); }
.header nav { display: flex; justify-content: space-between; width: 100%; gap: 16px; align-items: center; }
.header nav > a { text-align: center; min-height: 44px; display: grid; place-items: center; padding: 12px 0; }
.header nav > a:last-child { justify-self: end; }
.header nav > a:first-child { justify-self: start; }

/* The photograph remains the source; an animated atmosphere adds depth. */
.universe {
  position: absolute;
  inset: -18px;
  z-index: -3;
  pointer-events: none;
  transform: translate3d(var(--universe-x, 0px), var(--universe-y, 0px), 0);
  transition: transform 1.3s cubic-bezier(.2, .65, .3, 1);
}
.universe .cosmos {
  inset: -6%;
  z-index: 0;
  transform-origin: 70% 60%;
  animation: universe-travel 10s ease-in-out -3s infinite alternate;
  will-change: transform;
}
.universe .cosmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 13% 9% at 90% 56%, #ffffff30, #ffffff09 35%, transparent 75%);
  mix-blend-mode: screen;
  animation: universe-glow 6s ease-in-out infinite alternate;
}
.star-field { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.universe .cosmos.has-canvas { inset: 0; background: none; animation: none; transform: none; opacity: .85; will-change: auto; }
.cosmos.has-canvas::after { display: none; }
.universe-canvas { display: block; width: 100%; height: 100%; }
.cosmic-star {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  box-shadow: 0 0 5px #ffffff3d;
  animation: star-passage var(--star-duration) linear var(--star-delay) infinite;
}
.cosmic-star:nth-child(7n) { box-shadow: 0 0 9px 1px #ffffff55; }
.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 0 8px 12px;
  border: 0;
  background: none;
  color: #ccc;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  letter-spacing: .6px;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { color: #fff; }
.motion-icon { width: 8px; height: 10px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.hero[data-motion="paused"] .motion-icon { width: 0; height: 0; border: 5px solid transparent; border-right: 0; border-left: 7px solid currentColor; }
.hero[data-motion="paused"] .cosmos,
.hero[data-motion="paused"] .cosmos::after,
.hero[data-motion="paused"] .cosmic-star,
.hero[data-render="idle"] .cosmos,
.hero[data-render="idle"] .cosmos::after,
.hero[data-render="idle"] .cosmic-star { animation-play-state: paused; }
.hero[data-motion="paused"] .universe { transition: none; }
@keyframes universe-travel {
  from { transform: translate3d(-3%, -2%, 0) scale(1.08) rotate(-.7deg); }
  to { transform: translate3d(3%, 2%, 0) scale(1.19) rotate(.7deg); }
}
@keyframes universe-glow { from { opacity: .18; } to { opacity: .78; } }
@keyframes star-passage {
  0% { opacity: 0; transform: translate3d(var(--star-from-x), var(--star-from-y), 0) scale(.55); }
  14% { opacity: calc(var(--star-opacity) * .6); }
  65% { opacity: var(--star-opacity); }
  86% { opacity: calc(var(--star-opacity) * .75); }
  100% { opacity: 0; transform: translate3d(var(--star-to-x), var(--star-to-y), 0) scale(1.35); }
}
@media (min-width: 701px) and (max-width: 1024px) {
  .header { column-gap: 36px; }
  .header .wordmark { font-size: 11px; letter-spacing: 1.8px; }
  .header nav { font-size: 11px; gap: 12px; }
  .cosmic-star:nth-child(n+65) { display: none; }
}
@media (max-width: 700px) {
  .header { height: 116px; grid-template-columns: 1fr; grid-template-rows: 60px 55px; row-gap: 0; padding: 0 24px; }
  .header .wordmark { justify-self: center; }
  .header nav { position: static; display: flex; flex-direction: row; width: 100%; padding: 0; gap: 5px; background: none; border: 0; align-self: start; }
  .header nav > a { font-size: 11px; padding: 12px 0; min-height: 44px; }
  .hero-content { padding-top: 158px; }
  .hero-bottom > span { display: none; }
  .motion-toggle { font-size: 8px; min-height: 44px; }
  .cosmic-star:nth-child(n+49) { display: none; }
  .universe .cosmos { animation-duration: 12s; }
  .universe .cosmos.has-canvas { opacity: .76; }
}
@media (prefers-reduced-motion: reduce) {
  .universe { transform: none !important; transition: none; }
  .universe .cosmos { animation: none; transform: none; will-change: auto; }
  .universe .cosmos::after, .cosmic-star { animation: none; }
  .star-field, .motion-toggle { display: none; }
}
