/* 루트웍스 연구소 — 새 판(next)
   방향(unslop 다섯 줄)
   · 제품  = 사람 개발자 한 명과 AI 조율자 · 아홉 에이전트가 회로부터 앱 · 서버 · AI 자동화까지 만들어 주는 개발 연구소
   · 성격  = 손때 묻은 · 정확한 · 묵직하게 다정한
   · 세계  = 사막 언덕의 나무 다락 연구소(나무 · 황동 · 초록 CRT · 종이 작업 지시서)
   · 빛나는 곳 = 연구소 장면 하나 + 상영 선반의 영사막 — 그 밖의 크롬은 조용히
   · 서명  = 「대표 개발자 검토」 도장(작업 카드의 끝에만)
   그리기 구조 = 합성 단계 속성(transform · opacity)만 움직인다 · 그림은 미리 풀어 DOM 에 올려 둔다 */

:root {
  --sans: 'Noto Sans KR Variable', 'Noto Sans KR', system-ui, sans-serif;
  --mono: ui-monospace, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans KR Variable', monospace;

  /* 나무(어두운 크롬) — 따뜻한 한 줄기 */
  --wood-0: #110D0A;
  --wood-1: #1A1410;
  --wood-2: #261D17;
  --line: rgba(241, 230, 210, 0.09);
  --cream: #F1E6D2;
  --cream-2: #BDAF9A;
  --cream-3: #938777;

  /* 종이(작업 지시서) */
  --paper: #F5EEDF;
  --paper-2: #EBE1CD;
  --ink: #26201A;
  --ink-2: #584C41;
  --ink-3: #74685B;
  --ink-line: rgba(38, 32, 26, 0.11);

  --copper: #974B25;
  --copper-2: #7F3D1C;
  --copper-ink: #FFF6E8;
  --rust: #8E3B2E;
  --brass: #B79760;

  /* 움직임 — 곡선 하나 · 무게가 실리게 길이를 넉넉히 */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t-hover: 220ms;
  --t-pose: 190ms;
  --t-seq: 70ms;
  --t-eye: 220ms;
  --t-lean: 680ms;
  --t-enter: 460ms;
  --t-leave: 300ms;
  --t-prof: 760ms;
  --t-card: 480ms;
  --t-out: 170ms;
  --t-spot: 680ms;
  --t-menu: 420ms;
  --t-stamp: 170ms;
}
/* 스톱모션 맛 — 캐릭터는 컷으로 · 화면(카드 · 빛 · 메뉴)만 부드럽게 */
html[data-motion='stop'] {
  --t-pose: 0ms; --t-seq: 0ms; --t-eye: 0ms; --t-lean: 0ms; --t-enter: 0ms; --t-leave: 0ms; --t-prof: 0ms; --t-stamp: 0ms;
}
/* 전부 컷(앞 판과 같은 느낌) · 동작 줄이기 */
html[data-motion='cut'], html[data-motion='none'] {
  --t-hover: 0ms; --t-pose: 0ms; --t-seq: 0ms; --t-eye: 0ms; --t-lean: 0ms; --t-enter: 0ms; --t-leave: 0ms; --t-prof: 0ms;
  --t-card: 0ms; --t-out: 0ms; --t-spot: 0ms; --t-menu: 0ms; --t-stamp: 0ms;
}

