/* 좋아요로 이어진 길 · 스타일
   여백 규칙: .wrap 계열과 클래스를 공유하는 요소에는 padding 단축 속성을 쓰지 않는다.
   좌우는 padding-inline, 세로는 padding-block 으로 축을 나눈다 (known-issues.md #1). */

:root {
  --bg: #0f1a1d;
  --bg2: #142427;
  --ink: #e8eee7;
  --dim: #a9b8b4;
  --faint: #6f817d;
  --accent: #bfe5cf;
  --line: #34494a;
  --paper: #e3e8de;
  --paper-ink: #22332e;
  --mem: #f0d7a1;
  --sim: #9fd0c9;
  --book: #c9b8ec;
  --focus: #f5ce89;
  --gutter: max(20px, 4vw);
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Roboto Mono", monospace;
  --holo: #8fdcff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.85;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-underline-offset: 4px; }
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: #9acaac; color: #12231d; }

.wrap { max-width: 920px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: calc(1040px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow { font-size: 12px; letter-spacing: .18em; color: var(--accent); margin: 0 0 14px; }
h1, h2, h3 { font-weight: 500; }

/* 태그: 색만이 아니라 글자로 구분한다 */
.tag {
  display: inline-block; font-size: 12px; line-height: 1; letter-spacing: .04em;
  padding-block: 5px; padding-inline: 8px; border-radius: 3px; border: 1px solid currentColor;
  white-space: nowrap;
}
.tag-mem { color: var(--mem); }
.tag-sim { color: var(--sim); }
.tag-book { color: var(--book); }

/* 버튼 */
.btn, .walk, .chip, .opt, .linkish {
  font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding-inline: 20px; border: 1px solid var(--accent); border-radius: 3px;
  color: var(--accent); background: transparent; text-decoration: none; font-size: 15px;
  transition: background .2s;
}
.btn:hover { background: #bfe5cf18; }
.btn.primary { background: var(--accent); color: #10211b; }
.btn.primary:hover { background: #d4f0df; }
.chip {
  min-height: 36px; padding-inline: 12px; border-radius: 18px; font-size: 13px;
  border: 1px solid #ffffff33; background: #0c1517cc; color: var(--dim);
}
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 4px; color: var(--dim); font-size: 14px; }

/* 헤더 · 히어로 */
.top {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 22px; font-size: 12px; letter-spacing: .08em; color: var(--faint);
  max-width: 1240px;
}
/* 키아트는 ::before, 아래로 잦아드는 그라데이션은 ::after 에 따로 둔다 (키아트만 움직이게) */
.hero-art {
  position: relative; overflow: hidden;
  height: clamp(240px, 48vh, 500px); display: flex; align-items: flex-end;
}
.hero-art::before, .hero-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hero-art::before {
  background: url(assets/keyart.webp) right 30% / cover no-repeat;
  transform: translateY(var(--sy, 0px)); will-change: transform;
}
.hero-art::after { background: linear-gradient(0deg, var(--bg), #0f1a1d00 45%); }
.hero-art .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 8px; }
.hero { padding-top: 3vh; padding-bottom: 8vh; }
.hero-art .logo { display: block; width: min(280px, 62%); height: auto; opacity: .92; }
/* 글 사이의 공식 스크린샷 */
.shot { margin-inline: 0; margin-block: 40px; }
.shot img { display: block; width: 100%; height: auto; }
/* GIF 대신 쓰는 영상: 다른 사진과 같은 폭, 아래에 설명 */
.shot-clip video { cursor: pointer; display: block; width: 100%; height: auto; background: #0b1214; }
.shot-clip figcaption { font-size: 14.5px; line-height: 1.7; color: var(--dim); margin-top: 12px; }
.hero h1 {
  font-size: clamp(40px, 10.5vw, 96px); line-height: 1.15; letter-spacing: -.02em;
  margin: 0 0 24px; font-weight: 400;
}
.nw { white-space: nowrap; }
.lede { font-size: 18px; color: var(--dim); margin: 0 0 40px; }
.world-intro { margin-bottom: 28px; }
.world-intro p { margin: 0 0 8px; font-size: 16.5px; }
.disclose {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 4px;
  padding-block: 16px; padding-inline: 18px; margin-bottom: 30px; font-size: 14.5px; color: var(--dim);
}
.disclose p { margin: 0; }
.disclose strong { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* 체험 */
.play { padding-bottom: 28px; scroll-margin-top: 8px; }
.stage {
  position: relative; max-width: 1040px; margin-inline: auto;
  height: min(64vh, 580px); min-height: 400px;
  background: #1a2a2b; overflow: hidden; border-block: 1px solid var(--line);
  user-select: none; -webkit-user-select: none;
}
/* 넓은 화면에서는 체험 창도 좌우 여백을 두고 글과 같은 축에 선다. 폰에서는 화면을 꽉 채운다 */
@media (min-width: 641px) { .stage { width: calc(100% - 2 * var(--gutter)); border: 1px solid var(--line); border-radius: 4px; } }
#world { display: block; width: 100%; height: 100%; }
.hud {
  position: absolute; inset-inline: 12px; top: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.objective {
  margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: linear-gradient(90deg, #0a1214d9, #0a121499); border-top: 1px solid #ffffff55;
  padding-block: 7px; padding-inline: 11px; max-width: 62%;
  display: flex; flex-direction: column;
}
.objective .sub { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--dim); }
.objective .sub:empty { display: none; }
/* 받은 좋아요: 하늘색 홀로그램 톤 */
.likes {
  margin: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding-block: 6px; padding-inline: 10px; border-radius: 3px;
  background: #0c1517cc; border: 1px solid #8fdcff55; color: #d6f5ff; font-size: 13px;
}
.likes svg { width: 16px; height: 16px; fill: #8fdcff; }
.likes b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.likes.pulse { animation: likepulse .7s ease-out; }
@keyframes likepulse {
  0% { box-shadow: 0 0 0 0 #8fdcff99; background: #8fdcff38; }
  100% { box-shadow: 0 0 0 12px #8fdcff00; background: #0c1517cc; }
}
.toasts {
  position: absolute; left: 12px; top: 64px; width: min(300px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.45;
  padding-block: 7px; padding-inline: 10px;
  background: linear-gradient(90deg, #0a1214e6, #0a121466); color: #d6f5ff;
  animation: toastin .35s ease-out; transition: opacity .5s;
}
.toast svg { flex: none; width: 16px; height: 16px; fill: #8fdcff; }
.toast.out { opacity: 0; }
@keyframes toastin { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.caption {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0;
  width: max-content; max-width: min(600px, calc(100% - 24px));
  font-size: 15px; line-height: 1.6; color: #f1f5ef; text-align: center; white-space: pre-line;
  background: #0a1214b3; padding-block: 6px; padding-inline: 14px;
  transition: opacity .5s;
}
.caption:empty { opacity: 0; }

.panel {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  max-width: 520px; max-height: calc(100% - 110px); overflow: auto;
  background: #0a1214eb; border-top: 2px solid #ffffffb3;
  padding-block: 14px 16px; padding-inline: 18px; font-size: 15px; line-height: 1.7;
  box-shadow: 0 10px 30px #0008;
}
.panel[hidden] { display: none; }
.panel:focus { outline: 2px solid #ffffff30; outline-offset: 0; }
.panel h3 { margin: 6px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.panel .tag { border: 0; padding: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; }
/* 배송 의뢰 · 결과: 원작의 의뢰서처럼 항목을 가는 선으로 나눈 표 */
.order-no { display: inline-block; margin-left: 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; color: var(--faint); }
.rows { margin: 4px 0 12px; display: grid; grid-template-columns: auto 1fr; font-size: 14px; }
.rows dt, .rows dd { margin: 0; padding-block: 6px; border-bottom: 1px solid #ffffff1a; }
.rows dt { color: var(--faint); padding-right: 18px; }
.rows .num { font-family: var(--mono); }
.rows-h { grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 22px; border-block: 1px solid #ffffff1a; padding-block: 6px; }
.rows-h dt, .rows-h dd { border: 0; padding-block: 0; }
.rows-h dt { font-size: 12px; }
.panel .goal { font-size: 16px; color: var(--ink); }
.panel p { margin: 0 0 10px; }
.panel .say { color: var(--ink); font-size: 16px; }
.panel .who { color: var(--faint); font-size: 13px; margin-bottom: 4px; }
.panel .note { font-size: 13px; color: var(--faint); }
.opts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.opt {
  touch-action: manipulation;
  flex: 1 1 180px; text-align: left; min-height: 48px;
  padding-block: 10px; padding-inline: 14px; border-radius: 2px;
  border: 1px solid #ffffff40; background: #ffffff08; color: var(--ink); font-size: 15px; line-height: 1.5;
}
.opt:hover { background: #ffffff14; }
.opt small { display: block; color: var(--dim); font-size: 13px; margin-top: 3px; }
.opt.go { border-color: var(--accent); color: var(--accent); }
.opt:disabled { opacity: .5; cursor: default; }
.opt.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-color: #8fdcff99; background: #8fdcff14; color: #d6f5ff;
}
.opt.like-btn svg { width: 20px; height: 20px; fill: #8fdcff; }
.opt.like-btn:active { background: #8fdcff38; }
.panel .sent { color: #d6f5ff; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.panel .sent:empty { display: none; }
.like-line { display: flex; align-items: center; gap: 8px; color: #d6f5ff; }
.like-line svg { flex: none; width: 20px; height: 20px; fill: #8fdcff; }
.like-line.big { font-size: 17px; }
.like-line b { font-variant-numeric: tabular-nums; }

.dayfade {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #0b1214; color: var(--dim); letter-spacing: .3em; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .9s;
}
.dayfade.on { opacity: 1; }

.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 14px;
}
.walk {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding-inline: 26px; border-radius: 30px; font-size: 17px;
  border: 1px solid var(--accent); background: #bfe5cf1a; color: var(--accent);
  touch-action: none; -webkit-touch-callout: none;
}
.walk svg { width: 20px; height: 20px; fill: currentColor; }
.walk.active { background: #bfe5cf38; }
.walk:disabled { opacity: .45; cursor: default; }
.hint { margin: 0; font-size: 13px; color: var(--faint); flex-basis: 100%; }
.play-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 14px; font-size: 14px; color: var(--dim); }

/* 글: 체험과 같은 어두운 바탕을 잇는다. 색 줄 대신 번호와 여백으로 나눈다 */
.essay { background: var(--bg); color: var(--ink); border-top: 1px solid var(--line); counter-reset: mem; }
.essay .wrap { max-width: 860px; }
.essay .eyebrow { color: var(--accent); }
.essay a { color: var(--accent); }
.block { padding-top: 96px; padding-bottom: 64px; }
.essay h2 { font-size: clamp(27px, 4.4vw, 40px); line-height: 1.4; margin: 0 0 28px; letter-spacing: -.02em; font-weight: 600; }
.essay p { font-size: 17px; margin: 0 0 18px; color: #dfe7e2; }
.memory { margin-block: 56px; counter-increment: mem; }
.memory::before {
  content: counter(mem, decimal-leading-zero); display: block;
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--mem); margin-bottom: 6px;
}
.memory .tag { display: none; }
.memory h3 { font-size: 20px; margin: 0 0 10px; font-weight: 600; }
.memory .fact { color: var(--ink); }
.lens { padding-top: 24px; }
.block + .lens { border-top: 0; }
.lens > .tag { display: none; }
.abstract { margin: 0; }
.abstract blockquote { margin: 0; }
.abstract blockquote p { font-size: clamp(20px, 3vw, 24px); line-height: 1.6; color: var(--ink); font-weight: 500; margin-bottom: 14px; }
.abstract .orig { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 15px; font-weight: 400; color: var(--dim); }
.abstract figcaption { font-size: 13.5px; color: var(--faint); }
.q-quote { margin-block: 8px 40px; }
.question .q-bridge { color: var(--ink); font-size: 17px; margin-bottom: 8px; }
.q-quote blockquote p { font-size: clamp(18px, 2.4vw, 21px) !important; }
.q-quote .orig { font-style: normal; color: var(--ink); line-height: 1.55; }   /* 원문을 위에 크게 */
.q-quote .tr { font-size: 16px !important; font-weight: 400; color: var(--dim); }   /* 번역은 아래에 작게 */

.question {
  background: radial-gradient(ellipse at 50% 40%, #2a433b, var(--bg) 75%); color: var(--ink);
  text-align: center; padding-top: 110px; padding-bottom: 110px;
}
.question .eyebrow { color: var(--accent); }
.question h2 { font-size: clamp(25px, 5.4vw, 48px); margin-block: 18px 32px; max-width: 15em; margin-inline: auto; }
.question p { color: var(--dim); }
.question .aside { color: #8fa29d; }

.foot { padding-top: 50px; padding-bottom: 60px; font-size: 13.5px; color: var(--dim); }
.foot h2 { font-size: 15px; color: var(--ink); margin: 0 0 12px; }
.foot ul { padding-left: 1.1em; margin: 0 0 18px; }
.foot li { margin-bottom: 8px; }
.foot .small { font-size: 12.5px; color: var(--faint); }

@media (max-width: 640px) {
  .stage { height: min(74svh, 640px); min-height: 440px; }
  .caption { font-size: 14.5px; bottom: 12px; }
  .objective { max-width: 58%; font-size: 13px; }
  .likes span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* 좁은 폭: 글자는 숨기되 화면 낭독기에는 남긴다 */
  .panel {
    left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - 96px);
    padding-block: 12px; padding-inline: 14px; font-size: 14px; line-height: 1.6;
  }
  .panel h3 { font-size: 16px; margin-block: 4px; }
  .panel p { margin-bottom: 8px; }
  .opts { gap: 8px; margin-top: 8px; }
  .opt { min-height: 44px; padding-block: 8px; font-size: 14.5px; }
  .walk { flex: 1 1 auto; justify-content: center; }
  .block { padding-top: 64px; padding-bottom: 40px; }
  .question { padding-top: 80px; padding-bottom: 80px; }
}

/* ---------- 연출 ----------
   html.js 일 때만 건다 (스크립트가 없으면 모든 내용이 그냥 보인다). 동작 줄이기 설정에서는 아래 미디어 쿼리가 모두 끈다. */

/* 첫 화면: 검은 화면에서 키아트가 천천히 가라앉고, 로고 · 제목 · 소개가 차례로 드러난다 (원작 타이틀의 느린 페이드) */
@keyframes artIn { from { opacity: 0; scale: 1.07; } to { opacity: 1; scale: 1; } }   /* transform 은 스크롤 시차가 쓰므로 scale 속성으로 */
@keyframes logoIn { from { opacity: 0; filter: blur(8px); } to { opacity: .92; filter: blur(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.js .hero-art::before { animation: artIn 1.9s cubic-bezier(.2, .6, .2, 1) both; }
.js .hero-art .logo { animation: logoIn 1.2s .45s ease-out both; }
.js .hero h1 { animation: riseIn .9s .75s cubic-bezier(.2, .6, .2, 1) both; }
.js .hero .world-intro { animation: riseIn .9s .95s cubic-bezier(.2, .6, .2, 1) both; }
.js .hero .disclose { animation: riseIn .9s 1.1s cubic-bezier(.2, .6, .2, 1) both; }
.js .hero .hero-actions { animation: riseIn .9s 1.25s cubic-bezier(.2, .6, .2, 1) both; }
.js .top { animation: fadeIn 1s 1.4s both; }

/* 화면 전환: 체험 창은 가운데서 양옆으로 열리고, 글은 아래에서 떠오른다 */
@keyframes stageOpen {
  0% { clip-path: inset(49.5% 50% 49.5% 50%); }
  35% { clip-path: inset(49.5% 0 49.5% 0); }
  100% { clip-path: inset(0 0 0 0); }
}
@keyframes secIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.play.entering .stage { animation: stageOpen 1s cubic-bezier(.6, 0, .2, 1) both; }
.play.entering .hud, .play.entering .panel { animation: fadeIn .6s .85s both; }
.play.entering .controls, .play.entering .play-foot { animation: riseIn .7s .6s both; }
.essay.entering .block > :first-child { animation: secIn .9s cubic-bezier(.2, .6, .2, 1) both; }

/* 다음 날: 글자 간격이 좁혀지며 떠오르고, 아래 가는 선이 그어진다 */
.dayfade span { display: grid; justify-items: center; gap: 14px; transition: letter-spacing 1.6s ease-out, opacity 1s; letter-spacing: .6em; opacity: 0; }
.dayfade span::after { content: ""; width: 120px; height: 1px; background: var(--dim); transform: scaleX(0); transition: transform 1.2s .2s ease-out; }
.dayfade.on span { letter-spacing: .3em; opacity: 1; }
.dayfade.on span::after { transform: scaleX(1); }

/* 스크롤: 글의 문단 · 사진이 화면에 들어오면 떠오른다. 클래스는 app.js 가 IntersectionObserver 가 있을 때만 붙인다 */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .9s ease-out, transform .9s cubic-bezier(.2, .6, .2, 1); }
.rv.in { opacity: 1; transform: none; }
.shot.rv { transform: none; }
.shot.rv img, .shot.rv video { clip-path: inset(6% 6% 6% 6%); transform: scale(1.04); transition: clip-path 1.2s cubic-bezier(.2, .6, .2, 1), transform 1.6s cubic-bezier(.2, .6, .2, 1); }
.shot.rv.in img, .shot.rv.in video { clip-path: inset(0 0 0 0); transform: none; }

/* 글 읽는 위치: 화면 맨 위의 가는 하늘색 선 (원작 지도의 경로선처럼) */
.progress {
  position: fixed; left: 0; top: 0; z-index: 20; height: 2px; width: 100%;
  background: var(--holo); box-shadow: 0 0 8px #8fdcff88;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0)); opacity: 0; transition: opacity .4s; pointer-events: none;
}
.progress.on { opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  .rv, .shot.rv img, .shot.rv video { opacity: 1; transform: none; clip-path: none; }
  .hero-art::before { transform: none; }
  .progress { display: none; }
}

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

/* 인쇄 · PDF 대체본: 체험은 빼고 소개 · 글 · 참고 자료만, 밝은 종이에 어두운 글자로 */
.shot img.print-only, .print-note { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  :root { color-scheme: light; --ink: #1a1a1a; --dim: #444; --faint: #666; --accent: #1f5f4a; --mem: #8a5a00; }
  html, body { background: #fff !important; color: #1a1a1a; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv, .shot.rv img, .shot.rv video { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .top, .play, .hero-actions, .progress, .shot-clip video, .disclose { display: none !important; }
  .print-note { display: block; font-size: 10pt; color: #444; margin: 0 0 6mm; }
  .essay[hidden], .foot[hidden] { display: block !important; }
  .shot img.print-only { display: block; width: 100%; height: auto; }
  .hero-art { height: 60mm; }
  .hero-art::before { opacity: 1 !important; scale: 1 !important; }
  .hero { padding-bottom: 0; }
  .hero h1 { font-size: 30pt; }
  .disclose { background: none; border-color: #ccc; color: #444; }
  .essay, .question { background: none !important; border: 0; color: #1a1a1a; }
  .essay p, .question p, .abstract blockquote p { color: #1a1a1a !important; }
  .block { padding-top: 12mm; padding-bottom: 6mm; }
  .question { padding-top: 10mm; padding-bottom: 10mm; break-inside: avoid; }
  .memory, .shot, .q-quote { break-inside: avoid; }
  .foot a { color: #1f5f4a; }
}
