:root {
  --ink: #161614;
  --ink-2: #5E5A52;
  --paper: #FAF7F0;
  --green: #2E6B34;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #161614;
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; text-transform: lowercase; }

/* ---------- the scene ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.scene { position: absolute; inset: 0; }
.layer { position: absolute; will-change: transform; }
.layer svg { display: block; width: 100%; height: 100%; }
.layer svg text { font-family: var(--display); }

/* the door: knocking rings the bell */
.door { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; outline: none; }
.door::before {
  content: ""; position: absolute; inset: -6px; border-radius: 4px;
  border: 3px solid var(--green); opacity: 0; transition: opacity .2s ease;
}
.door:hover::before, .door:focus-visible::before { opacity: 1; }

/* the doorbell */
.bell { cursor: pointer; outline: none; }
.bell-area { fill: transparent; stroke: var(--green); stroke-width: 4; stroke-opacity: 0; transition: stroke-opacity .2s ease; }
.bell:hover .bell-area, .bell:focus-visible .bell-area { stroke-opacity: 1; }
.bell-wave { fill: none; stroke: #FAF7F0; stroke-width: 4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.bell:not(.rung) .bell-wave:not(.bell-wave-2) { animation: wave 2.8s ease-out infinite; }
.bell.rung .bell-wave { animation: wave 1s ease-out 2; }
.bell.rung .bell-wave-2 { animation-delay: .25s; }
.hot-label { pointer-events: none; transition: opacity .2s ease; }
.hot-label.off { display: none; }
.hot-label rect { fill: rgba(250, 247, 240, .94); stroke: var(--ink); stroke-width: 2; }
.hot-label text { fill: var(--ink); font-size: 18px; font-weight: 600; text-anchor: middle; }
.bell:hover .hot-label rect, .bell:focus-visible .hot-label rect { fill: var(--ink); }
.bell:hover .hot-label text, .bell:focus-visible .hot-label text { fill: var(--paper); }
.bell.rung .hot-label { opacity: 0; }

/* the sign on the door */
.sign {
  position: absolute; z-index: 2;
  padding: 1.1% 1.4% 1%;
  background: #FFFDF6;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45);
  transform: translateX(-50%) rotate(-2deg);
  text-align: center; white-space: nowrap;
  pointer-events: none;
  font-size: clamp(13px, 1.05vw, 17px);
}
.sign::before {
  content: ""; position: absolute; left: 50%; top: -8px; width: 56px; height: 16px;
  transform: translateX(-50%) rotate(3deg);
  background: rgba(233, 222, 196, .85);
}
.sign strong { display: block; font: 700 1.25em/1 var(--display); letter-spacing: -0.03em; }
.sign span { display: block; margin-top: .4em; font: 500 .8em/1.2 var(--body); color: var(--ink-2); }

/* ---------- brand ---------- */
.brand, .corner, .token {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(250, 247, 240, .9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, .4);
}
.brand { position: fixed; z-index: 6; top: 16px; left: 16px; }
.corner-wrap { position: fixed; z-index: 6; top: 16px; right: 16px; display: flex; gap: 8px; }
.corner { gap: 14px; }
.wordmark { font: 700 1.15rem/1 var(--display); letter-spacing: -0.03em; }
.token { font: 700 1.05rem/1 var(--display); letter-spacing: -0.03em; }
/* the token's official spelling keeps its capital */
.token { text-transform: none; }
.token:hover, .corner a:hover { color: var(--green); }
.corner a { display: grid; place-items: center; width: 18px; height: 18px; }
.corner svg { width: 100%; height: 100%; }

/* ---------- ui ---------- */
.hint {
  position: fixed; z-index: 5; left: 50%; top: 20px; transform: translateX(-50%);
  margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(22, 22, 20, .72); color: var(--paper);
  font: .8rem/1 var(--mono); text-transform: none; white-space: nowrap;
  pointer-events: none;
}
.hint[hidden] { display: none; }

/* the fan-made notice: shown once, answered with "understood" */
.notice {
  position: fixed; z-index: 7; left: 50%; bottom: 28px;
  width: min(440px, calc(100% - 24px));
  padding: 22px 24px 20px;
  background: rgba(250, 247, 240, .97);
  border: 1px solid var(--ink); border-radius: 16px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .5);
  transform: translate(-50%, 24px); opacity: 0;
  transition: opacity .5s ease, transform .6s var(--ease);
}
.notice.on { transform: translate(-50%, 0); opacity: 1; }
.notice[hidden] { display: none; }
.kicker { margin: 0 0 10px; font: .78rem/1 var(--mono); color: var(--green); text-transform: none; }
.notice h2 { margin: 0 0 8px; font: 700 1.5rem/1 var(--display); letter-spacing: -0.035em; }
.notice p { margin: 0 0 16px; }
.notice button {
  height: 40px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper);
  font: 600 .92rem/1 var(--display); cursor: pointer;
}
.notice button:hover { background: var(--green); }

.noscript { position: fixed; inset: auto 20px 20px; color: var(--paper); }
.noscript a { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- motion ---------- */
@keyframes wave { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }

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

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .hint { top: 60px; }
  .brand, .corner, .token { height: 36px; padding: 0 14px; }
  .brand { top: 12px; left: 12px; }
  .corner-wrap { top: 12px; right: 12px; gap: 6px; }
  .token { font-size: .95rem; }
  .notice { bottom: 16px; padding: 18px 18px 16px; }
}