* { box-sizing: border-box; }
html { background: var(--wood-0); scroll-behavior: smooth; }
html[data-motion='cut'], html[data-motion='none'] { scroll-behavior: auto; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--wood-0);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
[inert] { pointer-events: none; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ 위 막대 */
.bar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--wood-1);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  border-radius: 8px;
  color: var(--cream);
  text-decoration: none;
}
.brand-mark { color: var(--brass); flex: none; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
/* 위 막대의 링크와 단추 — 누르는 높이는 44px 이고, 눈에 보이는 판은 그 가운데 36px 이다(::before 가 그린다).
   판까지 44px 로 키우면 56px 막대를 위아래 6px 만 남기고 채워 답답해진다. 터치 기기와 좁은 화면에서는 판도 44px(아래 두 미디어 조건) */
.nav-link {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cream-2);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-hover) var(--ease);
}
.nav-link::before, .nav-ask::before {
  content: '';
  position: absolute;
  inset: 4px 0;
  z-index: -1;
  border-radius: 8px;
  background-color: transparent;
  transition: background-color var(--t-hover) var(--ease);
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::before { background-color: rgba(241, 230, 210, 0.06); }
.nav-ask {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  height: 44px;
  margin-left: 8px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--wood-1);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-hover) var(--ease);
}
.nav-ask::before { background-color: var(--cream); }
.nav-ask:hover::before { background-color: #FFF7E8; }
.nav-ask:active { transform: scale(0.98); }

/* ------------------------------------------------------------ 무대 */
.lab { position: relative; display: flex; justify-content: center; overflow: hidden; background: var(--wood-0); }
.stage {
  --u: calc(100cqw / 1672);            /* 세트 1px 의 화면 길이 — 무대의 자손에서만 쓴다 */
  position: relative;
  flex: none;
  width: min(100vw, calc((100svh - 56px - 64px) * 1672 / 941));
  aspect-ratio: 1672 / 941;
  container-type: inline-size;
  overflow: hidden;
}
.set { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.world, .layer { position: absolute; inset: 0; }
.layer { pointer-events: none; }

/* 세트 좌표 배치 — 값은 세트 픽셀(1672×941) */
.at {
  position: absolute;
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  width: calc(var(--u) * var(--w));
  height: calc(var(--u) * var(--h));
}

/* 작업등 — 고른 장비에 빛이 모이고 방은 한 톤 가라앉는다(작은 판을 4배 키워 쓴다 · 움직임은 transform 만) */
.spot { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity var(--t-spot) var(--ease); }
.spot.on { opacity: 1; }
.spot.peek { opacity: 0.62; }
.spot.on i, .spot.peek i { will-change: transform; }   /* 보일 때만 레이어를 미리 올린다 */
.spot i {
  position: absolute;
  left: 25%; top: 25%; width: 50%; height: 50%;
  background: radial-gradient(ellipse 13.5% 18% at 50% 50%, rgba(12, 7, 3, 0) 0, rgba(12, 7, 3, 0) 40%, rgba(12, 7, 3, 0.38) 100%);
  transform: translate3d(calc(var(--u) * var(--sx, 0)), calc(var(--u) * var(--sy, 0)), 0) scale(calc(4 * var(--ss, 1)));
  transition: transform var(--t-spot) var(--ease);
}

/* 구역 — 보이지 않는 단추(이름은 낭독기용) */
#zones > .zone, #zones > .egg { pointer-events: auto; }
.zone {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.zone:focus-visible { outline: 2px solid var(--cream); outline-offset: -3px; }

/* 숨은 소품 — 볼트 · 전선 스풀 */
.egg {
  position: absolute;
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  width: max(44px, calc(var(--u) * var(--w)));
  height: max(44px, calc(var(--u) * var(--h)));
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.egg:focus-visible { outline: 2px solid var(--cream); outline-offset: -4px; }
.egg::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--u) * 46); height: calc(var(--u) * 46);
  margin: calc(var(--u) * -23) 0 0 calc(var(--u) * -23);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 196, 0.85), rgba(255, 236, 196, 0));
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}
.egg.glint::after { animation: glint 1500ms var(--ease) 1; }
@keyframes glint {
  0% { opacity: 0; transform: scale(0.5); }
  35% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ------------------------------------------------------------ 배우(캐릭터) — 원점 = 발 */
.actor {
  position: absolute;
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  width: 0; height: 0;
  opacity: 0;
  transform: translate3d(0, calc(var(--u) * 12), 0);
  transition: opacity var(--t-leave) linear, transform var(--t-leave) var(--ease);
}
.actor.in { opacity: 1; transform: translate3d(0, 0, 0); transition-duration: var(--t-enter); will-change: opacity, transform; }
.actor .sh {
  position: absolute;
  left: calc(var(--u) * var(--sw) * -0.5);
  top: calc(var(--u) * var(--shh) * -0.5);
  width: calc(var(--u) * var(--sw));
  height: calc(var(--u) * var(--shh));
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 11, 4, 0.46), rgba(20, 11, 4, 0));
}
.actor .body { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform var(--t-lean) var(--ease); }
.actor img {
  position: absolute;
  max-width: none;
  opacity: 0;
  transition: opacity var(--t-pose) linear;
  user-select: none;
  -webkit-user-drag: none;
}
/* 자세 바꿈 = 새 그림이 위에서 떠오르고, 반쯤 떠오른 뒤에 옛 그림이 빠진다(몸통이 비쳐 보이지 않게) */
.actor img.on { opacity: 1; z-index: 2; }
.actor img.out { opacity: 0; z-index: 1; transition-delay: calc(var(--t-pose) * 0.5); transition-duration: calc(var(--t-pose) * 0.5); }
.actor.seq img { --t-pose: var(--t-seq); }

