/* RB par RB — 발제 시각자료
   설계 기준: Figma "Desktop - 1" (1440px). 모든 좌표·크기는 1440 단위(u)로 적고,
   화면 폭에 비례해 확대·축소한다. 1000px 미만은 모바일 흐름 레이아웃으로 바뀐다. */

@font-face { font-family: "Gothic A1"; src: url("fonts/GothicA1-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gothic A1"; src: url("fonts/GothicA1-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Baskervville"; src: url("fonts/Baskervville-VF.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Baskervville"; src: url("fonts/Baskervville-Italic-VF.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url("fonts/ZillaSlab-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* 테마 색 — 열 순서: 1 중의성 · 2 몸 · 3 형상/움직임 · 4 대립 · 5 문장부호 · 6 전략 */
  --t-amphi: #adbcff;   /* 🔵 중의성 */
  --t-corps: #f5ff8b;   /* 🟡 몸 */
  --t-figure: #c1ffa6;  /* 🟢 형상/움직임 */
  --t-oppos: #ff8a7f;   /* 🔴 대립 */
  --t-ponct: #d293ea;   /* 🟣 문장부호 */
  --t-strat: #ffd79a;   /* 🟠 전략 */

  --ink: #000;
  --ref-left: #0012da;
  --ref-right: #24ffe9;
  --bg: #fff;

  --ko: "Gothic A1", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --fr: "Baskervville", "Baskerville", "Times New Roman", serif;
  --title: "Zilla Slab", "Rockwell", serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ko); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
:lang(fr) { font-family: var(--fr); }
a { color: inherit; }

/* ---------- 1440 단위 ---------- */
.page { width: 100%; max-width: 1920px; margin: 0 auto; container-type: inline-size; }
.page { --u: calc(100cqw / 1440); }

/* ---------- 타이틀 ---------- */
.hero { position: relative; height: calc(800 * var(--u)); }
.hero svg { position: absolute; left: calc(3 * var(--u)); top: calc(108 * var(--u)); width: calc(1437 * var(--u)); height: auto; overflow: visible; }
.hero .rb-text { font-family: var(--fr); fill: #000; white-space: pre; }
.ref.q, .ref[data-noline] { cursor: default; }
.hero h1 { position: absolute; left: 0; right: 0; top: calc(611 * var(--u)); margin: 0; text-align: center; font: 400 calc(32 * var(--u)) / 1.2 var(--title); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 캔버스: Figma 좌표 그대로 ---------- */
.canvas { position: relative; height: calc((var(--h) - 800) * var(--u)); }
.it {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc((var(--y) - 800) * var(--u));
  white-space: nowrap;
  margin: 0;
  transition: opacity .25s ease;
}

/* 텍스트 종류 */
.t24 { font: 400 calc(24 * var(--u)) / 1.25 var(--ko); }
.t24 :lang(fr), .t24:lang(fr) { font-family: var(--fr); }
.fr24 { font: 500 calc(24 * var(--u)) / 1.25 var(--fr); }
.q18 { font: 400 calc(18 * var(--u)) / 1.28 var(--fr); }
.cap { font: 600 calc(16 * var(--u)) / 1.31 var(--fr); }
.cap.ko { font-family: var(--ko); }
.ko16 { font: 400 calc(16 * var(--u)) / 1.25 var(--ko); white-space: pre; }
.t24 .m { font-weight: 500; }
.fr24.reg { font-weight: 400; }
.sub { font: 500 calc(12 * var(--u)) / 1.31 var(--fr); }
.ital { font: italic 400 calc(26 * var(--u)) / 1.3 var(--fr); }
.n { display: inline-block; width: calc(36 * var(--u)); }

/* 노트소 박스 */
.nm {
  width: calc(var(--w, 150) * var(--u));
  height: calc(var(--hh, 57) * var(--u));
  padding: calc(8 * var(--u)) calc(var(--px, 8) * var(--u));
  background: var(--c);
}
.nm b { display: block; font: 400 calc(24 * var(--u)) / 1.25 var(--ko); }
.nm span { display: block; font: 500 calc(12 * var(--u)) / 1.25 var(--fr); }
.nm.one b { font: 500 calc(24 * var(--u)) / 1.25 var(--fr); }
.th-ponct { --c: var(--t-ponct); } .th-strat { --c: var(--t-strat); } .th-figure { --c: var(--t-figure); }
.th-oppos { --c: var(--t-oppos); } .th-amphi { --c: var(--t-amphi); } .th-corps { --c: var(--t-corps); }

/* 이미지 */
.im { width: calc(var(--w) * var(--u)); height: calc(var(--hh) * var(--u)); object-fit: cover; display: block; }

/* 왼쪽 참조: 오른쪽 끝을 x=216에 맞추고 ▶는 x=224 */
.ref {
  left: auto;
  right: calc((1440 - 240) * var(--u));
  display: flex; align-items: flex-start; gap: calc(8 * var(--u));
  font: 400 calc(16 * var(--u)) / 1.31 var(--fr);
  color: var(--ref-left);
  text-align: right;
  cursor: pointer;
}
.ref .mk { font-family: var(--ko); width: calc(16 * var(--u)); text-align: left; flex: none; }
.ref.q { right: calc((1440 - 216) * var(--u)); }       /* 인용(¶)형: ¶가 제목 앞 */
.ref.q .mk { order: -1; width: auto; }
.ref.q.solo { right: calc((1440 - 221) * var(--u)); }   /* 제목 없이 ¶만 */

/* 오른쪽 참조 */
.rref {
  left: calc(1200 * var(--u));
  display: flex; align-items: flex-start; gap: calc(5 * var(--u));
  font: 400 calc(16 * var(--u)) / 1.25 var(--ko);
  color: var(--ref-right);
}
.rref a { text-decoration: underline; text-underline-position: from-font; white-space: pre; }
.rref .tx { white-space: pre; }
.rref .mk { width: calc(16 * var(--u)); flex: none; }

/* ---------- 강조(hover / 탭) ---------- */
.canvas.focus .it:not(.lit) { opacity: .12; }
.canvas.focus .it.lit { opacity: 1; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.arrows line { stroke-width: 1.2; }

/* ---------- 애너그램 시연 ---------- */
.anag {
  width: calc(var(--w) * var(--u)); height: calc(var(--hh) * var(--u));
  overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none;
  background: linear-gradient(to bottom, #eef3f5 0%, #e3e8ea 58%, #d9d9d9 58.5%, #d4d2cd 100%);
  outline-offset: 3px;
}
.anag .wl {   /* 물 위에 떠 있는 문장 */
  position: absolute; left: 0; right: 0; top: 14%;
  text-align: center; white-space: nowrap;
  font: 400 calc(var(--fs) * var(--u)) / 1.35 var(--fr);
  animation: bob 4.2s ease-in-out infinite;
}
.anag.upper .wl, .anag.upper .wd { text-transform: uppercase; letter-spacing: .06em; }
.anag .ch { display: inline-block; white-space: pre; transition: opacity 1.2s ease; }
.anag.sunk .ch.rest { opacity: .3; }
.anag .wd {   /* 바닥 자리 (보이지 않는 자리표) */
  position: absolute; left: 0; right: 0; bottom: 9%;
  text-align: center; white-space: nowrap; visibility: hidden;
  font: 500 calc(var(--fs) * 1.25 * var(--u)) / 1 var(--fr);
}
.anag .ch.mv { position: relative; z-index: 1; }
.anag .ch.mv.landed { font-weight: 500; }
.anag .hint { position: absolute; right: calc(8 * var(--u)); bottom: calc(6 * var(--u)); font: 400 calc(11 * var(--u)) / 1 var(--fr); color: #8a8a8a; transition: opacity .6s; }
.anag.sunk .hint { opacity: 0; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(calc(5 * var(--u))) rotate(.4deg); } }
.anag.sunk .wl { animation-play-state: paused; }

/* ---------- 푸터 ---------- */

/* ---------- 좁은 화면(1000px 미만): 흐름 레이아웃 ---------- */
@media (max-width: 999px) {
  .page { --u: 1px; }
  .hero { height: auto; padding: 24px 16px 40px; }
  .hero svg { position: static; width: 100%; }
  .hero h1 { position: static; font-size: 22px; margin-top: 12px; }

  .canvas { height: auto; padding: 0 16px 40px; }
  .it { position: static; white-space: normal; margin-top: 14px; }
  /* 열 위치는 들여쓰기로 남긴다 */
  .it[data-col] { margin-left: calc((var(--col) - 1) * 4.5vw); }
  .it.gap { margin-top: 56px; }

  .t24 { font-size: 19px; }
  .fr24 { font-size: 19px; }
  .q18 { font-size: 17px; border-left: 2px solid var(--ref-left); padding-left: 10px; }
  .cap { font-size: 13px; margin-top: 4px; }
  .sub { font-size: 12px; margin-top: 2px; }
  .ital { font-size: 22px; }
  .n { width: 26px; }

  .nm { width: auto; height: auto; display: inline-block; padding: 6px 12px 7px; border-radius: 0; }
  .nm b { font-size: 19px; }
  .nm span { font-size: 12px; }

  .im { width: min(100%, calc(var(--w) * 1px)); height: auto; aspect-ratio: var(--w) / var(--hh); }
  .im[data-col], .anag[data-col] { margin-left: 0; }

  .ref, .ref.q, .ref.q.solo { right: auto; justify-content: flex-start; text-align: left; font-size: 13px; margin-top: 22px; gap: 6px; }
  .ref .mk { order: -1; width: auto; }
  .ref br { display: none; }
  .ref .pg::before { content: " "; }
  .rref { font-size: 13px; margin-left: 0 !important; }
  .rref a, .rref .tx { white-space: normal; }
  .ko16 { font-size: 14px; white-space: normal; margin-top: 4px; color: #333; }
  .anag { width: min(100%, calc(var(--w) * 1.15px)); height: calc(var(--hh) * 1.15px); position: relative; left: auto; top: auto; --u: 1.15px; }
  .rref br { display: none; }
  .arrows { display: none; }
  .numout { display: none; }
  .canvas.focus .it:not(.lit) { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .it { transition: none; }
}
