/* gfx-bits · 사진 지문 대조(지문 비트장) — 11-04 자동 반복판(지시서 §19 · 가운데 대칭 배치)
   선택자는 모두 .gfx-bits 로 시작 · 전역 변수는 읽기만(--font 홈 · --font-sans Next).
   색 = 무대 토큰 다섯(--gfx-ink · --gfx-paper · --gfx-dim · --gfx-line · --gfx-accent)을 읽고, 없으면 밝은 기본값(크림 · 먹 · 주황).
     .hb-stage(어두운 무대)가 다섯 토큰을 덮으면 글·선·캔버스가 모두 무대 색으로 바뀜(캔버스는 그릴 때 계산된 색을 읽음).
     장면 안에서 --gfx-* 를 다시 정의하지 않음(무대 값이 그대로 내려오게) — 장면 안 이름은 --gb-*.
   배치: 머리(제목 · 표기 · 멈춤) → 큰 숫자 셋(대조한 이미지 · 같은 사진 · 서로 다른 파일) → 이름표 5(바퀴에 맞춰 바뀜) → 캔버스(지문 판 둘 + 가운데 큰 숫자 + 차트).
   캔버스 자리(--gfx-bits-h)는 엔진 layout() 의 모드별 높이(A 532 · B 500 · P 579 · S 579) → JS 전후 밀림 0.
   모드: A ≥1280 · B 960–1279 · P 375–959 · S ≤374 (엔진 MODES 와 같은 미디어 쿼리) · 곡선 cubic-bezier(.22,1,.36,1) 한 벌 · 숫자 tabular-nums. */