/* 루띠의 눈 — 정면 원화 위에 얹는 덮개(반짝임이 시선을 따라간다) */
.eye {
  position: absolute;
  z-index: 3;
  border-radius: 50%;
  background: #1A120B;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--t-pose) linear;
}
.rooti.eyes .eye { opacity: 1; }
.eye i {
  position: absolute;
  border-radius: 50%;
  background: #FFF8EE;
  transform: translate3d(calc(var(--u) * var(--gx, 0)), calc(var(--u) * var(--gy, 0)), 0);
  transition: transform var(--t-eye) var(--ease);
}
.eye i.g1 { left: 24%; top: 23%; width: 20%; height: 20%; }
.eye i.g2 { left: 58.5%; top: 55.5%; width: 9%; height: 9%; opacity: 0.55; }
.eye b {
  position: absolute; inset: 0;
  background: #B7AFA6;
  transform: translate3d(0, -102%, 0);
  transition: transform 120ms var(--ease);
}
.rooti.blink .eye b { transform: translate3d(0, 0, 0); transition-duration: 80ms; }
.rooti.half .eye b { transform: translate3d(0, -50%, 0); }
html[data-motion='stop'] .eye b, html[data-motion='cut'] .eye b, html[data-motion='none'] .eye b { transition: none; }

/* 박사 — 오른쪽 가장자리에서 들어와 머문다(강체 이동만) */
.prof {
  position: absolute;
  left: calc(var(--u) * 1092);
  top: calc(var(--u) * 361);
  width: calc(var(--u) * 580);
  height: calc(var(--u) * 580);
  opacity: 0;
  transform: translate3d(calc(var(--u) * 210), 0, 0);
  transition: opacity var(--t-leave) linear, transform var(--t-leave) var(--ease);
}
.prof.in { opacity: 1; transform: translate3d(calc(var(--u) * 24), 0, 0); transition: opacity var(--t-hover) linear, transform var(--t-prof) var(--ease); will-change: opacity, transform; }
html[data-motion='blend'] .prof { --t-pose: 70ms; }
.prof img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity var(--t-pose) linear; user-select: none; -webkit-user-drag: none; }
.prof img.on { opacity: 1; z-index: 2; }
.prof img.out { opacity: 0; z-index: 1; transition-delay: calc(var(--t-pose) * 0.5); transition-duration: calc(var(--t-pose) * 0.5); }

/* ------------------------------------------------------------ 장비 깨어남 */
.wk { opacity: 0; transition: opacity var(--t-hover) linear; }
.wk.on { opacity: 1; }

