/* =========================================================
   Dex-One2Many project page — styles
   Structure: tokens → base → nav → hero → sections → components → responsive
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #14181d;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --border: #e5e7eb;

  /* TODO: 프로젝트 포인트 색. 기본은 중립 파랑 */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);

  --hero-bg: #06090d;

  --max-w: 1180px;
  --max-w-text: 860px;
  --nav-h: 64px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.10);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--accent-soft); }

/* fixed nav 높이만큼 앵커 이동 시 여백 확보 */
section[id], header[id] { scroll-margin-top: var(--nav-h); }

.container {
  width: min(100%, var(--max-w));
  margin: 0 auto;
}
.container--text {
  width: min(100%, var(--max-w-text));
  margin: 0 auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Nav ----------
   히어로 위에서는 투명(흰 글자), 히어로를 지나면 JS가 .is-solid 를 붙여
   흰 배경 + blur 로 바뀐다. */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 40px);
  background: transparent;
  transition: background .28s ease, box-shadow .28s ease;
}

.nav.is-solid {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 1px 0 var(--border), 0 6px 20px rgba(0, 0, 0, 0.06);
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .01em;
  color: #fff;
  transition: color .28s ease;
  white-space: nowrap;
}
.nav__brand:hover { text-decoration: none; }
.nav.is-solid .nav__brand { color: var(--text); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}

