:root {
  color-scheme: light;
  --ink: #505050;
  --paper: #fff;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  user-select: none;
  touch-action: none;
}

button {
  color: inherit;
  font: inherit;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.wordmark {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 0.7em;
  align-items: baseline;
  padding: 18px 20px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: clamp(0.78rem, 1.05vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.215em;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  cursor: none;
}

.word {
  display: inline-flex;
}

.letter {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 1px, 0);
  will-change: transform, opacity;
}

.edge-menu {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: clamp(17px, 2.4vw, 38px);
  display: grid;
  gap: 0.85rem;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.edge-menu.is-visible {
  opacity: 0.58;
  pointer-events: auto;
}

.edge-menu button {
  padding: 5px;
  border: 0;
  background: transparent;
  font-size: 0.69rem;
  font-weight: 400;
  letter-spacing: 0.19em;
  text-align: right;
  cursor: none;
  transition: opacity 160ms ease;
}

.edge-menu button:hover,
.edge-menu button:focus-visible {
  opacity: 0.48;
  outline: none;
}

.about {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  gap: clamp(2.2rem, 5vh, 4rem);
  visibility: hidden;
  opacity: 0;
}

.about.is-visible {
  visibility: visible;
}

.about p {
  margin: 0;
  font-size: clamp(0.7rem, 0.85vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-align: center;
  opacity: 0;
  transform: translateY(2px);
}

.echo {
  position: absolute;
  z-index: 4;
  bottom: clamp(24px, 4vw, 52px);
  left: 50%;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.client-entry {
  position: absolute;
  z-index: 6;
  right: clamp(17px, 2.4vw, 38px);
  bottom: clamp(17px, 2.4vw, 34px);
  color: var(--ink);
  font-size: 0.61rem;
  letter-spacing: 0.19em;
  opacity: 0.34;
  text-decoration: none;
  transition: opacity 180ms ease;
}

.client-entry:hover,
.client-entry:focus-visible {
  opacity: 0.68;
  outline: none;
}

.client-entry {
  position: fixed;
  z-index: 8;
  right: clamp(18px, 2.4vw, 38px);
  bottom: clamp(18px, 2.4vw, 34px);
  color: #777;
  font-size: 0.61rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  opacity: 0.34;
  transition: opacity 180ms ease;
}

.client-entry:hover,
.client-entry:focus-visible {
  opacity: 0.72;
  outline: none;
}

#particles {
  position: absolute;
  z-index: 7;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cursor {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #555;
  opacity: 0;
  transform: translate3d(-20px, -20px, 0);
  pointer-events: none;
  will-change: transform, opacity;
}

.cursor::after {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: inherit;
  content: "";
  opacity: var(--trail-opacity, 0);
  transform: translateX(var(--trail-x, 0));
  transition: opacity 120ms ease;
}

.is-transitioning .letter {
  letter-spacing: 0.65em;
}

@media (pointer: coarse) {
  body,
  .wordmark,
  .edge-menu button {
    cursor: auto;
  }

  .cursor {
    display: none;
  }

  .wordmark {
    font-size: 0.78rem;
    gap: 0.55em;
    letter-spacing: 0.17em;
  }

  .client-entry { right: 19px; bottom: 19px; }

  .edge-menu {
    right: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .letter {
    opacity: 1;
    transform: none !important;
    transition: none !important;
  }

  #particles,
  .cursor {
    display: none;
  }
}
