/* 거품판독기 — 번호표 · 영수증 */
:root {
  --ink: #111111;
  --paper: #ffffff;
  --paper-2: #f2f2ef;
  --asphalt: #141414;
  --asphalt-2: #1d1d1d;
  --grid: #262626;
  --yellow: #ffd400;
  --stamp: #e3261b;
  --stamp-mid: #e07b00;
  --stamp-ok: #1a7f3c;
  --mono: "Nanum Gothic Coding", "D2Coding", ui-monospace, Menlo, monospace;
  --display: "Black Han Sans", "Nanum Gothic Coding", sans-serif;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --asphalt: #0d0d0d; --asphalt-2: #171717; --grid: #222; } }
:root[data-theme="dark"] { --asphalt: #0d0d0d; --asphalt-2: #171717; --grid: #222; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background-color: var(--asphalt);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: var(--mono);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; }

/* ---------- 상단 테이프 (경고 띠 + 흐르는 글자) ---------- */
.tape {
  background: var(--yellow); color: var(--ink);
  border-bottom: 6px solid var(--ink);
  overflow: hidden; white-space: nowrap; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.tape-track { display: inline-flex; animation: tape 28s linear infinite; padding: 6px 0; }
.tape-track span { padding-right: 2ch; }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }

/* ---------- 헤더 ---------- */
.top {
  max-width: var(--max); margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; gap: 16px;
}
.logo { font-family: var(--display); font-size: 1.5rem; text-decoration: none; letter-spacing: .02em; }
.top-meta { flex: 1; font-size: .75rem; color: #8a8a8a; }
.top-link {
  font-weight: 700; text-decoration: none; font-size: .85rem;
  border: 2px solid var(--paper); padding: 6px 12px;
}
.top-link:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 640px) { .top-meta { display: none; } }

main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0; }
.sec-head { margin-bottom: 28px; }
.sec-title { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: .01em; }
.sec-title::before { content: "■ "; color: var(--yellow); }
.sec-note { color: #a8a8a8; font-size: .9rem; margin-top: 6px; max-width: 46ch; }

/* ---------- 히어로 ---------- */
.hero {
  display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center;
  padding-top: 48px;
}
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr .85fr; gap: 56px; padding-top: 72px; } }
.kicker { color: var(--yellow); font-weight: 700; font-size: .85rem; margin-bottom: 18px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(3.2rem, 11vw, 6.4rem);
  line-height: .98; letter-spacing: -0.01em;
}
.hero h1 mark {
  background: var(--yellow); color: var(--ink);
  padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero-sub { margin-top: 24px; font-size: 1rem; color: #d6d6d6; max-width: 40ch; }
.hero-sub b { color: var(--paper); background: var(--asphalt-2); outline: 1px dashed #555; padding: 1px 4px; white-space: nowrap; }
.cta {
  display: inline-flex; flex-direction: column; gap: 2px; margin-top: 32px;
  background: var(--paper); color: var(--ink); text-decoration: none;
  padding: 14px 20px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--yellow);
  font-weight: 700; transition: transform .08s ease, box-shadow .08s ease;
}
.cta:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--yellow); }
.cta-arrow { font-size: .85rem; color: #555; }

/* ---------- 번호표 ---------- */
.ticket {
  background: var(--paper); color: var(--ink);
  width: min(100%, 360px); margin: 0 auto; padding: 22px 22px 0;
  position: relative; transform: rotate(-1.2deg);
  box-shadow: 0 24px 40px -20px rgba(0,0,0,.8);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; left: 0; right: 0; height: 12px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px,
              linear-gradient(45deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px;
}
.ticket::before { top: -12px; transform: scaleY(-1); }
.ticket::after { bottom: -12px; }
.ticket-head { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.ticket-num {
  font-family: var(--display); font-size: 6.5rem; line-height: 1; text-align: center; padding: 18px 0 6px;
  display: flex; flex-direction: column; align-items: center;
}
.ticket-num small { font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .1em; }
.ticket-num .pct { font-size: 1.6rem; font-family: var(--display); align-self: flex-end; margin-top: -1.6rem; margin-right: 10%; }
.ticket-rows { border-top: 1px dashed var(--ink); border-bottom: 1px dashed var(--ink); padding: 10px 0; font-size: .9rem; }
.ticket-rows div { display: flex; justify-content: space-between; padding: 3px 0; }
.ticket-rows .strong { font-weight: 700; }
.ticket-foot { display: flex; justify-content: space-between; gap: 8px; font-size: .7rem; padding: 10px 0 22px; color: #444; }
.ticket-out { transform: none; margin-top: 28px; }
.ticket-out[hidden] { display: none; }
.ticket-out { animation: print .5s ease-out; }
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* ---------- 영수증 ---------- */
.receipt {
  background: var(--paper); color: var(--ink);
  width: min(100%, 420px); margin: 0 auto; padding: 26px 24px 0; position: relative;
  box-shadow: 0 30px 50px -24px rgba(0,0,0,.9);
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px,
              linear-gradient(45deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 12px;
}
.r-brand { font-family: var(--display); font-size: 1.9rem; text-align: center; letter-spacing: .04em; }
.r-meta { display: flex; justify-content: space-between; font-size: .78rem; color: #444; }
.r-rule { border-top: 1px dashed var(--ink); margin: 12px 0; }
.r-field { display: block; margin: 8px 0 14px; }
.r-line { display: flex; justify-content: space-between; align-items: baseline; font-size: .95rem; padding: 3px 0; }
.r-line output, .r-line span:last-child { font-variant-numeric: tabular-nums; }
.r-total { font-weight: 700; font-size: 1.35rem; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.r-formula { font-size: .75rem; color: #666; text-align: right; }
.r-note { font-size: .75rem; color: #555; line-height: 1.5; }
.r-thanks { text-align: center; font-weight: 700; margin: 14px 0 6px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 2px 0 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px); }
input[type="range"]::-moz-range-track { height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 0; }

/* 바코드 */
.barcode {
  height: 44px; margin: 14px 0 26px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px,
    var(--ink) 9px 12px, transparent 12px 14px, var(--ink) 14px 15px, transparent 15px 19px,
    var(--ink) 19px 21px, transparent 21px 22px, var(--ink) 22px 25px, transparent 25px 29px);
}

/* 도장 */
.stamp-area { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 10px; }
.stamp {
  font-family: var(--display); font-size: 2.6rem; line-height: 1;
  color: var(--stamp); border: 4px solid var(--stamp); padding: 4px 14px 2px;
  transform: rotate(-8deg); letter-spacing: .06em;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 -.25'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)' fill='%23000'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  mask-composite: add; -webkit-mask-composite: source-over;
  mask-size: 120px 60px, 100% 100%;
  opacity: .92;
  animation: slam .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes slam { from { transform: rotate(-8deg) scale(1.6); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: .92; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }
.stamp-sub { font-size: .8rem; color: #444; text-align: center; }
[data-level="mid"] .stamp { color: var(--stamp-mid); border-color: var(--stamp-mid); }
[data-level="low"] .stamp { color: var(--stamp-ok); border-color: var(--stamp-ok); }
[data-level="none"] .stamp { color: #777; border-color: #777; }

/* ---------- 샘플 스텁 ---------- */
.stubs {
  list-style: none; margin: 0; padding: 8px 0 24px;
  display: grid; gap: 22px; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .stubs { grid-template-columns: repeat(3, 1fr); } }
.stub {
  background: var(--paper-2); color: var(--ink); padding: 18px 18px 22px; position: relative;
  box-shadow: 0 18px 30px -18px rgba(0,0,0,.9);
}
.stub:nth-child(1) { transform: rotate(-1.5deg); }
.stub:nth-child(2) { transform: rotate(1deg) translateY(10px); }
.stub:nth-child(3) { transform: rotate(-.6deg); }
.stub::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(135deg, var(--paper-2) 50%, transparent 50%) 0 0 / 10px 10px,
              linear-gradient(45deg, var(--paper-2) 50%, transparent 50%) 0 0 / 10px 10px;
}
.stub h3 { font-family: var(--display); font-size: 1.4rem; margin: 8px 0 10px; }
.stub .r-total { font-size: 1.1rem; }
.stub .stamp { font-size: 2rem; border-width: 3px; }
.stub .stamp-area { padding: 10px 0 4px; }
.stub .r-note { margin-top: 8px; text-align: center; }

/* ---------- 작동 방식 ---------- */
.how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--paper); }
.how-list li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px dashed #555; }
@media (min-width: 720px) { .how-list { grid-template-columns: repeat(3, 1fr); border-top: 0; } .how-list li { grid-template-columns: 1fr; border-bottom: 0; border-top: 2px solid var(--paper); padding-right: 24px; } }
.how-num { font-family: var(--display); font-size: 2.6rem; color: var(--yellow); line-height: 1; }
.how-list h3 { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.how-list p { color: #bdbdbd; font-size: .92rem; }

/* ---------- 번호표 뽑기 ---------- */
.dispenser {
  border: 3px solid var(--paper); padding: 28px 20px 32px; position: relative;
  max-width: 560px; margin: 0 auto;
  background: var(--asphalt-2);
  box-shadow: 10px 10px 0 var(--yellow);
}
.dispenser::before {
  content: "뽑으세요"; position: absolute; top: -14px; left: 20px;
  background: var(--yellow); color: var(--ink); font-weight: 700; font-size: .8rem; padding: 2px 10px;
}
.disp-head { margin-bottom: 20px; }
.waitlist form { display: grid; gap: 6px; }
.waitlist label { font-weight: 700; font-size: .9rem; margin-top: 10px; }
.waitlist input[type="email"], .waitlist select {
  width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--paper); border-radius: 0;
  background: var(--asphalt); color: var(--paper);
}
.waitlist input[type="email"]:focus, .waitlist select:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.waitlist fieldset { border: 0; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.waitlist legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--yellow); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pull {
  margin-top: 18px; display: flex; justify-content: space-between; align-items: center;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink);
  font: inherit; font-weight: 700; font-size: 1.1rem; padding: 14px 18px; cursor: pointer;
  box-shadow: 0 6px 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease;
}
.pull:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--ink); }
.pull:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.pull:disabled { opacity: .6; cursor: default; }
.pull-arrow { font-size: 1.4rem; }
.form-msg { min-height: 1.4em; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.form-msg.ok { color: var(--yellow); }
.form-msg.err { color: #ff6a5b; }
.fine { color: #8a8a8a; font-size: .78rem; margin-top: 4px; }

/* ---------- 푸터 ---------- */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 24px 16px 56px;
  border-top: 6px solid var(--yellow);
  color: #8a8a8a; font-size: .78rem;
}
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot-brand { font-family: var(--display); color: var(--paper); font-size: 1rem; }
.foot-biz {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed #333;
  display: flex; flex-wrap: wrap; gap: 6px 0;
}
.foot-biz > * { padding-right: 12px; margin-right: 12px; border-right: 1px solid #333; text-decoration: none; }
.foot-biz > *:last-child { border-right: 0; }
.foot-biz a:hover { color: var(--paper); }
.foot-copy { margin-top: 12px; color: #666; }
