@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/JetBrainsMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color: #171717;
  background: #fff;
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
}

.page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(2rem, 8vh, 5rem) 1.25rem;
}

.announcement {
  display: grid;
  justify-items: center;
  gap: clamp(2.5rem, 7vh, 4rem);
}

h1 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
}

.olly-scene {
  --eye-x: 0%;
  --eye-y: 0%;
  --eye-open: 1;
  --gaze-duration: 150ms;
  --beacon-play-state: running;
  --head-yaw: 0deg;
  --head-pitch: 0deg;
  --head-lift: 0%;
  --scene-width: min(82vw, 22.5rem);
  --head-width: 70%;
  --head-left: 15%;
  --head-top: -17%;
  position: relative;
  width: var(--scene-width);
  aspect-ratio: 1 / 1;
  user-select: none;
}

.bucket,
.olly-head,
.olly-head__art {
  position: absolute;
  display: block;
  pointer-events: none;
}

.bucket {
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.olly-head {
  top: calc(var(--head-top) + var(--head-lift));
  left: var(--head-left);
  z-index: 2;
  width: var(--head-width);
  aspect-ratio: 1;
  transform: perspective(30rem) rotateX(var(--head-pitch)) rotateY(var(--head-yaw));
  transform-origin: 50% 65%;
  transform-style: preserve-3d;
  transition: top var(--gaze-duration) ease-out, transform var(--gaze-duration) ease-out;
  will-change: transform;
}

.olly-head__art {
  inset: 0;
  width: 100%;
  height: 100%;
}

.olly-beacon {
  position: absolute;
  top: 22%;
  left: 49%;
  z-index: 1;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(70 255 187 / 65%) 0, rgb(70 255 187 / 28%) 35%, transparent 70%);
  filter: blur(0.12rem);
  opacity: 0.15;
  transform: translate(-50%, -50%) scale(0.98);
  animation: beacon-pulse 8s ease-in-out infinite;
  animation-play-state: var(--beacon-play-state);
  pointer-events: none;
}

@keyframes beacon-pulse {
  50% {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(1.03);
  }
}

.olly-eye {
  position: absolute;
  top: calc(55.8% + var(--eye-y));
  z-index: 1;
  width: 7.8%;
  aspect-ratio: 1;
  border-radius: 25%;
  background: #fff;
  box-shadow: 0 0.08em 0.15em rgb(0 0 0 / 8%);
  transform: translate(-50%, -50%) scaleY(var(--eye-open));
  transform-origin: center;
  transition: top var(--gaze-duration) ease-out, left var(--gaze-duration) ease-out, transform 105ms ease-in-out;
}

.olly-eye--left {
  left: calc(38.5% + var(--eye-x));
}

.olly-eye--right {
  left: calc(59.5% + var(--eye-x));
}

.bucket--front {
  z-index: 3;
  clip-path: polygon(
    0 22%,
    10% 22%,
    25% 24.5%,
    50% 26.5%,
    75% 24.5%,
    90% 22%,
    100% 22%,
    100% 100%,
    0 100%
  );
}

footer {
  position: fixed;
  right: 0;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 0;
  padding: 0 1rem;
  color: #aaa;
  font-size: clamp(0.58rem, 1.5vw, 0.7rem);
  line-height: 1.4;
  text-align: center;
}

@media (max-height: 30rem) {
  .announcement {
    gap: 1.5rem;
  }

  .olly-scene {
    --scene-width: min(48vh, 18rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .olly-head {
    transition: none;
    will-change: auto;
  }

  .olly-eye {
    transition: none;
  }

  .olly-beacon {
    animation: none;
    opacity: 0.4;
    transform: translate(-50%, -50%);
  }
}
