:root {
  --main: #721819;
  --sub: #eae1c7;
  --light: #F7F2E5;
  --paper: #eeeae1;
  --heart-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #e6e0d4;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--main);
  line-height: 1.7;
  word-break: keep-all;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

.card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--light);
  overflow: clip;
  box-shadow: 0 0 40px rgba(0, 0, 0, .08);
}

/* 배경 */
.bg-light {
  background:
    url("images/배경1.jpg") center top / 100% auto repeat-y,
    var(--paper);
  color: var(--main);
}
.bg-dark {
  background:
    url("images/배경2.jpg") center top / 100% auto repeat-y,
    #6a1820;
  color: var(--sub);
}

/* 하트 */
.heart-icon {
  display: inline-block;
  width: .8em;
  height: .73em;
  background: currentColor;
  -webkit-mask: var(--heart-svg) center / contain no-repeat;
  mask: var(--heart-svg) center / contain no-repeat;
}
.heart-icon.inline { margin: 0 1px; vertical-align: -1px; color: var(--main); }

/* 공통 섹션 */
.sec { padding: 72px 24px; text-align: center; }
.sec-tight { padding-top: 24px; }
.heart {
  width: 11px;
  height: 10px;
  margin: 0 auto 8px;
  font-size: 0;
  background: currentColor;
  -webkit-mask: var(--heart-svg) center / contain no-repeat;
  mask: var(--heart-svg) center / contain no-repeat;
}
.en {
  font-family: 'Reenie Beanie', cursive;
  font-weight: 400;
  font-size: 46px;
  line-height: 1;
}
.ko { font-size: 14px; margin-top: 6px; opacity: .85; }

/* 업로드되지 않은 이미지 자리 */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  margin: 20px auto;
  border: 1.5px dashed currentColor;
  border-radius: 4px;
  font-size: 12px;
  opacity: .55;
}

/* 이미지 위 글자 (미리캔버스 이미지 속 예시 글자 자리) */
.ov-wrap { position: relative; container-type: inline-size; }
.ov-wrap .ov-img { width: 100%; }
.ov { position: absolute; left: 0; right: 0; text-align: center; }
.ov p { white-space: pre-line; }
.ov-names { top: 76.4%; font-size: 2.9cqw; line-height: 1.55; color: #2b2622; }
.ov-date1, .ov-date2, .ov-venue { font-family: 'Gowun Batang', serif; font-size: 5.6cqw; line-height: 1; color: #1d1a17; }
.ov-date1 { top: 34%; }
.ov-date2 { top: 42.8%; }
.ov-venue { top: 60%; }
.ov-notice { font-size: 4.3cqw; line-height: 1.75; color: #4a403b; display: flex; align-items: center; justify-content: center; }
.ov-notice-1 { top: 38%; bottom: 19%; left: 12%; right: 12%; }
.ov-notice-2 { top: 34%; bottom: 25%; left: 10%; right: 10%; }
.ov-notice-3 { top: 27%; bottom: 27%; left: 18%; right: 18%; }
.ov-notice-4 { top: 35%; bottom: 33%; left: 20%; right: 20%; font-size: 4cqw; }

/* 1. 대문사진 */
.cover img { width: 100%; }
.cover .ph { margin: 0; min-height: 0; aspect-ratio: 539 / 800; border: none; border-radius: 0; opacity: 1; }

/* 2. Our Wedding Day */
.bg-dark > .asset, .bg-dark > .ov-wrap, .bg-dark > .ph { margin: 28px auto; }
.tilt { transform: rotate(3deg); }
.family { margin: 32px 0; font-size: 15px; line-height: 2.1; }
.family b { font-weight: 600; font-size: 17px; margin-left: 4px; }
.quote cite { display: block; font-style: italic; font-size: 13px; margin-bottom: 14px; opacity: .85; }
.quote p { font-size: 15px; line-height: 2; }

/* 3. 장식 이미지 */
.deco img { width: 100%; }
.deco .ph { margin: 0; min-height: 200px; border: none; border-radius: 0; background: #ddd2b8; opacity: 1; }

/* 4. Gallery - 우표 콜라주 */
.collage-frame {
  margin: 32px auto 0;
  padding: 26px 10px;
  background: #f1ece2;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.collage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 4px;
}
.stamp-wrap {
  width: 30%;
  transform: rotate(var(--rot));
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .16));
  cursor: pointer;
  transition: transform .2s;
}
.stamp-wrap.landscape { width: 46%; }
.stamp-wrap:active { transform: rotate(var(--rot)) scale(.97); }
.stamp-wrap.is-empty { cursor: default; }
.stamp {
  --r: 4px;  /* 톱니 구멍 반지름 */
  --s: 11px; /* 톱니 간격 */
  padding: 9px;
  background: #fff;
  -webkit-mask:
    radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(-1 * var(--r)) calc(-1 * var(--r)) / var(--s) var(--s) round,
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat;
  mask:
    radial-gradient(var(--r) at var(--r) var(--r), #0000 97%, #000) calc(-1 * var(--r)) calc(-1 * var(--r)) / var(--s) var(--s) round,
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat;
}
.stamp img { width: 100%; height: auto; }
.stamp .empty {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: #efe7d4;
  color: #b9a98a;
  font-size: 13px;
}

/* 갤러리 뷰어 */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background: rgba(0, 0, 0, .88);
}
.viewer.open { display: flex; }
.v-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
}
.v-close::before, .v-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1px;
  background: #fff;
}
.v-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.v-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.v-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 12px 12px;
  touch-action: pan-y;
}
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.v-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 40px;
  font-weight: 200;
}
.v-prev { left: 0; }
.v-next { right: 0; }
.v-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.v-thumbs::-webkit-scrollbar { display: none; }
.v-thumbs > :first-child { margin-left: auto; }
.v-thumbs > :last-child  { margin-right: auto; }
.v-thumbs img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
}
.v-thumbs img.active { border-color: var(--sub); transform: scale(1.08); }

