/* 모든 테마가 공유하는 레이아웃. 색·폰트는 css/themes/*.css 에서 */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: #EDE6DA;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 440px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.06);
}
section { padding: 72px 24px; position: relative; }
section + section { border-top: 1px dashed var(--line); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- 공통 ---------- */
.eyebrow {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--accent);
  text-align: center;
  line-height: 1;
  margin-bottom: 6px;
}
.title {
  text-align: center;
  font-size: 21px;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.mark {
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
  padding: 0 2px;
}
.hand { font-family: var(--hand); }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  transition: transform .15s, background .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.block { width: 100%; }

/* 스크립트가 끝까지 돌았을 때만 숨겼다가 나타나게 (중간에 실패해도 내용은 보임) */
.reveal-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal-ready .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 히어로 ---------- */
.hero { padding: 40px 24px 56px; text-align: center; }
.hero-top {
  display: flex; justify-content: space-between;
  font-size: 12px; letter-spacing: .12em; color: var(--ink-soft);
  margin-bottom: 28px;
}
.hero-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 200px 200px 16px 16px;
  overflow: hidden;
  background: var(--paper-2);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sticker {
  position: absolute;
  right: -6px; bottom: 28px;
  background: var(--accent); color: #fff;
  font-family: var(--hand);
  font-size: 22px; line-height: 1.1;
  padding: 10px 14px;
  border-radius: 6px;
  transform: rotate(-8deg);
  box-shadow: 0 6px 14px rgba(232,87,63,.3);
}
.hero h1 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.05;
  margin: 32px 0 14px;
}
.hero h1 .en, .hero h1 .ko { display: block; }
.hero h1 .amp { color: var(--accent); font-size: 40px; vertical-align: 4px; margin: 0 4px; }
.hero .when { font-size: 15px; letter-spacing: .02em; }
.hero .where { color: var(--ink-soft); font-size: 14px; }
.squiggle { display: block; margin: 18px auto 0; color: var(--accent); }

/* ---------- 인사말 ---------- */
.greeting p { text-align: center; }
.greeting .lead {
  font-family: var(--hand); font-size: 30px; line-height: 1.3;
  margin-bottom: 24px;
}
.parents {
  margin-top: 36px;
  display: grid; gap: 6px;
  text-align: center; font-size: 15px;
}
.parents .rel { color: var(--ink-soft); font-size: 13px; margin: 0 4px; }
.parents strong { font-weight: 400; font-size: 17px; }

/* ---------- 소개 카드 ---------- */
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 14px 14px 16px;
  box-shadow: 4px 4px 0 var(--ink);
}
.card:nth-child(1) { transform: rotate(-1.5deg); }
.card:nth-child(2) { transform: rotate(1.5deg); }
.card .face {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--paper-2); margin-bottom: 10px;
}
.card .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .role { font-size: 12px; color: var(--accent); }
.card .name { font-size: 18px; margin-bottom: 8px; }
.card dl { font-size: 12.5px; line-height: 1.6; }
.card dt { color: var(--ink-soft); }
.card dd { margin-bottom: 4px; }

/* ---------- 달력 ---------- */
.cal {
  background: #fff; border-radius: 16px; padding: 20px 16px 16px;
  border: 1px solid var(--line);
}
.cal-head { text-align: center; font-size: 17px; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; row-gap: 6px; font-size: 14px; }
.cal-grid .dow { font-size: 12px; color: var(--ink-soft); padding-bottom: 6px; }
.cal-grid .sun { color: var(--accent); }
.cal-grid .day { height: 36px; display: grid; place-items: center; position: relative; }
.cal-grid .day.on { color: #fff; }
.cal-grid .day.on::before {
  content: ""; position: absolute; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); z-index: 0;
}
.cal-grid .day.on span { position: relative; }
.dday {
  margin-top: 22px; text-align: center;
}
.dday .count { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; }
.dday .unit {
  min-width: 62px; padding: 10px 6px 6px;
  background: var(--ink); color: var(--paper); border-radius: 10px;
}
.dday .unit b { display: block; font-size: 24px; font-weight: 400; line-height: 1.1; }
.dday .unit small { font-size: 11px; opacity: .7; }
.dday .caption { font-family: var(--hand); font-size: 23px; }

/* ---------- 갤러리 ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery button { aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.gallery button:nth-child(1) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; transition: transform .4s; }
.gallery button:active img { transform: scale(1.04); }
.more { margin-top: 14px; }

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20,17,15,.94);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; user-select: none; }
.lightbox .lb-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; color: #fff; font-size: 14px;
}
.lightbox .lb-close { color: #fff; font-size: 28px; line-height: 1; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 30px; padding: 16px; opacity: .7; }
.lightbox .prev { left: 0; } .lightbox .next { right: 0; }

/* ---------- 오시는 길 ---------- */
.venue-name { text-align: center; font-size: 19px; }
.venue-addr { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }
.map-img {
  display: block; border-radius: 14px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); margin-bottom: 12px;
}
.map-img img { width: 100%; height: auto; display: block; }
.map-img .ph { aspect-ratio: 4 / 3; }
.map-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 28px; }
.map-btns .btn { padding: 10px 6px; font-size: 13px; }
.route { display: grid; gap: 18px; }
.route h3 {
  font-weight: 400; font-size: 14px; display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 10px; border-radius: 999px; margin-bottom: 4px;
}
.route p { font-size: 14px; }

