:root {
  --background: #000000;
  --foreground: #eef0ed;
  --muted: rgba(238, 240, 237, 0.44);
  --hairline: rgba(238, 240, 237, 0.15);
  --header-height: 70px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  color: var(--foreground);
  background: var(--background);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  display: grid;
  width: 100%;
  height: var(--header-height);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 3.5vw, 56px);
  border-bottom: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.identity,
.orbit-status,
.local-time {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.2em;
}

.identity {
  justify-self: start;
  gap: 10px;
}

.identity__edition,
.local-time__place,
.orbit-status {
  color: var(--muted);
}

.identity__orbit {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(238, 240, 237, 0.7);
  border-radius: 0;
  animation: none;
}

.orbit-status {
  justify-self: center;
  gap: 10px;
}

.orbit-status i {
  width: 24px;
  height: 1px;
  overflow: hidden;
  background: var(--hairline);
}

.orbit-status i::after {
  display: block;
  width: 35%;
  height: 100%;
  background: rgba(238, 240, 237, 0.7);
  content: "";
  animation: status-travel 3.8s ease-in-out infinite alternate;
}

@keyframes status-travel {
  to { transform: translateX(190%); }
}

.local-time {
  justify-self: end;
  gap: 14px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.universe {
  position: fixed;
  inset: var(--header-height) 0 0;
  overflow: hidden;
  cursor: move;
}

#orbit-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.edge-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 16%),
    radial-gradient(ellipse at center, transparent 64%, rgba(0, 0, 0, 0.34) 100%);
}

.formula-note {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 3.5vw, 56px);
  bottom: clamp(18px, 3.5vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: rgba(255, 255, 255, 0.42);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(7px, 0.62vw, 9px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
  line-height: 1.9;
  pointer-events: none;
  white-space: nowrap;
}

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

.scroll-content {
  position: relative;
  z-index: 1;
  min-height: 260vh;
  padding: calc(92svh + 4vh) clamp(20px, 8vw, 12vw) 22vh;
  pointer-events: none;
}

.square-track {
  display: flex;
  flex-direction: column;
  gap: clamp(28vh, 42vh, 56vh);
}

.content-square {
  width: min(66vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(238, 240, 237, 0.72);
  opacity: 0;
  transform: translateY(48px) scale(0.965);
  transition: opacity 900ms ease, transform 1200ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.content-square--offset {
  align-self: flex-end;
  width: min(58vw, 680px);
}

.content-square.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 520px) {
  :root { --header-height: 62px; }

  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
  }

  .orbit-status {
    display: none;
  }

  .identity,
  .local-time {
    font-size: 8px;
  }

  .identity__orbit {
    width: 25px;
    height: 25px;
  }

  .formula-note {
    right: 14px;
    bottom: 14px;
    font-size: 6.5px;
    line-height: 1.75;
  }

  .scroll-content {
    min-height: 220vh;
    padding: calc(88svh + 5vh) 18px 16vh;
  }

  .square-track {
    gap: 30vh;
  }

  .content-square,
  .content-square--offset {
    width: min(82vw, 420px);
  }

  .content-square--offset {
    align-self: flex-end;
  }

  .local-time__place {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .identity__orbit,
  .orbit-status i::after {
    animation: none;
  }

  .content-square {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