/* 부품 컴퓨터 화면 */
.crt {
  border-radius: calc(var(--u) * 10);
  background: #0E2112;
  color: #A6EAB0;
  font-family: var(--mono);
  transform: scaleY(0.03);
  transition: opacity var(--t-hover) linear, transform var(--t-menu) var(--ease);
  overflow: hidden;
  z-index: 1;
}
.crt.on { transform: scaleY(1); pointer-events: auto; }
.crt-line {
  position: absolute;
  left: calc(var(--u) * 11); top: calc(var(--u) * 9);
  font-size: calc(var(--u) * 13);
  line-height: calc(var(--u) * 20);
  color: #6FB77B;
  white-space: pre;
}
.crt-line::after { content: ''; display: inline-block; width: calc(var(--u) * 8); height: calc(var(--u) * 13); margin-left: 2px; vertical-align: -1px; background: #A6EAB0; }
.crt.menu .crt-line::after { display: none; }
.crt-menu { position: absolute; left: calc(var(--u) * 7); right: calc(var(--u) * 7); top: calc(var(--u) * 35); opacity: 0; transition: opacity var(--t-hover) linear; }
.crt.menu .crt-menu { opacity: 1; }
.crt-item {
  display: block;
  width: 100%;
  height: calc(var(--u) * 26);
  margin: 0 0 calc(var(--u) * 1);
  padding: 0 calc(var(--u) * 8);
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #A6EAB0;
  font-family: var(--mono);
  font-size: calc(var(--u) * 16);
  font-weight: 500;
  line-height: calc(var(--u) * 26);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}
.crt-item[aria-pressed='true'] { background: #A6EAB0; color: #0E2112; }
.crt-item:focus-visible { outline: 1px solid var(--cream); outline-offset: -1px; }

/* 오실로스코프 화면 — 작은 캔버스 한 장만 다시 그린다 */
.scope { border-radius: calc(var(--u) * 6); background: #102017; overflow: hidden; }
.scope canvas { display: block; width: 100%; height: 100%; }

/* 북쪽 창 — 신호가 퍼진다 */
.radio { overflow: visible; }
.radio i {
  position: absolute;
  left: 50%; top: 100%;
  width: calc(var(--u) * var(--r) * 2); height: calc(var(--u) * var(--r) * 2);
  margin: calc(var(--u) * var(--r) * -1) 0 0 calc(var(--u) * var(--r) * -1);
  border: calc(var(--u) * 3.2) solid rgba(255, 244, 222, 0.9);
  border-radius: 50%;
  clip-path: polygon(50% 50%, 0 0, 100% 0);
  opacity: 0;
  transform: scale(0.72);
  transition: opacity var(--t-enter) linear, transform var(--t-spot) var(--ease);
  transition-delay: calc(var(--i) * 130ms);
}
.radio.on i { opacity: 0.9; transform: scale(1); }
html[data-motion='cut'] .radio i, html[data-motion='none'] .radio i { transition-delay: 0ms; }

/* 부품 서랍장 — 세트 조각이 앞으로 나온다 */
.drawer-hole { background: #130C07; }
.drawer {
  background-image: var(--set-src);
  background-size: calc(var(--u) * 1672) calc(var(--u) * 941);
  background-position: calc(var(--u) * var(--x) * -1) calc(var(--u) * var(--y) * -1);
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform var(--t-enter) var(--ease);
  transition-delay: calc(var(--i) * 90ms);
}
.drawers.on .drawer { transform: translate3d(0, calc(var(--u) * 10), 0) scale(1.08); will-change: transform; }
html[data-motion='cut'] .drawer, html[data-motion='none'] .drawer { transition-delay: 0ms; }

/* 종이 꼬리표 — 장비 이름 · 숨은 소품의 한 줄 */
.tag {
  position: absolute;
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  transform: translate(-50%, 0) rotate(-6deg);
  transform-origin: 50% 0;
  opacity: 0;
  transition: opacity var(--t-hover) linear, transform var(--t-card) var(--ease);
  pointer-events: none;
}
.tag.on { opacity: 1; transform: translate(-50%, 0) rotate(0deg); }
.tag::before { content: ''; display: block; width: 1px; height: calc(var(--u) * 14); margin: 0 auto; background: #6E5A40; }
.tag span {
  display: block;
  padding: 2px 8px;
  border: 1px solid #9C8763;
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(11px, calc(var(--u) * 13.5), 13px);
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.tag.note span { font-weight: 400; white-space: normal; width: max-content; max-width: 260px; }
.tag.note b { font-weight: 600; }
.tag.left { transform: translate(-12%, 0) rotate(-6deg); }
.tag.left.on { transform: translate(-12%, 0) rotate(0deg); }
.tag.left::before { margin-left: 12%; }
.tag.right { transform: translate(-88%, 0) rotate(-6deg); }
.tag.right.on { transform: translate(-88%, 0) rotate(0deg); }
.tag.right::before { margin-left: 88%; }

/* ------------------------------------------------------------ 도착 글(작업대 위 · 이 화면의 유일한 큰 글) */
.hello {
  position: absolute;
  left: calc(var(--u) * 452);
  top: calc(var(--u) * 650);
  max-width: calc(var(--u) * 900);
  color: #24140A;
  opacity: 1;
  isolation: isolate;
  transition: opacity var(--t-card) linear;
  pointer-events: none;
}
/* 글자 뒤 — 작업대에 볕이 든 자리(나뭇결의 어두운 줄 위에서도 글자 대비 4.5 이상 · 잰 값은 README 7절) */
.hello::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: calc(var(--u) * -150); right: calc(var(--u) * -190);
  top: calc(var(--u) * -60); bottom: calc(var(--u) * -70);
  background: radial-gradient(ellipse closest-side, rgba(248, 216, 168, 0.74) 0, rgba(248, 216, 168, 0.7) 46%, rgba(248, 216, 168, 0.4) 68%, rgba(248, 216, 168, 0.12) 86%, rgba(248, 216, 168, 0) 100%);
}
.hello.off { opacity: 0; transition-duration: var(--t-out); }
.hello h1 {
  font-size: clamp(20px, calc(var(--u) * 42), 44px);
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 0 rgba(255, 226, 184, 0.34);
}
.hello p {
  margin-top: calc(var(--u) * 14);
  font-size: clamp(14px, calc(var(--u) * 19), 19px);
  line-height: 1.5;
  font-weight: 500;
  color: #33200F;
  text-shadow: 0 1px 0 rgba(255, 226, 184, 0.3);
}

/* ------------------------------------------------------------ 작업 카드(작업 지시서 한 장 — 늘 작업대의 같은 자리) */
.card {
  position: absolute;
  left: calc(var(--u) * 436);
  bottom: calc(var(--u) * 20);
  width: var(--card-w, 720px);
  padding: 12px 20px 16px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 252, 244, 0.7) inset, 0 12px 28px rgba(18, 13, 9, 0.34), 0 2px 6px rgba(18, 13, 9, 0.22);
  font-size: 13.5px;
  line-height: 20px;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--t-out) linear, transform var(--t-out) var(--ease);
}
.card.in { opacity: 1; transform: translate3d(0, 0, 0); transition: opacity var(--t-hover) linear, transform var(--t-card) var(--ease); will-change: opacity, transform; }
.card-head { display: flex; align-items: center; gap: 12px; min-height: 36px; margin-bottom: 8px; }
.card-zone { margin-top: 4px; font-family: var(--mono); font-size: 12px; line-height: 16px; letter-spacing: 0.02em; color: var(--ink-3); white-space: nowrap; }
.card-tabs { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--paper-2); }
.card-tabs button {
  height: 28px; padding: 0 12px;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}
.card-tabs button:hover { color: var(--ink); }
.card-tabs button[aria-pressed='true'] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(38, 32, 26, 0.14); }
.icon-btn {
  flex: none;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  margin-left: 8px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}
.icon-btn:hover { background: var(--ink-line); color: var(--ink); }
.card-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4px 28px; }
.card h2 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; outline: none; }
.card .one { font-size: 14px; line-height: 22px; }
.card .example { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--ink-2); }
.card .example::before { content: '이런 의뢰 — '; color: var(--ink); font-weight: 600; }
.card .example.basis::before { content: none; }
/* 브리핑 룸으로 — 「자세히」(분야 소개 장) · 「실적 N건」(그 분야의 첫 실적) · 공간 지도 2-6 의 「나」 */
.card-more { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0 0 -8px -10px; }   /* 누름 높이 44px(터치 기준) — 위아래 여백을 줄여 카드 높이는 32px 판과 거의 같다 */
.card-more a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--copper-2); text-decoration: none; transition: background-color var(--t-hover) var(--ease); }
.card-more a:hover { background-color: var(--ink-line); }
.card-more a:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.card-more a[hidden] { display: none; }
.side-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); }
.card .can { margin: 4px 0 12px; }
.card .can li { position: relative; padding-left: 16px; }
.card .can li + li { margin-top: 2px; }
.card .can li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--brass); }
.card .can.flow { counter-reset: step; }
.card .can.flow li { counter-increment: step; padding-left: 24px; }
.card .can.flow li::before { content: counter(step); top: 0; left: 0; width: auto; height: auto; border-radius: 0; background: none; color: var(--copper); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.card .deliv { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-line);
}
.crew { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; min-width: 0; }
.crew li { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 16px; color: var(--ink-2); white-space: nowrap; }
.crew li:not(:last-child)::after {
  content: '';
  width: 5px; height: 5px;
  margin: 0 12px 0 4px;
  border-top: 1.5px solid var(--brass);
  border-right: 1.5px solid var(--brass);
  transform: rotate(45deg);
}
.crew .faces { display: inline-flex; }
.crew .face { box-shadow: 0 0 0 1.5px var(--paper); }
.crew .face + .face { margin-left: -6px; }
/* 얼굴 — 원화에서 캐릭터가 있는 자리만 잘라 보여 준다 */
.face { position: relative; flex: none; display: inline-block; border-radius: 50%; background: var(--paper-2); overflow: hidden; }
.face img { position: absolute; max-width: none; }
a.text-btn { display: inline-flex; align-items: center; text-decoration: none; }
.text-btn {
  height: 36px;
  padding: 0 12px;
  margin-left: -12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: underline;
  text-decoration-color: var(--ink-line);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease);
}
.text-btn:hover { color: var(--ink); background: var(--ink-line); }
.go {
  flex: none;
  display: inline-flex; align-items: center;
  height: 36px;
  margin-left: auto;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--copper);
  color: var(--copper-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset;
  transition: background-color var(--t-hover) var(--ease), transform var(--t-hover) var(--ease);
}
.go:hover { background: var(--copper-2); }
.go:active { transform: scale(0.98); }
.card.prof-card .card-side .side-label.deliv-label, .card.prof-card .deliv { display: none; }

