:root {
  --bg: #0b0d10;
  --line: #ffffff14;
  --line-strong: #ffffff33;
  --text: #eceff4;
  --text-dim: #a1a8b4;
  --text-faint: #7c8592;
  --accent: #b7cadf;
  --display: Georgia, 'Times New Roman', serif;
  --ui:
    system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  color-scheme: dark;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--ui);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  flex-shrink: 0;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict;
  background: var(--bg);
}

.backdrop::before,
.backdrop::after {
  content: '';
  position: absolute;
  inset: -45%;
  background: linear-gradient(
    112deg,
    transparent 39%,
    #708da108 45%,
    #b2c9db14 47%,
    #b2c9db03 49%,
    transparent 54%
  );
  animation: drift 26s ease-in-out infinite alternate;
}

.backdrop::after {
  background: linear-gradient(
    109deg,
    transparent 58%,
    #8099b508 63%,
    #d0dde810 64%,
    transparent 67%
  );
  animation-duration: 34s;
  animation-delay: -17s;
}

.shell {
  width: min(1180px, 100% - 80px);
  margin-inline: auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 104px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.6px;
}

.brand img {
  width: 30px;
  height: 30px;
}

.brand span {
  margin-left: -3px;
  color: var(--text-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-dim);
  transition: color 180ms;
}

.nav a::after {
  content: '';
  position: absolute;
  inset: auto 16px 3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--text);
}

.nav a[aria-current='page']::after {
  transform: scaleX(1);
}

.nav svg {
  width: 16px;
  height: 16px;
}

.nav .discord {
  margin-left: 12px;
}

.nav .discord img {
  width: 17px;
  height: 17px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 158px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid #e2e3e0;
  border-radius: 4px;
  background: #e2e3e0;
  color: #16181b;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 180ms,
    border-color 180ms,
    transform 180ms;
}

.button:hover {
  background: #fff;
  border-color: #fff;
  transform: translateY(-2px);
}

.button:active {
  transform: none;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  min-width: 104px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 14px;
  color: var(--text-dim);
  transition:
    color 180ms,
    border-color 180ms;
}

.link-action svg {
  width: 17px;
  height: 17px;
  transition: transform 180ms;
}

.link-action:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.link-action:hover svg {
  transform: translateX(4px);
}

.copy {
  position: relative;
}

.copy-fallback {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 2;
  width: min(360px, 100vw - 48px);
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #0a0e13;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  -webkit-user-select: text;
  user-select: text;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: calc(100svh - 180px);
  padding-bottom: 75px;
}

.hero h1 {
  margin-bottom: 42px;
  font-family: var(--display);
  font-size: clamp(100px, 12vw, 170px);
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.hero h1 span {
  margin-left: 18px;
  font-size: 0.36em;
  letter-spacing: -0.045em;
  color: #9ea5af;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
}

.moon {
  display: grid;
  place-items: center;
  height: 420px;
}

.moon img {
  width: 80%;
  height: auto;
  filter: drop-shadow(15px 32px 26px #0006);
  animation: float 14s ease-in-out infinite;
}

.page {
  min-height: calc(100svh - 104px);
  padding: 60px 0 90px;
}

.page h1 {
  font-family: var(--display);
  font-size: clamp(54px, 7vw, 88px);
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 250px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-faint);
  transition:
    border-color 180ms,
    color 180ms;
}

.search:focus-within {
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.search input {
  width: 100%;
  border: 0;
  background: none;
  font-size: 14px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.search input::placeholder {
  color: var(--text-faint);
}

.games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 38px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.games a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  transition: border-color 180ms;
}

.games img {
  width: 72px;
  height: 72px;
  border-radius: 9px;
  object-fit: cover;
  background: linear-gradient(145deg, #28323e, #15191f);
  filter: saturate(0.55);
  transition: filter 220ms;
}

.games h2 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: #c8ced8;
  overflow-wrap: anywhere;
  transition: color 180ms;
}

.games svg {
  margin-left: auto;
  color: var(--text-faint);
  transition:
    transform 180ms,
    color 180ms;
}

.games a:hover {
  border-color: var(--line-strong);
}

.games a:hover img {
  filter: none;
}

.games a:hover h2 {
  color: var(--text);
}

.games a:hover svg {
  transform: translate(2px, -2px);
  color: var(--text);
}

.no-results {
  margin: 0;
  padding: 60px 0;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
}

@keyframes drift {
  from {
    transform: translate3d(-5%, 0, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(9%, 3%, 0) rotate(4deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-12px) rotate(-1deg);
  }
}

@media (max-width: 900px) {
  .shell {
    width: calc(100% - 48px);
  }

  .hero {
    gap: 16px;
  }

  .hero h1 {
    font-size: 110px;
  }

  .hero h1 span {
    margin-left: 12px;
  }

  .moon {
    height: 350px;
  }
}

@media (max-width: 760px) {
  .page-head {
    display: block;
  }

  .search {
    width: 100%;
    margin-top: 24px;
  }

  .games {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 40px);
  }

  .header {
    flex-wrap: wrap;
    gap: 20px;
    height: auto;
    padding: 24px 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .nav a {
    gap: 6px;
    padding: 9px 0;
  }

  .nav a::after {
    inset: auto 0 0;
  }

  .nav svg {
    width: 14px;
    height: 14px;
  }

  .nav .discord {
    margin-left: 0;
  }

  .hero {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    min-height: 0;
    padding: 15px 0 48px;
  }

  .hero h1 {
    margin-bottom: 34px;
    font-size: 103px;
  }

  .hero h1 span {
    margin-left: 13px;
    font-size: 0.33em;
  }

  .moon {
    align-self: flex-end;
    width: 245px;
    height: 245px;
  }

  .actions {
    gap: 28px;
  }

  .page {
    padding-top: 40px;
  }

  .page h1 {
    font-size: 58px;
  }

  .games a {
    gap: 16px;
    padding: 20px 0;
  }

  .games img {
    width: 64px;
    height: 64px;
  }
}

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

@view-transition {
  navigation: auto;
}

.header {
  view-transition-name: header;
}

.backdrop {
  view-transition-name: backdrop;
}

::view-transition-old(header),
::view-transition-new(header),
::view-transition-old(backdrop),
::view-transition-new(backdrop) {
  animation: none;
}

::view-transition-old(root) {
  animation: page-out 0.3s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: page-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

@keyframes page-out {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

.load-anim main {
  animation: page-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*),
  .load-anim main {
    animation: none !important;
  }
}
