:root {
  color-scheme: dark;
  --canvas: #000000;
  --canvas-soft: #050505;
  --ink: #f4f1e8;
  --ink-muted: #9ea2ae;
  --ink-dim: #686d7a;
  --line: rgba(235, 237, 242, 0.17);
  --line-strong: rgba(235, 237, 242, 0.42);
  --sun: #ffc27a;
  --coral: #f08a48;
  --focus: #fff2c7;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
}

body {
  color: var(--ink);
  font-family: "Geologica", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
}

.experience {
  position: fixed;
  inset: 0;
  isolation: isolate;
  background: #000;
}

#universe,
.atmosphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#universe {
  display: block;
  touch-action: manipulation;
}

.atmosphere {
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.7) 100%);
}

.site-head,
.orbit-index,
.planet-layer,
.orbit-tip,
.webgl-fallback {
  position: fixed;
  z-index: 4;
}

.site-head {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 30px;
  pointer-events: none;
}

.wordmark {
  pointer-events: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-family: "Silkscreen", monospace;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
}

.orbit-index {
  top: 50%;
  right: 26px;
  width: 104px;
  transform: translateY(-50%);
}

.orbit-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.orbit-index button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 34px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: right;
  opacity: 0.54;
  transition: opacity 160ms ease, color 160ms ease;
}

.orbit-index button:hover,
.orbit-index button:focus-visible,
.orbit-index button[aria-current="true"] {
  opacity: 1;
}

.orbit-index button:focus-visible {
  outline: 0;
  text-shadow: 0 0 14px rgba(244, 241, 232, 0.6);
}

.orbit-index__name {
  font-family: "Silkscreen", monospace;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.is-project-selected .orbit-index button:not([aria-current="true"]) {
  opacity: 0.28;
}

.planet-layer {
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.planet-anchor {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: var(--hit-size, 64px);
  height: var(--hit-size, 64px);
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(var(--screen-x, 0), var(--screen-y, 0), 0) translate(-50%, -50%);
  will-change: transform;
}

.planet-anchor:focus-visible {
  outline: 0;
}

.planet-anchor__label {
  position: absolute;
  top: 50%;
  left: calc(50% + var(--body-radius, 24px) + var(--label-gap, 10px));
  color: rgba(244, 241, 232, 0.78);
  font-family: "Silkscreen", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.045em;
  opacity: 0;
  filter: blur(2px);
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(0, -50%);
  transition: color 180ms ease, filter 200ms ease, opacity 180ms ease, transform 220ms var(--ease-out);
}

.planet-anchor:focus-visible .planet-anchor__label {
  color: var(--ink);
  opacity: 1;
  filter: none;
  transform: translate(6px, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .planet-anchor:hover .planet-anchor__label {
    color: var(--ink);
    opacity: 1;
    filter: none;
    transform: translate(6px, -50%);
  }
}

.planet-anchor--about .planet-anchor__label {
  top: calc(50% + var(--body-radius, 50px) + var(--label-gap, 16px));
  left: 50%;
  transform: translate(-50%, -3px);
}

.planet-anchor--about:focus-visible .planet-anchor__label {
  transform: translate(-50%, 4px);
}

@media (hover: hover) and (pointer: fine) {
  .planet-anchor--about:hover .planet-anchor__label {
    transform: translate(-50%, 4px);
  }
}

.planet-anchor[aria-pressed="true"] .planet-anchor__label,
.planet-anchor[aria-pressed="true"]:focus-visible .planet-anchor__label {
  opacity: 0;
  filter: blur(2px);
}

@media (hover: hover) and (pointer: fine) {
  .planet-anchor[aria-pressed="true"]:hover .planet-anchor__label {
    opacity: 0;
    filter: blur(2px);
  }
}

.orbit-tip {
  left: -999px;
  top: -999px;
  z-index: 8;
  width: min(360px, calc(100vw - 32px));
  padding: 4px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  filter: blur(5px);
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.92);
  transform: translate(var(--tip-offset, 210px), calc(-50% + 8px)) scale(0.985);
  transform-origin: left center;
  transition: opacity 360ms var(--ease-out), filter 420ms var(--ease-out), transform 420ms var(--ease-out);
  will-change: transform;
}

.orbit-tip.is-visible {
  opacity: 1;
  filter: none;
  transform: translate(var(--tip-offset, 210px), -50%) scale(1);
}

.orbit-tip.orbit-tip--left {
  transform: translate(calc(-100% - var(--tip-offset, 210px)), calc(-50% + 8px)) scale(0.985);
  transform-origin: right center;
}

.orbit-tip.orbit-tip--left.is-visible {
  transform: translate(calc(-100% - var(--tip-offset, 210px)), -50%) scale(1);
}

.orbit-tip__title {
  margin: 0 0 14px;
  color: var(--tip-reactive-color, var(--ink));
  font-family: "Silkscreen", monospace;
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-transform: uppercase;
  transition: color 140ms ease;
}

.orbit-tip__title-text {
  color: inherit;
}

.orbit-tip__summary,
.orbit-tip__detail {
  margin: 0;
  color: var(--tip-reactive-color, rgba(244, 241, 232, 0.92));
  font-size: 1rem;
  font-weight: 380;
  line-height: 1.58;
  transition: color 140ms ease;
}

.orbit-tip__detail {
  margin: 12px 0 0;
}

.orbit-tip__detail a {
  color: inherit;
  pointer-events: auto;
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: filter 140ms ease;
}

.orbit-tip__detail a:hover,
.orbit-tip__detail a:focus-visible {
  filter: brightness(1.22);
}

.orbit-tip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
}

.orbit-tip__links[hidden] {
  display: none;
}

.orbit-tip__links a {
  color: var(--tip-reactive-color, #fff);
  font-family: "Silkscreen", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.045em;
  line-height: 1.4;
  pointer-events: auto;
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  text-transform: uppercase;
  transition: color 140ms ease, text-decoration-color 160ms ease, transform 160ms ease;
}

.orbit-tip__links a:hover,
.orbit-tip__links a:focus-visible {
  filter: brightness(1.18);
  transform: translateX(3px);
}

.webgl-fallback {
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 40px));
  padding: 22px;
  border: 1px solid var(--line-strong);
  background: var(--canvas-soft);
  text-align: center;
  transform: translate(-50%, -50%);
}