/* 서명 — 「대표 개발자 검토」 도장 */
.stamp {
  flex: none;
  padding: 2px 8px;
  border: 2px solid var(--rust);
  outline: 1px solid var(--rust);
  outline-offset: 2px;
  border-radius: 4px;
  color: var(--rust);
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  mix-blend-mode: multiply;
  opacity: 0;
  transform: rotate(-7deg) scale(1.16);
  transition: opacity var(--t-stamp) linear, transform var(--t-stamp) var(--ease);
  pointer-events: none;
}
.stamp.on { opacity: 0.9; transform: rotate(-7deg) scale(1); }
.stamp:empty { display: none; }
.card-head .stamp { margin-left: auto; }
.card-head .stamp:empty + .icon-btn { margin-left: auto; }

/* 단추(점검 에이전트) — 카드 모서리에 내려앉는다 */
.inspector {
  position: absolute;
  right: 44px; top: -44px;
  width: 60px; height: 60px;
  opacity: 0;
  transform: translate3d(0, -10px, 0);
  transition: opacity var(--t-leave) linear, transform var(--t-leave) var(--ease);
  pointer-events: none;
}
.inspector.in { opacity: 1; transform: translate3d(0, 0, 0); transition-duration: var(--t-enter); }
.inspector img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity var(--t-pose) linear; }
.inspector img.on { opacity: 1; z-index: 2; }
.inspector img.out { opacity: 0; z-index: 1; transition-delay: calc(var(--t-pose) * 0.5); transition-duration: calc(var(--t-pose) * 0.5); }

