:root {
  color-scheme: dark;
  --canvas: oklch(0.155 0.012 52);
  --ink: oklch(0.943 0.018 85);
  --muted: oklch(0.67 0.022 76);
  --faint: oklch(0.385 0.016 58);
  --line: oklch(0.29 0.018 56);
  --signal: oklch(0.7 0.17 42);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;
  --space-4xl: 4rem;
  --page-gutter: clamp(1.25rem, 4vw, 4.5rem);
  --display: "Michroma", "Eurostile", sans-serif;
  --body: "Hanken Grotesk", "Avenir Next", sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-lg);
  left: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--ink);
  color: var(--canvas);
  font: 600 0.875rem/1 var(--body);
  transform: translateY(calc(-100% - 2rem));
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}

.page-shell::before,
.page-shell::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.page-shell::before {
  inset: var(--page-gutter);
  border: 1px solid color-mix(in oklch, var(--line), transparent 18%);
}

.page-shell::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: color-mix(in oklch, var(--line), transparent 50%);
}

.masthead,
.footer {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding-inline: var(--page-gutter);
}

.masthead {
  min-height: clamp(5rem, 10vw, 7.5rem);
  padding-top: env(safe-area-inset-top);
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 2.75rem;
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.identity-mark {
  position: relative;
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--faint);
  place-items: center;
  transform: rotate(45deg);
}

.identity-mark span {
  width: 0.28rem;
  height: 0.28rem;
  background: var(--signal);
}

.registry,
.footer-note,
.orbit-index {
  margin: 0;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.registry span {
  padding-inline: var(--space-sm);
  color: var(--signal);
}

.stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 32rem;
  padding: clamp(3.5rem, 10vh, 7.5rem) var(--page-gutter) clamp(3rem, 8vh, 5rem);
  align-items: center;
}

.hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: flex-start;
  gap: var(--space-xl);
  max-width: min(75vw, 72rem);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.65rem, 0.75vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: reveal 700ms 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--signal);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal), transparent 100%);
  animation: pulse 2.8s 1.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

h1 {
  display: flex;
  flex-direction: column;
  gap: clamp(0.1rem, 0.5vw, 0.5rem);
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.45rem, 9.8vw, 10.5rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.82;
  text-transform: uppercase;
}

h1 span {
  display: block;
  animation: title-in 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

h1 span:last-child {
  color: var(--canvas);
  text-shadow:
    1px 0 0 var(--ink),
    -1px 0 0 var(--ink),
    0 1px 0 var(--ink),
    0 -1px 0 var(--ink);
  animation-delay: 90ms;
}

.subline {
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.25vw, 1.18rem);
  line-height: 1.55;
  animation: reveal 700ms 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.orbit {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: clamp(-26rem, -19vw, -7rem);
  width: clamp(32rem, 65vw, 66rem);
  aspect-ratio: 1;
  color: var(--line);
  transform: translateY(-50%);
  pointer-events: none;
  animation: orbit-arrive 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.orbit svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.orbit-outer,
.orbit-middle,
.orbit-inner {
  vector-effect: non-scaling-stroke;
}

.orbit-ticks {
  opacity: 0.85;
  stroke-dasharray: 1 10.17;
  stroke-width: 8;
  vector-effect: non-scaling-stroke;
}

.orbit-arc {
  stroke: var(--muted);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.orbit-arc-a {
  stroke-dasharray: 188 580;
}

.orbit-arc-b {
  stroke-dasharray: 92 676;
}

.orbit-axis {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbit-spin 28s linear infinite;
}

.orbit-axis path {
  opacity: 0.56;
  stroke-dasharray: 2 8;
  vector-effect: non-scaling-stroke;
}

.signal {
  fill: var(--signal);
  stroke: none;
}

.orbit-core {
  fill: var(--canvas);
  stroke: var(--signal);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.orbit-index {
  position: absolute;
}

.orbit-index-top {
  top: 7.5%;
  left: 48%;
}

.orbit-index-side {
  top: 49%;
  right: 4.5%;
  transform: rotate(90deg);
}

.footer {
  min-height: clamp(5.5rem, 11vw, 7rem);
  padding-bottom: env(safe-area-inset-bottom);
}

.footer-links {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: clamp(0.25rem, 1.5vw, 1.25rem);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--space-sm);
  color: var(--muted);
  font-size: clamp(0.64rem, 0.7vw, 0.72rem);
  font-weight: 400;
  letter-spacing: 0.055em;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition:
    color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    text-decoration-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration-color: var(--signal);
}

a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(0.45em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbit-arrive {
  from {
    opacity: 0;
    transform: translate(5rem, -50%) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%) rotate(0);
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  72%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal), transparent 100%);
  }
  84% {
    box-shadow: 0 0 0 0.55rem color-mix(in oklch, var(--signal), transparent 78%);
  }
}

@media (max-width: 48rem) {
  .page-shell::after {
    left: 72%;
  }

  .stage {
    min-height: 0;
    padding-top: 5rem;
    align-items: start;
  }

  .hero {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(3.2rem, 16.8vw, 6.8rem);
    line-height: 0.87;
  }

  .orbit {
    top: auto;
    right: -17rem;
    bottom: -16rem;
    width: 42rem;
    transform: none;
    opacity: 0.78;
    animation-name: orbit-arrive-mobile;
  }

  .orbit-axis {
    animation-duration: 36s;
  }

  .footer {
    align-items: end;
  }

  .footer-note {
    padding-bottom: 0.95rem;
  }
}

@media (max-width: 34rem) {
  .identity {
    font-size: 0.67rem;
  }

  .registry {
    display: none;
  }

  .status-line {
    letter-spacing: 0.14em;
  }

  .subline {
    max-width: 22ch;
  }

  .footer-note {
    display: none;
  }

  .footer-links {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: space-between;
  }

  .footer-links a {
    padding-inline: 0;
    font-size: 0.61rem;
  }
}

@media (max-width: 22rem) {
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-block: var(--space-md);
  }
}

@keyframes orbit-arrive-mobile {
  from {
    opacity: 0;
    transform: translateX(3rem) rotate(-6deg);
  }
  to {
    opacity: 0.78;
    transform: translateX(0) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: oklch(0.8 0.02 76);
    --faint: oklch(0.55 0.016 58);
    --line: oklch(0.48 0.018 56);
  }
}
