@font-face {
  font-family: "Familjen Grotesk";
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/familjen-grotesk.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo Expanded";
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/archivo-expanded.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono.woff2") format("woff2");
}

:root {
  --blue: #0000ee;
  --link: #0000ee;
  --hot: #ff2a1f;
  --bg: #ffffff;
  --surface: #ffffff;
  --quiet: #f3f3f8;
  --line: #e4e4ec;
  --dot: #d4d4dc;
  --ink: #111111;
  --text-2: #3d3d48;
  --muted: #686874;
  --off: #ebebf3;
  --off-text: #8b8bb0;
  --sans: "Familjen Grotesk", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --wide: "Archivo Expanded", "Familjen Grotesk", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --link: #8585ff;
  --bg: #0c0c14;
  --surface: #15151f;
  --quiet: #1e1e2b;
  --line: #262636;
  --dot: #2c2c3c;
  --ink: #f2f2f8;
  --text-2: #c9c9d9;
  --muted: #9a9ab2;
  --off: #262636;
  --off-text: #7a7a98;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button {
  font: inherit;
  color: inherit;
}
#fabric {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ------------------------------------------------------------ header */
.bar {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 14px;
  translate: -50% 0;
  width: min(1080px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
.mark {
  display: grid;
  grid-template-columns: repeat(6, 4px);
  gap: 2.5px;
  height: 22px;
}
.mark i {
  border-radius: 2px;
  background: var(--off);
  transition: transform 0.2s;
}
.mark i:nth-child(n + 5) {
  background: var(--hot);
}
.brand:hover .mark i {
  animation: wave 0.6s ease-in-out;
}
.mark i:nth-child(2) {
  animation-delay: 0.05s !important;
}
.mark i:nth-child(3) {
  animation-delay: 0.1s !important;
}
.mark i:nth-child(4) {
  animation-delay: 0.15s !important;
}
.mark i:nth-child(5) {
  animation-delay: 0.2s !important;
}
.mark i:nth-child(6) {
  animation-delay: 0.25s !important;
}
@keyframes wave {
  50% {
    transform: scaleY(0.45);
    background: var(--blue);
  }
}
.wordmark {
  display: flex;
  font-family: var(--wide);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: pre;
}
.wordmark span {
  display: inline-block;
  transition: transform 0.9s cubic-bezier(0.2, 1.4, 0.4, 1);
}
/* ------------------------------------------------------------ stage */
main {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 92px 16px 64px;
}
.hero {
  position: relative;
  width: min(640px, 100%);
  text-align: center;
  transform: perspective(1400px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.6s cubic-bezier(0.3, 1.5, 0.5, 1);
}
h1 {
  margin: 0;
  font-size: clamp(44px, 10vw, 96px);
  line-height: 0.85;
  letter-spacing: -0.055em;
  font-weight: 700;
}
/* The fingerprint, drawn large. Each bar is a live power you can use. */
.print {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: min(330px, 100%);
  height: 46px;
  margin: 28px auto 0;
}
.power {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 6px;
  border: 0;
  border-radius: 6px;
  background: var(--hot);
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transform-origin: bottom;
  transition: background 0.25s, transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.power:hover {
  transform: scaleY(1.06);
}
.power:active {
  transform: scaleY(0.9);
}
.power:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.power span {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.power.is-off {
  background: var(--off);
  color: var(--off-text);
}
.power.is-firing {
  animation: fire 0.5s ease-out;
}
@keyframes fire {
  30% {
    background: #fff;
    transform: scaleY(1.18);
  }
}
.power.is-nope {
  animation: nope 0.35s;
}
@keyframes nope {
  25% {
    translate: -5px 0;
  }
  75% {
    translate: 5px 0;
  }
}

/* Eyes appear when the visitor goes quiet. */
.eyes {
  position: absolute;
  top: 6px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transform: scaleY(0.1);
  transition: opacity 0.3s, transform 0.3s;
}
.watching .eyes {
  opacity: 1;
  transform: none;
}
.eyes i {
  position: relative;
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}
.eyes i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background: #111;
  translate: calc(-50% + var(--ex, 0px)) calc(-50% + var(--ey, 0px));
}
.watching .eyes {
  animation: lids 4s infinite;
}
@keyframes lids {
  0%,
  92%,
  100% {
    transform: none;
  }
  96% {
    transform: scaleY(0.1);
  }
}

.ape-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  min-height: 48px;
}
.ape {
  position: relative;
  z-index: 4;
  padding: 13px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: translate 0.32s cubic-bezier(0.2, 1.3, 0.4, 1), transform 0.12s, background 0.2s;
}
.ape:hover {
  background: var(--hot);
}
.ape:active {
  transform: scale(0.95);
}

.line {
  margin: 0;
  max-width: 560px;
  text-align: center;
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.hint {
  margin: -8px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------ feed */
.feed {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100% - 32px));
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.feed li {
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 10px;
  align-items: baseline;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  animation: slide-in 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
  transition: opacity 0.4s, translate 0.4s;
}
.feed li.is-going {
  opacity: 0;
  translate: 30px 0;
}
/* A red dot, like a live power, marks each event. */
.feed li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--hot);
  translate: 0 -1px;
}
.feed b {
  font-size: 15px;
}
.feed span {
  grid-column: 2;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
@keyframes slide-in {
  from {
    opacity: 0;
    translate: 40px 0;
  }
}

/* ------------------------------------------------------------ powers */
.coin {
  position: fixed;
  z-index: 15;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--wide);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
  will-change: transform;
}
.coin.is-hot {
  background: var(--hot);
}

.stamp {
  position: fixed;
  z-index: 18;
  left: 50%;
  top: 50%;
  padding: 10px 30px;
  border: 8px solid var(--hot);
  border-radius: 16px;
  color: var(--hot);
  font-family: var(--wide);
  font-size: clamp(48px, 13vw, 140px);
  font-weight: 800;
  letter-spacing: -0.02em;
  translate: -50% -50%;
  rotate: -12deg;
  scale: 3;
  opacity: 0;
  pointer-events: none;
  transition: scale 0.25s cubic-bezier(0.5, 0, 0.7, 1.4), opacity 0.2s;
}
.is-paused .stamp {
  scale: 1;
  opacity: 1;
}
.is-paused main,
.is-paused .bar {
  filter: grayscale(1) contrast(0.85);
  pointer-events: none;
}
.is-paused,
.is-paused * {
  cursor: wait !important;
}

.blocked {
  position: fixed;
  z-index: 18;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(255 42 31 / 0.88);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.is-blocked .blocked {
  opacity: 1;
  pointer-events: auto;
  cursor: not-allowed;
}
.blocked strong {
  display: block;
  font-family: var(--wide);
  font-size: clamp(36px, 9vw, 96px);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.blocked span {
  display: block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 15px;
}
.is-blocked main {
  animation: shake 0.4s;
}
@keyframes shake {
  20%,
  60% {
    translate: -10px 0;
  }
  40%,
  80% {
    translate: 10px 0;
  }
}

.is-pulled main {
  animation: pull 0.95s cubic-bezier(0.55, -0.25, 0.8, 0.4) forwards;
}
.is-returning main {
  animation: drop 0.9s cubic-bezier(0.2, 1.25, 0.4, 1);
}
@keyframes pull {
  25% {
    transform: translateY(-14px) skewX(4deg);
  }
  to {
    transform: translateY(130vh) rotate(9deg) skewX(-8deg);
  }
}
@keyframes drop {
  from {
    transform: translateY(-120vh) rotate(-6deg);
  }
}
.void {
  position: fixed;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s 0.5s;
}
.is-pulled .void {
  opacity: 1;
}
.void strong {
  font-family: var(--wide);
  font-size: clamp(32px, 7vw, 72px);
  letter-spacing: -0.03em;
}
.void span {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.upgraded h1,
.upgraded .line {
  font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
  letter-spacing: 0;
}
.is-mirrored .hero {
  transform: scaleX(-1);
}
.is-flipped .hero {
  transform: rotate(180deg);
}
.is-melting .hero {
  transform: perspective(900px) rotateX(38deg) scale(0.92);
}
.glitch {
  animation: glitch 0.45s steps(6);
}
@keyframes glitch {
  20% {
    clip-path: inset(10% 0 60% 0);
    translate: -12px 0;
  }
  40% {
    clip-path: inset(50% 0 20% 0);
    translate: 12px 0;
  }
  60% {
    clip-path: inset(30% 0 40% 0);
    translate: -6px 0;
    filter: hue-rotate(120deg);
  }
  80% {
    clip-path: inset(0 0 80% 0);
    translate: 6px 0;
  }
}

.is-god .wordmark {
  color: var(--hot);
}
.is-god h1 {
  color: var(--hot);
}

/* ------------------------------------------------------------ dialog */
dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop {
  background: rgb(12 12 20 / 0.5);
  backdrop-filter: blur(4px);
}
.sign {
  display: grid;
  gap: 16px;
  padding: 24px;
}
.sign h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.sign h3 {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.warn {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--quiet);
  font-size: 16px;
  line-height: 1.4;
}
.sign label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  cursor: pointer;
}
.sign input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.actions {
  display: flex;
  gap: 10px;
}
.actions button {
  flex: 1;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}
.actions .go {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.actions .go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .feed {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .is-pulled main {
    animation: none;
    opacity: 0;
  }
}