/* ------------------------------------------------------------ 분야 바로 보기 */
.rail {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  background: var(--wood-1);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rail-label { flex: none; font-size: 13px; line-height: 20px; color: var(--cream-3); }
.rail-list { position: relative; display: flex; flex-wrap: wrap; gap: 0 2px; flex: 1; min-width: 0; }
.rail-list button {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cream-2);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease);
}
.rail-list button:hover { color: var(--cream); background: rgba(241, 230, 210, 0.06); }
.rail-list button[aria-pressed='true'] { color: var(--cream); }
.rail-ind {
  position: absolute;
  left: 0; top: 0;
  width: 100px; height: 2px;
  border-radius: 1px;
  background: var(--brass);
  transform-origin: 0 50%;
  transform: translate3d(var(--ix, 0px), var(--iy, 38px), 0) scaleX(var(--iw, 0.2));
  opacity: 0;
  transition: transform var(--t-menu) var(--ease), opacity var(--t-hover) linear;
  pointer-events: none;
}
.rail-ind.on { opacity: 1; }
.rail-src {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--cream-3);
  text-decoration: none;
  transition: color var(--t-hover) var(--ease);
}
.rail-src:hover { color: var(--cream); }
.sheet:empty { display: none; }
.noscript { padding: 16px 24px; }