.gfx-bits {
  --gb-ink: var(--gfx-ink, #151414);
  --gb-paper: var(--gfx-paper, #fffdf9);
  --gb-dim: var(--gfx-dim, #736d66);
  --gb-line: var(--gfx-line, #e6dccd);
  --gb-acc: var(--gfx-accent, #ff5e1f);
  --gb-sub: #4d4a46;
  --gb-ease: cubic-bezier(.22, 1, .36, 1);
  --gb-font: var(--font, var(--font-sans, 'AboutUs Home Sans', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif));
  --gb-g: 40px;
  --gfx-bits-h: 532px;
  position: relative;
  display: block;
  margin: 0;
  padding: 0;   /* 위 여백 = 무대 자리(section.hb-gfx)의 --st-pad · 뿌리 바깥 여백 0 */
  color: var(--gb-ink);
  font-family: var(--gb-font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .gfx-bits { --gb-sub: color-mix(in srgb, var(--gb-ink) 76%, var(--gb-paper)); }
}
.gfx-bits *, .gfx-bits *::before, .gfx-bits *::after { box-sizing: border-box; }
.gfx-bits-wrap { width: var(--st-col, min(100% - 2 * var(--gb-g), 1360px)); margin: 0 auto; }

/* 머리: 제목 · 표기 · 멈춤(5초 넘게 움직이는 장면의 멈춤 단추) */
.gfx-bits-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 24px; }
.gfx-bits-title { flex: 1 1 auto; margin: 0; font-size: var(--st-h, 48px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 650; color: var(--gb-ink); }
.gfx-bits-label { margin: 0 0 6px; font-size: 15px; line-height: 1.5; font-weight: 560; color: var(--gb-dim); white-space: nowrap; }
.gfx-bits-ctl {
  appearance: none;
  -webkit-appearance: none;
  margin: 0 0 2px;
  height: 40px;
  min-width: 76px;
  padding: 0 16px;
  border: 1px solid var(--gb-line);
  border-radius: 12px;
  background: transparent;
  color: var(--gb-ink);
  font: 600 15px/1 var(--gb-font);
  cursor: pointer;
  transition: border-color 160ms var(--gb-ease);
}
.gfx-bits-ctl:hover { border-color: var(--gb-dim); }
.gfx-bits-ctl[hidden] { display: none; }
.gfx-bits-ctl:focus-visible { outline: 2px solid var(--gb-acc); outline-offset: 3px; }

/* 큰 숫자 셋 — 가운데 맞춤 세 칸 · 숫자 칸 폭은 마지막 자릿수로 고정(세는 동안 밀림 0) */
.gfx-bits-stats { margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--gb-line); }
.gfx-bits-stats > div { min-width: 0; padding: 16px 8px 0; text-align: center; }
.gfx-bits-stats > div + div { border-left: 1px solid var(--gb-line); }
.gfx-bits-stats dt { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--gb-dim); white-space: nowrap; }
.gfx-bits-stats dd { margin: 8px 0 0; display: flex; align-items: baseline; justify-content: center; white-space: nowrap; font-size: clamp(60px, 5.6vw, 84px); line-height: 1; }
.gfx-bits-n { display: inline-block; text-align: right; font-weight: 560; letter-spacing: -0.045em; color: var(--gb-ink); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.gfx-bits-n[data-d="3"] { width: 3.05ch; }
.gfx-bits-n[data-d="2"] { width: 2.05ch; }
.gfx-bits-u { margin-left: 0.1em; font-size: 0.24em; font-weight: 600; color: var(--gb-dim); letter-spacing: 0; }
.gfx-bits-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 이름표 5 — 바퀴에 맞춰 지금 단계가 바뀜. 쪽 진행 줄(선 + 밑줄)과 다른 모양: 가운데 한 줄 낱말 · 지금 = 1px 테두리 알약 + 주황 점(+ 아래 1px 주황이 차오름) · 지난 = 중간 글 · 남은 = 흐림 */
.gfx-bits-steps { --gb-p: 1; position: relative; list-style: none; margin: 26px 0 0; padding: 0; display: flex; justify-content: center; align-items: center; gap: 4px; }
.gfx-bits-steps li { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; font-size: 15px; line-height: 1; font-weight: 560; color: var(--gb-dim); white-space: nowrap; transition: color 200ms var(--gb-ease), border-color 200ms var(--gb-ease); }
.gfx-bits-steps li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: .55; }
.gfx-bits-steps li.is-done, .gfx-bits-steps.is-end li { color: var(--gb-sub); }
.gfx-bits-steps li.is-now { color: var(--gb-ink); font-weight: 650; border-color: var(--gb-line); background: linear-gradient(var(--gb-acc), var(--gb-acc)) 14px calc(100% - 1px) / calc((100% - 28px) * var(--gb-p, 0)) 1px no-repeat; }
.gfx-bits-steps li.is-now::before { background: var(--gb-acc); opacity: 1; }

/* 장면(캔버스) — 주인공 판 = .gfx-bits-art.st-frame(둥글기 · 머리카락 선 · 그림자 · 테두리 빛 = stage.css 정의) · 안쪽 여백만 여기서(캔버스 폭 = 판 안쪽 폭 · 엔진이 읽음) */
.gfx-bits-art { position: relative; margin-top: 18px; min-width: 0; }
.gfx-bits-art.st-frame { margin-top: 24px; padding: 32px 32px 26px; }
.gfx-bits-canvas { display: block; width: 100%; height: var(--gfx-bits-h); }
/* JS 꺼짐 포스터 둘: 밝은 판 기본 · 어두운 무대(html[data-scheme="dark"] · JS 꺼짐 html:not(.fxjs) = stage.css 와 같은 조건)면 어두운 판 */
.gfx-bits-poster, .gfx-bits-poster img { display: block; width: 100%; height: auto; }
.gfx-bits-poster.is-dark, html[data-scheme="dark"] .gfx-bits-poster.is-light, [data-theme="dark"] .gfx-bits-poster.is-light, html:not(.fxjs) .gfx-bits-poster.is-light { display: none; }
html[data-scheme="dark"] .gfx-bits-poster.is-dark, [data-theme="dark"] .gfx-bits-poster.is-dark, html:not(.fxjs) .gfx-bits-poster.is-dark { display: block; }
/* §21 뒤집는 동안(html[data-theme-transition])만 장면 글·선 색이 0.5초로 따라 바뀜(토큰이 등록 색이면 저절로 섞이고, 아니면 이 규칙이 섞음) */
html[data-theme-transition] .gfx-bits, html[data-theme-transition] .gfx-bits * { transition-property: color, background-color, border-color, box-shadow, fill, stroke; transition-duration: var(--theme-duration, .5s); transition-timing-function: var(--theme-ease, ease); }

/* 모드 B(960–1279) */
@media (max-width: 1279px) {
  .gfx-bits { --gfx-bits-h: 500px; }
  .gfx-bits-title { font-size: var(--st-h, 42px); }
  .gfx-bits-steps li { font-size: 14px; }
}

/* 좁은 판(959 이하): 판 폭 560 안 · 큰 숫자 셋은 한 줄 · 이름표는 지금 단계 하나만 글로 */
@media (max-width: 959px) {
  .gfx-bits { --gfx-bits-h: 579px; }
  .gfx-bits-wrap { width: min(var(--st-col, 100% - 2 * var(--gb-g)), 560px); }
  .gfx-bits-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title ctl" "label label"; align-items: center; gap: 6px 12px; }
  .gfx-bits-title { grid-area: title; font-size: var(--st-h, 30px); line-height: 1.16; letter-spacing: -0.025em; }
  .gfx-bits-label { grid-area: label; margin: 0; font-size: 14px; white-space: normal; }
  .gfx-bits-ctl { grid-area: ctl; height: 44px; min-width: 72px; padding: 0 14px; font-size: 14px; margin: 0; }
  .gfx-bits-stats { margin-top: 20px; }
  .gfx-bits-stats > div { padding: 14px 4px 0; }
  .gfx-bits-stats dt { font-size: 14px; }
  .gfx-bits-stats dd { margin-top: 6px; font-size: 44px; }
  .gfx-bits-u { font-size: 14px; margin-left: 2px; }
  /* 폰: 네모 점 다섯(지난 = 먹 · 지금 = 주황 · 남은 = 흐림) + 그 옆에 지금 단계 이름 하나 */
  .gfx-bits-steps { justify-content: flex-start; gap: 6px; margin-top: 18px; height: 24px; }
  .gfx-bits-steps li { height: auto; padding: 0; gap: 0; border: 0; background: none; font-size: 0; }
  .gfx-bits-steps li.is-now { background: none; }
  .gfx-bits-steps li::before { width: 8px; height: 8px; border-radius: 2px; opacity: 1; background: var(--gb-line); }
  .gfx-bits-steps li.is-done::before, .gfx-bits-steps.is-end li::before { background: var(--gb-ink); }
  .gfx-bits-steps li.is-now::before { background: var(--gb-acc); }
  .gfx-bits-steps li > span { display: none; }
  .gfx-bits-steps li.is-now > span, .gfx-bits-steps.is-end li:last-child > span { display: block; position: absolute; left: 80px; top: 50%; transform: translateY(-50%); font-size: 15px; line-height: 1.2; color: var(--gb-ink); font-weight: 650; }
  .gfx-bits-art { margin-top: 18px; }
  /* 폰: 판은 글 기둥 밖으로 8px 씩(안쪽 여백 10 · 지문 판 칸 크기 유지) */
  .gfx-bits-art.st-frame { margin: 20px -8px 0; padding: 14px 10px 12px; }
}
@media (max-width: 767px) {
  .gfx-bits { --gb-g: 16px; }
}
@media (max-width: 374px) {
  .gfx-bits { --gfx-bits-h: 579px; }
  .gfx-bits-title { font-size: var(--st-h, 28px); }
  .gfx-bits-stats dt { font-size: 14px; letter-spacing: -0.02em; }
  .gfx-bits-stats dd { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .gfx-bits *, .gfx-bits *::before, .gfx-bits *::after { transition: none !important; }
}
