/* LiDAR Point Cloud 001: title screen and in-game readouts. One typeface, white on black, red only for the creature. */

:root {
  --ink: #f2f6ff;
  --dim: rgba(242, 246, 255, 0.5);
  --faint: rgba(242, 246, 255, 0.28);
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

section { position: fixed; inset: 0; }

#fade {
  position: fixed; inset: 0; background: #000; pointer-events: none;
  opacity: 1; transition: opacity 1.1s ease;
}
body.ready #fade { opacity: 0; }
body.leaving #fade { opacity: 1; transition-duration: 0.7s; }

#title { transition: opacity 0.6s ease; }
body.leaving #title, body.playing #title { opacity: 0; pointer-events: none; }
body.playing #title { display: none; }

#title .shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 62% 78% at 20% 54%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.62) 46%, rgba(0, 0, 0, 0) 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 84%, rgba(0, 0, 0, 0.6) 100%);
}

.corner {
  position: absolute; font-size: 11px; letter-spacing: 0.26em; color: var(--dim); white-space: nowrap;
  opacity: 0; animation: rise 1s ease 1.5s forwards;
}
.corner.tl { top: 30px; left: 36px; }
.corner.tr { top: 30px; right: 36px; }
.corner.bl { bottom: 30px; left: 36px; }
.corner.br { bottom: 30px; right: 36px; }
.corner.tr::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 12px; border-radius: 50%;
  background: #2f7dff; vertical-align: 1px; animation: blink 2.4s ease-in-out infinite;
}

.mark { position: absolute; left: clamp(36px, 8.5vw, 150px); top: 50%; transform: translateY(-52%); }

h1 { font-weight: 300; font-size: clamp(42px, 7.2vw, 112px); line-height: 0.94; letter-spacing: -0.045em; }
h1 span { display: block; opacity: 0; animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
h1 span:nth-child(1) { animation-delay: 0.35s; }
h1 span:nth-child(2) { animation-delay: 0.5s; }
h1 .num { animation-delay: 0.65s; color: transparent; -webkit-text-stroke: 1px var(--dim); letter-spacing: 0.02em; }

.tag {
  margin-top: clamp(20px, 2.6vw, 34px); font-size: 12px; letter-spacing: 0.56em; color: var(--dim);
  opacity: 0; animation: rise 1s ease 1s forwards;
}

#play {
  position: relative; margin-top: clamp(26px, 3.4vw, 46px); display: flex; align-items: center; gap: 16px;
  padding: 17px 54px 17px 26px; background: transparent; color: var(--ink); border: 1px solid var(--ink);
  font: 500 14px var(--mono); letter-spacing: 0.5em; cursor: pointer;
  opacity: 0; animation: rise 1s ease 1.2s forwards;
  transition: background 0.18s ease, color 0.18s ease, padding 0.25s ease;
}
#play i { width: 7px; height: 7px; background: currentColor; animation: blink 1.1s steps(2, jump-none) infinite; }
#play b { font-weight: 500; }
#play:hover, #play:focus-visible { background: var(--ink); color: #000; outline: none; padding-right: 66px; }
#play:active { transform: translateY(1px); }
#play:disabled { cursor: default; border-color: var(--faint); color: var(--dim); background: transparent; padding-right: 54px; }

.call {
  display: block; margin-top: 22px; font-size: 11px; letter-spacing: 0.26em; color: var(--faint);
  opacity: 0; animation: rise 1s ease 1.4s forwards;
}
.call input {
  width: 12ch; margin-left: 8px; background: transparent; border: 0; border-bottom: 1px solid transparent; color: var(--dim);
  font: 400 11px var(--mono); letter-spacing: 0.26em; text-transform: uppercase; user-select: text; -webkit-user-select: text;
}
.call input:hover { border-bottom-color: var(--faint); }
.call input:focus { outline: none; color: var(--ink); border-bottom-color: var(--ink); }

.note { margin-top: 14px; min-height: 14px; font-size: 11px; letter-spacing: 0.2em; color: var(--dim); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }

#hud { pointer-events: none; }
#hud[hidden] { display: none; }

#cross { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
#cross i { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: rgba(242, 246, 255, 0.75); }
#cross svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#cross circle { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 106.8; stroke-dashoffset: 106.8; }

#level { position: absolute; left: 36px; bottom: 30px; font-size: 11px; letter-spacing: 0.28em; color: var(--faint); transition: color 2.5s ease; }
#level b { display: block; font-weight: 400; margin-bottom: 7px; }
#level.flash { color: var(--ink); transition-duration: 0.1s; }

#mic { position: absolute; right: 36px; bottom: 30px; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 0.28em; color: var(--faint); }
#mic i { display: block; width: 64px; height: 3px; background: rgba(242, 246, 255, 0.12); }
#mic em { display: block; height: 100%; width: 0; background: var(--ink); }
#mic.off i { display: none; }

#hint { position: absolute; left: 0; right: 0; bottom: 16%; text-align: center; font-size: 11px; letter-spacing: 0.3em; line-height: 2.3; color: var(--dim); opacity: 0; transition: opacity 1.6s ease; }
#hint.on { opacity: 1; }

#toast { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font-size: 11px; letter-spacing: 0.32em; color: var(--ink); opacity: 0; transition: opacity 0.8s ease; }
#toast.on { opacity: 0.9; }

#dead, #win, #pause {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
#dead { background: #000; transition-duration: 0.08s; }
#dead.on, #win.on, #pause.on { opacity: 1; }
#dead b { font-weight: 400; font-size: 13px; letter-spacing: 0.6em; color: #ff2a1a; animation: blink 0.9s steps(2, jump-none) infinite; }
#dead span, #win span, #pause span { font-size: 11px; letter-spacing: 0.3em; line-height: 2.2; color: var(--dim); }
#win { background: rgba(0, 0, 0, 0.72); }
#win b { font-weight: 300; font-size: clamp(22px, 3.4vw, 46px); letter-spacing: 0.04em; }
#pause { background: rgba(0, 0, 0, 0.78); }
#pause.on { pointer-events: auto; cursor: pointer; }
#pause b { font-weight: 500; font-size: 14px; letter-spacing: 0.5em; }

@media (max-width: 760px) {
  .corner.br, .corner.bl { display: none; }
  .mark { left: 28px; right: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  h1 span, .tag, #play, .call, .corner { animation-duration: 0.01s; animation-delay: 0s; }
}
