/* ============================================================
 *  모바일 초대장 공통 스타일 (청첩장·행사·부고)
 *  테마 색상·글꼴은 맨 아래 [테마] 영역에서 바꿀 수 있습니다.
 * ============================================================ */

/* ---------- 기본 변수 (classic) ---------- */
:root {
  --bg: #fbf8f3;
  --bg-alt: #f4eee5;
  --card: #ffffff;
  --text: #4a4036;
  --text-soft: #8a7e72;
  --accent: #b08d57;
  --accent-soft: #e9dcc6;
  --line: #e6ddd0;
  --sun: #c0574f;
  --sat: #5f7da8;
  --font-body: "Nanum Myeongjo", "Pretendard Variable", serif;
  --font-title: "Nanum Myeongjo", serif;
  --font-en: "Cormorant Garamond", "Nanum Myeongjo", serif;
  --radius: 4px;
  --page-w: 480px;
  --petal: 233, 205, 175;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: #e9e4dd;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.page {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, .08);
}

/* ---------- 공통 섹션 ---------- */
.section { padding: 88px 28px; text-align: center; }
.section:nth-of-type(even) { background: var(--bg-alt); }
.section__eyebrow {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .32em;
  color: var(--accent);
  margin-bottom: 10px;
}
.section__title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 28px;
}
.section__desc {
  color: var(--text-soft);
  font-size: 15px;
  white-space: pre-line;
  margin: -12px 0 28px;
}

