/* 태움 픽셀 모드 — the 별관. Same printed-office language as the main site
   (bone paper, olive ink, a red 소각 seal, Gowun Batang / Zilla Slab), with one loud element:
   a 176 x 112 pixel-art campfire drawn from the vendored pixelfx library.
   Standalone on purpose: it does not load style.css. */

:root {
  --paper: #ecebe7;        /* bone ground */
  --sheet: #e1ddd2;        /* the form's paper, one tone down */
  --ink: #38450f;          /* olive ink */
  --ink-soft: #566130;
  --night: #0c0a08;        /* the pixel fire's dark field */
  --seal: #a8341a;         /* the red seal on a printed document */
  --on-dark: #f2f2f0;

  --font-kr: "Gowun Batang", "Nanum Myeongjo", Batang, serif;
  --font-num: "Zilla Slab", "Gowun Batang", serif;

  --wrap: 1180px;
  --pad: 20px;
  --h1: clamp(40px, 5vw, 66px);
  --h2: clamp(24px, 2.2vw, 32px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-kr);
  font-size: 18px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.pixpanel :focus-visible,
.px-footer :focus-visible { outline-color: var(--on-dark); }

.skip {
  position: absolute;
  left: 0;
  top: -80px;
  z-index: 50;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- masthead ---------- */

.px-topbar { border-bottom: 2px solid var(--ink); }

.px-topbar__in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 17px var(--pad) 15px;
}

.px-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.px-brand__name {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.px-chip {
  padding: 3px 8px 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.09em;
}

.px-back {
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid rgba(56, 69, 15, 0.4);
  transition: border-color 0.18s, color 0.18s;
}
.px-back:hover { color: var(--ink-soft); border-color: var(--ink-soft); }
.px-back span { font-family: var(--font-num); }

/* ---------- page ---------- */

.px-main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad) 40px;
  min-width: 0;
}

.px-hero { padding: clamp(38px, 6.5vh, 72px) 0 clamp(26px, 4.2vh, 42px); }

