/* Hallmark · genre: atmospheric · macrostructure: bespoke "Rush Path" (scroll-linked: the game's hero sprite runs a crimson line down the page and cuts each heading; the gameplay screen scrubs with scroll) · theme: custom (dark / pixel-bitmap / warm, tokens kept) · enrichment: real game sprites + frames · nav: floating chip · footer: one line
 * differs from last build (Bento Grid · N9 · Ft2) on macrostructure and nav; user turned down the catalog tones and asked for scroll interaction
 * pre-emit critique: P5 H4 E4 S5 R4 V5
 * contrast: pass (40–41) · nav: floating chip · footer: one line · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50–57; checked 320 / 375 / 768 / 1024)
 * tokens: tokens.css (index.html loads it first)
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; background: var(--color-paper); }
body {
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
canvas { display: block; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: 6px; }

/* 언어: 고른 쪽만 보인다 */
:root[data-lang="ko"] [data-l="en"], :root[data-lang="en"] [data-l="ko"] { display: none !important; }

.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-lg); }
.body { grid-column: 1 / span 6; position: relative; z-index: var(--z-text); }
[data-side="right"] .body { grid-column: 7 / -1; }

/* 도트 글꼴: 자간 0, 줄 간격도 픽셀 단위 */
.px { font-family: var(--font-pixel); font-weight: 700; letter-spacing: 0; -webkit-font-smoothing: none; }
.px-24 { font-size: var(--px-24); line-height: var(--lh-24); }
.px-36 { font-size: var(--px-36); line-height: var(--lh-36); }
.px-48 { font-size: var(--px-48); line-height: var(--lh-48); }

/* ---------- 떠 있는 칩: 언어 · 메일 ---------- */
.chip {
  position: fixed; top: var(--space-md); right: var(--space-md); z-index: var(--z-chip);
  display: flex; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-chip);
}
.chip__btn {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 var(--space-md);
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-ink);
  font: inherit; font-size: var(--text-sm); font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.chip__btn:hover { background: var(--color-tile-hi); }
.chip__btn:active { transform: scale(0.97); }
.chip__btn:focus-visible { outline-offset: 2px; border-radius: var(--radius-pill); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 var(--space-lg); border-radius: var(--radius-pill);
  background: var(--color-accent-fill); color: var(--color-accent-ink);
  font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--color-accent-deep); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { border-radius: var(--radius-pill); }
.btn[aria-disabled="true"], .chip__btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
/* 링크가 아직 없는 자리: 누를 수 없고, 준비 중이라고 쓴다 */
.soon {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  min-height: 2.75rem; padding: 0 var(--space-lg);
  border: var(--rule-hair) dashed var(--color-rule); border-radius: var(--radius-pill);
  color: var(--color-muted); font-weight: 700; line-height: 1; white-space: nowrap;
}
.soon small { color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; }

/* ---------- 칸 ---------- */
.page { position: relative; }
.sec { position: relative; display: grid; align-items: center; min-height: 80svh; padding-block: var(--space-3xl); }
.sec--open { min-height: 100svh; padding-block: var(--space-2xl) var(--space-3xl); }
.sec--end { min-height: 90svh; }

.mark { display: inline-block; color: var(--color-muted); margin-bottom: var(--space-lg); text-decoration: none; }
.mark:hover { color: var(--color-ink); }
.logo {
  font-family: var(--font-logo); font-weight: 400; font-size: var(--text-logo);
  line-height: 1.05; color: var(--color-ink); min-width: 0; overflow-wrap: anywhere;
  text-shadow: 0 0.04em 0 var(--color-shadow);
}
.tag { margin-top: var(--space-md); }
.lede { margin-top: var(--space-sm); max-width: 34rem; color: var(--color-muted); font-size: var(--text-lg); line-height: 1.5; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-xl); }
.hint { margin-top: var(--space-2xl); color: var(--color-muted); font-size: var(--text-sm); }

.body > p { max-width: 34rem; }
.body > p + p, .body > ul + p { margin-top: var(--space-sm); }
.small { color: var(--color-muted); font-size: var(--text-sm); }
.tiers { font-weight: 700; }

/* 제목: 주인공이 지나가는 순간 붉은 선이 긋고, 흐리던 글이 밝아진다 */
.cut { position: relative; width: fit-content; max-width: 100%; margin-bottom: var(--space-lg); color: var(--color-muted); }
.cut.is-cut { color: var(--color-ink); animation: hit 200ms linear; }
.cut::after {
  content: ""; position: absolute; left: -0.25em; right: -0.25em; top: 50%; height: 3px;
  background: var(--color-accent); opacity: 0; pointer-events: none;
  transform: rotate(-5deg) scaleX(0); transform-origin: left center;
}
.cut.is-cut::after { animation: slash 460ms var(--ease-out); }
.cut.is-still, .cut.is-still::after { animation: none; }
@keyframes slash {
  0%   { opacity: 1; transform: rotate(-5deg) scaleX(0); }
  45%  { opacity: 1; transform: rotate(-5deg) scaleX(1); }
  100% { opacity: 0; transform: rotate(-5deg) scaleX(1); }
}
@keyframes hit {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(3px, -1px); }
  50% { transform: translate(-2px, 1px); }
  75% { transform: translate(1px, 0); }
}