.nav__link {
  position: relative;
  padding: 4px 1px;
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.78);
  transition: color .2s ease;
}
.nav__link:hover { text-decoration: none; color: #fff; }
.nav.is-solid .nav__link { color: var(--text-secondary); }
.nav.is-solid .nav__link:hover { color: var(--text); }

.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav__link.is-active { color: #fff; }
.nav.is-solid .nav__link.is-active { color: var(--accent-strong); }
.nav__link.is-active::after { transform: scaleX(1); }

/* 오른쪽 위 링크 묶음: 아이콘 + 텍스트 링크들, 마지막은 흰 버튼(Code) */
.nav__actions {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 26px);
}

.nav__action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  transition: color .2s ease;
}
.nav__action svg { width: 22px; height: 22px; flex: 0 0 auto; }
.nav__action:hover { text-decoration: none; color: var(--accent); }
.nav.is-solid .nav__action { color: var(--text-secondary); text-shadow: none; }
.nav.is-solid .nav__action:hover { color: var(--accent); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .28);
  transition: background .2s ease, color .2s ease, box-shadow .28s ease, transform .15s ease;
}
.nav__cta svg { width: 22px; height: 22px; flex: 0 0 auto; }
.nav__cta:hover { text-decoration: none; transform: translateY(-1px); background: var(--accent); color: #fff; }
.nav.is-solid .nav__cta { background: var(--text); color: #fff; box-shadow: none; }
.nav.is-solid .nav__cta:hover { background: var(--accent); color: #fff; }

/* 공개 전 Code 링크: "(Coming soon)" 표시, 클릭·호버 반응 없음 */
.nav__action small { font-size: .78em; font-weight: 500; opacity: .75; margin-left: 2px; }
.nav__action--soon { cursor: default; opacity: .75; }
.nav__action--soon:hover { color: #fff; }
.nav.is-solid .nav__action--soon:hover { color: var(--text-secondary); }
@media (max-width: 640px) { .nav__action small { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn--sm { padding: 8px 16px; font-size: .9rem; }
.btn--sm svg { width: 14px; height: 14px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.btn--primary:hover { background: var(--accent-strong); color: #fff; }

/* 어두운 배경(히어로) 위의 반투명 버튼 */
.btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 어두운 영상 위의 흰 버튼 (히어로) */
.btn--light {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}
.btn--light:hover { background: var(--accent); color: #fff; }

/* 밝은 배경(본문) 위의 외곽선 버튼 */
.btn--outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.btn--outline:hover { border-color: var(--text-secondary); color: var(--text); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* 티저(16:9)가 잘리지 않도록: 화면 높이와 '폭 × 9/16' 중 작은 값. 16:10 화면에서는 히어로가 살짝 짧아짐 */
  height: min(100svh, 56.25vw);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--hero-bg);
}

.hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* 영상이 잘 보이도록 옅게. 상단은 내비 글자, 하단은 제목 가독성용 */
  background: linear-gradient(
    180deg,
    rgba(6, 9, 13, .16) 0%,
    rgba(6, 9, 13, .02) 40%,
    rgba(6, 9, 13, .26) 100%
  );
  pointer-events: none;
}

/* 프로젝트명을 화면 왼쪽 아래에 */
.hero__content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 0 clamp(24px, 4vw, 56px) clamp(48px, 9vh, 100px);
  text-align: left;
}

.hero__title {
  font-weight: 800;
  /* 화면 폭 9% 와 높이 15% 중 작은 값: 1440×900 에서 약 130px, 1920×1080 에서 약 162px, 375px 에서 40px */
  font-size: clamp(2.5rem, min(9vw, 15svh), 10.5rem);
  line-height: 1;
  overflow-wrap: anywhere;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 40px);
}
.section--alt { background: var(--bg-alt); }
.section--tight { padding-top: clamp(40px, 5vw, 64px); }

.section__title {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 18px;
}

/* 설명문을 아래 콘텐츠(본문 최대 폭)와 같은 너비로 */
p.section__lead.section__lead--wide { max-width: var(--max-w); }
/* 설명문을 아래 영상(.media--wide, 960px)과 같은 너비로 */
p.section__lead.section__lead--video { max-width: 960px; }

/* 부제 없이 제목 바로 아래 콘텐츠가 올 때 */
.section__title--solo { margin-bottom: 36px; }

/* p.section__lead 로 써야 base의 p:last-child { margin-bottom: 0 } 보다 우선한다 */
p.section__lead {
  max-width: var(--max-w-text);
  margin: 0 auto 40px;
  text-align: center;
  font-size: clamp(1.02rem, 1.3vw, 1.18rem);
  color: var(--text-secondary);
}

/* 요약문 앞의 TL;DR 라벨 */
.tldr {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .78em;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.prose {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--text);
}
.prose p + p { margin-top: 1em; }

/* ---------- Paper header (첫 섹션) ---------- */
.paper-header {
  padding-top: 72px;
  padding-bottom: 40px;
  text-align: center;
}

.paper-header__title {
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: clamp(1.4rem, 3.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.2;
}
.paper-header__name { font-weight: 800; }

/* 데스크톱에서만 제목을 지정한 위치에서 두 줄로 끊음 */
@media (max-width: 900px) { .br-desktop { display: none; } }

.paper-header__meta {
  max-width: 920px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.5;
  color: var(--text-secondary);
}

.authors, .affils, .notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 18px;
}
.authors a { color: var(--text); }
.authors a:hover { color: var(--accent); }
.authors sup, .affils sup { font-size: .7em; margin-left: 1px; }
.notes { font-size: .92em; color: var(--muted); }

.venue {
  margin-top: 8px;
  font-weight: 600;
  color: var(--text);
}

.paper-header .btn-row { margin-top: 28px; }

/* ---------- Media ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #101820;
  box-shadow: var(--shadow);
}
.media video, .media img { width: 100%; height: auto; margin: 0 auto; }
/* 영상이 로드되기 전(또는 파일이 없을 때)에도 16:9 자리를 잡아 레이아웃이 튀지 않게 */
.media video { aspect-ratio: auto 16 / 9; }

.media--wide {
  max-width: 960px;
  margin: 0 auto;
}

.media--plain {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.video-grid figure { margin: 0; }
.video-grid figcaption,
figcaption,
.figure-caption {
  margin-top: 10px;
  text-align: center;
  font-size: .95rem;
  color: var(--muted);
}

/* 영상 위 좌상단 라벨 (Human video / Robot) */
.media__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.media__badge--accent { background: var(--accent); }

/* ---------- One → Many (하이라이트 섹션) ---------- */
/* 사람 영상 1개 → 화살표 → 로봇 클립 3개, 네 영상 모두 같은 크기로 한 줄 */
.one2many {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
}
.one2many figure { margin: 0; }

/* 래퍼를 투명하게 해서 안의 figure 3개가 부모 그리드의 열을 직접 차지 */
.one2many__targets { display: contents; }

/* task 별 줄 묶음 + 열 머리글 */
.one2many-table > .one2many + .one2many { margin-top: 18px; }
.one2many--head { align-items: end; margin-bottom: -2px; }
.one2many__col {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.one2many__col--span { grid-column: span 3; }

.one2many__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.one2many__arrow svg { width: 40px; height: 40px; }

@media (max-width: 860px) {
  .one2many { grid-template-columns: 1fr; gap: 18px; }
  .one2many--head { display: none; }
  .one2many-table > .one2many + .one2many { margin-top: 32px; }
  .one2many__arrow svg { transform: rotate(90deg); width: 36px; height: 36px; }
}

.video-note {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: .92rem;
  color: var(--muted);
}

/* ---------- Results: 소제목 / 탭 / 영상 행 ---------- */
.subsection { margin-top: clamp(48px, 6vw, 72px); }
.subsection:first-of-type { margin-top: 0; }

.subsection__title {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  margin-bottom: 12px;
}
.subsection__lead {
  max-width: var(--max-w-text);
  margin: 0 auto 24px;
  text-align: center;
  color: var(--text-secondary);
}
/* 한 블록 안에서 두 번째 콘텐츠(예: 차트 아래 영상 캐러셀) 앞에 붙는 짧은 설명 */
.subsection__note {
  max-width: var(--max-w-text);
  margin: clamp(36px, 5vw, 56px) auto 20px;
  text-align: center;
  font-size: .95rem;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.tab {
  padding: 9px 20px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .15s ease;
}
.tab:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }
.tab:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tab-panel[hidden] { display: none; }
.tab-panel.is-entering { animation: panel-in .28s var(--ease); }
@keyframes panel-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Carousel (Simulation / Real World): 제목 + 점 + 양옆 화살표 ---------- */
.carousel__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}
/* 위치 표시 점은 시각적으로만 숨김 — JS의 [data-tab] 역할과 키보드/스크린리더 접근은 유지 */
.carousel__dots {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.carousel__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.carousel__dots { display: flex; gap: 8px; }
.dot {
  width: 9px; height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #c7ccd3;
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.dot:hover { border-color: var(--accent); }
.dot.is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.dot:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

.carousel__body {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}
.carousel__arrow {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.carousel__arrow svg { width: 20px; height: 20px; }
.carousel__arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.carousel__arrow:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

@media (max-width: 860px) {
  /* 좁은 화면: 화살표를 제목 양옆으로 올려 영상 폭을 확보.
     carousel__body 를 투명하게 만들어 화살표·제목·패널을 한 flex 컨테이너에서 정렬한다. */
  .carousel { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; }
  .carousel__body { display: contents; }
  .carousel__arrow { width: 38px; height: 38px; }
  .carousel__arrow--prev { order: -1; }
  .carousel__head { order: 0; margin-bottom: 0; }
  .carousel__arrow--next { order: 1; }
  .carousel .tab-panels { order: 2; flex: 1 1 100%; margin-top: 8px; }
}

.media-row {
  display: grid;
  gap: 14px;
}
.media-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.media-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-row figure { margin: 0; }

/* Simulation: embodiment 한 줄 = 왼쪽 라벨 + 클립 3개 */
.sim-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.sim-row + .sim-row { margin-top: 14px; }
.sim-row__label {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}

/* 패널 첫 줄: 사람 시연 영상 1칸 + 설명 문구. 아래 로봇 줄과 구분선으로 나뉨 */
.sim-row--human {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sim-row--human + .sim-row { margin-top: 0; }

/* 로봇 줄 위 열 머리글: Configuration 1 · 2 · 3 */
.sim-row--cols { margin-bottom: 8px; }
.sim-row--cols + .sim-row { margin-top: 0; }
.sim-col {
  display: block;
  width: 100%;
  text-align: center;
  justify-self: center;
  font-size: .82rem;          /* .sim-row__label 과 동일 */
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-secondary);
}

.sim-row__caption {
  grid-column: span 2;
  align-self: center;
  margin: 0;
  padding-left: 6px;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 860px) {
  .media-row--4, .media-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-row { grid-template-columns: 1fr; gap: 10px; }
  .sim-row__label { text-align: left; }
  .sim-row + .sim-row { margin-top: 26px; }
  .sim-row--human + .sim-row { margin-top: 0; }
  .sim-row__caption { grid-column: span 1; }
  .sim-row--cols { display: none; } /* 클립이 2열·1열로 재배치되면 열 머리글이 맞지 않음 */
}
@media (max-width: 560px) {
  .sim-row__caption { text-align: center; padding-left: 0; }
}
@media (max-width: 560px) {
  .media-row--4, .media-row--3 { grid-template-columns: 1fr; }
}

/* ---------- Results: 정량 결과 차트 ---------- */
.rchart { position: relative; }

.rchart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 18px;
  font-size: .92rem;
  color: var(--text-secondary);
}
.rchart__key { display: inline-flex; align-items: center; gap: 8px; }
.rchart__swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.rchart__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.rchart__panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 10px;
}
.rchart__panel-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.rchart__row + .rchart__row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.rchart__row-head { margin-bottom: 2px; }
.rchart__row-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.rchart__row--primary .rchart__row-title { font-size: 1.02rem; }
.rchart__row:not(.rchart__row--primary) .rchart__row-title { color: var(--text-secondary); font-weight: 600; }

.rchart__svg { display: block; width: 100%; overflow: visible; font-family: var(--font-sans); }
.rchart__tick, .rchart__xlabel, .rchart__value, .rchart__na { fill: var(--text-secondary); font-size: 11px; }
.rchart__xlabel { font-size: 12px; font-weight: 600; fill: var(--text); }
.rchart__value { font-size: 11px; font-weight: 600; }
.rchart__na { fill: var(--muted); font-size: 9px; }
.rchart__hit { outline: none; cursor: default; }
.rchart__hit:focus-visible { stroke: var(--accent); stroke-width: 2; }

.rchart__tip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 8px));
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: .8rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.rchart__tip[hidden] { display: none; }

@media (max-width: 860px) {
  .rchart__grid { grid-template-columns: 1fr; }
}

/* ---------- Results: 인터랙티브 grasp taxonomy ---------- */
/* 클릭 전: 보드만 가운데. 클릭하면 .is-open → 오른쪽 열이 0 → 1fr 로 자라며 패널이 밀려 들어옴 */
.taxo {
  position: relative; /* #taxo-peek 의 기준 */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
  column-gap: 0;
  align-items: start;
  transition: grid-template-columns .5s var(--ease), column-gap .5s var(--ease);
}
.taxo.is-open { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); column-gap: 24px; }

/* 보드 위 사용법 애니메이션 (SVG + 두 단계 문구, 한 바퀴 5.2 s; 섹션이 보이면 약 세 바퀴 돌고 멈춤) */
.taxo__how {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 8px 24px 8px 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--border);
}
.taxo__how-anim { width: 150px; height: auto; flex: none; overflow: visible; }
.taxo__how-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--text-secondary);
}
.taxo__how-step { display: flex; align-items: center; gap: 10px; }
.taxo__how-step b { color: var(--text); font-weight: 700; }
.taxo__how-num {
  flex: none;
  width: 22px; height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}
.taxo__how-touch,
.taxo__how-anim .hw-finger { display: none; }
@media (hover: none) and (pointer: coarse) { /* 터치 기기: 화살표 커서 대신 손가락, "Tap" 문구 */
  .taxo__how-mouse,
  .taxo__how-anim .hw-cursor { display: none; }
  .taxo__how-touch,
  .taxo__how-anim .hw-finger { display: inline; }
}
/* SVG 부품. 애니메이션이 없을 때의 모양 = 마지막 장면 (prefers-reduced-motion · 다 돈 뒤 · .is-done) */
.taxo__how-anim * { transform-box: view-box; }
.taxo__how-anim .hw-plate { fill: #e6e9ee; }
.taxo__how-anim .hw-card { fill: #fff; stroke: #d3d8df; stroke-width: 1; }
.taxo__how-anim .hw-sel { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.taxo__how-anim .hw-ripple { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0; transform-origin: 53px 53px; }
.taxo__how-anim .hw-cursor { fill: #fff; stroke: var(--text); stroke-width: 1.1; stroke-linejoin: round; }
.taxo__how-anim .hw-finger { fill: rgba(20, 24, 29, .28); stroke: #fff; stroke-width: 1.5; }
.taxo__how-anim .hw-cursor,
.taxo__how-anim .hw-finger { transform: translate(53px, 53px); }
.taxo__how-anim .hw-peek { transform-origin: 52.5px 44.5px; }
/* 2.9 바퀴: 세 번째 바퀴의 90 %(전부 보이는 구간)에서 끝나서, 끝난 뒤의 기본 스타일(= 마지막 장면)과 튀지 않고 이어짐 */
.taxo__how-anim .hw-cursor,
.taxo__how-anim .hw-finger { animation: taxoHowCursor 5.2s 2.9; }
.taxo__how-anim .hw-peek { animation: taxoHowPeek 5.2s 2.9; }
.taxo__how-anim .hw-ripple { animation: taxoHowRipple 5.2s 2.9; }
.taxo__how-anim .hw-sel { animation: taxoHowSel 5.2s 2.9; }
.taxo__how-anim .hw-panel { animation: taxoHowPanel 5.2s 2.9; }
.taxo__how-step .taxo__how-num { animation: taxoHowStep1 5.2s 2.9; } /* 지금 장면의 번호만 진해짐 (문구는 늘 또렷하게) */
.taxo__how-step + .taxo__how-step .taxo__how-num { animation-name: taxoHowStep2; }
[data-reveal].is-hidden .taxo__how * { animation-play-state: paused; } /* 섹션이 화면에 들어오기 전에는 시작하지 않음 */
.taxo__how.is-done .taxo__how-anim *,
.taxo__how.is-done .taxo__how-num { animation: none; } /* 칸을 한 번 열면 바로 마지막 장면에서 멈춤 (JS) */
@keyframes taxoHowCursor {
  0% { opacity: 0; transform: translate(150px, 58px); }
  6% { opacity: 1; transform: translate(146px, 56px); animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
  24%, 44% { transform: translate(53px, 53px); }
  47% { transform: translate(53px, 53px) scale(.8); }
  51%, 92% { opacity: 1; transform: translate(53px, 53px); }
  100% { opacity: 0; transform: translate(53px, 53px); }
}
@keyframes taxoHowPeek {
  0%, 25% { opacity: 0; transform: scale(.4); }
  31% { opacity: 1; transform: scale(1.06); }
  35%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes taxoHowRipple {
  0%, 45% { opacity: 0; transform: scale(.2); }
  46% { opacity: .9; transform: scale(.2); }
  62%, 100% { opacity: 0; transform: scale(1.5); }
}
@keyframes taxoHowSel { 0%, 47% { opacity: 0; } 50%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes taxoHowPanel {
  0%, 49% { opacity: 0; transform: translateX(18px); animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
  62%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes taxoHowStep1 {
  0%, 8%, 50%, 100% { background-color: var(--accent-soft); color: var(--accent); }
  14%, 44% { background-color: var(--accent); color: #fff; }
}
@keyframes taxoHowStep2 {
  0%, 46%, 98%, 100% { background-color: var(--accent-soft); color: var(--accent); }
  52%, 92% { background-color: var(--accent); color: #fff; }
}

.taxo__stage {
  position: relative;
  width: 100%;
  max-width: 940px; /* 패널이 닫혀 있을 때 가운데 놓이는 보드 폭 */
  justify-self: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  user-select: none;
}
.taxo__stage img { display: block; width: 100%; height: auto; }

/* 단위 정사각형(100×100px)을 JS가 matrix3d로 바둑판 위치에 투영 */
.taxo__grid {
  position: absolute;
  top: 0; left: 0;
  width: 100px; height: 100px;
  transform-origin: 0 0;
  display: grid;
}
.taxo__cell {
  position: relative;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  scroll-margin: calc(var(--nav-h) + 16px) 0 16px; /* 키보드 포커스로 스크롤될 때 고정 nav 밑에 숨지 않게 */
}
.taxo__cell[data-grasp] { background: var(--cell-color, transparent); }
.taxo__cell:hover,
.taxo__cell:focus-visible {
  border-color: #fff;
  outline: 2px solid var(--text);
  outline-offset: -2px;
  z-index: 1;
}
.taxo__cell.is-selected { border-color: #fff; outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; } /* 패널에서 재생 중인 칸 */
.taxo__cell:not([data-grasp]) { cursor: default; }

/* ?taxodebug 모드: 격자 외곽선 + 셀 인덱스 */
.taxo--debug .taxo__grid { outline: 2px dashed #e11d48; }
.taxo--debug .taxo__cell { border-color: rgba(225, 29, 72, .6); }
.taxo--debug .taxo__cell::after {
  content: attr(data-rc);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #e11d48;
  pointer-events: none;
}

/* 커서 옆 grasp 미리보기 (JS 가 transform 으로 위치를 잡음, --tail = 꼬리의 x) */
.taxo__peek {
  position: absolute;
  left: 0; top: 0;
  z-index: 20;
  width: 196px;
  padding: 6px 6px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, visibility 0s linear .12s;
}
.taxo__peek.is-on { opacity: 1; visibility: visible; transition: opacity .12s ease; }
.taxo__peek img { width: 100%; aspect-ratio: 6 / 5; object-fit: cover; border-radius: 6px; background: var(--bg-alt); }
.taxo__peek img[hidden] { display: none; }
.taxo__peek-name {
  display: flex;
  align-items: center;
  margin: 7px 2px 0;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.taxo__peek::after { /* 칸을 가리키는 꼬리 */
  content: "";
  position: absolute;
  left: var(--tail, 50%);
  bottom: -7px;
  width: 12px; height: 12px;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}
.taxo__peek.is-below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(-135deg); }
.taxo__peek-cta { /* 미리보기에서 클릭으로 이끄는 한 줄 */
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 2px 0;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
}
.taxo__peek-cta::before { content: ""; flex: none; border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.taxo__peek.is-current .taxo__peek-cta { display: none; } /* 이미 재생 중인 칸 */

/* 클릭하면 생기는 패널 */
.taxo__card {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  min-width: 0;
  padding: 16px 18px 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.taxo__card[hidden] { display: none; }
.taxo.is-open .taxo__card { animation: taxoPanelIn .5s var(--ease) both; }
@keyframes taxoPanelIn { 0%, 20% { opacity: 0; transform: var(--taxo-panel-from, translateX(32px)); } } /* 열이 거의 다 자란 뒤 나타남 */
.taxo__card img,
.taxo__card video {
  margin-top: 10px;
  width: 100%;
  aspect-ratio: 4 / 3; /* rollout clips are 720×540; the grasp stills are cropped to the same box */
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.taxo__card img[hidden],
.taxo__card video[hidden] { display: none; }
.taxo__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 400 24px/1 var(--font-sans);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.taxo__close:hover { background: var(--bg-alt); color: var(--text); }
.taxo__close:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }

/* 대표 타일 아래 이름 (페이지 폰트로 얹음) */
.taxo__tile-label {
  position: absolute;
  transform: translate(-50%, 0);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 640px) { .taxo__tile-label { font-size: .62rem; } }
/* 대표 타일도 누르면 그 칸이 열림: 타일 + 이름 줄을 덮는 투명 상자 (JS 가 left/top 을 이름 위치 at[] 에서 잡음).
   크기는 바둑판 그림의 타일 배치(1036×640 그림에서 타일 278×232 px, 이름 줄까지)에서 잰 값 */
.taxo__tile {
  position: absolute;
  width: 27%;
  height: 41.5%;
  transform: translateX(-50%);
  cursor: pointer;
}
.taxo__tile::before,
.taxo__tile::after { content: ""; position: absolute; left: 50%; top: 44%; opacity: 0; transition: opacity .15s ease; }
.taxo__tile::before { width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 14px rgba(15, 23, 42, .25); }
.taxo__tile::after { margin: -9px 0 0 -5px; border-left: 16px solid var(--accent); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
@media not all and (hover: none) and (pointer: coarse) { /* hover 하면 재생 버튼 (터치 기기는 탭 뒤 hover 가 남지 않게 뺌) */
  .taxo__tile:hover::before,
  .taxo__tile:hover::after { opacity: 1; }
}
.taxo__swatch {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
  background: var(--cell-color, var(--border));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .14);
}
.taxo__name { display: flex; align-items: center; padding-right: 36px; font-weight: 700; font-size: 1.2rem; line-height: 1.3; color: var(--text); }
.taxo__sub { font-size: .85rem; color: var(--muted); }

@media (max-width: 860px) {
  /* 좁은 화면: 패널은 보드 아래에 쌓임 */
  .taxo, .taxo.is-open { grid-template-columns: minmax(0, 1fr); column-gap: 0; row-gap: 14px; }
  .taxo__card {
    position: relative; top: auto; scroll-margin-bottom: 12px; --taxo-panel-from: translateY(12px);
    width: 100%; max-width: 520px; justify-self: center; /* 태블릿 세로에서도 보드와 패널이 한 화면에 */
  }
}
@media (max-width: 560px) {
  .taxo__how { padding: 8px 12px; gap: 6px 12px; }
  .taxo__how-anim { width: 104px; }
  .taxo__how-steps { font-size: .84rem; }
  .taxo__how-step { gap: 8px; }
  .taxo__peek { width: 164px; }
  .taxo__peek-cta { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .taxo { transition: none; }
  .taxo.is-open .taxo__card,
  .taxo__how-anim *,
  .taxo__how-num { animation: none !important; }
  .taxo__tile::before,
  .taxo__tile::after { transition: none; }
}

/* ---------- Concurrent work 카드 ---------- */
.cw-wrap { max-width: 1000px; margin: 0 auto; }
.cw-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cw-card + .cw-card { margin-top: 16px; }
.cw-card__media img {
  display: block;
  width: 100%;
  aspect-ratio: auto 16 / 9;   /* 로드되면 원래 비율, 전에는 16:9 자리 */
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.cw-card__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cw-card__title { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.45; }
.cw-card__title a { color: var(--text); font-weight: 800; }
.cw-card__title a:hover { color: var(--accent); }
.cw-card__desc { margin: 0; color: var(--text-secondary); }
.cw-card__rel { margin-top: 10px; }
.cw-card__rel summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; font-size: .95rem; }
.cw-card__rel p { margin: 8px 0 0; color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }
@media (max-width: 700px) { .cw-card { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- BibTeX ---------- */
.bibtex {
  position: relative;
  max-width: var(--max-w-text);
  margin: 0 auto;
}

.bibtex pre {
  margin: 0;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.bibtex__copy {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px clamp(20px, 5vw, 40px) 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- Reveal (JS가 초기 상태를 설정하므로 JS 없이도 보임) ---------- */
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(20px);
}
[data-reveal] {
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .nav__links { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  /* 세로 화면: 16:9 로 맞추면 띠처럼 얇아지므로 화면을 채우고 좌우를 자른다 */
  .hero { height: 100svh; }
  .nav__action { display: none; } /* 좁은 화면에서는 Code 버튼만 남김 */
  .nav__cta { padding: 9px 16px; font-size: 1.05rem; }
  .nav__cta svg { width: 18px; height: 18px; }
  .btn { padding: 10px 18px; font-size: .95rem; }
  .paper-header { padding-top: 56px; }
  .bibtex pre { font-size: .8rem; padding: 18px; }
  .bibtex__copy { top: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], [data-reveal].is-hidden { opacity: 1; transform: none; transition: none; }
  .nav { transition: none; }
  .btn:hover { transform: none; }
}
