/* word — 봇트레이드 단어 · BotTrade WORD (md/word-spec.md 7절)
   2026-11 새 옷: OKLCH 색 · 밝음/어둠 자동 · 유동 글자 크기 · 컨테이너 쿼리 · :has() · 캐스케이드 레이어 · 뷰 전환 · 스크롤 연동 움직임.
   절대 규칙: 글은 크고 또렷하게, 잘리거나 숨지 않게. 강세는 굵기가 아니라 글자 크기(강세 = 제 크기, 약한 소리 = 작게). 그림은 선 그림 그대로.
   모든 규칙은 이 파일(word 하위 도메인)만 — 공용 조각(_site_theme 등)은 맨 아래 「공용 덮기」에서 body.wx 로만 고친다. */
@layer wx.tokens, wx.base, wx.parts, wx.pages, wx.motion;

/* ───────── 색·크기 토큰 ───────── */
@layer wx.tokens {
  :root {
    color-scheme: light dark;
    --bg: oklch(97.6% .012 95);
    --bg-2: oklch(94.5% .02 95);
    --card: oklch(99.6% .004 95);
    --text: oklch(23% .03 275);
    --muted: oklch(46% .025 275);
    --line: oklch(88% .015 275);
    --border: var(--line);
    --accent: oklch(50% .17 268);
    --en: oklch(43% .14 255);
    --ko: oklch(47% .14 32);
    --rt: oklch(42% .035 275);
    --stress: oklch(56% .2 36);
    --ok: oklch(52% .14 155);
    --on: oklch(94% .08 95);
    --warn: oklch(50% .19 25);
    --note: oklch(96% .05 90);
    --tile-l: 93%; --tile-c: .055;
    --sh-1: 0 1px 2px oklch(23% .03 275 / .06), 0 2px 8px -2px oklch(23% .03 275 / .08);
    --sh-2: 0 2px 4px oklch(23% .03 275 / .05), 0 8px 20px -8px oklch(30% .06 275 / .18);
    --sh: var(--sh-1);
    --r-s: 10px; --r-m: 16px; --r-l: 24px;
    --fs-body: clamp(1.0625rem, .98rem + .35vw, 1.1875rem);
    --rt-size: .62em;   /* 발음 줄 기본(강세 글자 = 이 크기 그대로) */
    --ease: cubic-bezier(.2, .7, .2, 1);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: oklch(17.5% .02 275);
      --bg-2: oklch(21% .025 275);
      --card: oklch(22.5% .022 275);
      --text: oklch(95% .01 95);
      --muted: oklch(76% .02 275);
      --line: oklch(34% .025 275);
      --accent: oklch(78% .12 268);
      --en: oklch(82% .1 245);
      --ko: oklch(83% .09 45);
      --rt: oklch(82% .03 275);
      --stress: oklch(78% .15 52);
      --ok: oklch(76% .13 155);
      --on: oklch(36% .07 85);
      --warn: oklch(74% .15 25);
      --note: oklch(28% .045 85);
      --tile-l: 34%; --tile-c: .06;
      --sh-1: 0 1px 2px oklch(0% 0 0 / .3), 0 4px 14px -4px oklch(0% 0 0 / .4);
      --sh-2: 0 2px 6px oklch(0% 0 0 / .35), 0 8px 20px -8px oklch(0% 0 0 / .55);
    }
  }
}

