/* 용어 상세: 첫 화면과 같은 어두운 방 × 반으로 나뉜 무대 + 왼쪽 용어 목록.
   시연대(.stage)만 흰 바탕 — 시연은 흰 바탕에서 또렷해야 하고, 어두운 방 안의 밝은 창처럼 보이게 둔다. */

body { overflow-x: clip; }   /* 시연대 뒤 빛이 화면 밖으로 번져 가로 스크롤이 생기지 않게 */

/* 머리 아래 얇은 줄: 전체로 돌아가기 · 목록 · 이전/다음 */
.bar {
  display: flex; align-items: center; gap: 24px; min-height: 48px;
  padding: 0 clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--d-line);
  font-size: 13px;
}
.bar a { color: var(--d-mute); text-decoration: none; }
.bar a:hover { color: var(--d-text); text-decoration: none; }
.back { font-weight: 600; color: var(--d-text) !important; }
.step { display: flex; gap: 20px; margin-left: auto; }
.step a:empty { display: none; }
.share-btn { appearance: none; background: rgba(255, 255, 255, .04); border: 1px solid var(--d-line); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; color: var(--d-text); cursor: pointer; }
.share-btn:hover { border-color: rgba(255, 255, 255, .35); }
.share-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.guide-btn { appearance: none; background: none; border: 0; padding: 6px 0; min-height: 36px; font-size: 13px; color: var(--d-mute); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.guide-btn:hover { color: var(--d-text); }
.list-btn {
  display: none; appearance: none; background: rgba(255, 255, 255, .04); border: 1px solid var(--d-line); border-radius: 999px;
  padding: 6px 14px; min-height: 36px; font-size: 13px; color: var(--d-text); cursor: pointer;
}

.page { display: grid; grid-template-columns: 220px 1fr; }

/* 왼쪽 목록 */
.side { position: sticky; top: 71px; align-self: start; height: calc(100vh - 71px); overflow-y: auto; padding: 28px 16px 40px clamp(16px, 3vw, 40px); border-right: 1px solid var(--d-line); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.side-list h2 { margin: 22px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--d-meta); }
.side-list h2:first-child { margin-top: 0; }
.side-list h2 span { font-weight: 400; margin-left: 4px; }
.side-list a { display: block; padding: 5px 0; font-size: 15px; color: var(--d-mute); text-decoration: none; }
.side-list a:hover { color: var(--d-text); text-decoration: none; }
.side-list a[aria-current="page"] { color: var(--d-text); font-weight: 700; }
.side-list p { font-size: 13px; color: var(--d-meta); padding: 4px 0; }

.term {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-areas: "head bench" "info bench";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 4vw, 72px);
  padding: 48px clamp(16px, 3vw, 40px) 88px;
  min-width: 0;
}
.term:focus { outline: none; }
.head { grid-area: head; }
.bench { grid-area: bench; position: sticky; top: 96px; align-self: start; isolation: isolate; }
.info { grid-area: info; margin-top: 40px; }

/* 제목: 첫 화면처럼 굵고 좁게 */
.grp { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--d-mute); }
.head h1 { margin-top: 12px; font-size: clamp(44px, 5.4vw, 84px); font-weight: 800; line-height: 1.02; letter-spacing: -.045em; }
.head .en { margin-top: 8px; font-size: clamp(22px, 2.2vw, 30px); color: var(--d-mute); }
.aka { margin-top: 8px; font-size: 14px; color: var(--d-meta); }
.aka:empty { display: none; }
.def { margin-top: 28px; font-size: clamp(19px, 1.5vw, 22px); font-weight: 600; line-height: 1.5; letter-spacing: -.01em; max-width: 26em; }
.detail { margin-top: 14px; font-size: 16px; line-height: 1.7; color: var(--d-mute); max-width: 32em; }
.detail:empty { display: none; }

