/* ============================================================
   BASE — 프로젝트 A 의 스타일을 그대로 승계.
   프로젝트 B 에서 넘어온 UI(스캔 스테이지 / 진단 로그 / 비포애프터 /
   쉐이드 칩 / 픽토그램)는 하단 "PORTED FROM B" 블록에서
   본화이트 · 다크 포레스트로 전면 교체했습니다.
   ============================================================ */

:root { --ease: cubic-bezier(.22,.61,.36,1); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, "Noto Sans KR", sans-serif;
  background: #F6F3ED;
  color: #1C2E26;
  overscroll-behavior-y: none;
}
::selection { background: #1C2E26; color: #F6F3ED; }
* { -webkit-tap-highlight-color: transparent; }

/* 데이터 도구 인상을 만드는 라벨 — 모노 + 극단적 자간.
   국문에는 쓰지 마세요 (자간이 벌어져 깨집니다). */
.label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* Calibration Bar — 포인트 컬러가 허용되는 얇은 구분선 */
.calib-bar { height: 2px; width: 100%; display: flex; gap: 2px; }
.calib-bar > i { flex: 1; opacity: .55; }

/* 가로 스와이프 (라이브러리 없이 scroll-snap) */
.swipe {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.swipe::-webkit-scrollbar { display: none; }
.swipe > * { scroll-snap-align: start; flex: 0 0 auto; }

/* 이미지 슬롯 플레이스홀더 — 실제 촬영컷으로 교체 */
.ph {
  position: relative;
  background: linear-gradient(140deg, #EFEAE1 0%, #E6E0D4 45%, #F2EEE6 100%);
  overflow: hidden;
}
.ph::after {
  content: attr(data-slot); position: absolute; left: 8px; bottom: 7px;
  font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: .12em;
  color: #6B7A72; opacity: .7;
}

/* 드로어 */
.drawer { transform: translateX(100%); transition: transform .38s var(--ease); }
.drawer.open { transform: translateX(0); }
.scrim { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* 전체화면 뷰 (진단 플로우) */
.view {
  position: fixed; inset: 0; z-index: 90; background: #F6F3ED;
  transform: translateY(100%); transition: transform .45s var(--ease);
  overflow-y: auto; overscroll-behavior: contain;
}
.view.open { transform: translateY(0); }
.step { display: none; }
.step.active { display: block; animation: stepIn .45s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 심볼 활성점(Node) 점등 */
.node { transition: fill .5s ease, r .5s var(--ease); }
.node.lit { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* 분석 중 로딩 — 궤도를 도는 스캔 */
.orbit { transform-origin: 60px 60px; animation: spin 2.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scanline { animation: scan 1.8s var(--ease) infinite; }
@keyframes scan {
  0% { transform: translateY(-26px); opacity: 0; }
  35%,65% { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}

/* 지표 게이지 */
.gauge { transition: width 1.1s var(--ease); }

/* 스크롤 진입 연출 */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* 고민 선택 칩 */
.concern {
  padding: 9px 14px; border: 1px solid #E2DCD1; border-radius: 2px;
  font-size: 13px; color: #2E453B; background: transparent; transition: all .2s ease;
}
.concern[aria-pressed="true"] { background: #1C2E26; border-color: #1C2E26; color: #F6F3ED; }


/* ============================================================
   PORTED FROM B — 기능은 유지, 스킨만 A 로 교체
   ============================================================ */

/* 업로드 · 스캔 스테이지.
   B: 검은 배경 + 네온 레이저 → A: 본화이트 + 1px 포레스트 라인 */
.scan-stage {
  position: relative; overflow: hidden;
  background: #EFEAE1; border: 1px solid #E2DCD1; border-radius: 2px;
}
.scan-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-overlay { position: absolute; inset: 0; background: rgba(28,46,38,.10); backdrop-filter: blur(1px); }
.scan-overlay .rule { position: absolute; left: 24px; right: 24px; height: 1px; background: #5A7F97; opacity: .8; }
.scan-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(to right, rgba(28,46,38,.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28,46,38,.12) 1px, transparent 1px);
  background-size: 28px 28px;
}
/* 얼굴 정렬 가이드 프레임 */
.frame-guide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* 진단 로그. B: 형광 그린 터미널 → A: 모노 + 포레스트 뮤트 */
.diag-log {
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; line-height: 1.9;
  letter-spacing: .04em; color: #6B7A72;
  max-height: 108px; overflow-y: auto;
  border-left: 1px solid #E2DCD1; padding-left: 12px;
}
.diag-log > div::before { content: "› "; color: #A7AEB2; }

/* 쉐이드 칩 — HEX 코드 표기 전면 삭제. 컬러명 텍스트만.
   (B 의 .chip + i.dot 조합을 대체) */
.shade-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border: 1px solid #E2DCD1; border-radius: 2px;
  font-size: 12px; color: #2E453B; background: rgba(255,255,255,.5);
}
.shade-chip > i { width: 14px; height: 1px; background: currentColor; opacity: .5; }
.shade-chip.avoid { color: #6B7A72; border-style: dashed; }

/* 비포/애프터 슬라이더 — B 로직 유지, 라벨만 A 스킨 */
.ba-wrap { position: relative; overflow: hidden; user-select: none; touch-action: pan-y; border-radius: 2px; }
.ba-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ba-after-wrap { position: absolute; inset: 0 auto 0 0; width: 50%; overflow: hidden; }
.ba-after-wrap img { width: 100vw; max-width: none; height: 100%; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: #F6F3ED; box-shadow: 0 0 0 1px rgba(28,46,38,.25); cursor: ew-resize;
}
.ba-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; border: 1px solid #F6F3ED; border-radius: 50%;
  background: rgba(28,46,38,.35);
}
.ba-label {
  position: absolute; bottom: 10px; z-index: 2;
  font-family: "IBM Plex Mono", monospace; font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: #F6F3ED;
  background: rgba(28,46,38,.72); padding: 4px 8px; border-radius: 2px;
}

/* 픽토그램 — B 의 이모지(🌿 💕 💰 🍀 🚀)를 전량 대체한 라인아트 슬롯 */
.picto { display: block; }
.picto-box {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #E2DCD1; border-radius: 2px; background: rgba(255,255,255,.5);
}

/* 한정 특가 타이머 */
.timer-cell {
  min-width: 46px; padding: 7px 0; text-align: center;
  border: 1px solid rgba(246,243,237,.28); border-radius: 2px;
}

/* 탭 */
.tab-btn[aria-selected="true"] { color: #1C2E26; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