/* ───────── 바탕·글 ───────── */
@layer wx.base {
  body.wx {
    background:
      radial-gradient(120% 60% at 0% 0%, color-mix(in oklch, var(--accent) 9%, transparent), transparent 60%),
      radial-gradient(90% 50% at 100% 0%, color-mix(in oklch, var(--stress) 7%, transparent), transparent 60%),
      var(--bg);
    background-attachment: fixed;
    color: var(--text); margin: 0;
    font-size: var(--fs-body); line-height: 1.65;
    font-feature-settings: "ss06", "tnum" 0;
    word-break: var(--xn-wb, keep-all); overflow-wrap: anywhere;
    accent-color: var(--accent);
  }
  .wx-wrap { max-width: 1040px; margin: 0 auto; padding: 18px clamp(14px, 4vw, 28px) 56px; }
  a { color: var(--accent); text-underline-offset: 3px; }
  :focus-visible { outline: 3px solid color-mix(in oklch, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
  .wx-crumb { font-size: .92rem; display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; color: var(--muted); }
  .wx-crumb a { color: var(--accent); text-decoration: none; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: color-mix(in oklch, var(--accent) 10%, transparent); }
  .wx-h1 { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.75rem); line-height: 1.9; letter-spacing: -.02em; margin: 12px 0 8px; text-wrap: balance; }
  .wx-h1 small { font-size: .5em; background: var(--text); color: var(--bg); padding: 3px 10px; vertical-align: middle; border-radius: 999px; }
  .wx-h2 { font-size: clamp(1.2rem, 1.05rem + .8vw, 1.5rem); line-height: 2.2; margin: 36px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; text-wrap: balance; }
  .wx-h2::before { content: ""; align-self: center; width: 6px; height: 1.1em; border-radius: 3px; background: linear-gradient(var(--accent), var(--stress)); }
  .wx-h2 a { text-decoration: none; }
  .wx-h2 small { font-size: .75rem; color: var(--muted); font-weight: 600; }
  .wx-h3 { font-size: 1.1rem; margin: 18px 0 6px; color: var(--muted); }
  .wx-lead, .wx-how, .wx-goal, .wx-about p { line-height: 1.75; color: var(--muted); text-wrap: pretty; }
  .wx-about a { color: var(--accent); font-weight: 700; }
  .wx-src { font-size: .9rem; }
  .wx-sl { opacity: .45; }
  canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; width: 40px; height: 40px; vertical-align: middle; }
}