/* 5. Save the Date */
.calendar { max-width: 340px; margin: 32px auto 0; }
.cal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  padding-top: 4px;
  font-size: 14px;
}
.cal-grid .dow { font-size: 12px; font-weight: 600; padding-bottom: 6px; }
.cal-grid .dow.sun { color: #d0312d; }
.cal-grid .dow.sat { color: #2f68c9; }
.cal-day.sun { opacity: .45; }
.cal-day { position: relative; height: 38px; display: flex; align-items: center; justify-content: center; }
.cal-day.wed svg { position: absolute; width: 36px; height: 36px; fill: var(--main); }
.cal-day.wed span { position: relative; color: #fff; font-weight: 600; font-size: 13px; margin-top: -2px; }
.date-text { margin-top: 22px; font-size: 15px; font-weight: 500; }
.countdown { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 20px; }
.cd-box {
  min-width: 52px;
  height: 62px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--main);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cd-box span { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-box small { font-size: 9px; opacity: .85; }
.cd-sep { font-size: 16px; font-weight: 700; }
.dday-msg { margin-top: 22px; font-size: 15px; }
.dday-msg strong { font-size: 20px; font-weight: 700; }

/* 6. Location */
.map {
  display: block;
  width: 100%;
  height: 260px;
  margin-top: 28px;
  border: 0;
  border-radius: 6px;
  background: #e8dfc9;
}
.map-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
  border: 1px solid rgba(114, 24, 25, .35);
  border-radius: 6px;
  overflow: hidden;
}
.map-links a {
  padding: 11px 0;
  color: var(--main);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: rgba(255, 255, 255, .45);
}
.map-links a + a { border-left: 1px solid rgba(114, 24, 25, .35); }
.venue { margin-top: 22px; font-size: 16px; font-weight: 600; }
.address { font-size: 14px; opacity: .85; }

/* 7. Detail 캐러셀 */
.carousel { position: relative; margin: 24px -24px 0; }
.track {
  position: relative;
  display: flex;
  padding: 0 9%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 82%;
  padding: 24px 8px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
}
.slide-inner { width: 100%; }
.slide-inner { transform: rotate(var(--rot)); }
.slide-inner img { width: 100%; }
.slide-inner .ph { margin: 0; min-height: 0; aspect-ratio: 4 / 5; }

.c-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: #5a1a1e;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.c-btn:disabled { opacity: .35; cursor: default; }
.c-prev { left: 8px; }
.c-next { right: 8px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--sub);
  opacity: .4;
  transition: width .3s, opacity .3s;
}
.dot.active { width: 22px; opacity: 1; }

/* 8. Gift */
.accounts { max-width: 420px; margin: 32px auto 0; }
.acc { margin-bottom: 12px; border: 1px solid var(--main); border-radius: 8px; overflow: hidden; }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  background: var(--main);
  color: var(--sub);
  border: 0;
  font-weight: 500;
  font-size: 14px;
}
.acc-head .chev { transition: transform .25s; font-size: 9px; }
.acc.open .chev { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; background: var(--light); transition: grid-template-rows .3s; }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  text-align: left;
}
.account + .account { border-top: 1px solid rgba(114, 24, 25, .12); }
.account .meta { font-size: 13px; opacity: .8; }
.account .num { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.copy {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--main);
  border-radius: 6px;
  background: #fff;
  color: var(--main);
  font-size: 13px;
}
.gift-note { margin-top: 28px; font-size: 14px; line-height: 1.9; }

/* 9. 감사 인사 */
.thanks { padding: 80px 24px 96px; font-size: 15px; line-height: 2; }
.thanks p + p { margin-top: 18px; }
.thanks .sign { margin-top: 28px; font-weight: 600; }

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 200;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
