/* Design polish informed by unslop, Damir Sokolovsky (@heydamir).
   https://heydamir.design/unslop · CC BY 4.0. */
@font-face {
  font-family: Bodoni;
  src: url('./bodoni-moda.ttf') format('truetype');
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --paper: #f5f2e9;
  --surface: #ede8de;
  --ink: #28271f;
  --secondary: #5f5a4f;
  --muted: #726d60;
  --rule: #d9d3c7;
  --control-border: #c4bcae;
  --backdrop: #796752;
  --radius: 8px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sans: 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Malgun Gothic', Arial, sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
  color: var(--ink);
  background: var(--backdrop);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  padding: 48px 24px;
}
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 4px;
}
button, .save-button, .shop-link, .contact-actions a, .location-actions a, .share-options a {
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
svg { display: block; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.paper {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 492px;
  margin: 0 auto;
  padding: 16px 40px 0;
  background: var(--paper);
  box-shadow: 0 2px 4px #28271f0a, 0 12px 32px #28271f1f;
}
.paper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath opacity='.035' filter='url(%23n)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: 44px;
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}
.dot { margin: 0 4px; }
.share-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  border-radius: var(--radius);
}
.share-button {
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--control-border);
  font-size: 12px;
  color: var(--secondary);
}
.share-button .icon { width: 16px; height: 16px; }
.share-button:hover, .icon-button:hover { background: var(--surface); }
.icon-button { width: 44px; padding: 0; }
.brand-signature { padding: 48px 0 56px; text-align: center; }
.wordmark {
  font-family: Bodoni, 'Bodoni MT', Didot, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 120px;
  letter-spacing: -.045em;
  line-height: 1.2;
  margin: 0 0 16px;
}
.brand-caption { margin: 0; color: var(--secondary); font-size: 12px; line-height: 20px; }
.brand-caption span { margin: 0 8px; }
.company-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
  line-height: 20px;
}
.company-legal { color: var(--muted); font-size: 11px; }
.person { text-align: right; padding: 32px 0 16px; }
.name-line { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; }
.role { font-size: 16px; line-height: 24px; }
h1 { font-size: 32px; line-height: 40px; font-weight: 500; letter-spacing: -.04em; margin: 0; }
.english-name { margin: 4px 0 0; font-size: 14px; line-height: 24px; color: var(--muted); }
.printed-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 0 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.printed-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: .01em;
}
.printed-contact a:last-child { font-size: 16px; line-height: 24px; letter-spacing: 0; }
.printed-contact a:hover { text-decoration: underline; text-underline-offset: 4px; }
.primary-actions { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding-bottom: 24px; }
.save-button, .qr-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.save-button { color: var(--paper); background: var(--ink); }
.save-button:hover { background: #454136; border-color: #454136; }
.save-button:active, .qr-button:active, .contact-actions > :active, .share-button:active,
.location-actions > :active, .share-options > :active { transform: translateY(1px); }
.qr-button { padding-inline: 16px; color: var(--ink); background: transparent; border-color: var(--control-border); font-size: 12px; }
.qr-button:hover { background: var(--surface); border-color: #a79d8c; }
.contact-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.contact-actions > a, .contact-actions > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 12px 4px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #f0ece3;
  color: var(--secondary);
  font-size: 12px;
  line-height: 16px;
}
.contact-actions > a:hover, .contact-actions > button:hover { background: #e8e2d6; border-color: var(--control-border); color: var(--ink); }
.shops { padding-top: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.section-heading > span { font-size: 11px; line-height: 16px; color: var(--muted); }
.shop-link { display: flex; align-items: center; min-height: 112px; padding: 24px 0; gap: 16px; border-top: 1px solid var(--rule); }
.shop-link:last-child { border-bottom: 1px solid var(--rule); }
.shop-info { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
.shop-wordmark { display: block; font-family: Bodoni, Didot, 'Times New Roman', serif; font-size: 36px; line-height: 40px; letter-spacing: -.035em; }
.deneir { font-size: 32px; letter-spacing: -.025em; }
.shop-domain { color: var(--muted); font-size: 11px; line-height: 16px; }
.shop-name { color: var(--secondary); font-size: 11px; line-height: 20px; }
.shop-link > .icon { width: 16px; height: 16px; color: var(--secondary); }
.shop-link:hover { color: #65513d; }
.shop-link:hover > .icon { transform: translate(2px, -2px); }
.location { padding: 32px 0; }
.address { margin: 0 0 24px; color: var(--secondary); font-size: 13px; line-height: 24px; word-break: keep-all; }
.location-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.location-actions a, .location-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.location-actions a { background: var(--surface); }
.location-actions button { color: var(--secondary); }
.location-actions .icon { width: 16px; height: 16px; }
.location-actions a > .icon:last-child { margin-left: auto; }
.location-actions a:hover, .location-actions button:hover { background: #e5dfd3; border-color: #a79d8c; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 11px; line-height: 16px; }
.footer > button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; border-radius: var(--radius); font-size: 11px; }
.footer > button:hover { background: var(--surface); color: var(--ink); }
.footer .icon { width: 16px; height: 16px; }

dialog { width: calc(100% - 32px); max-width: 384px; max-height: calc(100svh - 48px); margin: auto; padding: 16px 24px 24px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 8px 24px #28271f1a; }
dialog::backdrop { background: #28271fa6; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; line-height: 16px; color: var(--muted); }
.dialog-top .icon-button { margin-right: -8px; }
dialog h2 { margin: 24px 0 12px; text-align: center; font-size: 24px; line-height: 32px; font-weight: 500; letter-spacing: -.02em; }
.dialog-explain { margin: 0 0 24px; text-align: center; color: var(--secondary); font-size: 13px; line-height: 24px; }
dialog .save-button { width: 100%; }
.kakao-id { margin: 32px 0; font-size: 36px; line-height: 48px; text-align: center; letter-spacing: .01em; }
#qr-code { display: flex; justify-content: center; width: 224px; max-width: 100%; padding: 12px; margin: 24px auto; background: #fff; }
#qr-code svg { width: 100%; height: auto; }
.share-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.share-options a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 4px; border: 1px solid var(--control-border); border-radius: var(--radius); font-size: 12px; line-height: 20px; }
.share-options a:hover { background: var(--surface); }
.share-options .icon { width: 16px; height: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); width: max-content; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: var(--radius); background: #28271ff5; color: var(--paper); opacity: 0; pointer-events: none; text-align: center; font-size: 13px; line-height: 20px; transition: opacity 160ms var(--ease), transform 160ms var(--ease); z-index: 10; box-shadow: 0 2px 8px #28271f14; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.location-actions button.is-complete { background: var(--surface); color: var(--ink); }
.save-button.is-complete { background: #454136; border-color: #454136; }
@media (min-width: 760px) {
  body { padding-top: 64px; }
  .brand-signature { padding-top: 56px; padding-bottom: 64px; }
  .wordmark { font-size: 128px; }
}
@media (max-width: 520px) {
  body { padding: 16px 12px 32px; }
  .paper { padding: 12px 28px 0; }
  .brand-signature { padding-top: 40px; padding-bottom: 48px; }
  .wordmark { font-size: clamp(84px, 25vw, 120px); }
}
@media (max-width: 360px) {
  body { padding: 12px 8px 24px; }
  .paper { padding-inline: 24px; }
  .brand-signature { padding-top: 32px; padding-bottom: 40px; }
  .topline { gap: 8px; }
  .share-button { padding-inline: 8px; }
  .company-line { font-size: 13px; }
  .company-legal { font-size: 11px; }
  .primary-actions { gap: 8px; }
  .save-button { padding-inline: 12px; font-size: 13px; }
  .qr-button { padding-inline: 12px; }
  .contact-actions { gap: 4px; }
  .contact-actions > a, .contact-actions > button { font-size: 11px; }
  .shop-link { gap: 8px; }
  .shop-name { font-size: 11px; }
  .footer { gap: 4px; }
  .footer > button { gap: 4px; padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
