
  :root {
    --heat: 0;
    --depth: 0;
    --spread: 0em;
    --line: 1.9;
    --ink: #e8e6e1;
    --tremble: 0px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body {
    height: 100dvh;
    overflow: hidden;
    background: #000;
    overscroll-behavior: none;
  }

  body {
    font-family: "Nanum Myeongjo", "Noto Serif KR", "Apple SD Gothic Neo", serif;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }

  #stage {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
  }

  #scroll {
    width: min(38em, 88vw);
    height: 100%;
    overflow-y: hidden;
    padding: 18dvh 0 22dvh;
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 82%, transparent 97%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 82%, transparent 97%);
  }

  #text {
    font-size: clamp(16px, 2.4vw, 21px);
    line-height: var(--line);
    letter-spacing: var(--spread);
    color: var(--ink);
    word-break: keep-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    transition: line-height 0.9s ease, letter-spacing 0.9s ease, color 1.2s ease;
  }

  .live {
    display: inline-block;
    animation: tremble 0.09s infinite steps(2);
  }
  @keyframes tremble {
    0%   { transform: translate(calc(var(--tremble) * -1), var(--tremble)); }
    100% { transform: translate(var(--tremble), calc(var(--tremble) * -1)); }
  }

  /* 관객의 명령 — 다른 목소리의 조판. 기계의 잉크색을 따르지 않는다 */
  .cmd {
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 0.78em;
    color: #6e6e6e;
    letter-spacing: 0.14em;
  }
  .cut { color: #555; }

  #cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 0.1em;
    vertical-align: text-bottom;
    background: var(--ink);
    animation: blink 1.1s steps(1) infinite;
  }
  @keyframes blink { 50% { opacity: 0; } }

  #hint {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;   /* 위 = 새로움, 아래 = 깊이 */
    z-index: 20;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.4s ease;
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  }
  #hint.gone { opacity: 0; }
  #hint.waiting { opacity: 0; transition: none; }
  #hint .half {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    color: #777;
    font-size: 15px;
    letter-spacing: 0.15em;
  }
  #hint .half:first-child { border-bottom: 1px solid #1c1c1c; }
  #hint .key {
    font-size: 11px;
    color: #444;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 8px;
    letter-spacing: 0.05em;
  }

  /* ───────── 진입: 1909년의 명령 ───────── */
  #epigraph {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: opacity 1.6s ease;
  }
  #epigraph.gone { opacity: 0; pointer-events: none; }
  #epigraph .inner {
    width: min(30em, 84vw);
    animation: epiIn 2.2s ease both;
  }
  @keyframes epiIn { from { opacity: 0; } to { opacity: 1; } }
  #epigraph .q {
    color: #cfccc6;
    font-size: clamp(16px, 2.6vw, 22px);
    line-height: 2.1;
    word-break: keep-all;
    margin-bottom: 0.9em;
  }
  #epigraph .attr {
    margin-top: 2.4em;
    color: #575757;
    font-size: clamp(11px, 1.5vw, 13px);
    letter-spacing: 0.12em;
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  }

  /* ───────── 작업설명 ───────── */
  #infoBtn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 30;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    border: 1px solid #242424;
    border-radius: 50%;
    font-family: "Nanum Myeongjo", "Noto Serif KR", Georgia, serif;
    font-style: italic;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.4s ease, border-color 0.4s ease;
  }
  #infoBtn:hover { color: #999; border-color: #444; }

  #about {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    cursor: pointer;
  }
  #about.open { opacity: 1; pointer-events: auto; }
  #about .sheet {
    width: min(34em, 86vw);
    max-height: 82dvh;
    overflow-y: auto;
    color: #b5b2ac;
    font-size: clamp(13px, 1.7vw, 15px);
    line-height: 1.95;
    word-break: keep-all;
  }
  #about h2 {
    font-weight: 400;
    font-size: 1.5em;
    color: #ddd;
    letter-spacing: 0.06em;
    margin-bottom: 0.2em;
  }
  #about .meta {
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 0.8em;
    color: #5c5c5c;
    letter-spacing: 0.08em;
    margin-bottom: 2.2em;
  }
  #about p { margin-bottom: 1.3em; }
  #about .sec {
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 0.72em;
    color: #4e4e4e;
    letter-spacing: 0.35em;
    margin: 2.6em 0 1.2em;
    padding-top: 1.6em;
    border-top: 1px solid #1a1a1a;
  }
  #about .sec:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
  #about .manual {
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 0.85em;
    color: #7d7a75;
    line-height: 2.3;
    letter-spacing: 0.04em;
  }
  #about .manual b { color: #b5b2ac; font-weight: 500; }
  #about .manual .k {
    display: inline-block;
    min-width: 8.5em;
    color: #565656;
    letter-spacing: 0.08em;
  }
  #about .close {
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 0.75em;
    color: #3f3f3f;
    letter-spacing: 0.2em;
    margin-top: 2.4em;
    text-align: center;
  }

  /* 냉각 표시 — 손을 뗀 뒤 언어가 제 온도로 돌아가는 동안 */
  #drift {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
    color: #3a3a3a;
    font-size: 12px;
    letter-spacing: 0.3em;
    font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    opacity: 0;
    transition: opacity 1.2s ease;
    pointer-events: none;
  }
  #drift.show { opacity: 1; }

  #pulse {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.05), transparent 70%);
  }
  #pulse.hit { animation: pulse 0.22s ease-out; }
  @keyframes pulse { 0% { opacity: 1; } 100% { opacity: 0; } }