/* ───────── 부품 ───────── */
@layer wx.parts {
  /* 단추 — 알약 모양, 누르면 살짝 눌림 */
  .wx-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
  .wx-bar button, .wx-say, .wx-known {
    font: inherit; font-size: .95rem; font-weight: 700; line-height: 1.3;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap;
    border: 1.5px solid var(--line); background: var(--card); color: var(--text);
    box-shadow: var(--sh-1); border-radius: 999px; padding: 8px 16px; cursor: pointer; min-height: 44px;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease); }
  .wx-bar button:hover, .wx-say:hover, .wx-known:hover { border-color: color-mix(in oklch, var(--accent) 55%, var(--line)); box-shadow: var(--sh-2); }
  .wx-bar button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
  .wx-known[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: oklch(99% 0 0); }
  #wxPlay { background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 55%, var(--stress))); color: oklch(99% 0 0); border-color: transparent; }
  #wxPlay.on { background: var(--stress); }
  @media (prefers-color-scheme: dark) { #wxPlay, .wx-known[aria-pressed="true"] { color: oklch(18% .02 275); } }
  button:active, .wx-say:active { transform: scale(.97); }
  .wx-en, .wx-ko, .wx-ex { font: inherit; background: none; border: 0; padding: 2px 6px; cursor: pointer; color: inherit; text-align: left; border-radius: 10px; transition: background-color .15s; }
  .wx-en:hover, .wx-ko:hover, .wx-ex:hover { background: var(--on); }

  /* 발음 줄(md/bible-spec.md 1-1 표지) — 강세는 글자 크기로만: a·b(1강세) = 제 크기, s(2강세) 조금 작게,
     표지 없는 소리 더 작게, r 약모음·f 기능어 작게, e 끼운 '으'·c 아주 작게. 굵기는 모두 같다. */
  ruby { ruby-position: over; }
  rt { font-size: var(--rt-size); font-weight: 600; color: var(--rt); letter-spacing: 0; line-height: 1.15; }
  rt i, .wx-ex small i { font-style: normal; font-weight: inherit; }
  rt i { font-size: .82em; }
  rt i.a, rt i.b { font-size: 1em; color: var(--stress); }
  rt i.s { font-size: .92em; }
  rt i.r { font-size: .74em; opacity: .85; }
  rt i.f { font-size: .78em; opacity: .75; }
  rt i.e, rt i.c { font-size: .64em; opacity: .7; }
  .wx-ex small i { font-size: .84em; }
  .wx-ex small i.a, .wx-ex small i.b { font-size: 1em; color: var(--stress); }
  .wx-ex small i.e { font-size: .66em; opacity: .7; }

  /* 모든 글의 발음 ruby(md/word-spec.md 7절) — 영어 위 한글, 한국어 위 알파벳. ruby.w 는 누르면 소리·풍선 */
  .wx-r { line-height: 2.55; }
  p.wx-r { margin: 6px 0; }
  ruby.w { cursor: pointer; border-radius: 6px; padding: 0 2px; transition: background-color .15s; }
  ruby.w:hover, ruby.w.on { background: var(--on); }
  ruby.w rt { font-size: var(--rt-size); font-weight: 600; color: var(--rt); }
  .wx-h1 ruby.w rt, .wx-h2 ruby.w rt { font-size: .5em; }

  /* 안내 상자 */
  .wx-note { background: var(--note); border: 1.5px solid color-mix(in oklch, var(--stress) 30%, var(--line)); border-radius: var(--r-m); padding: 12px 16px; line-height: 1.7; }
  .wx-kr { font-size: .85rem; color: var(--ko); background: color-mix(in oklch, var(--ko) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
  .wx-pos { font-size: .78rem; font-weight: 700; color: var(--muted); background: color-mix(in oklch, var(--muted) 12%, transparent); padding: 2px 10px; border-radius: 999px; }
  .wx-more { color: var(--muted); font-size: .9rem; }

  /* 낱말 풍선 */
  .wx-pop { position: absolute; z-index: 50; max-width: min(340px, calc(100vw - 24px)); background: var(--card);
    border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-2); padding: 12px 14px; font-size: 1rem; line-height: 1.6; }
  .wx-pop b { font-size: 1.3rem; }
  .wx-pop .pr { color: var(--stress); font-weight: 600; font-size: 1.05rem; }
  .wx-pop .m { margin-top: 4px; }
  .wx-pop .src { font-size: .78rem; color: var(--muted); margin-top: 4px; }

  /* 철자 ↔ 소리(scripts/spell_align.py): s 소리 안 남 · c 한국어에 없는 소리 · t 소리 바뀜 — 흑백 책에서도 읽히게 밑줄로 */
  .sp-s { opacity: .38; }
  .sp-c { text-decoration: underline 2px; text-underline-offset: 4px; }
  .sp-t { color: var(--stress); text-decoration: underline wavy 1.5px; text-underline-offset: 4px; }
  .sp-x { text-decoration: underline dotted 2px; text-underline-offset: 4px; }
  .wx-snd { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }

  /* 품사 칸(그림 없는 낱말) — 색은 OKLCH 색상각 하나로, 어둠에서도 같은 무리 색 */
  .wx-tile { --h: 95; width: 84px; height: 84px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: oklch(var(--tile-l) var(--tile-c) var(--h)); border: 1.5px solid oklch(from oklch(var(--tile-l) var(--tile-c) var(--h)) calc(l - .12) c h); }
  .wx-tile b { font-size: 2.3rem; line-height: 1; text-transform: lowercase; }
  .wx-tile small { font-size: .62rem; font-weight: 700; text-align: center; line-height: 1.15; margin-top: 4px; color: var(--muted); }
  .wx-tile-mini { --h: 95; display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: middle; background: oklch(var(--tile-l) calc(var(--tile-c) * 2) var(--h)); }
  .pos-n { --h: 255; } .pos-v { --h: 25; } .pos-a { --h: 145; } .pos-ad { --h: 80; }
  .pos-p, .pos-c, .pos-d, .pos-part, .pos-aux { --h: 300; } .pos-pr { --h: 200; } .pos-ph { --h: 340; } .pos-i, .pos-num { --h: 95; }
  .pos-end { --h: 95; }

  /* 비속어·민감어 */
  .wx-warn { display: inline-block; font-size: .78rem; font-weight: 800; border: 1.5px solid var(--warn); color: var(--warn); background: color-mix(in oklch, var(--warn) 10%, transparent); padding: 2px 10px; border-radius: 999px; }
  .wx-warn-big { display: block; font-size: 1rem; line-height: 1.65; padding: 10px 14px; margin: 8px 0; border-radius: var(--r-m); }
  .wx-mature > summary { cursor: pointer; font-weight: 800; color: var(--warn); border: 1.5px solid var(--warn); background: color-mix(in oklch, var(--warn) 10%, transparent); padding: 10px 14px; border-radius: var(--r-m); min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
  .wx-mature[open] > summary { margin-bottom: 10px; }
  .wx-gate { max-width: 640px; margin: 24px auto; background: var(--card); border: 1.5px solid var(--warn); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 18px 20px; line-height: 1.75; }

  /* 발음 읽는 법 상자 — 열 때 높이가 부드럽게(지원 브라우저만) */
  .wx-howto { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 4px 14px; max-width: 680px; flex: 1 1 300px; }
  .wx-howto > summary { position: relative; cursor: pointer; font-weight: 800; min-height: 44px; display: block; padding: 4px 30px 4px 0; line-height: 2.4; list-style: none; }
  .wx-howto > summary::-webkit-details-marker { display: none; }
  .wx-howto > summary::after { content: "＋"; position: absolute; right: 2px; top: 50%; translate: 0 -50%; color: var(--accent); font-weight: 700; transition: rotate .25s var(--ease); }
  .wx-howto[open] > summary::after { rotate: 45deg; }
  .wx-howto ul { margin: 4px 0 10px; padding-left: 20px; line-height: 2.5; }

  .wx-credit { font-size: .8rem; color: var(--muted); text-align: center; margin: 28px auto 8px; max-width: 1040px; padding: 0 14px; }
  .wx-credit a { color: inherit; }
}

/* ───────── 쪽별 배치 ───────── */
@layer wx.pages {
  /* 대문 히어로 */
  .wx-hero { position: relative; padding: clamp(16px, 4vw, 32px); margin: 8px 0 18px; border-radius: var(--r-l);
    background:
      radial-gradient(80% 120% at 100% 0%, color-mix(in oklch, var(--stress) 14%, transparent), transparent 60%),
      radial-gradient(70% 100% at 0% 100%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 60%),
      var(--card);
    border: 1px solid var(--line); box-shadow: var(--sh-2); overflow: clip; }
  .wx-hero .wx-h1 { margin-top: 4px; }
  .wx-hero-pix { display: flex; gap: 10px; flex-wrap: wrap; }
  .wx-hero-pix .px { width: 44px; height: 44px; padding: 4px; border-radius: 12px; background: var(--bg-2); }
  .wx-brand small { display: block; font-size: .46em; background: none; color: var(--muted); padding: 0; margin-top: 6px; line-height: 2.4; font-weight: 700; }
  .wx-lead[lang="en"], .wx-about p[lang="en"] { border-left: 3px solid color-mix(in oklch, var(--accent) 35%, var(--line)); padding-left: 12px; }
  .wx-how[lang="en"] { margin-top: -6px; }

  .wx-top { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 8px 0 14px; }
  .wx-start-go { color: var(--accent); font-weight: 800; text-decoration: none; min-height: 44px; display: inline-block; line-height: 2.4; }
  a.wx-go { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
  .wx-start-big { display: inline-block; border-radius: 22px; background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 50%, var(--stress))); color: oklch(99% 0 0) !important; border: 0; padding: 6px 20px; font-size: 1.05rem; line-height: 2.3; }
  .wx-start-big rt { color: oklch(99% 0 0 / .85); }
  .wx-start-big rt i.a, .wx-start-big rt i.b { color: oklch(96% .06 85); }
  @media (prefers-color-scheme: dark) { .wx-start-big { color: oklch(18% .02 275) !important; } .wx-start-big rt, .wx-start-big rt i.a, .wx-start-big rt i.b { color: oklch(22% .03 275); } }
  .wx-series { align-items: center; }
  .wx-series > b { font-size: 1.05rem; }

  /* 묶음 목록 */
  .wx-sets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
  .wx-set { display: grid; gap: 4px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-1);
    text-decoration: none; color: var(--text); min-height: 44px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
  .wx-set:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in oklch, var(--accent) 45%, var(--line)); }
  .wx-set b { font-size: 1.2rem; }
  .wx-set span { color: var(--en); font-size: .95rem; }
  .wx-set small { color: var(--muted); font-size: .88rem; }
  .wx-set small i { font-style: normal; font-weight: 800; color: var(--ok); }
  .wx-prog { display: block; height: 8px; border-radius: 999px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
  .wx-prog::after { content: ""; display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--ok), color-mix(in oklch, var(--ok) 60%, var(--accent))); transition: width .6s var(--ease); }

  /* 후렴 */
  .wx-hook { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
  .wx-hook .wx-say { font-size: 1.15rem; padding: 10px 18px; line-height: 2.4; border-radius: var(--r-m); }

  /* 낱말 카드 — 카드 폭(컨테이너 쿼리)에 따라: 좁으면 위아래, 넓으면 그림 왼쪽 · 글 오른쪽 */
  .wx-cards { container: cards / inline-size; list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; counter-reset: wc; }
  .wx-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 16px 18px 14px; counter-increment: wc;
    transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
  .wx-card::before { content: counter(wc); position: absolute; top: 10px; right: 12px; min-width: 26px; height: 26px; display: grid; place-items: center;
    font-size: .78rem; font-weight: 800; color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 0 6px; }
  .wx-card.on { background: color-mix(in oklch, var(--on) 75%, var(--card)); border-color: var(--stress); box-shadow: 0 0 0 3px color-mix(in oklch, var(--stress) 25%, transparent), var(--sh-2); }
  .wx-card.got, .wx-card:has(.wx-known[aria-pressed="true"]) { border-color: color-mix(in oklch, var(--ok) 60%, var(--line)); background: color-mix(in oklch, var(--ok) 5%, var(--card)); }
  .wx-card.wx-flag { border-color: var(--warn); }
  .wx-pic { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; flex: none; }
  .wx-pic img { width: 96px; height: 96px; object-fit: contain; border-radius: 18px; background: oklch(99% .004 95); }
  .wx-en ruby { font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.1rem); font-weight: 800; letter-spacing: -.01em; color: var(--en); line-height: 1.2; }
  .wx-ko ruby { font-size: 1.35rem; font-weight: 700; color: var(--ko); line-height: 1.2; }
  .wx-en rt, .wx-ko rt { padding-bottom: 2px; }
  .wx-ex { font-size: .95rem; border-top: 1.5px dashed var(--line); padding-top: 8px; width: 100%; }
  .wx-ex b { color: var(--en); }
  .wx-ex small { color: var(--muted); }
  p.wx-ex { margin: 6px 0 0; border-top: 1.5px dashed var(--line); padding-top: 8px; width: 100%; font-size: 1rem; line-height: 2.45; }
  p.wx-ex [lang="en"] { color: var(--en); font-weight: 700; }
  p.wx-ex [lang="ko"] { color: var(--muted); display: block; }
  .wx-mini { min-height: 36px; padding: 2px 10px; font-size: .9rem; margin-right: 4px; vertical-align: middle; }
  .wx-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; width: 100%; margin-top: auto; padding-top: 6px; }
  .wx-foot a { color: var(--accent); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
  .wx-foot .wx-known { font-size: .85rem; padding: 4px 12px; white-space: nowrap; }
  @container cards (min-width: 330px) {
    .wx-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; align-items: start; }
    .wx-card > * { grid-column: 2; min-width: 0; }
    .wx-card > .wx-warn { grid-column: 1 / -1; justify-self: start; }
    .wx-card > .wx-pic { grid-column: 1; grid-row: span 3; align-self: start; }
    .wx-card > .wx-en, .wx-card > .wx-ko, .wx-card > .wx-pos { justify-self: start; }
    .wx-card > .wx-ex, .wx-card > .wx-foot { grid-column: 1 / -1; }
  }

  /* 가리기: 가린 쪽은 자리만 남기고, 카드를 누르면(open) 다시 보인다 */
  .hide-en .wx-card:not(.open) .wx-en, .hide-en .wx-card:not(.open) .wx-ex b { visibility: hidden; }
  .hide-ko .wx-card:not(.open) .wx-ko, .hide-ko .wx-card:not(.open) .wx-more, .hide-ko .wx-card:not(.open) .wx-ex small { visibility: hidden; }
  .hide-en .wx-card:not(.open), .hide-ko .wx-card:not(.open) { cursor: pointer; }
  :is(.hide-en, .hide-ko) .wx-card:not(.open) { background-image: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in oklch, var(--line) 35%, transparent) 10px 11px); }

  /* 낱말 쪽 */
  .wx-word { container: word / inline-size; }
  .wx-big { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
  .wx-big ruby { font-size: clamp(2.8rem, 1.8rem + 6vw, 4.5rem); color: var(--en); line-height: 1.15; }
  .wx-big canvas.px { width: 64px; height: 64px; }
  .wx-big img { width: 128px; height: 128px; object-fit: contain; border-radius: var(--r-l); background: oklch(99% .004 95); box-shadow: var(--sh-1); }
  .wx-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 16px 20px; margin: 16px 0; }
  .wx-dl dt { font-weight: 700; color: var(--muted); font-size: .92rem; padding-top: 4px; }
  .wx-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; line-height: 2.2; }
  .wx-dl a { color: var(--accent); font-weight: 700; }
  @container word (max-width: 440px) { .wx-dl { grid-template-columns: 1fr; gap: 0; } .wx-dl dd { margin-bottom: 10px; } }
  .wx-sibs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .wx-sibs a { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s; }
  .wx-sibs a:hover { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, var(--card)); }
  .wx-sibs b { color: var(--en); }
  .wx-pn { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
  .wx-pn a { color: var(--accent); font-weight: 800; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-1); }

  /* 왜 함께인가 */
  .wx-near, .wx-sents { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
  .wx-near li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 12px; }
  .wx-why .wx-near li { grid-template-columns: repeat(5, auto) 1fr; }
  .wx-near a { color: var(--en); font-weight: 800; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
  .wx-near span { color: var(--ko); }
  .wx-score { display: block; height: 8px; min-width: 40px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
  .wx-score::after { content: ""; display: block; height: 100%; width: var(--s, 0%); background: var(--accent); }
  .wx-sents li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 12px; }
  @media (max-width: 520px) { .wx-why .wx-near li { grid-template-columns: repeat(5, auto); } .wx-why .wx-score { grid-column: 1 / -1; } }

  /* 곡 뮤직비디오 */
  .wx-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sh-2); background: #000; margin: 14px 0; }
  .wx-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

  /* 처음 · Start 쪽(한글·알파벳 표) */
  .wx-letters { list-style: none; padding: 0; margin: 10px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
  .wx-letters li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 10px; display: flex; flex-direction: column; gap: 4px; transition: background-color .2s, box-shadow .2s; }
  .wx-letters li.on { background: color-mix(in oklch, var(--on) 80%, var(--card)); box-shadow: 0 0 0 3px color-mix(in oklch, var(--stress) 30%, transparent), var(--sh-2); }
  .wx-l { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 12px; min-height: 44px; }
  .wx-l b { font-size: 2.6rem; line-height: 1.15; }
  .wx-l small { color: var(--muted); font-weight: 700; }
  .wx-l:hover, .wx-lex:hover { background: var(--on); }
  .wx-lex { font: inherit; color: inherit; background: none; border: 0; border-top: 1.5px dashed var(--line); cursor: pointer; padding: 6px 2px 2px; text-align: center; min-height: 44px; line-height: 2.3; border-radius: 0 0 10px 10px; }
  .wx-lex small { color: var(--muted); }
  .wx-lsnd { color: var(--muted); font-size: .85rem; text-align: center; }
  .wx-lsnd b { color: var(--stress); }
  .wx-abcex { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
  .wx-rows { list-style: none; padding: 0; margin: 8px 0 18px; display: grid; gap: 8px; }
  .wx-rows li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; line-height: 2.3; }
  .wx-lex.wx-in { border-top: 0; padding: 0 6px; display: inline-flex; align-items: center; border-radius: 8px; }
  .wx-letters .wx-lex ruby { font-size: 1.2rem; font-weight: 700; }
  .wx-letters .wx-lex rt { font-size: .62em; }
  .wx-rows-inline { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 14px; line-height: 1.9; }
  .wx-pos-t { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); font-size: .95rem; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
  .wx-pos-t th, .wx-pos-t td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
  .wx-pos-t th { background: var(--bg-2); font-size: .85rem; }
  .wx-pos-t tr:last-child td { border-bottom: 0; }
  @media (max-width: 560px) { .wx-pos-t thead { display: none; } .wx-pos-t td { display: block; border: 0; padding: 4px 12px; } .wx-pos-t tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; } }

  /* 글자 노래 /hangul·/abc — 큰 기호 단추, 큰 글자 */
  .wx-big-btn { font: inherit; font-size: 2rem; line-height: 1; min-width: 68px; min-height: 68px; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--sh-1); border-radius: 22px; cursor: pointer; text-decoration: none; padding: 4px 12px;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
  .wx-big-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
  #wxSeq.on { background: var(--stress); color: oklch(99% 0 0); }
  .wx-big-letters { grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); }
  .wx-big-letters .wx-l b { font-size: 3.4rem; }
  .wx-ico { font-size: 1.1rem; opacity: .7; }
  .wx-lname { font-size: 1.25rem; font-weight: 700; text-align: center; display: block; line-height: 2.3; }
}