.use { display: grid; grid-template-columns: 4.5em 1fr; gap: 16px 16px; padding-top: 24px; border-top: 1px solid var(--d-line); }
.use dt { font-size: 13px; font-weight: 600; color: var(--d-meta); padding-top: 3px; }
.use dd { font-size: 16px; line-height: 1.65; color: rgba(255, 255, 255, .88); }
.use ul { display: grid; gap: 4px; }

.rel { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--d-line); }
.rel h2 { font-size: 13px; font-weight: 600; color: var(--d-meta); }
.rel ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 15px; }
.rel a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--d-line); border-radius: 999px; color: var(--d-text); background: rgba(255, 255, 255, .03); }
.rel a:hover { border-color: rgba(255, 255, 255, .35); text-decoration: none; }
.rel .soon { color: var(--d-meta); }
.rel .soon small { font-size: 12px; margin-left: 4px; }
.t-foot { margin-top: 28px; font-size: 13px; color: var(--d-meta); display: flex; flex-wrap: wrap; gap: 6px 20px; }
.t-foot a { color: var(--d-mute); text-decoration: underline; text-underline-offset: 3px; }

/* 시연대: 뒤로 은은한 빛, 흰 무대는 유리 테 안에 */
.bench-glow {
  position: absolute; z-index: -1; left: -10%; right: -10%; top: 6%; height: 70%; pointer-events: none;
  background: radial-gradient(closest-side at 35% 50%, rgba(59, 91, 219, .45), transparent), radial-gradient(closest-side at 70% 55%, rgba(190, 75, 219, .3), transparent);
  filter: blur(50px); opacity: .7;
}
/* 상태 버튼: "눌러서 바꿔 보기" 머리말 + 크게. 고른 것은 파랑(적용된 상태의 색) 면으로 또렷하게 */
.seg-head { display: flex; width: fit-content; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.seg-k { font-size: 13px; font-weight: 700; color: #8fbcff; }
.seg-k::before { content: "●"; margin-right: 6px; font-size: 8px; vertical-align: 2px; }
.seg-n { font-size: 12px; color: var(--d-meta); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: rgba(255, 255, 255, .06); }
.seg button {
  position: relative; appearance: none; border: 0; background: none; cursor: pointer;
  padding: 10px 20px; min-height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .78);
  transition: background-color .24s var(--ease), color .24s var(--ease);
}
.seg button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(49, 130, 246, .35); }
/* 처음 들어왔을 때: 아직 안 본 다음 상태 버튼을 세 번만 은은하게 두드린다 */
.seg.is-hint button[aria-pressed="true"] + button::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 2px rgba(143, 188, 255, .9);
  animation: seg-ping 1.6s var(--ease) .8s 3 both; pointer-events: none;
}
@keyframes seg-ping { 0% { opacity: 0; transform: scale(1); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }
.seg button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.frame { position: relative; margin-top: 14px; padding: 6px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12); }
.frame .stage { aspect-ratio: 4 / 3; border-radius: 14px; }
/* 무대 위 "지금 보는 상태" — 첫 상태가 진짜 로딩으로 보이지 않게 */
.now {
  position: absolute; left: 16px; bottom: 16px; z-index: 2; padding: 4px 12px; font-size: 12px; color: rgba(255, 255, 255, .8);
  background: rgba(7, 9, 13, .7); border-radius: 999px; pointer-events: none; font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.now b { margin-right: 4px; color: #fff; font-weight: 700; }
.frame .note {
  position: absolute; right: 16px; bottom: 16px; padding: 3px 10px; font-size: 12px; color: #fff;
  background: rgba(7, 9, 13, .62); border-radius: 999px; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* AI에게: 판 하나. 주황은 라벨·버튼에만 */
.say { margin-top: 16px; padding: 20px 22px 22px; border: 1px solid var(--d-line); border-radius: 20px; background: rgba(255, 255, 255, .04); }
.say-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.say-k { font-size: 13px; font-weight: 800; color: #ff9b54; }
.say-m { display: flex; gap: 14px; font-size: 13px; }
.say-m button { appearance: none; border: 0; background: none; padding: 4px 0; cursor: pointer; color: var(--d-mute); }
.say-m button:hover { color: var(--d-text); }
.say-m button[aria-pressed="true"] { color: var(--d-text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.say-t { margin-top: 10px; font-size: clamp(18px, 1.4vw, 20px); font-weight: 500; line-height: 1.6; color: #fff; }
.say-copy {
  margin-top: 16px; appearance: none; cursor: pointer; min-height: 44px; padding: 8px 20px;
  font-size: 15px; font-weight: 800; color: #1a0b00; background: var(--orange); border: 0; border-radius: 999px;
  transition: background-color .2s var(--ease);
}
.say-copy:hover { background: #ff8a3d; }
.say-mix { display: inline-block; margin: 16px 0 0 16px; font-size: 14px; font-weight: 600; color: var(--d-mute); text-decoration: underline; text-underline-offset: 3px; }
.say-mix:hover { color: var(--d-text); }
.say-mix[hidden] { display: none; }

/* 처음 안내: 짚는 곳만 밝게 남기고 나머지를 어둡게, 옆에 작은 카드 */
.guide { position: fixed; inset: 0; z-index: 60; }
.guide[hidden] { display: none; }
.guide-hole {
  position: fixed; border-radius: 20px; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(143, 188, 255, .95), 0 0 0 9999px rgba(3, 4, 7, .72);
  transition: top .35s var(--ease), left .35s var(--ease), width .35s var(--ease), height .35s var(--ease);
}
.guide-card {
  position: fixed; padding: 20px 20px 16px; border-radius: 20px; color: var(--d-text);
  background: rgba(28, 32, 42, .88); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: top .35s var(--ease), left .35s var(--ease);
}
.guide-card:focus { outline: none; }
.guide-n { font-size: 12px; color: #8fbcff; font-weight: 700; font-variant-numeric: tabular-nums; }
.guide-card h2 { margin-top: 6px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.guide-d { margin-top: 6px; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .78); }
.guide-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.guide-act button { appearance: none; cursor: pointer; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--d-mute); }
.guide-act button:hover { color: var(--d-text); }
.guide-act .guide-go { border: 0; background: #fff; color: #07090d; }
.guide-act button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .guide-hole, .guide-card { transition: none; }
  .seg.is-hint button[aria-pressed="true"] + button::after { animation: none; opacity: 1; }
}

/* 목록 판 (1024px 이하) */
.drawer {
  margin: 0; padding: 0; width: min(320px, 86vw); max-width: none; height: 100dvh; max-height: none;
  border: 0; border-right: 1px solid var(--d-line); background: #0d1016; color: var(--d-text);
}
.drawer::backdrop { background: rgba(0, 0, 0, .55); }
.drawer-top { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: #0d1016; border-bottom: 1px solid var(--d-line); }
.drawer-top button { appearance: none; border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--d-mute); min-height: 40px; }
.drawer .side-list { padding: 16px 20px 40px; }

.missing { grid-column: 1 / -1; padding: 40px 0; }
.missing h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; letter-spacing: -.03em; }
.missing p { margin-top: 12px; color: var(--d-mute); }
.missing a { color: var(--d-text); text-decoration: underline; }

@media (max-width: 1024px) {
  .page { grid-template-columns: 1fr; }
  .side { display: none; }
  .list-btn { display: inline-block; }
}

@media (max-width: 768px) {
  .bar { gap: 14px; }
  .step { gap: 14px; }
  .term { grid-template-columns: 1fr; grid-template-areas: "head" "bench" "info"; padding-top: 28px; }
  .bench { position: static; margin-top: 28px; }
  .def { margin-top: 18px; font-size: 18px; }
  .info { margin-top: 32px; }
}