.list { list-style: none; display: grid; gap: var(--space-md); margin-bottom: var(--space-lg); }
.list li { display: grid; gap: var(--space-2xs); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); }
.list strong { color: var(--color-ink); }

.crew { list-style: none; display: grid; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.crew li { display: flex; flex-direction: column; }
.crew li > span { color: var(--color-muted); font-size: var(--text-sm); }

.mail {
  display: inline-block; margin: var(--space-md) 0 var(--space-2xs);
  font-size: var(--text-lg); font-weight: 700; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--color-accent);
}
.mail:hover { color: var(--color-accent); }

/* ---------- 실제 게임 화면: 스크롤한 만큼 한 장씩 (96x60 원본, 정수 배율) ---------- */
.scrub { display: block; min-height: 0; height: 260svh; padding: 0; }
.scrub__stick { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; }
.scrub__inner { display: grid; justify-items: center; gap: var(--space-md); text-align: center; position: relative; z-index: var(--z-text); }
.scrub .cut { margin-bottom: 0; }
.stage {
  --k: 3;
  width: calc(96px * var(--k)); height: calc(60px * var(--k));
  image-rendering: pixelated; border-radius: var(--radius-frame);
  background: var(--color-shadow);
  box-shadow: 0 0 0 var(--rule-hair) var(--color-rule), 0 30px 80px -30px var(--color-accent-deep);
}
:root:not(.js) .stage { background: var(--color-shadow) url("img/og.png") center / cover no-repeat; }
.note { color: var(--color-muted); font-size: var(--text-sm); }
@media (min-width: 40rem) { .stage { --k: 4; } }
@media (min-width: 64rem) and (min-height: 44rem) { .stage { --k: 6; } }
@media (min-width: 90rem) and (min-height: 56rem) { .stage { --k: 8; } }

/* ---------- 붉은 선과 달리는 주인공 ---------- */
.rush { position: absolute; left: 0; top: 0; z-index: var(--z-rush); display: none; overflow: visible; pointer-events: none; }
.rush line { stroke: var(--color-accent); stroke-width: 2; stroke-linecap: square; fill: none; }
:root.is-path .rush { display: block; }

/* 좁은 화면: 오른쪽 아래에 붙어서 달린다. 넓은 화면(is-path): 선을 따라 문서 위를 달린다 */
.hero {
  --k: 2;
  position: fixed; right: var(--space-md); bottom: var(--space-md); z-index: var(--z-hero);
  width: calc(32px * var(--k)); height: calc(24px * var(--k));
  image-rendering: pixelated; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-micro) linear;
}
:root.is-live .hero { opacity: 1; }
:root.is-live .hero.is-gone { opacity: 0; }
:root.is-path .hero { --k: 4; position: absolute; left: 0; top: 0; right: auto; bottom: auto; will-change: transform; }
@media (min-width: 80rem) { :root.is-path .hero { --k: 5; } }
@media (min-width: 100rem) { :root.is-path .hero { --k: 6; } }
:root:not(.js) .hero { display: none; }

/* ---------- 맨 아래 한 줄 ---------- */
.foot { border-top: var(--rule-hair) solid var(--color-rule); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-block: var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }

/* ---------- 좁은 화면: 한 줄 ---------- */
@media (max-width: 47.99rem) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .body, [data-side="right"] .body { grid-column: 1 / -1; }
  .sec { min-height: 70svh; padding-block: var(--space-2xl); }
  .sec--open { min-height: 100svh; }
  .px-48 { font-size: var(--px-36); line-height: var(--lh-36); }
  .px-36 { font-size: var(--px-24); line-height: var(--lh-24); }
  .foot .wrap { padding-bottom: calc(var(--space-lg) + 48px + var(--space-md)); }
}
@media (max-width: 22.5rem) {
  .mail { font-size: var(--text-md); }
}

/* ---------- 접근성 ---------- */
@media (prefers-reduced-motion: reduce) {
  .cut { color: var(--color-ink); }
  .cut.is-cut, .cut.is-cut::after { animation: none; }
  .btn:active, .chip__btn:active { transform: none; }
  .hero { transition: none; }
}
@media (prefers-contrast: more) {
  .soon { border-style: solid; }
}
