@font-face {
  font-family: "Isildur Mono";
  src: local("Cascadia Mono"), local("Consolas");
  font-display: swap;
}

@font-face {
  font-family: "Aniron";
  src: url("/assets/fonts/aniron-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Aniron";
  src: url("/assets/fonts/aniron-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #080909;
  --ink: #edeee9;
  --muted: #a7aaa4;
  --accent: #d59a52;
}

* {
  box-sizing: border-box;
}

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

html {
  background: var(--ground);
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, #171918 0%, var(--ground) 52%),
    var(--ground);
  color: var(--ink);
  font-family: "Isildur Mono", monospace;
}

main {
  position: relative;
  min-height: 100dvh;
}

.identity {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  pointer-events: none;
  transform: translateZ(1px);
}

.wordmark {
  position: absolute;
  top: 32px;
  left: 40px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  font-family: "Aniron", "Isildur Mono", monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.wordmark-mark {
  display: grid;
  width: 30px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "Aniron", "Isildur Mono", monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.scene,
.scene canvas,
.fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene {
  z-index: 0;
  overflow: hidden;
}

.scene::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(8, 9, 9, 0.16) 62%, rgba(8, 9, 9, 0.62) 100%),
    linear-gradient(180deg, rgba(8, 9, 9, 0.28), transparent 28%, transparent 72%, rgba(8, 9, 9, 0.32));
}

.scene canvas {
  z-index: 1;
  display: block;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity 900ms ease;
}

.scene canvas:active {
  cursor: grabbing;
}

.scene.is-ready canvas {
  opacity: 1;
}

.fallback {
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0.35;
  transition: opacity 700ms ease;
}

.fallback span {
  width: clamp(36px, 7vw, 120px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #777a75, transparent);
  transform: rotate(var(--angle, 0deg)) translateY(var(--offset, 0));
}

.fallback span:nth-child(1) { --angle: -3deg; --offset: -18px; }
.fallback span:nth-child(2) { --angle: 2deg; --offset: 10px; }
.fallback span:nth-child(3) { --angle: -1deg; --offset: -6px; }
.fallback span:nth-child(4) { --angle: 4deg; --offset: 16px; }
.fallback span:nth-child(5) { --angle: -2deg; --offset: -12px; }

.scene.is-ready .fallback {
  opacity: 0;
}

.loader {
  position: absolute;
  z-index: 4;
  bottom: 42px;
  left: 50%;
  width: min(180px, 38vw);
  height: 1px;
  overflow: hidden;
  background: rgba(237, 238, 233, 0.12);
  transform: translateX(-50%);
  transition: opacity 300ms ease;
}

.loader span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--load, 0));
  transform-origin: left;
  transition: transform 180ms ease;
}

.scene.is-ready .loader,
.scene.has-failed .loader {
  opacity: 0;
}

.email {
  position: absolute;
  right: 40px;
  bottom: 36px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration-color: rgba(213, 154, 82, 0.55);
  text-underline-offset: 6px;
  transition: color 180ms ease;
  pointer-events: auto;
}

.email:hover,
.email:focus-visible {
  color: var(--ink);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 7px;
}

@media (max-width: 640px) {
  .wordmark {
    top: 22px;
    left: 20px;
  }

  .email {
    right: auto;
    bottom: 26px;
    left: 20px;
  }

  .loader {
    bottom: 82px;
  }

  .fallback {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
