:root {
  color-scheme: dark;
  font-family: Courier, "Courier New", monospace;
  color: #f5f5f5;
  background: #000;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a,
button {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid #c9e6fc;
  outline-offset: 6px;
}
[hidden] {
  display: none !important;
}
#scene,
#atmosphere-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#scene {
  z-index: 0;
}
#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#atmosphere-veil {
  z-index: 1;
  background: #6e8394;
  opacity: 0;
}
.chapter {
  position: relative;
  z-index: 2;
  pointer-events: none;
  height: 200svh;
}
#top {
  height: 180svh;
}
#afterBang {
  height: 780svh;
}
#descent {
  height: 240svh;
}
#aviation {
  height: 560svh;
}
#contact {
  height: 620svh;
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 6vw;
}
.welcome {
  justify-content: center;
  text-align: center;
}
.welcome h1 {
  font-weight: 400;
  font-size: clamp(56px, 7vw, 100px);
  margin: 0 0 18px;
  text-shadow: 0 0 12px #ffffff30;
}
.welcome p {
  font-size: 12px;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 3px #ffffff55;
}
.copy {
  max-width: 540px;
  pointer-events: auto;
  text-shadow: 0 2px 24px #000;
}
.copy h2 {
  font-size: clamp(32px, 3.7vw, 58px);
  line-height: 1.2;
  font-weight: 400;
  margin: 16px 0 28px;
  letter-spacing: -2px;
}
.copy p {
  font-size: clamp(14px, 1.3vw, 19px);
  line-height: 1.6;
  margin: 10px 0;
}
.copy .profession {
  font-size: clamp(11px, 1.1vw, 17px);
  letter-spacing: 1px;
}
.copy .personal-note {
  max-width: 35ch;
  margin-top: 22px;
}
#contact-copy {
  position: absolute;
  bottom: 9vh;
  left: 5vw;
  right: 5vw;
  text-align: center;
  pointer-events: auto;
  color: #fff;
  text-shadow: 0 2px 10px #173219;
}
#contact-copy h2 {
  font-size: clamp(17px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 24px;
}
.contact-links,
.secondary-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
}
.contact-links a {
  font-size: 14px;
  border-bottom: 1px solid #ffffff80;
  padding: 7px 0;
}
.secondary-links {
  margin-top: 19px;
  gap: 12px 22px;
}
.secondary-links a {
  font-size: 10px;
  color: #ebeee5;
}
.contact-links a:hover,
.secondary-links a:hover {
  color: #fff0b9;
}
.sr-only,
.object-controls button {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.object-controls button:focus {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 18px;
  width: auto;
  height: auto;
  clip-path: none;
  margin: 0;
  background: #151c24;
  padding: 14px 24px;
  border: 1px solid #afc5d3;
  color: #fff;
}
.scene-unavailable #afterBang,
.scene-unavailable #descent,
.scene-unavailable #aviation {
  display: none;
}
.scene-unavailable .chapter {
  height: 100svh !important;
}
.scene-unavailable .stage {
  position: relative;
}
.scene-unavailable #contact-copy {
  bottom: 30vh;
}
.scene-unavailable :is(#scene, #atmosphere-veil, #pixel-copy, #explore-button) {
  display: none;
}
.scene-unavailable :is(#welcome-copy, #earth-copy, #contact-copy) {
  opacity: 1 !important;
  visibility: visible !important;
}
#scene-error {
  max-width: 36ch;
  margin: 14px auto 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: normal;
  color: #b9c6d4;
}
@media (max-width: 700px) {
  .stage {
    padding: 8vw;
  }
  .copy {
    align-self: flex-start;
    margin-top: 12vh;
    max-width: 90%;
  }
  .copy h2 {
    font-size: 32px;
    letter-spacing: -1px;
    margin-bottom: 18px;
  }
  .copy p {
    font-size: 13px;
  }
  .copy .profession {
    font-size: 10px;
    letter-spacing: 0.6px;
  }
  .welcome h1 {
    font-size: 54px;
  }
  .welcome p {
    font-size: 10px;
  }
  #contact-copy {
    bottom: 12vh;
    left: 7vw;
    right: 7vw;
  }
  #contact-copy h2 {
    font-size: 17px;
    margin-bottom: 15px;
  }
  .contact-links {
    gap: 12px 20px;
  }
  .contact-links a {
    font-size: 12px;
  }
  .secondary-links {
    gap: 12px 17px;
  }
  .secondary-links a {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.welcome h1,
.welcome p {
  position: relative;
}
.welcome-glow {
  position: absolute;
  inset: 0;
  color: transparent;
  pointer-events: none;
  animation: welcome-pulse 2.6s ease-in-out infinite;
}
.welcome-glow::after {
  content: attr(data-label);
}
.welcome h1 .welcome-glow {
  text-shadow: 0 0 32px #ffffff88;
}
.welcome p .welcome-glow {
  text-shadow: 0 0 8px #ffffff55;
  animation-duration: 3.6s;
}
#welcome-copy[inert] .welcome-glow {
  animation-play-state: paused;
}
@keyframes welcome-pulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.85;
  }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-glow {
    display: none;
  }
}

/* Earth copy follows the fixed camera view, independently of section height. */
#earth-copy {
  position: fixed;
  left: 6vw;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
@media (max-width: 700px) {
  #earth-copy {
    left: 8vw;
    top: 9vh;
    transform: none;
    margin: 0;
  }
}

.scene-unavailable #earth-copy {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 0;
}

#explore-button[aria-busy="true"] {
  min-inline-size: 9.5rem;
  cursor: progress;
  animation: none;
  background: linear-gradient(
    to right,
    #55774c var(--explore-progress, 0%),
    #263c36 var(--explore-progress, 0%)
  );
}

.explore-load-error {
  margin: -8px 0 12px;
  font-size: 12px;
  text-shadow: 0 1px 4px #000;
}

#welcome-copy[role="button"] {
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

html.journey-loading,
.journey-loading body {
  overflow: hidden;
  overscroll-behavior: none;
}
#journey-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  touch-action: none;
}
.loader-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.1%;
  background: #030508;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}
.loader-left {
  left: 0;
}
.loader-right {
  right: 0;
}
.loader-label {
  position: relative;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: #b9c6d4;
  transition: opacity 0.2s;
}
.loader-dots {
  animation: loader-breathe 1.3s ease-in-out infinite alternate;
}
.opening .loader-left {
  transform: translateX(-100%);
}
.opening .loader-right {
  transform: translateX(100%);
}
.opening .loader-label {
  opacity: 0;
}
.journey-loading :is(#scene, #atmosphere-veil) {
  visibility: hidden;
}
/* Keep later chapter copy hidden while the curtain reveals Welcome. */
.journey-loading :is(#earth-copy, #pixel-copy, #contact-copy) {
  visibility: hidden !important;
}
@keyframes loader-breathe {
  to {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loader-dots {
    animation: none;
  }
  .loader-panel,
  .loader-label {
    transition: none;
  }
}
