/* 0x1A */

@font-face {
  font-family: "Mona Sans";
  src: url("/assets/fonts/mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Funnel Display";
  src: url("/assets/fonts/funnel-display.woff2") format("woff2");
  font-weight: 300 800;
  font-display: block;
}

:root {
  color-scheme: dark;

  --bone: #ede5d8;
  --ash: #a39a8f;
  --ember: #1b1512;
  --umber: #0b0807;
  --pitch: #050303;

  --glow: radial-gradient(120% 85% at 50% 42%, var(--ember) 0%, var(--umber) 55%, var(--pitch) 100%);
  --pad: clamp(1.25rem, 4.5vw, 3.5rem);
  --sans: "Mona Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mark: "Funnel Display", var(--sans);
}

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

html {
  background: var(--pitch);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
}

::selection {
  background: var(--bone);
  color: var(--pitch);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 4px;
  border-radius: 2px;
}


/* mark */

.logo {
  margin: 0;
  font-family: var(--mark);
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  animation: arrive 1.2s ease 0.9s both;
}

.logo a {
  text-decoration: none;
}

.px {
  font-weight: 300;
}

.logo a .px {
  transition: font-weight 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.logo a:hover .px,
.logo a:focus-visible .px {
  font-weight: 600;
}


/* field */

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--glow);
}

.fallback {
  display: none;
}

.no-webgl .fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  font-family: var(--mark);
  font-size: clamp(4rem, 20vw, 15rem);
  font-weight: 800;
}


/* header */

.top {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  right: var(--pad);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.motion {
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--ash);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.motion:hover {
  color: var(--bone);
}


/* scenes */

main {
  position: relative;
  z-index: 1;
}

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad);
  padding-bottom: clamp(3rem, 11vh, 7rem);
}

.cap {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.25rem, 6.6vw, 5.75rem);
  font-weight: 380;
  font-stretch: 108%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-shadow: 0 0 2rem var(--pitch), 0 0 0.5rem var(--pitch);
}

.last .cap {
  max-width: 19ch;
  font-size: clamp(1.875rem, 4.6vw, 4rem);
  line-height: 1.04;
}

.contact {
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-stretch: 110%;
  line-height: 1.4;
}

.contact span {
  display: block;
  color: var(--ash);
}

.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 5vh, 3rem);
  width: 1px;
  height: 3.5rem;
  overflow: hidden;
  background: linear-gradient(var(--ash), transparent);
  opacity: 0.6;
}

.cue::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 1px;
  height: 40%;
  background: var(--bone);
  animation: fall 2.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.paused .cue::after {
  animation-play-state: paused;
}

.js .cap,
.js .contact {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .in .cap,
.js .in .contact {
  opacity: 1;
  transform: none;
}

.js .in .contact {
  transition-delay: 0.15s;
}


/* 404 */

.lost {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad);
  background: var(--glow);
}

.lost .logo {
  animation: none;
}

.lost main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(3rem, 11vh, 7rem);
}

.lost h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.25rem, 6.6vw, 5.75rem);
  font-weight: 380;
  font-stretch: 108%;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.lost main p {
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-stretch: 110%;
}


/* utilities */

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

@keyframes arrive {
  from { opacity: 0; }
}

@keyframes fall {
  to { top: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .cue::after {
    animation: none;
  }

  .logo a .px {
    transition: none;
  }

  .js .cap,
  .js .contact {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