/* ───────── 움직임(줄이기 설정이면 모두 끔) ───────── */
@layer wx.motion {
  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
    /* 스크롤 연동: 카드가 화면에 들어오며 살짝 떠오른다(글은 늘 보인다 — 처음부터 불투명도 .6 이상) */
    @supports (animation-timeline: view()) {
      .wx-card, .wx-set, .wx-letters li {
        animation: wx-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
      @keyframes wx-rise { from { opacity: .6; translate: 0 18px; scale: .985; } to { opacity: 1; translate: 0 0; scale: 1; } }
    }
    @supports (interpolate-size: allow-keywords) {
      .wx-howto { interpolate-size: allow-keywords; }
      .wx-howto::details-content { block-size: 0; overflow: clip; transition: block-size .3s var(--ease), content-visibility .3s allow-discrete; }
      .wx-howto[open]::details-content { block-size: auto; }
    }
    .wx-pop { animation: wx-pop .18s var(--ease); }
    @keyframes wx-pop { from { opacity: 0; translate: 0 6px; scale: .97; } }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  }
}

/* ───────── 공용 덮기(레이어 밖 — _site_theme 의 레이어 없는 규칙보다 앞서려면 여기) ───────── */
body.wx::before { display: none; }              /* 공용 보랏빛 배경광 대신 이 파일의 바탕 */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    body.wx::after { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 2147483000; pointer-events: none; transform-origin: 0 50%;
      background: linear-gradient(90deg, var(--accent), var(--stress)); animation: wx-progress linear both; animation-timeline: scroll(root); }
    @keyframes wx-progress { from { scale: 0 1; } to { scale: 1 1; } }
  }
}
@media print {
  body.wx { background: #fff; color: #000; }
  body.wx::after { display: none; }
  .wx-card, .wx-set, .wx-dl { box-shadow: none; break-inside: avoid; }
}
.wx-keys { font-size: .88rem; color: var(--muted); margin: -4px 0 10px; line-height: 1.6; }
@media (pointer: coarse) { .wx-keys { display: none; } }

/* 떠다니는 한글·알파벳 칸(/static/shared/letters3d.js, 운영자 승인 11-11 「가볍게 넣어」 — md/decisions/ui.md). 글 옆 자리에만, 글 뒤에 깔지 않는다.
   기본 = 서버가 그린 정지 글자(폰·절전·움직임 줄이기). 넓은 화면에서 three.js 가 붙으면 .live 로 바꿔 캔버스만 */
.x3d { position: relative; height: 72px; margin: 0 0 10px; border-radius: 18px; overflow: hidden; pointer-events: none;
  background: radial-gradient(60% 120% at 30% 50%, color-mix(in oklch, var(--accent) 12%, transparent), transparent 70%),
              radial-gradient(50% 120% at 80% 50%, color-mix(in oklch, var(--stress) 10%, transparent), transparent 70%); }
.x3d span { position: absolute; font-weight: 800; font-size: 1.7rem; line-height: 1; opacity: .5; color: var(--accent); }
.x3d span:nth-child(3n+2) { color: var(--stress); } .x3d span:nth-child(3n) { color: var(--ok); }
.x3d span:nth-child(1) { left: 4%; top: 18%; } .x3d span:nth-child(2) { left: 13%; top: 52%; font-size: 1.2rem; } .x3d span:nth-child(3) { left: 22%; top: 12%; }
.x3d span:nth-child(4) { left: 31%; top: 50%; } .x3d span:nth-child(5) { left: 40%; top: 16%; font-size: 1.3rem; } .x3d span:nth-child(6) { left: 49%; top: 48%; }
.x3d span:nth-child(7) { left: 58%; top: 14%; } .x3d span:nth-child(8) { left: 67%; top: 52%; font-size: 1.2rem; } .x3d span:nth-child(9) { left: 75%; top: 18%; }
.x3d span:nth-child(10) { left: 83%; top: 50%; } .x3d span:nth-child(11) { left: 91%; top: 14%; font-size: 1.3rem; } .x3d span:nth-child(12) { left: 88%; top: 62%; font-size: 1.1rem; }
.x3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.x3d.live span { display: none; }
@media (min-width: 1024px) {
  .wx-hero:has(> .x3d) { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 24px; align-items: start; }
  .wx-hero:has(> .x3d) > * { grid-column: 1; }
  .wx-hero > .x3d { grid-column: 2; grid-row: 1 / span 12; height: 280px; margin: 0; align-self: center; }
  .wx-hero > .x3d span { font-size: 2.6rem; }
}