/* ------------------------------------------------------------ 상영 선반 */
.films { padding: 56px 24px 96px; background: var(--wood-0); }
.films-in { max-width: 1200px; margin: 0 auto; }
.films-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.films-head h2 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.films-head p { font-size: 15px; color: var(--cream-2); }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: end; }
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #080604;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.screen-poster, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.screen-poster { opacity: 1; transition: opacity var(--t-card) linear; }
.screen-poster.swap { opacity: 0; transition-duration: var(--t-out); }
.screen.playing .screen-poster, .screen.playing .play { opacity: 0; pointer-events: none; }
.play {
  position: absolute;
  left: 50%; top: 50%;
  width: 72px; height: 72px;
  margin: -36px 0 0 -36px;
  display: grid; place-items: center;
  padding: 0 0 0 4px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--wood-1);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(8, 6, 4, 0.5);
  transition: transform var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease), opacity var(--t-hover) linear;
}
.play:hover { background: #FFF7E8; transform: scale(1.04); }
.play:active { transform: scale(0.97); }
.feature-text { padding-bottom: 8px; }
.film-series { font-family: var(--mono); font-size: 12px; line-height: 16px; letter-spacing: 0.02em; color: var(--cream-3); }
.film-title { margin-top: 8px; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.film-line { margin-top: 8px; font-size: 15px; line-height: 24px; color: var(--cream-2); }
.film-len { margin-top: 12px; font-family: var(--mono); font-size: 13px; line-height: 20px; color: var(--cream-3); font-variant-numeric: tabular-nums; }
.reel { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; margin-top: 24px; }
.reel button {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wood-1);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease);
}
.reel button:hover { background: var(--wood-2); }
.reel button[aria-pressed='true'] { background: var(--wood-2); border-color: rgba(183, 151, 96, 0.6); }
.reel img { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; background: #080604; }
.reel b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--cream); }
.reel .meta { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--cream-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ 무대 크기에 맞춘 카드 — 카드 윗변이 선반 위 친구의 발(세트 y 565)보다 아래에 놓이게
   (작업대 높이는 무대 폭에 비례해 줄지만 글자는 줄지 않는다. 그래서 무대가 작을수록 카드를 촘촘히 한다 · 재는 도구 = tools/audit.js A8) */
@container (max-width: 1420px) {
  .card { padding: 10px 18px 12px; font-size: 13px; line-height: 19px; }
  .card-head { margin-bottom: 4px; }
  .card .one { font-size: 13.5px; line-height: 20px; }
  .card .example { margin-top: 6px; font-size: 12.5px; line-height: 19px; }
  .card-body { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 4px 24px; }
  .card .can { margin: 2px 0 8px; }
  .card .can li + li { margin-top: 0; }
  .card .deliv { margin-top: 2px; font-size: 12.5px; }
  .card-foot { margin-top: 8px; padding-top: 8px; }
}
@container (max-width: 1240px) {
  .card { bottom: calc(var(--u) * 10); padding: 6px 16px 8px; font-size: 12.5px; line-height: 18px; }
  .card h2 { font-size: 19px; line-height: 24px; }
  .card-head { min-height: 32px; margin-bottom: 2px; }
  .card .one { font-size: 13px; line-height: 19px; }
  .card .example { margin-top: 4px; font-size: 12.5px; line-height: 18px; }
  .card-body { gap: 2px 20px; }
  .card .can { margin: 2px 0 6px; }
  .card .can li::before { top: 7px; }
  .card-foot { margin-top: 6px; padding-top: 6px; }
  /* 대표 개발자 카드는 박사가 설 자리만큼 좁다 — 한 단으로 쌓아 높이를 줄인다 */
  .card.prof-card .card-body { grid-template-columns: minmax(0, 1fr); }
  .card.prof-card .can { margin-bottom: 0; }
}

/* ------------------------------------------------------------ 터치 기기 — 누르는 곳 44px */
@media (pointer: coarse) {
  .rail-list button, .rail-src, .go, .text-btn { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .card-tabs button { height: 44px; }
  .nav-link::before, .nav-ask::before { inset: 0; }   /* 위 막대는 어디서나 44px — 터치 기기에서는 보이는 판도 44px */
}

/* ------------------------------------------------------------ 좁은 화면(1000px 이하 · 태블릿 세로 · 휴대폰) — 무대는 옆으로 밀어 둘러보고, 글은 무대 아래에 */
@media (max-width: 1000px) {
  .lab { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .lab::-webkit-scrollbar { display: none; }
  .stage { width: max(100vw, calc(54svh * 1672 / 941)); }
  .sheet { padding: 20px 24px 4px; }
  .sheet .hello { position: static; max-width: none; color: var(--cream); pointer-events: auto; }
  .sheet .hello::before { display: none; }
  .sheet .hello.off { display: none; }
  .sheet .hello h1 { font-size: 24px; line-height: 32px; text-shadow: none; }
  .sheet .hello p { margin-top: 8px; font-size: 14.5px; line-height: 22px; color: var(--cream-2); text-shadow: none; font-weight: 400; }
  .sheet .card { position: relative; left: auto; bottom: auto; width: auto; max-width: 720px; display: none; padding: 12px 16px 16px; font-size: 14px; line-height: 22px; box-shadow: none; transform: translate3d(0, 10px, 0); }
  .sheet .card.in { display: block; opacity: 1; transform: none; }
  @starting-style { .sheet .card.in { opacity: 0; transform: translate3d(0, 10px, 0); } }
  /* 카드 머리 — 첫 줄 = 장비 이름(또는 분야 탭)과 닫기 · 둘째 줄 = 제목과 도장 */
  .sheet .card-head { flex-wrap: wrap; gap: 4px 12px; }
  .sheet .card-zone, .sheet .card-tabs { order: 1; }
  .sheet .card-head .icon-btn { order: 2; margin-left: auto; }
  .sheet .card h2 { order: 3; flex: 1 0 calc(100% - 136px); min-width: 0; font-size: 22px; line-height: 28px; white-space: normal; }
  .sheet .card-head .stamp { order: 4; margin-left: 0; }
  .sheet .card-zone { margin-top: 0; }
  .sheet .card-body { grid-template-columns: 1fr; gap: 12px; }
  .sheet .card .can li::before { top: 9px; }
  .sheet .card-foot { flex-wrap: wrap; gap: 12px; }
  .sheet .crew { flex: 1 0 100%; }
  .sheet .go { height: 44px; margin-left: 0; flex: 1; justify-content: center; }
  .sheet .icon-btn { width: 44px; height: 44px; }
  .sheet .card-tabs button { height: 44px; padding: 0 12px; }
  .sheet .inspector { right: 60px; top: -40px; width: 52px; height: 52px; }
  .prof { display: none; }
  .tag span { font-size: 11px; line-height: 16px; padding: 2px 6px; }
  .rail { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 24px 16px; }
  .rail-list { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rail-list button { height: 44px; border: 1px solid var(--line); text-align: center; }
  .rail-list button[aria-pressed='true'] { background: var(--wood-2); border-color: rgba(183, 151, 96, 0.6); }
  .rail-ind { display: none; }
  .rail-src { height: 44px; }
}
@media (max-width: 760px) {
  .bar { position: relative; display: block; height: auto; padding: 0 16px; }
  .brand { display: flex; width: fit-content; height: 56px; min-height: 44px; }
  .nav { height: 44px; gap: 0; margin: 0 -12px; }
  .nav-link { padding: 0 12px; }
  .nav-ask { position: absolute; right: 16px; top: 6px; margin-left: 0; }
  .nav-link::before, .nav-ask::before { inset: 0; }
  .sheet { padding: 20px 16px 4px; }
  .rail { padding: 12px 16px 16px; }
  .rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail-list button:nth-of-type(odd):last-of-type { grid-column: 1 / -1; }
  .films { padding: 40px 16px 72px; }
  .films-head { display: block; margin-bottom: 16px; }
  .films-head h2 { font-size: 24px; line-height: 32px; }
  .films-head p { margin-top: 4px; }
  .feature { grid-template-columns: 1fr; gap: 16px; }
  .screen { border-radius: 8px; }
  .reel { grid-template-columns: 1fr; margin-top: 20px; }
}