/* ---------- FAQ / 아코디언 ---------- */
.acc { border-top: 1.5px solid var(--ink); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-q {
  width: 100%; text-align: left; padding: 16px 4px;
  display: flex; gap: 10px; align-items: baseline; font-size: 15px;
}
.acc-q .q { font-family: var(--hand); font-size: 22px; color: var(--accent); line-height: 1; }
.acc-q .chev { margin-left: auto; transition: transform .25s; font-size: 12px; color: var(--ink-soft); }
.acc-item.open .chev { transform: rotate(180deg); }
.acc-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.acc-item.open .acc-a { grid-template-rows: 1fr; }
.acc-a > div { overflow: hidden; }
.acc-a p { padding: 0 4px 18px 32px; font-size: 14px; color: var(--ink-soft); }

/* ---------- 계좌 ---------- */
.accounts { display: grid; gap: 12px; }
.acc-group { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.acc-group > .acc-q { padding: 16px 18px; }
.acc-group .acc-a p { padding: 0; }
.acc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-top: 1px dashed var(--line); font-size: 14px;
}
.acc-row .who { font-size: 12px; color: var(--ink-soft); }
.acc-row .num { letter-spacing: .01em; }
.acc-row .copy { margin-left: auto; padding: 6px 12px; font-size: 12px; }

/* ---------- RSVP ---------- */
.ticket {
  position: relative;
  background: var(--ink); color: var(--paper);
  border-radius: 18px; padding: 28px 24px;
  text-align: center;
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); transform: translateY(-50%);
}
.ticket::before { left: -11px; } .ticket::after { right: -11px; }
.ticket .hand { font-size: 30px; line-height: 1.2; color: var(--marker); }
.ticket p { font-size: 14px; opacity: .85; margin: 8px 0 20px; }
.ticket .btn { border-color: var(--paper); background: var(--paper); color: var(--ink); }

/* ---------- 방명록 ---------- */
.gb-list { display: grid; gap: 12px; margin-bottom: 20px; }
.note {
  background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px;
  padding: 14px 16px; font-size: 14px;
}
.note:nth-child(3n+2) { background: #FFF8DC; }
.note:nth-child(3n+3) { background: #EEF5EF; }
.note .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.note .meta b { color: var(--ink); font-weight: 400; font-size: 13px; }
.note p { white-space: pre-wrap; }
.empty { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 16px 0; }

/* ---------- 폼/모달 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(20,17,15,.5);
  align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; }
.sheet {
  width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  animation: up .3s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font-weight: 400; font-size: 19px; margin-bottom: 4px; }
.sheet .sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field > label, .field > .lbl { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.input, textarea.input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 15px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
}
.input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: transparent; }
textarea.input { min-height: 96px; resize: vertical; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 10px 6px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; }
.stepper output { min-width: 28px; text-align: center; font-size: 17px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }

/* ---------- 공유/푸터 ---------- */
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kakao { background: #FEE500; border-color: #FEE500; color: #191600; }
footer {
  text-align: center; padding: 40px 24px 60px; font-size: 12px; color: var(--ink-soft);
}
footer .hand { font-size: 26px; color: var(--ink); display: block; margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--paper); font-size: 14px;
  padding: 10px 18px; border-radius: 999px; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 사진 없을 때 보이는 자리표시 */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--hand); font-size: 22px; color: var(--ink-soft);
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(0,0,0,.025) 10px 20px),
    var(--paper-2);
}

.en-sig { display: none; }

/* 배경음악 버튼 */
.bgm {
  position: fixed; z-index: 35;
  top: calc(14px + env(safe-area-inset-top));
  right: max(14px, calc((100vw - 440px) / 2 + 14px));
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.82); color: var(--ink);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bgm .on { display: none; }
.bgm[aria-pressed="true"] .on { display: block; }
.bgm[aria-pressed="true"] .off { display: none; }
.bgm[aria-pressed="true"] { animation: bgm-pulse 2.4s ease-in-out infinite; }
@keyframes bgm-pulse { 50% { box-shadow: 0 0 0 6px rgba(0,0,0,.04); } }
@media (prefers-reduced-motion: reduce) { .bgm[aria-pressed="true"] { animation: none; } }
.has-bgm .hero-top { padding-right: 46px; }

/* 레퍼런스(letter) 테마용 요소: 기본은 숨김 */
.lettering, .cal-venue, .nm-first, .cal-m, .fab, .rsvp > .eyebrow { display: none; }
.venue-hall { text-align: center; color: var(--ink-soft); font-size: 14px; }
.venue-name .tel { display: inline-grid; place-items: center; margin-left: 6px; color: var(--ink-soft); vertical-align: -1px; }
.copy-addr { text-decoration: underline; font-size: 13px; }
.kmap { aspect-ratio: 4 / 3; margin: 0 -24px 12px; background: var(--paper-2); cursor: pointer; }
.map-btns .btn { gap: 6px; }
.ico { display: inline-block; width: 14px; height: 14px; flex: none; }
.ico-tmap { background: linear-gradient(90deg, #E5413A 0 50%, #2D7BEF 50%); clip-path: polygon(0 0, 100% 0, 100% 30%, 65% 30%, 65% 100%, 35% 100%, 35% 30%, 0 30%); }
.ico-kakao { background: #FEE500; border-radius: 3px; box-shadow: inset 0 0 0 4px #FEE500, inset 0 0 0 7px #3A1D1D; }
.ico-naver { background: #03C75A; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.85); }
