/* ─────────────────────────────────────────────────────────────
   공개 페이지 «주요 기능» 모션 소개 — 단일 출처 (2026-11-08)
   쓰는 곳: landing.html(홈) · intro.html(서비스 소개). 그리는 코드 = /js/feature-motion.js
   문법: 산업 스킨 그대로 — 종이/잉크·헤어라인·radius 0·그림자 0·그라디언트 0·모노 라벨.
   ⭐원칙: 모든 움직임은 «시작 상태만» 키프레임 from 에 둔다 → 기본(=애니메이션이 꺼진) 상태가 곧 완성 화면.
     그래서 «동작 줄이기» 설정에서는 애니메이션만 끄면 완성된 장면이 그대로 보인다.
   ───────────────────────────────────────────────────────────── */
.fm {
  --fm-paper:var(--paper, #edeae1); --fm-panel:var(--panel, #f3f1ea); --fm-ink:var(--ink, #1c1b17);
  --fm-ink-2:var(--ink-2, #56544c); --fm-ink-3:var(--ink-3, #9a978c);
  --fm-line:var(--line, rgba(28,27,23,.16)); --fm-line-soft:var(--line-soft, rgba(28,27,23,.08));
  --fm-ok:var(--ok, #3f7d4e); --fm-ok-bg:var(--ok-bg, rgba(63,125,78,.12));
  --fm-warn:var(--warn, #b06f16); --fm-warn-bg:var(--warn-bg, rgba(176,111,22,.14));
  --fm-danger:var(--danger, #a5372a); --fm-danger-bg:var(--danger-bg, rgba(165,55,42,.12));
  --fm-info:var(--info, #2f5da8); --fm-info-bg:var(--info-bg, rgba(47,93,168,.12));
  --fm-accent:#e0a955;                 /* 앱 먹색 메뉴의 노랑과 같은 값 */
  --fm-mono:var(--mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  display:grid; grid-template-columns:minmax(0, 340px) minmax(0, 1fr); gap:28px; align-items:start;
  text-align:left;
}

/* ── 왼쪽: 기능 목록(누르면 그 장면) ── */
.fm-tabs { display:flex; flex-direction:column; border-top:1px solid var(--fm-line); }
.fm-tab {
  all:unset; box-sizing:border-box; display:block; cursor:pointer; position:relative;
  padding:16px 4px 18px 0; border-bottom:1px solid var(--fm-line);
}
.fm-tab:focus-visible { outline:2px solid var(--fm-ink); outline-offset:2px; }
.fm-tab-h { display:flex; align-items:baseline; gap:12px; }
.fm-no { font-family:var(--fm-mono); font-size:12px; color:var(--fm-ink-3); letter-spacing:.06em; min-width:22px; }
.fm-t { font-size:17px; font-weight:800; letter-spacing:-.3px; color:var(--fm-ink-3); transition:color .25s; }
.fm-tab:hover .fm-t { color:var(--fm-ink-2); }
.fm-d {
  font-size:14px; line-height:1.65; color:var(--fm-ink-2); margin:8px 0 0 34px;
  display:none; text-wrap:pretty;
}
.fm-tab.on .fm-t { color:var(--fm-ink); }
.fm-tab.on .fm-no { color:var(--fm-ink); }
.fm-tab.on .fm-d { display:block; }
/* 진행 막대 — 지금 장면이 얼마나 남았는지 */
.fm-prog { position:absolute; left:0; bottom:-1px; height:2px; width:0; background:var(--fm-ink); }
.fm-tab.on .fm-prog { width:100%; animation:fm-grow var(--fm-dur, 8s) linear both; }
.fm.paused .fm-tab.on .fm-prog, .fm.manual .fm-tab.on .fm-prog { animation:none; width:100%; }

/* ── 오른쪽: 장면 무대(터미널 프레임) ── */
.fm-stage-wrap { min-width:0; }
.fm-frame { border:1px solid var(--fm-line); background:var(--fm-panel); overflow:hidden; }
.fm-bar { height:32px; border-bottom:1px solid var(--fm-line); display:flex; align-items:center; gap:6px; padding:0 12px; }
.fm-bar i { width:8px; height:8px; border-radius:1px; display:block; }
.fm-bar i.r { background:var(--fm-danger); } .fm-bar i.y { background:var(--fm-warn); } .fm-bar i.g { background:var(--fm-ok); }
.fm-addr { font-family:var(--fm-mono); font-size:11px; color:var(--fm-ink-3); margin-left:8px; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fm-stage { position:relative; height:420px; background:var(--fm-paper); padding:24px 26px; overflow:hidden; }
.fm-note { font-family:var(--fm-mono); font-size:11px; color:var(--fm-ink-3); margin-top:10px; letter-spacing:.02em; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.fm-ctl { all:unset; cursor:pointer; font-family:var(--fm-mono); font-size:11px; color:var(--fm-ink-2); border-bottom:1px solid var(--fm-line); }
.fm-ctl:focus-visible { outline:2px solid var(--fm-ink); outline-offset:2px; }

/* ── 움직임 부품 (from 만 정의 → 기본 상태 = 완성) ── */
.fm-a { animation:fm-in .5s cubic-bezier(.25,.8,.25,1) var(--d, 0s) both; }
.fm-pop { animation:fm-pop .45s cubic-bezier(.3,1.4,.5,1) var(--d, 0s) both; }
.fm-type { display:inline-block; vertical-align:bottom; overflow:hidden; white-space:nowrap; width:calc(var(--n) * 1ch);
  animation:fm-type calc(var(--n) * .09s) steps(var(--n)) var(--d, 0s) both; }
.fm-bar-grow { animation:fm-grow 1.2s cubic-bezier(.4,0,.2,1) var(--d, 0s) both; }
@keyframes fm-in   { from { opacity:0; transform:translateY(8px); } }
@keyframes fm-pop  { from { opacity:0; transform:scale(.86); } }
@keyframes fm-type { from { width:0; } }
@keyframes fm-grow { from { width:0; } }
@keyframes fm-caret { 50% { opacity:0; } }
@keyframes fm-scan { from { top:0; opacity:1; } 85% { opacity:1; } to { top:100%; opacity:0; } }
@keyframes fm-dots { 0% { opacity:0; max-height:0; } 8%, 88% { opacity:1; max-height:40px; } 100% { opacity:0; max-height:0; margin:0; padding:0; border-width:0; } }
@keyframes fm-blinkdot { 0%, 100% { opacity:.25; } 50% { opacity:1; } }
@keyframes fm-sweep { from { opacity:1; left:-30%; } to { opacity:1; left:100%; } }

/* 공용 조각 */
.fm-k { font-family:var(--fm-mono); font-size:10.5px; color:var(--fm-ink-3); letter-spacing:.06em; }
.fm-tag { display:inline-flex; align-items:center; gap:5px; font-family:var(--fm-mono); font-size:11px; font-weight:600; padding:2px 8px; white-space:nowrap; }
.fm-tag::before { content:''; width:6px; height:6px; border-radius:1px; background:currentColor; }
.fm-tag.ok { color:var(--fm-ok); background:var(--fm-ok-bg); }
.fm-tag.warn { color:var(--fm-warn); background:var(--fm-warn-bg); }
.fm-tag.danger { color:var(--fm-danger); background:var(--fm-danger-bg); }
.fm-tag.info { color:var(--fm-info); background:var(--fm-info-bg); }
.fm-card { border:1px solid var(--fm-line); background:var(--fm-panel); padding:12px 14px; }

/* ① 화학물질 규제 판별 */
.fm-q { display:flex; gap:8px; align-items:stretch; }
.fm-input { flex:1; min-width:0; border:1px solid var(--fm-ink); background:var(--fm-panel); padding:10px 12px; font-family:var(--fm-mono); font-size:15px; display:flex; align-items:center; gap:10px; }
.fm-input .fm-k { flex-shrink:0; }
.fm-caret { display:inline-block; width:2px; height:18px; background:var(--fm-ink); margin-left:1px; animation:fm-caret 1s steps(1) infinite; vertical-align:middle; }
.fm-btn { background:var(--fm-ink); color:var(--fm-paper); font-family:var(--fm-mono); font-size:13px; font-weight:600; padding:0 18px; display:flex; align-items:center; }
.fm-chem-h { display:flex; align-items:baseline; gap:12px; margin:22px 0 12px; flex-wrap:wrap; }
.fm-chem-h b { font-size:24px; font-weight:800; letter-spacing:-.5px; }
.fm-rows { border-top:1px solid var(--fm-line); }
.fm-row { display:grid; grid-template-columns:minmax(0,150px) minmax(0,1fr) auto; gap:12px; align-items:center; padding:11px 0; border-bottom:1px solid var(--fm-line-soft); font-size:14px; }
.fm-row .l { font-weight:700; }
.fm-row .v { color:var(--fm-ink-2); }
.fm-row .v b { color:var(--fm-ink); font-family:var(--fm-mono); }
.fm-src { margin-top:14px; }

/* ② 사진 분석 */
.fm-split { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.08fr); gap:20px; height:100%; }
.fm-photo { position:relative; border:1px solid var(--fm-line); background:#e4e0d4; overflow:hidden; min-height:0; }
.fm-photo svg { position:absolute; inset:0; width:100%; height:100%; }
.fm-scanline { position:absolute; left:0; right:0; height:2px; background:var(--fm-accent); top:100%; opacity:0;
  animation:fm-scan 1.5s ease-in-out var(--d, 0s) both; }
.fm-findings { display:flex; flex-direction:column; gap:9px; min-width:0; }
.fm-findings .fm-card p { font-size:13.5px; line-height:1.55; margin-top:3px; }
.fm-flow { display:flex; align-items:center; gap:0; margin-top:4px; }
.fm-step { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; white-space:nowrap; }
.fm-step i { width:10px; height:10px; border:2px solid var(--fm-ok); background:var(--fm-ok); display:block; }
.fm-link { flex:1; height:2px; background:var(--fm-line); margin:0 8px; position:relative; min-width:14px; }
.fm-link::after { content:''; position:absolute; left:0; top:0; height:100%; width:100%; background:var(--fm-ok); animation:fm-grow .6s linear var(--d, 0s) both; }

/* ③ 이지 감시 */
.fm-sweep-h { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:12px; gap:10px; flex-wrap:wrap; }
.fm-sweep-h b { font-size:17px; font-weight:800; }
.fm-checks { border-top:1px solid var(--fm-line); position:relative; overflow:hidden; }
.fm-check { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:9px 2px; border-bottom:1px solid var(--fm-line-soft); font-size:14px; }
.fm-check .who { font-family:var(--fm-mono); font-size:11px; color:var(--fm-ink-3); margin-left:8px; }
.fm-sweepbar { position:absolute; top:0; bottom:0; width:30%; left:100%; opacity:0; background:rgba(224,169,85,.16); border-right:2px solid var(--fm-accent);
  animation:fm-sweep 2.6s cubic-bezier(.45,0,.55,1) var(--d, 0s) both; pointer-events:none; }
.fm-alert { display:flex; gap:12px; align-items:flex-start; margin-top:14px; border:1px solid var(--fm-warn); background:var(--fm-warn-bg); padding:12px 14px; border-left-width:4px; }
.fm-bell { flex-shrink:0; width:30px; height:30px; display:grid; place-items:center; background:var(--fm-ink); color:var(--fm-paper); font-family:var(--fm-mono); font-weight:700; font-size:13px; }
.fm-alert p { font-size:13.5px; line-height:1.55; }
.fm-alert b { font-weight:800; }

/* ④ MSDS → 관리요령 */
.fm-msds { display:grid; grid-template-columns:minmax(0, .8fr) 28px minmax(0, 1.2fr); gap:10px; align-items:center; height:100%; }
.fm-drop { border:1.5px dashed var(--fm-ink-3); height:100%; max-height:300px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; padding:16px; text-align:center; }
.fm-file { border:1px solid var(--fm-ink); background:var(--fm-panel); width:100%; max-width:190px; padding:12px; text-align:left; }
.fm-file .n { font-family:var(--fm-mono); font-size:12.5px; font-weight:700; }
.fm-file .p { height:4px; background:var(--fm-line); margin-top:10px; position:relative; }
.fm-file .p span { position:absolute; inset:0 auto 0 0; width:100%; background:var(--fm-ink); display:block; }
.fm-arrow { font-family:var(--fm-mono); font-size:22px; color:var(--fm-ink-3); text-align:center; }
.fm-sheet { background:#fff; color:#1c1b17; border:1px solid var(--fm-line); padding:16px; font-size:12px; line-height:1.5; }
.fm-sheet .t { border:1.5px solid #1c1b17; text-align:center; font-weight:800; font-size:14px; letter-spacing:3px; padding:5px; }
.fm-sheet .r { display:flex; border:1px solid #1c1b17; border-top:0; }
.fm-sheet .r .c { flex:1; padding:6px 8px; border-right:1px solid #1c1b17; }
.fm-sheet .r .g { width:86px; display:flex; gap:4px; align-items:center; justify-content:center; padding:4px; }
.fm-sheet .g img { width:32px; height:32px; display:block; }
.fm-sheet .h { border:1px solid #1c1b17; border-top:0; background:#efece3; text-align:center; font-weight:800; padding:2px; }
.fm-sheet .b { border:1px solid #1c1b17; border-top:0; padding:6px 8px; color:#56544c; }

/* ⑤ 이지 비서 */
.fm-chat { display:flex; flex-direction:column; gap:10px; height:100%; justify-content:flex-end; }
.fm-msg { max-width:82%; padding:10px 13px; font-size:14px; line-height:1.55; }
.fm-msg.me { align-self:flex-end; background:var(--fm-ink); color:var(--fm-paper); }
.fm-izi { display:flex; gap:9px; align-items:flex-start; max-width:88%; }
.fm-izi img { width:30px; height:30px; border-radius:50%; flex-shrink:0; }
.fm-izi .fm-msg { max-width:none; background:var(--fm-panel); border:1px solid var(--fm-line); }
.fm-typing { display:flex; gap:4px; padding:12px 14px; background:var(--fm-panel); border:1px solid var(--fm-line); width:max-content; max-height:0; opacity:0; overflow:hidden;
  animation:fm-dots 1.1s linear var(--d, 0s) both; margin-left:39px; }
.fm-typing i { width:6px; height:6px; background:var(--fm-ink-3); display:block; animation:fm-blinkdot .8s infinite; }
.fm-typing i:nth-child(2) { animation-delay:.15s; } .fm-typing i:nth-child(3) { animation-delay:.3s; }
.fm-mini { margin-top:8px; border-top:1px solid var(--fm-line); font-family:var(--fm-mono); font-size:12px; }
.fm-mini div { display:flex; justify-content:space-between; gap:18px; padding:4px 0; border-bottom:1px solid var(--fm-line-soft); }
.fm-go { display:inline-block; margin-top:6px; font-family:var(--fm-mono); font-size:12px; font-weight:600; border-bottom:1px solid var(--fm-ink); }

/* 동작 줄이기 — 장면 안 움직임을 모두 끄면 완성 화면이 그대로 남는다(자동 넘김도 JS가 끈다) */
@media (prefers-reduced-motion: reduce) {
  .fm *, .fm *::before, .fm *::after { animation:none !important; transition:none !important; }
  .fm .fm-tab.on .fm-prog { width:100%; }
}

/* 좁은 화면: 목록을 위로, 장면 아래 */
@media (max-width: 900px) {
  .fm { grid-template-columns:minmax(0, 1fr); gap:16px; }
  .fm-tabs { flex-direction:row; overflow-x:auto; border-top:0; border-bottom:1px solid var(--fm-line); scrollbar-width:none; }
  .fm-tabs::-webkit-scrollbar { display:none; }
  .fm-tab { flex:0 0 auto; padding:10px 14px 12px 0; margin-right:14px; border-bottom:0; }
  .fm-tab-h { gap:6px; }
  .fm-t { font-size:14px; white-space:nowrap; }
  .fm-tab.on .fm-d { display:none; }
  .fm-mdesc { display:block !important; }
  .fm-stage { height:auto; min-height:400px; padding:18px 16px; }
  .fm-split, .fm-msds { grid-template-columns:minmax(0, 1fr); }
  .fm-photo { height:190px; }
  .fm-arrow { transform:rotate(90deg); }
  .fm-drop { max-height:none; }
  .fm-row { grid-template-columns:minmax(0,1fr) auto; }
  .fm-row .v { grid-column:1 / -1; grid-row:2; }
}
.fm-mdesc { display:none; font-size:14px; line-height:1.65; color:var(--fm-ink-2); margin:2px 0 4px; }
