/* Messa di Voce — 재현
   미니멀: 종이 같은 바탕, 검은 잉크, 추적선 하나만 빨강 */

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #F3F1EB;
  color: #14161A;
  font-family: "IBM Plex Sans KR", "Malgun Gothic", -apple-system, system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

#gl, #ui {
  display: block; position: fixed; left: 0; top: 0;
  width: 100vw; height: 100vh;
}
#ui { pointer-events: none; }   /* 2D 오버레이 — GL 위에 선만 얹는다 */

/* MediaPipe 입력 전용. 화면에서는 숨김 */
#cam { position: fixed; left: -10000px; top: 0; width: 640px; height: 480px; }

#err {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 40;
  background: rgba(196,54,43,.08); border: 1px solid rgba(196,54,43,.35);
  color: #8C2A21; padding: 12px 16px; margin: 0; max-width: 620px;
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 11.5px; line-height: 1.8; white-space: pre-wrap;
}

/* ── 인트로 ─────────────────────────────────────────────── */
#intro {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: #F3F1EB;
  transition: opacity .5s ease;
}
#intro.gone { opacity: 0; pointer-events: none; }

.box { max-width: 640px; padding: 0 32px; text-align: center; }

.kicker {
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase;
  color: #9A968C; margin-bottom: 30px;
}

#intro h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 66px);
  font-weight: 300; line-height: 1; letter-spacing: .16em;
  color: #14161A;
}

.sub {
  margin-top: 20px;
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: #8C8880;
}

.blurb {
  margin: 36px auto 32px; max-width: 460px;
  font-size: 14.5px; line-height: 2; color: #5A574F;
}
.blurb b { color: #14161A; font-weight: 500; }

.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

button {
  font: inherit; font-size: 13px; letter-spacing: .06em;
  padding: 12px 26px; border-radius: 2px; cursor: pointer;
  border: 1px solid #C9C5BA; background: transparent; color: #3D3A34;
  transition: all .16s ease;
}
button:hover { border-color: #14161A; color: #14161A; }
button.primary { background: #14161A; color: #F3F1EB; border-color: #14161A; }
button.primary:hover { background: #000; }
button:focus-visible { outline: 2px solid #C4362B; outline-offset: 3px; }

.hint {
  margin-top: 34px;
  font-size: 11.5px; line-height: 2.1; color: #918C82;
}
.hint b { color: #5A574F; font-weight: 500; }

/* ── 상태 / 도움말 ──────────────────────────────────────── */
#status {
  /* 바닥에 형태가 쌓이면 글자가 묻힌다. 얇은 판을 깔아 항상 읽히게. */
  position: fixed; left: 12px; bottom: 10px; z-index: 20;
  background: rgba(243,241,235,.86); padding: 5px 9px;
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 10.5px; letter-spacing: .06em; color: #969187;
  pointer-events: none; white-space: pre;
}

#help {
  position: fixed; right: 20px; bottom: 20px; z-index: 25;
  background: rgba(255,255,255,.92); border: 1px solid #DDD8CE;
  padding: 18px 22px; font-size: 12px; color: #5A574F; max-width: 380px;
}
#help h3 {
  margin: 0 0 10px; font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: #A09B90; font-weight: 400;
}
#help h3 + table { margin-bottom: 18px; }
#help table { border-collapse: collapse; }
#help td { padding: 3px 0; vertical-align: top; }
#help td:first-child {
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  color: #14161A; width: 104px;
}

.hidden { display: none !important; }

/* 원작 영상으로 가는 줄 — 재현물 옆에 항상 원작이 있어야 한다 */
.refline {
  margin: 18px 0 0;
  font-family: "IBM Plex Mono", Consolas, "Malgun Gothic", monospace;
  font-size: 10.5px; letter-spacing: .04em; color: #A09B90;
}
.refline a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(160,155,144,.5); }
.refline a:hover { color: #5A574F; border-bottom-color: currentColor; }