.px-eyebrow {
  color: var(--ink-soft);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.px-title {
  margin-top: 12px;
  font-size: var(--h1);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.px-lead {
  margin-top: 22px;
  max-width: 35em;
  font-size: 19px;
  line-height: 1.75;
}

.px-h2 {
  font-size: var(--h2);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.px-lede {
  max-width: 34em;
  font-size: 18px;
  line-height: 1.7;
}

.note { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }

.linkbtn {
  padding: 4px 0;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s;
}
.linkbtn:hover { color: var(--ink-soft); border-color: var(--ink-soft); }

/* ---------- the desk: printed form + pixel fire ---------- */

.px-desk {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  align-items: start;
  gap: clamp(26px, 3.2vw, 48px);
}

.px-col {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.px-note {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

/* the printed form */

.slip {
  border: 2px solid var(--ink);
  background: var(--sheet);
}

.slip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 13px;
  border-bottom: 2px solid var(--ink);
}

.slip__title { font-size: 21px; font-weight: 700; line-height: 1.3; }
.slip__docno { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }

.slip__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--ink);
}
.slip__meta > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 22px;
  min-width: 0;
}
.slip__meta > div + div { border-left: 2px solid var(--ink); }
.slip__meta dt { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.slip__meta dd {
  margin: 0;
  font-family: var(--font-num);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slip__field { padding: 18px 22px 4px; }
.slip__label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; }

.slip__input {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 12px 14px;
  border: 2px solid rgba(56, 69, 15, 0.32);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.3);
  color: var(--ink);
  font-family: var(--font-kr);
  font-size: 18px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.18s, background-color 0.18s;
}
.slip__input::placeholder { color: rgba(93, 104, 58, 0.72); }
.slip__input:hover { border-color: rgba(56, 69, 15, 0.55); }
.slip__input:focus-visible {
  outline: none;
  border-color: var(--ink);
  background: #f3f0e8;
}

.slip__help {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.slip__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 4px 22px 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 34px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 0;
  transition: background-color 0.18s, color 0.18s, transform 0.16s ease, box-shadow 0.2s ease;
}
.btn:hover:enabled { transform: translateY(-1px); }
.btn:active:enabled { transform: translateY(1px); }
.btn:disabled { cursor: default; opacity: 0.72; }
.btn--burn { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); }
.btn--burn:hover:enabled { background: #2b3509; box-shadow: 0 6px 16px rgba(56, 69, 15, 0.18); }

.slip__promise { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

/* receipt */

.receipt {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 22px 20px;
  border: 2px solid var(--ink);
  background: var(--sheet);
}
.receipt:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.receipt__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.receipt__title { font-size: 21px; font-weight: 700; line-height: 1.3; }
.receipt__docno { color: var(--ink-soft); font-size: 13px; }

.receipt__rows { display: grid; gap: 8px; }
.receipt__rows > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: baseline;
}
.receipt__rows dt { color: var(--ink-soft); font-size: 13px; }
.receipt__rows dd {
  margin: 0;
  font-family: var(--font-num);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.receipt__note { max-width: 32em; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }

/* the one warm line on the receipt */
.receipt__comfort {
  max-width: 24em;
  padding-top: 10px;
  border-top: 2px solid rgba(168, 52, 26, 0.28);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.receipt .btn--again {
  justify-self: start;
  min-height: 52px;
  padding: 0 26px;
  background: var(--ink);
  color: var(--paper);
}
.receipt .btn--again:hover { background: #2b3509; box-shadow: 0 6px 16px rgba(56, 69, 15, 0.16); }

.seal {
  position: absolute;
  right: 24px;
  top: 58px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 3px solid var(--seal);
  color: var(--seal);
  writing-mode: vertical-rl;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  transform: rotate(-6deg);
  opacity: 0.92;
}

/* ---------- the pixel fire panel ---------- */

.pixpanel {
  min-width: 0;
  border: 2px solid var(--ink);
  background: var(--night);
  color: var(--on-dark);
}

.pixpanel__screen {
  position: relative;
  overflow: hidden;
  background: var(--night);
  box-shadow: inset 0 0 0 1px rgba(242, 242, 240, 0.07);
}

.pixpanel__canvas {
  width: 100%;
  height: auto;
  background: var(--night);
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: manipulation;
}

.pixpanel__label {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(242, 242, 240, 0.62);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
}
.pixpanel__label::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--seal);
}

.pixpanel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
  padding: 11px 14px 12px;
  border-top: 1px solid rgba(242, 242, 240, 0.18);
  transition: background-color 0.6s ease;
}
.pixpanel.is-done .pixpanel__foot { background: rgba(168, 52, 26, 0.16); }
.pixpanel__caption {
  max-width: 30em;
  min-width: 0;
  color: rgba(242, 242, 240, 0.74);
  font-size: 13px;
  line-height: 1.5;
}
.pixpanel__hint {
  display: block;
  margin-top: 3px;
  color: rgba(242, 242, 240, 0.58);
  font-size: 12px;
  line-height: 1.45;
  transition: opacity 0.5s ease;
}
.pixpanel.has-met-cup .pixpanel__hint {
  display: none;
}
@media (hover: none) {
  .pixpanel__hint { display: none; }
}
.pixpanel__status {
  min-width: 0;
  color: var(--on-dark);
  font-family: var(--font-num);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* the warm confirmation that sits over the fire for a moment */
.pixpanel__warm {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 12px;
  display: grid;
  gap: 2px;
  max-width: calc(100% - 24px);
  padding: 10px 16px 11px;
  border: 2px solid rgba(242, 242, 240, 0.42);
  background: rgba(12, 10, 8, 0.94);
  color: var(--on-dark);
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.pixpanel__warm span { font-size: 17px; font-weight: 700; line-height: 1.3; }
.pixpanel__warm small { color: rgba(242, 242, 240, 0.76); font-size: 12px; line-height: 1.5; }
.pixpanel.is-done .pixpanel__warm { opacity: 1; transform: translate(-50%, 0); }

/* no JavaScript: a photograph instead of the drawn fire */
.pixpanel__nojs {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  background: var(--night);
}
.pixpanel__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.85);
}
.pixpanel__nojs p {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgba(12, 10, 8, 0.9) 42%);
  color: var(--on-dark);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- ledger ---------- */

.px-ledger {
  margin-top: clamp(56px, 9vh, 104px);
  padding-top: clamp(24px, 4vh, 38px);
  border-top: 2px solid var(--ink);
}

.px-ledger__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 22px;
}
.px-ledger__tie {
  color: var(--ink-soft);
  font-family: var(--font-num);
  font-size: 13px;
}
.px-ledger .px-lede { margin: 12px 0 clamp(20px, 3vh, 30px); }

.book { max-width: 780px; }

