/* 도트 사진관 — 책상 위 민트 감열 프린터. 인화지가 한 줄씩 나오는 순간이 주인공. */
@font-face {
  font-family: "Galmuri Dot";
  src: url("../vendor/galmuri/galmuri11-dot.woff2") format("woff2");
  font-display: swap;
}
:root {
  --desk: #e9ebf0;
  --dot: rgba(27, 30, 36, .13);
  --mint: #8fd8c4;
  --mint-d: #4fae96;
  --slot: #23302c;
  --paper: #ffffff;
  --ink: #1b1e24;
  --ink-2: rgba(27, 30, 36, .62);
  --yellow: #ffcf33;
  --yellow-d: #d9a400;
  --rec: #ff4b3e;
  --pix: "Galmuri Dot", "Pretendard Variable", system-ui, sans-serif;
  --body: "Pretendard Variable", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; color: var(--ink); font-family: var(--body);
  background-color: var(--desk);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 16px 16px;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.app {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
  max-width: 1180px; margin: 0 auto; padding: env(safe-area-inset-top, 0) 16px env(safe-area-inset-bottom, 0);
}
.top { display: flex; align-items: baseline; gap: 12px; padding: 14px 0 6px; }
.home { font: 400 14px var(--pix); color: var(--ink-2); text-decoration: none; }
.home:hover { color: var(--ink); }
h1 { font: 700 20px/1 var(--pix); margin: 0; letter-spacing: 0; }

/* 프린터 + 인화지 */
.desk { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 8px; min-height: 0; }
.printer { width: min(100%, 420px); position: relative; z-index: 2; }
.p-body {
  height: 58px; background: var(--mint); border-radius: 18px 18px 6px 6px;
  box-shadow: inset 0 -7px 0 var(--mint-d), 0 3px 0 rgba(0,0,0,.08);
  display: flex; align-items: center; gap: 10px; padding: 0 18px 7px;
}
.p-led { width: 9px; height: 9px; border-radius: 50%; background: #2c6b5b; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
body.printing .p-led, body.live .p-led { background: var(--rec); box-shadow: 0 0 8px var(--rec); }
.p-name { font: 400 12px var(--pix); color: #1f5b4c; }
.p-feed { margin-left: auto; width: 26px; height: 14px; border-radius: 3px; background: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow-d); }
.p-slot { height: 10px; margin: 0 14px; background: var(--slot); border-radius: 0 0 4px 4px; }

.strip-clip { width: min(calc(100% - 44px), 392px); overflow: hidden; margin-top: -4px; position: relative; z-index: 1; padding-bottom: 14px; }
.strip { transform: translateY(0); will-change: transform; }
.strip.go { animation: feed var(--dur, 1.6s) steps(var(--steps, 48)) both; }
.strip.go #out { animation: reveal var(--dur, 1.6s) steps(var(--steps, 48)) both; } /* 위 줄부터 찍힌다 */
.strip.go .cap { animation: capin .25s var(--dur, 1.6s) both; }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes capin { from { opacity: 0; } to { opacity: 1; } }
@keyframes feed { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.paper {
  background: var(--paper); padding: 14px 14px 10px; position: relative;
  filter: drop-shadow(0 6px 6px rgba(27,30,36,.14));
  --tooth: 7px;
  -webkit-mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tooth) * 2) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 1px) no-repeat;
          mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tooth) * 2) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 1px) no-repeat;
  padding-bottom: 18px;
}
.view { position: relative; line-height: 0; }
#out { width: 100%; height: auto; image-rendering: pixelated; display: block; }
#cam { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cap { font: 400 12px/1.4 var(--pix); color: var(--ink-2); margin: 10px 0 0; display: flex; justify-content: space-between; gap: 8px; }
.shutter {
  margin-top: 6px; font: 700 16px var(--pix); background: var(--rec); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 22px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); cursor: pointer;
}

/* 조작 */
.panel { padding: 10px 0 18px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn {
  font: 400 15px var(--pix); background: var(--paper); border: 2px solid var(--ink); border-radius: 6px;
  padding: 9px 13px 8px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); position: relative; top: 0; white-space: nowrap;
}
.btn:active { top: 3px; box-shadow: 0 0 0 var(--ink); }
.btn.yellow { background: var(--yellow); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.samples { display: flex; gap: 6px; margin-left: auto; }
.samples button { width: 40px; height: 40px; padding: 0; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; }
.samples img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.samples button[aria-pressed="true"] { outline: 3px solid var(--yellow); outline-offset: 1px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.tabs button { font: 400 15px var(--pix); background: var(--paper); border: 0; padding: 10px 0 9px; cursor: pointer; }
.tabs button + button { border-left: 2px solid var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); padding: 6px 8px 5px; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; align-items: stretch; min-width: 86px;
}
.chip .sw { display: flex; height: 12px; border: 1px solid rgba(27,30,36,.35); }
.chip .sw i { flex: 1; }
.chip .nm { font: 400 12px var(--pix); white-space: nowrap; text-align: left; }
.chip .emo { font-size: 13px; line-height: 12px; height: 12px; letter-spacing: -1px; white-space: nowrap; overflow: hidden; }
.chip[aria-checked="true"] { background: var(--yellow); }

.knobs { gap: 14px; }
.slider { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; font: 400 13px var(--pix); }
.slider b { font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--ink); height: 26px; }
.tog { font: 400 14px var(--pix); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tog input { width: 20px; height: 20px; accent-color: var(--ink); }
body[data-mode="emoji"] #ditherWrap { visibility: hidden; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--paper); font: 400 14px var(--pix); padding: 10px 14px; border-radius: 6px;
  transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 900px) {
  .app { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); grid-template-rows: auto 1fr; column-gap: 40px; padding: 0 32px; }
  .top { grid-column: 1 / -1; padding-top: 22px; }
  .desk { padding-top: 24px; }
  .printer { width: 600px; }
  .strip-clip { width: 560px; }
  .panel { padding-top: 32px; align-self: start; }
  .chips { flex-wrap: wrap; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .strip.go, .strip.go #out, .strip.go .cap { animation: none; } .btn, .toast { transition: none; } }

/* 아래 안내 */
.guide { background: var(--paper); border-top: 2px solid var(--ink); content-visibility: auto; contain-intrinsic-size: auto 1500px; }
.guide-in { max-width: 680px; margin: 0 auto; padding: 44px 20px 64px; }
.guide h2 { font: 700 19px/1.35 var(--pix); margin: 38px 0 12px; }
.guide h2:first-child { margin-top: 0; }
.guide p, .guide li, .guide dd { font-size: 16px; line-height: 1.75; word-break: keep-all; }
.guide p { margin: 0 0 12px; }
.steps { padding-left: 22px; } .steps li { margin-bottom: 8px; } .steps b { margin-right: 6px; }
.faq dt { font-weight: 700; margin-top: 16px; } .faq dd { margin: 4px 0 0; }
.others { padding-left: 18px; } .others li { margin-bottom: 6px; line-height: 1.7; } .others a { font-weight: 700; margin-right: 6px; }
.guide a { color: var(--ink); text-underline-offset: 3px; }
.credit { font-size: 13px !important; color: var(--ink-2); margin-top: 28px !important; }
.fallback { padding: 20px; text-align: center; }
@media (max-width: 599px) { .row.act { display: grid; grid-template-columns: 1fr 1fr; } .row.act .btn { text-align: center; } } /* 버튼 4~5개를 2열로 가지런히 */
