/* ───────── 토큰 ───────── */
:root {
  --bg: #f4efe8;          /* 바깥 배경(데스크톱) */
  --paper: #fbf8f3;       /* 카드 지면 */
  --paper-2: #f5eee6;     /* 교차 섹션 */
  --ink: #3b3531;
  --ink-2: #6e655e;
  --muted: #9a9087;
  --line: #e6dcd1;
  --accent: #c79c92;      /* 더스티 로즈 */
  --accent-deep: #a87a70;
  --accent-soft: #f1e2dc;
  --kakao: #fee500;
  --radius: 14px;
  --maxw: 480px;
  --serif: 'Noto Serif KR', 'Apple SD Gothic Neo', serif;
  --batang: 'Gowun Batang', var(--serif);
  --script: 'Great Vibes', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-weight: 300; line-height: 1.75; letter-spacing: -0.01em;
  word-break: keep-all;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0; }

.page {
  max-width: var(--maxw); margin: 0 auto; background: var(--paper);
  box-shadow: 0 0 60px rgba(60, 40, 30, .08); min-height: 100dvh; overflow-x: clip;
}

/* ───────── 공통 ───────── */
.sec { padding: 72px 24px; text-align: center; }
.sec:nth-of-type(even) { background: var(--paper-2); }
.eyebrow { font-family: var(--script); font-size: 30px; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.sec h2 { font-size: 20px; letter-spacing: .16em; margin-bottom: 26px; }
.sub { color: var(--ink-2); font-size: 14px; margin-bottom: 24px; }
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 12px 26px;
  background: var(--accent); color: #fff; font-size: 14px; letter-spacing: .04em;
}
.btn.ghost { background: transparent; color: var(--accent-deep); border: 1px solid var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.kakao { background: var(--kakao); color: #191600; }
.orn { color: var(--accent); font-size: 22px; margin-bottom: 18px; }

/* 사진 자리표시자 — 사진 경로가 들어오면 .ph 가 빠지고 <img> 로 바뀐다 */
.ph {
  margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; letter-spacing: .08em;
  background:
    linear-gradient(135deg, rgba(255,255,255,.35), rgba(255,255,255,0)),
    repeating-linear-gradient(45deg, #efe6dd 0 10px, #eadfd5 10px 20px);
  border: 1px dashed var(--line);
}
.ph span::before { content: '📷  '; }

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ───────── 1. 커버 ───────── */
.cover {
  position: relative; min-height: 100dvh; padding: 64px 24px 56px; text-align: center;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
}
.bgm {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.7); color: var(--accent-deep); font-size: 17px;
}
.bgm[aria-pressed="true"] { background: var(--accent); color: #fff; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.script { font-family: var(--script); font-size: 40px; color: var(--accent); line-height: 1.1; }
.script.small { font-size: 30px; margin-top: 14px; }
.names { font-size: 22px; letter-spacing: .14em; margin-top: 6px; display: flex; justify-content: center; align-items: baseline; gap: 14px; }
.names em { font-style: normal; font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.cover-photo { aspect-ratio: 3 / 4; border-radius: 160px 160px var(--radius) var(--radius); overflow: hidden; width: min(100%, 320px); margin: 0 auto; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }
.date-line { font-size: 15px; letter-spacing: .06em; }
.venue-line { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.scroll-hint { position: absolute; left: 50%; bottom: 14px; width: 1px; height: 28px; background: var(--line); overflow: hidden; }
.scroll-hint span { position: absolute; inset: 0; background: var(--accent); animation: drop 1.6s ease-in-out infinite; }
@keyframes drop { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ───────── 2. 시 ───────── */
.poem-text { font-family: var(--batang); font-size: 16px; line-height: 2; white-space: pre-line; }
.poem-author { margin-top: 18px; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

/* ───────── 3. 초대 ───────── */
.greeting-text { font-size: 15px; line-height: 2; white-space: pre-line; }
.parents { margin: 34px 0 28px; font-size: 15px; line-height: 2.1; }
.parents b { font-weight: 600; }
.parents small { color: var(--muted); font-size: 12.5px; margin: 0 8px; }

/* ───────── 4. 캘린더 ───────── */
.calendar h2 { letter-spacing: .3em; font-size: 24px; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; max-width: 320px; margin: 22px auto 0; font-size: 14px; }
.cal-grid .dow { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; letter-spacing: .06em; }
.cal-grid .dow.sun, .cal-grid .d.sun { color: #c97a7a; }
.cal-grid .d { height: 40px; display: grid; place-items: center; position: relative; }
.cal-grid .d.today::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.cal-grid .d.wed { color: #fff; font-weight: 600; }
.cal-grid .d.wed::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); z-index: -1; }
.cal-grid .d.wed { z-index: 0; }
.dday { margin-top: 26px; font-size: 14.5px; color: var(--ink-2); }
.dday b { color: var(--accent-deep); font-weight: 600; }

/* ───────── 5. 갤러리 ───────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid .tile { aspect-ratio: 1; overflow: hidden; border-radius: 6px; padding: 0; border: 0; background: none; }
.grid .tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.grid .tile:active img { transform: scale(1.04); }
.grid .tile.ph { font-size: 11px; }
.grid .tile.ph span::before { content: ''; }
.grid .tile.hide { display: none; }
#galleryMore { margin-top: 22px; }

/* ───────── 6. 영상 ───────── */
.video-wrap { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ───────── 7. 오시는 길 ───────── */
.venue-name { font-size: 17px; font-weight: 400; }
.venue-addr { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.venue-tel { font-size: 13px; color: var(--muted); margin-top: 2px; }
.venue-tel a { color: inherit; text-decoration: none; }
.map { height: 260px; margin: 22px 0 12px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #ece6df; position: relative; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.map .maplibregl-ctrl-attrib { font-size: 10px; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--accent-deep); transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.navi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.navi-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 0; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 13px;
}
.navi-btn i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; }
#naviKakao i { background: #f7e600; color: #3b1e1e; }
#naviTmap i { background: #e2232a; }
#naviNaver i { background: #03c75a; }
.transit { text-align: left; margin: 28px 0 0; display: grid; gap: 16px; }
.transit dt { font-size: 13px; color: var(--accent-deep); letter-spacing: .06em; margin-bottom: 4px; }
.transit dd { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ───────── 8. 프로필 ───────── */
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
.avatar { aspect-ratio: 1; border-radius: 50%; overflow: hidden; width: 100%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.role { margin-top: 12px; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.pname { font-size: 17px; }
.pintro { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ───────── 9. 안내 ───────── */
.cards { display: grid; gap: 12px; text-align: left; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; color: var(--accent-deep); }
.card p { font-size: 14px; color: var(--ink-2); }

/* ───────── 10. 계좌 ───────── */
.acc-groups { display: grid; gap: 12px; text-align: left; }
.acc { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.acc summary { list-style: none; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '⌄'; color: var(--muted); transition: transform .25s; }
.acc[open] summary::after { transform: rotate(180deg); }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.acc-row .rel { font-size: 12px; color: var(--muted); }
.acc-row .num { color: var(--ink-2); letter-spacing: .02em; }
.copy { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }

/* ───────── 11. 방명록 ───────── */
.msgs { display: grid; gap: 10px; text-align: left; margin-bottom: 14px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg header { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.msg header b { font-weight: 600; font-size: 14px; }
.msg header > span { color: var(--muted); font-size: 11.5px; }
.msg-acts { margin-left: auto; display: flex; gap: 2px; }
.msg-acts button { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 2px 5px; }
.msg p { font-size: 14px; color: var(--ink-2); white-space: pre-line; }
#gbMore { margin-bottom: 26px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ───────── 11·12. 폼 ───────── */
.soon { display: inline-block; font-size: 12.5px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: 18px; }
.form { display: grid; gap: 10px; text-align: left; }
.form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; font-size: 14px;
}
.form textarea { resize: vertical; }
.form .btn { justify-self: center; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
.seg input:checked + span { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }

/* ───────── 13. 엔딩 ───────── */
.ending { position: relative; text-align: center; padding: 0 0 48px; }
.ending-photo { aspect-ratio: 4 / 5; width: 100%; }
.ending-photo img { width: 100%; height: 100%; object-fit: cover; }
.ending-text { margin-top: 36px; padding: 0 24px; font-size: 15px; line-height: 2; }

/* ───────── 14. 공유 ───────── */
.share { padding: 28px 24px 48px; text-align: center; display: grid; gap: 10px; justify-items: center; background: var(--paper-2); }
.credit { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ───────── 모달 / 라이트박스 / 토스트 ───────── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(40, 30, 25, .45); display: grid; place-items: end center; }
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: var(--maxw); max-height: 86dvh; overflow: auto; background: var(--paper);
  border-radius: 20px 20px 0 0; padding: 26px 22px 30px; text-align: center; animation: up .3s ease;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.modal-box h3 { font-size: 17px; letter-spacing: .1em; margin-bottom: 20px; }
.modal-box .close { margin-top: 20px; }
.contact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.contact-cols h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent-deep); letter-spacing: .08em; text-align: center; }
.c-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.c-row .who { font-size: 11.5px; color: var(--muted); display: block; }
.c-acts a { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); margin-left: 4px; text-decoration: none; font-size: 14px; color: var(--accent-deep); background: #fff; }
.qa { text-align: left; display: grid; gap: 18px; }
.qa .q { font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.qa .a { font-size: 14px; color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--accent-soft); margin-bottom: 6px; }
.qa .a b { font-weight: 400; color: var(--accent-deep); margin-right: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lb-close, .lb-nav { position: absolute; background: none; border: 0; color: #fff; font-size: 34px; line-height: 1; padding: 12px; opacity: .8; }
.lb-close { top: 10px; right: 10px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 44px; }
.lb-nav.prev { left: 4px; } .lb-nav.next { right: 4px; }
.lb-count { position: absolute; bottom: 18px; color: #fff; font-size: 13px; opacity: .8; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 70;
  background: rgba(50, 40, 35, .92); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  body { padding: 32px 0; }
  .page { border-radius: 24px; min-height: auto; }
  .cover { min-height: 820px; }
}