.book__table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
}
.book__table caption {
  padding-bottom: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
}
.book__table th,
.book__table td {
  padding: 11px 0;
  border-bottom: 2px solid rgba(56, 69, 15, 0.22);
  text-align: left;
  font-size: 15px;
  font-weight: 400;
}
.book__table th { color: var(--ink-soft); font-size: 13px; }
.book__table td:first-child,
.book__table td:nth-child(2) {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.book__empty { padding: 18px 0 4px; font-size: 18px; }

.book__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 16px;
}
.book__foot .note { max-width: 34em; }

/* ---------- footer ---------- */

.px-footer {
  margin-top: clamp(64px, 10vh, 120px);
  background: var(--ink);
  color: var(--on-dark);
}

.px-footer__in {
  display: grid;
  gap: clamp(22px, 3.6vh, 36px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(30px, 4.6vw, 52px) var(--pad) 0;
}

.px-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 16px;
}
.px-footer__nav a {
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(242, 242, 240, 0.36);
  text-decoration: none;
  transition: border-color 0.18s;
}
.px-footer__nav a:hover { border-color: var(--on-dark); }

.px-footer__meta {
  display: grid;
  gap: 12px;
  max-width: 46em;
  color: rgba(242, 242, 240, 0.74);
  font-size: 14px;
  line-height: 1.7;
}
.px-footer__meta a { color: var(--on-dark); }
.px-footer__legal { color: rgba(242, 242, 240, 0.68); font-size: 13px; }

.px-footer__close { padding: clamp(28px, 4.6vh, 46px) var(--pad) clamp(16px, 3vh, 26px); }

.px-footer__mark {
  display: block;
  max-width: var(--wrap);
  margin: 0 auto;
  color: var(--on-dark);
  font-size: clamp(60px, 11vw, 132px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-decoration: none;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .receipt.is-new { animation: receipt-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .receipt .seal { opacity: 0; }
  .receipt.is-stamped .seal { animation: stamp 0.42s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
  .slip.is-empty { animation: slip-shake 0.42s ease; }
  /* the hearth breathes even when nothing is happening */
  .pixpanel__label::before { animation: hearth 5.4s ease-in-out infinite; }
  .pixpanel.is-burning .pixpanel__label::before { animation: dot-blink 1.1s steps(2, end) infinite; }

  @keyframes receipt-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes stamp {
    from { opacity: 0; transform: scale(1.65) rotate(-1deg); }
    to { opacity: 0.92; transform: scale(1) rotate(-6deg); }
  }
  @keyframes slip-shake {
    20% { transform: translateX(-6px); }
    45% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
    100% { transform: none; }
  }
  @keyframes dot-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.24; }
  }
  @keyframes hearth {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.42; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover:enabled { transform: none; }
  .pixpanel__warm { transition: none; }
  .pixpanel__foot { transition: none; }
}

/* ---------- tablet: one column, the fire above the form ---------- */

@media (max-width: 960px) {
  .px-desk { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .pixpanel { order: -1; }
  .px-note { max-width: none; }
  .px-footer__mark { max-width: none; }
}

/* ---------- phone ---------- */

@media (max-width: 600px) {
  .px-main { padding: 0 16px 32px; }
  .px-topbar__in { padding: 13px 16px 12px; }
  .px-brand__name { font-size: 19px; }
  .px-back { font-size: 14px; }

  .px-hero { padding-top: clamp(26px, 4.6vh, 38px); }
  .px-lead { margin-top: 16px; font-size: 17px; line-height: 1.7; }

  .slip__head { padding: 14px 16px 11px; }
  .slip__meta > div { padding: 8px 16px; }
  .slip__meta dt, .slip__help, .slip__promise { font-size: 12px; }
  .slip__field { padding: 14px 16px 4px; }
  .slip__foot { padding: 4px 16px 16px; }
  .slip__input { min-height: 104px; font-size: 17px; }
  .btn { width: 100%; }
  .slip__promise { width: 100%; }

  .receipt { padding: 16px 16px 18px; }
  .receipt__rows > div { grid-template-columns: 72px 1fr; }
  .seal { right: 14px; top: 50px; width: 54px; height: 54px; font-size: 14px; }
  .receipt .btn--again { width: 100%; }

  .pixpanel__foot { padding: 10px 12px 11px; }
  .pixpanel__caption { font-size: 12px; }
  .pixpanel__hint { display: none; }
  .pixpanel__status { font-size: 11px; }

  .px-h2 { font-size: 24px; }
  .px-lede { font-size: 17px; }
  .book__table th, .book__table td { font-size: 14px; }
  .book__empty { font-size: 17px; }
  .px-footer__meta { font-size: 13px; }
  .px-footer__mark { font-size: clamp(54px, 18vw, 80px); }
}
