/* Shared runtime for the wedding invitation pages.
   All design-space coordinates are multiplied by --s (css px per design px). */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; }
body {
  display: flex;
  justify-content: center;
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.stage { position: relative; overflow: hidden; }
.stage img { display: block; user-select: none; -webkit-user-drag: none; }
.a, .t, .hotspot { position: absolute; }
.t { white-space: pre; }
.t.wrap { white-space: pre-wrap; }
.hotspot { background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tappable { cursor: pointer; }

/* ---------- scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal, .accordion.reveal, .gallery.reveal {
    opacity: 0;
    transform: translateY(calc(26 * var(--s)));
    transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform .9s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--d, 0s);
    will-change: opacity, transform;
  }
  .reveal.in { opacity: 1; transform: none; }
  .hero { opacity: 0; transition: opacity 1.4s ease .15s; }
  .hero.in { opacity: 1; }
}

/* ---------- gallery (classic horizontal swipe) ---------- */
.gallery {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  gap: var(--gap);
  padding-left: var(--pad);
  padding-right: var(--pad);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 auto; scroll-snap-align: center; object-fit: cover; }
.zoomable { cursor: zoom-in; }

/* ---------- accordion ---------- */
.accordion { position: absolute; -webkit-tap-highlight-color: transparent; }
.acc-head {
  width: 100%;
  border: 0;
  background: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
}
.acc-arrow { position: absolute; transition: transform .35s ease; }
.accordion:not(.open) .acc-arrow { transform: rotate(180deg); }
.acc-body { height: 0; overflow: hidden; transition: height .4s cubic-bezier(.4,0,.2,1); }
.acc-inner { display: flex; flex-direction: column; }
.acc-row { position: relative; }
.acc-holder { position: absolute; left: 0; width: 100%; text-align: center; }
.acc-num { position: absolute; line-height: 1.2; white-space: pre; }
.copy-btn {
  position: absolute;
  border: 0;
  cursor: pointer;
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.copy-btn:active { filter: brightness(.9); }

/* classic (gc / yp): white card, shadow, rounded gray rows — offsets from Figma */
.acc-classic {
  background: #fff;
  border-radius: calc(34.3 * var(--s));
  box-shadow: 0 calc(6 * var(--s)) calc(27 * var(--s)) rgba(0,0,0,.13);
  padding-bottom: calc(39 * var(--s));
}
.acc-classic .acc-head {
  height: calc(194 * var(--s));
  color: #3E302C;
  font-family: 'Gowun Batang', serif;
  font-weight: 700;
  font-size: calc(61 * var(--s));
}
.acc-classic .acc-arrow { right: calc(135 * var(--s)); top: calc(86 * var(--s)); width: calc(42 * var(--s)); height: calc(21 * var(--s)); }
.acc-classic .acc-inner { gap: calc(32 * var(--s)); padding: calc(36 * var(--s)) calc(35 * var(--s)) 0; }
.acc-classic .acc-row {
  background: #F3EFEF;
  border-radius: calc(26.1 * var(--s));
  height: calc(251 * var(--s));
}
.acc-classic .acc-holder { top: calc(46 * var(--s)); color: #301F1C; font-weight: 700; font-size: calc(51.7 * var(--s)); letter-spacing: calc(5.2 * var(--s)); }
.acc-classic .acc-num { left: calc(52 * var(--s)); top: calc(140 * var(--s)); color: #3E302C; font-weight: 700; font-size: calc(45.3 * var(--s)); }
.acc-classic .copy-btn {
  right: calc(54 * var(--s)); top: calc(137 * var(--s));
  background: #84635B; color: #fff;
  width: calc(111 * var(--s)); height: calc(65 * var(--s));
  border-radius: calc(11.4 * var(--s));
  font-size: calc(38.3 * var(--s));
}

/* modern (beige / burgundy): flat tan header bar, gray rows — offsets from Figma */
.acc-modern .acc-head {
  height: calc(113 * var(--s));
  background: var(--abg, #C7AB8A);
  color: var(--afg, #301F1C);
  font-weight: 700;
  font-size: calc(47.6 * var(--s));
}
.acc-modern .acc-arrow { right: calc(46 * var(--s)); top: calc(48 * var(--s)); width: calc(30 * var(--s)); height: calc(17 * var(--s)); }
.acc-modern .acc-inner { gap: calc(15 * var(--s)); padding-top: calc(3 * var(--s)); }
.acc-modern .acc-row {
  background: var(--rbg, #D9D9D9);
  height: calc(268 * var(--s));
}
.acc-modern .acc-holder { top: calc(62 * var(--s)); color: var(--afg, #301F1C); font-weight: 700; font-size: calc(47.6 * var(--s)); letter-spacing: calc(4.8 * var(--s)); }
.acc-modern .acc-num { left: calc(62 * var(--s)); top: calc(148 * var(--s)); color: var(--afg, #301F1C); font-weight: 700; font-size: calc(41.7 * var(--s)); }
.acc-modern .copy-btn {
  right: calc(66 * var(--s)); top: calc(147 * var(--s));
  background: var(--bbg, #4D4D4D); color: var(--bfg, #C7AB8A);
  width: calc(95 * var(--s)); height: calc(60 * var(--s));
  border-radius: calc(10.6 * var(--s));
  font-size: calc(35.3 * var(--s));
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 24, 22, .92);
  color: #fff;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 1000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 900;
  cursor: zoom-out;
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }

/* ---------- background music ---------- */
.bgm-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(30, 24, 22, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 800;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .3s ease;
}
.bgm-btn svg { width: 18px; height: 18px; }
.bgm-btn.playing .bgm-icon { animation: bgm-spin 3s linear infinite; transform-origin: center; }
@keyframes bgm-spin { to { transform: rotate(360deg); } }
.bgm-btn .bgm-slash { display: none; }
.bgm-btn:not(.playing) .bgm-slash { display: block; }