.webgl-fallback p {
  margin: 0.4em 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--canvas);
  transition: opacity 500ms var(--ease-out), visibility 500ms;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.loader__mark {
  width: 11px;
  height: 11px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 240, 199, 0.62);
  animation: loader-orbit 1.2s linear infinite;
}

.camera-lab {
  position: fixed;
  top: 18px;
  right: 148px;
  z-index: 20;
  width: 218px;
  max-height: calc(100svh - 36px);
  overflow: auto;
  border: 1px solid rgba(244, 241, 232, 0.2);
  background: rgba(0, 0, 0, 0.82);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.camera-lab__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.14);
}

.camera-lab__head strong,
.camera-lab__head span {
  display: block;
}

.camera-lab__head strong {
  font-size: 0.62rem;
  letter-spacing: 0.09em;
}

.camera-lab__head span {
  margin-top: 2px;
  color: var(--ink-dim);
  font-size: 0.46rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.camera-lab button {
  border: 1px solid rgba(244, 241, 232, 0.18);
  background: rgba(244, 241, 232, 0.045);
  cursor: pointer;
}

.camera-lab button:hover,
.camera-lab button:focus-visible {
  border-color: rgba(244, 241, 232, 0.5);
  background: rgba(244, 241, 232, 0.1);
}

.camera-lab__collapse {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 0.82rem;
}

.camera-lab__body {
  padding: 9px 10px 10px;
}

.camera-lab.is-collapsed .camera-lab__body {
  display: none;
}

.camera-lab__presets,
.camera-lab__actions {
  display: grid;
  gap: 5px;
}

.camera-lab__presets {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 9px;
}

.camera-lab__actions {
  grid-template-columns: 1fr 1fr 0.58fr;
  margin-top: 10px;
}

.camera-lab__presets button,
.camera-lab__actions button {
  min-height: 28px;
  padding: 4px;
  font-size: 0.44rem;
  letter-spacing: 0.035em;
}

.camera-lab__actions button[aria-pressed="true"] {
  border-color: rgba(244, 241, 232, 0.48);
  background: rgba(244, 241, 232, 0.12);
}

.camera-lab__control {
  display: block;
  margin-top: 6px;
}

.camera-lab__control > span {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 0.47rem;
  letter-spacing: 0.04em;
}

.camera-lab__control output {
  color: var(--ink);
}

.camera-lab__control input {
  width: 100%;
  height: 12px;
  margin: 1px 0 0;
  accent-color: #f4f1e8;
}

@keyframes loader-orbit {
  50% { transform: scale(0.55); opacity: 0.35; }
}

@media (max-width: 960px) {
  .site-head {
    padding: 20px;
  }

  .orbit-index {
    top: 50%;
    right: 16px;
    bottom: auto;
    left: auto;
    width: 88px;
    transform: translateY(-50%);
  }

  .orbit-index ol {
    display: block;
  }

  .orbit-index button {
    min-height: 32px;
    justify-content: flex-end;
    border: 0;
    background: transparent;
    text-align: right;
    backdrop-filter: none;
  }

  .orbit-index__name {
    font-size: 0.52rem;
    letter-spacing: 0.06em;
  }

}

@media (max-width: 680px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100%;
  }

  .experience {
    position: relative;
    min-height: 100svh;
  }

  #universe,
  .atmosphere,
  .planet-layer {
    height: 100svh;
  }

  .orbit-index {
    top: auto;
    right: 20px;
    bottom: 26px;
    left: 20px;
    width: auto;
    transform: none;
  }

  .orbit-index ol {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .orbit-index button {
    display: flex;
    min-height: 44px;
    justify-content: center;
    border: 1px solid var(--line);
    background: rgba(1, 2, 8, 0.64);
    text-align: center;
    backdrop-filter: blur(8px);
  }

  .orbit-index__name {
    font-family: "Silkscreen", monospace;
    font-size: clamp(0.44rem, 2vw, 0.54rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .planet-anchor__label {
    display: none;
  }

  .orbit-tip {
    top: auto !important;
    right: 24px;
    bottom: 122px;
    left: 24px !important;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(8px) scale(0.98);
  }

  .orbit-tip.is-visible {
    transform: translateY(0) scale(1);
  }

  .orbit-tip.orbit-tip--left,
  .orbit-tip.orbit-tip--left.is-visible {
    border: 0;
    background: transparent;
    transform: translateY(0) scale(1);
  }

  .orbit-tip__title {
    font-size: 1.28rem;
  }

  .orbit-tip__summary,
  .orbit-tip__detail {
    max-width: 34em;
    font-size: 0.92rem;
  }

  .orbit-tip__links {
    margin-top: 16px;
  }

  .camera-lab {
    top: 12px;
    right: 12px;
    width: min(208px, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }
}