/* 등장 애니메이션 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s ease; }
.reveal.is-in { opacity: 1; transform: none; }
/* 메인 화면은 스크롤 없이 바로 순서대로 등장 */
.cover .reveal { transition: none; }
.is-ready .cover .reveal { animation: coverIn .9s ease forwards; }
.is-ready .cover .reveal:nth-child(3) { animation-delay: .15s; }
.is-ready .cover .reveal:nth-child(4) { animation-delay: .35s; }
@keyframes coverIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .cover .reveal { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px;
  font-family: "Pretendard Variable", sans-serif; font-size: 15px; font-weight: 500;
  border-radius: var(--radius);
  transition: background .2s, color .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn--line { border: 1px solid var(--line); background: var(--card); margin-top: 28px; }
.btn--fill { background: var(--accent); color: #fff; width: 100%; }
.btn--kakao { background: #fee500; color: #191919; width: 100%; }
.btn--kakao svg { width: 20px; height: 20px; fill: currentColor; }
.chip {
  display: inline-block; margin-left: 6px; padding: 2px 10px;
  font-family: "Pretendard Variable", sans-serif; font-size: 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  vertical-align: middle;
}

/* ============================================================
 *  1. 메인
 * ============================================================ */
.cover {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 32px 72px; text-align: center;
}
.petals { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.cover__label { font-family: var(--font-en); font-size: 13px; letter-spacing: .4em; color: var(--accent); }
.cover__date-en { font-family: var(--font-en); font-size: 26px; letter-spacing: .12em; margin: 6px 0 28px; }
.cover__photo { width: 100%; aspect-ratio: 3 / 4; overflow: hidden; }
.cover__photo img { width: 100%; height: 100%; object-fit: cover; }
.cover__info { margin-top: 32px; }
.cover__names { font-family: var(--font-title); font-size: 24px; font-weight: 700; letter-spacing: .04em; }
.cover__amp { display: inline-block; margin: 0 10px; font-size: 14px; font-weight: 400; color: var(--text-soft); }
.cover__when, .cover__where { font-size: 15px; color: var(--text-soft); }
.cover__when { margin-top: 12px; }
.cover__scroll { position: absolute; bottom: 22px; left: 50%; width: 1px; height: 36px; background: var(--line); overflow: hidden; }
.cover__scroll span { position: absolute; left: 0; top: -36px; width: 1px; height: 36px; background: var(--accent); animation: scrollLine 2.2s infinite; }
@keyframes scrollLine { to { top: 36px; } }

/* ============================================================
 *  2. 인사말
 * ============================================================ */
.greeting__deco { width: 120px; height: 120px; margin: 0 auto 32px; border-radius: 50%; object-fit: cover; }
.greeting__msg { white-space: pre-line; font-size: 16px; line-height: 2.1; }
.family {
  margin: 44px auto 0; padding-top: 32px; border-top: 1px solid var(--line);
  display: grid; gap: 10px; font-size: 16px;
}
.family__row { display: flex; justify-content: center; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.family__parents { font-weight: 700; }
.family__rel { font-size: 14px; color: var(--text-soft); min-width: 2.6em; }
.family__name { font-weight: 700; font-size: 18px; }
.deceased::before { content: "故"; font-size: 13px; margin-right: 2px; color: var(--text-soft); font-weight: 400; }

/* ============================================================
 *  3. 캘린더
 * ============================================================ */
.calendar__time { margin: -20px 0 28px; color: var(--text-soft); }
.cal { max-width: 340px; margin: 0 auto; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal__grid {
  display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px;
  font-family: "Pretendard Variable", sans-serif; font-size: 14px;
}
.cal__grid span { height: 38px; display: grid; place-items: center; }
.cal__head { font-size: 12px; color: var(--text-soft); }
.cal__grid .sun { color: var(--sun); }
.cal__grid .sat { color: var(--sat); }
.cal__grid .is-day { position: relative; color: #fff; font-weight: 700; }
.cal__grid .is-day::before {
  content: ""; position: absolute; inset: 2px; margin: auto; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent); z-index: -1;
}
.cal__grid .is-day { z-index: 0; }
.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 32px; }
.countdown div { min-width: 62px; padding: 10px 4px; background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.countdown b { display: block; font-family: var(--font-en); font-size: 26px; font-weight: 600; line-height: 1.2; }
.countdown span { font-family: var(--font-en); font-size: 11px; letter-spacing: .12em; color: var(--text-soft); }
.dday { margin-top: 24px; font-size: 15px; white-space: pre-line; }
.dday b { color: var(--accent); }

/* ============================================================
 *  4. 갤러리
 * ============================================================ */
.gallery__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery__grid button { aspect-ratio: 1; overflow: hidden; background: var(--accent-soft); }
.gallery__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery__grid button:hover img { transform: scale(1.04); }
.gallery__grid.is-slide { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -28px; padding: 0 28px; scrollbar-width: none; }
.gallery__grid.is-slide::-webkit-scrollbar { display: none; }
.gallery__grid.is-slide button { flex: 0 0 82%; aspect-ratio: 3/4; scroll-snap-align: center; }

/* 라이트박스 */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12, 10, 8, .96); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox__track { display: flex; width: 100%; height: 100%; transition: transform .35s ease; }
.lightbox__track figure { flex: 0 0 100%; display: grid; place-items: center; padding: 56px 12px; }
.lightbox__track img { max-height: 100%; max-width: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox__close { position: absolute; top: 10px; right: 14px; z-index: 2; width: 44px; height: 44px; color: #fff; font-size: 34px; line-height: 1; }
.lightbox__nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 64px; margin-top: -32px; color: #fff; font-size: 40px; opacity: .7; }
.lightbox__prev { left: 4px; }
.lightbox__next { right: 4px; }
.lightbox__count { position: absolute; bottom: 18px; left: 0; right: 0; color: #fff; text-align: center; font-family: "Pretendard Variable", sans-serif; font-size: 14px; opacity: .8; }

/* ============================================================
 *  5. 우리의 이야기
 * ============================================================ */
.timeline { list-style: none; position: relative; max-width: 360px; margin: 0 auto; text-align: left; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 32px 36px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--accent); }
.timeline li:last-child::before { background: var(--accent); }
.timeline time { font-family: var(--font-en); font-size: 14px; letter-spacing: .08em; color: var(--accent); }
.timeline h3 { font-family: var(--font-title); font-size: 17px; margin: 2px 0 4px; }
.timeline p { font-size: 15px; color: var(--text-soft); }

/* ============================================================
 *  6. 오시는 길
 * ============================================================ */
.location__name { font-weight: 700; font-size: 18px; }
.location__addr { margin-top: 4px; font-size: 15px; color: var(--text-soft); }
.location__tel { display: inline-block; margin-top: 4px; font-size: 15px; color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.map { margin: 24px -28px 0; height: 280px; background: var(--accent-soft); }
.map iframe, .map img { width: 100%; height: 100%; border: 0; object-fit: cover; }
.navi { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin: 0 -28px; }
.navi a {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 50px;
  font-family: "Pretendard Variable", sans-serif; font-size: 14px; background: var(--card);
}
.navi a + a { border-left: 1px solid var(--line); }
.navi img { width: 18px; height: 18px; border-radius: 4px; }
.transport { margin-top: 32px; text-align: left; }
.transport div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.transport div:first-child { padding-top: 0; }
.transport dt { font-weight: 700; font-size: 15px; margin-bottom: 4px; color: var(--accent); }
.transport dd { font-size: 15px; white-space: pre-line; }

/* ============================================================
 *  7. 마음 전하실 곳
 * ============================================================ */
.acc { text-align: left; margin-top: 12px; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.acc__toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-weight: 700; font-size: 16px; }
.acc__toggle::after { content: ""; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .3s; margin-top: -4px; }
.acc.is-open .acc__toggle::after { transform: rotate(-135deg); margin-top: 4px; }
.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.acc.is-open .acc__body { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; }
.acc__item { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); font-family: "Pretendard Variable", sans-serif; }
.acc__info { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; }
.acc__info b { font-weight: 600; }
.acc__info small { color: var(--text-soft); font-size: 13px; }
.acc__btns { display: flex; gap: 6px; }
.acc__btns button, .acc__btns a { padding: 7px 11px; font-size: 13px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.acc__btns .pay { background: #fee500; border-color: #fee500; color: #191919; }

/* ============================================================
 *  8. RSVP
 * ============================================================ */
.rsvp__card { padding: 32px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rsvp__date { font-weight: 700; }
.rsvp__venue { color: var(--text-soft); font-size: 15px; }
.rsvp__deadline { margin: 12px 0 24px; font-family: "Pretendard Variable", sans-serif; font-size: 13px; color: var(--accent); }

/* ============================================================
 *  9. 방명록
 * ============================================================ */
.gb__list { list-style: none; display: grid; gap: 10px; text-align: left; }
.gb__item { padding: 18px 20px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
.gb__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-family: "Pretendard Variable", sans-serif; }
.gb__head b { font-size: 15px; }
.gb__head time { font-size: 12px; color: var(--text-soft); }
.gb__item p { font-size: 15px; white-space: pre-line; }
.gb__empty { color: var(--text-soft); font-size: 15px; padding: 20px 0; text-align: center; }

/* ============================================================
 *  10. 공유 / 푸터
 * ============================================================ */
.share { padding-top: 0; }
.share__photo { width: calc(100% + 56px); max-width: none; margin: 0 -28px 40px; aspect-ratio: 4/3; object-fit: cover; }
.share__thanks { font-family: var(--font-title); font-size: 17px; margin-bottom: 28px; white-space: pre-line; }
.share__btns { display: grid; gap: 10px; }
.share__btns .btn--line { margin-top: 0; width: 100%; }
.footer { padding: 28px 0 40px; text-align: center; font-family: var(--font-en); font-size: 13px; letter-spacing: .14em; color: var(--text-soft); }

/* ============================================================
 *  음악 / 모달 / 토스트
 * ============================================================ */
.music {
  position: fixed; top: 14px; z-index: 50;
  right: max(14px, calc(50% - var(--page-w) / 2 + 14px));
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.85); backdrop-filter: blur(6px);
  display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.music svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 1.8; }
.music.is-playing svg { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); animation: fade .25s; }
.modal__sheet {
  position: relative; width: 100%; max-width: var(--page-w); max-height: 88vh; overflow-y: auto;
  padding: 36px 24px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg); border-radius: 18px 18px 0 0; animation: up .3s ease;
  font-family: "Pretendard Variable", sans-serif;
}
.modal__close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; font-size: 28px; color: var(--text-soft); }
.modal h3 { font-family: var(--font-title); font-size: 19px; text-align: center; margin-bottom: 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

.contact__group + .contact__group { margin-top: 24px; }
.contact__group h4 { font-size: 14px; color: var(--accent); margin-bottom: 6px; }
.contact__row { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact__row span { flex: 1; font-size: 15px; }
.contact__row small { color: var(--text-soft); margin-right: 6px; }
.contact__row a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.contact__row svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.8; }

/* 폼 */
.form { display: grid; gap: 18px; }
.form label, .form legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form input[type="text"], .form input[type="number"], .form textarea {
  width: 100%; padding: 13px 14px; font: inherit; font-size: 16px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.form textarea { min-height: 110px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form fieldset { border: 0; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 12px 0; text-align: center; font-weight: 500; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.seg input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.form .hp { position: absolute; left: -9999px; }
.form__note { font-size: 12px; color: var(--text-soft); line-height: 1.6; }
.form .btn--fill { margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 120; transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 999px; background: rgba(30,30,30,.9); color: #fff;
  font-family: "Pretendard Variable", sans-serif; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 데모 테마 전환 바 (판매용 미리보기) */
.demo-bar {
  position: fixed; left: 50%; bottom: 14px; z-index: 60; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(20,20,20,.82); backdrop-filter: blur(8px);
  font-family: "Pretendard Variable", sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.demo-bar button, .demo-bar a { padding: 7px 12px; border-radius: 999px; color: #fff; font-size: 13px; white-space: nowrap; }
.demo-bar button.is-active { background: #fff; color: #111; font-weight: 600; }
.demo-bar a { opacity: .8; border-left: 1px solid rgba(255,255,255,.2); border-radius: 0 999px 999px 0; }

