:root {
  --paper: #f8f7f4;
  --card: #ffffff;
  --text: #333030;
  --muted: #8d8885;
  --line: #e3dfdb;
  --rose: #c0727f;
  --rose-soft: #f3e3e5;
  --en: "Cormorant Garamond", "Gowun Batang", serif;
  --serif: "Gowun Batang", serif;
  --sans: "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  --script: "Mrs Saint Delafield", cursive;
  /* 종이 질감 */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

.cover-date, .when-date, .countdown b, .together, .eyebrow { font-variant-numeric: lining-nums; }

body {
  background: #e9e6e2;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  word-break: keep-all;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { fill: currentColor; }

.invitation {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: var(--noise), var(--paper);
}

/* ---------- 커버 ---------- */
.cover {
  min-height: 100svh;
  padding: 96px 24px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cover-title {
  font-family: var(--en);
  font-weight: 500;
  font-size: 58px;
  letter-spacing: 0.12em;
  line-height: 1;
  margin-bottom: 64px;
}
.cover-date {
  font-family: var(--en);
  font-size: 23px;
  line-height: 1.45;
  letter-spacing: 0.04em;
}
.cover-date sup { font-size: 0.55em; }
.cover-line {
  width: 1px;
  height: 108px;
  background: var(--text);
  opacity: 0.6;
  margin: 36px 0 40px;
}
.cover-names {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--serif);
  font-size: 21px;
}
.spaced { letter-spacing: 0.6em; margin-right: -0.6em; }
.cover-venue { margin-top: 44px; font-size: 12px; color: var(--muted); }

.main-photo img { display: block; width: 100%; }

/* ---------- 공통 ---------- */
.section { padding: 64px 28px; text-align: center; }
.section-left { text-align: left; padding-top: 40px; }
.eyebrow {
  font-family: var(--en);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--rose);
  margin-bottom: 6px;
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  color: var(--rose);
  margin-bottom: 32px;
}
.desc { font-size: 14px; margin-bottom: 28px; }
.message { font-size: 14.5px; line-height: 2.05; white-space: pre-line; }
.divider { display: block; width: 40px; height: 1px; background: var(--line); margin: 44px auto 28px; }

.parents { font-size: 15px; }
.parents p { margin: 6px 0; }
.parents span { font-weight: 400; }
.parents small { color: var(--muted); font-size: 14px; margin: 0 10px 0 0; }
.parents strong { font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 190px;
  margin-top: 36px;
  padding: 12px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--rose);
  font-size: 14px;
  transition: background 0.2s;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { background: var(--rose-soft); }
.btn-wide { display: flex; width: 100%; color: var(--text); }
.btn-small { min-width: 0; width: 100%; margin-top: 28px; }

/* ---------- 예식 일시 / 달력 ---------- */
.when-date { font-family: var(--en); font-size: 26px; letter-spacing: 0.04em; line-height: 1.3; }
.when-time { font-size: 14px; margin-bottom: 28px; }

.calendar {
  max-width: 300px;
  margin: 0 auto;
  padding: 22px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  font-size: 14px;
}
.cal-grid span { height: 38px; display: flex; align-items: center; justify-content: center; }
.cal-grid .dow { font-weight: 400; }
.cal-grid .sun { color: var(--rose); }
.cal-grid .target b {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-grid b { font-weight: inherit; }

.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  margin-top: 36px;
}
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
.countdown span { font-family: var(--en); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.countdown b { font-family: var(--en); font-size: 25px; font-weight: 500; line-height: 1.2; }
.countdown i { font-style: normal; color: var(--muted); padding-bottom: 6px; }
.dday-text { margin-top: 16px; font-size: 14px; }
.dday-text em { font-style: normal; color: var(--rose); font-weight: 500; }

/* ---------- 갤러리 ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery button {
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(160deg, #ece7e2, #dcd3cc);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(18, 16, 15, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: 100%; padding: 0 12px; }
.lb-stage img { max-width: 100%; max-height: 85vh; display: block; margin: 0 auto; }
.lb-stage .ph { width: 80vw; max-width: 400px; aspect-ratio: 3 / 4; background: linear-gradient(160deg, #ece7e2, #dcd3cc); }
.lb-close, .lb-prev, .lb-next { position: absolute; color: #fff; font-size: 32px; padding: 12px 16px; line-height: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; color: #ddd; font-size: 13px; }

/* ---------- 오시는 길 ---------- */
.venue-name { font-size: 16px; font-weight: 400; }
.venue-address { font-size: 14px; color: var(--muted); }
.venue-tel { font-size: 14px; margin-top: 6px; }
.map { height: 260px; background: #e8e4df; }
.map img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sub-title { font-size: 15px; font-weight: 500; }
.sub-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.nav-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.ico { display: inline-block; width: 16px; height: 16px; border-radius: 4px; flex: none; }
.ico-naver { background: #03c75a; }
.ico-tmap { background: linear-gradient(135deg, #e5302b, #4a49e5); }
.ico-kakao { background: #fee500; }
.ico-kakaotalk { background: #fee500; border-radius: 50%; }

.transport { margin-top: 28px; }
.transport > div { padding: 22px 0; border-top: 1px solid var(--line); font-size: 14px; }
.transport h4 { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.transport .line { display: flex; align-items: center; gap: 8px; }
.transport .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.transport .note { margin-top: 10px; white-space: pre-line; }

/* ---------- 스탬프 ---------- */
.stamp-wrap { padding: 32px 0; }
.stamp { width: 160px; height: 160px; display: block; margin: 0 auto; }
.stamp-edge { fill: none; stroke: var(--text); stroke-width: 1.6; }
.stamp-ring { font-family: var(--sans); font-weight: 500; font-size: 17px; letter-spacing: 1.5px; fill: var(--text); }
.stamp-text { font-family: var(--sans); font-weight: 500; font-size: 17px; text-anchor: middle; fill: var(--text); }

/* ---------- 계좌 ---------- */
.tabs {
  display: inline-flex;
  padding: 4px;
  background: #ebe8e5;
  border-radius: 999px;
  margin-bottom: 28px;
}
.tab { padding: 8px 26px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }

.account-list { display: grid; gap: 12px; }
.account-card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px 14px 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.account-card .who { font-size: 14px; }
.account-card .who small { color: var(--muted); margin-right: 6px; font-size: 13px; }
.account-card .num { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.account-card .num span { color: var(--muted); }
.copy-btn { display: inline-flex; padding: 4px; color: var(--muted); }
.copy-btn svg { width: 16px; height: 16px; }
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

/* ---------- 함께 걸어온 시간 ---------- */
.together { font-family: var(--en); font-size: 22px; letter-spacing: 0.04em; }
.together small { font-family: var(--sans); font-size: 11px; margin: 0 10px 0 2px; color: var(--muted); }

/* ---------- 마무리 ---------- */
.ending { padding-top: 40px; }
.script {
  font-family: var(--script);
  color: #b9433f;
  font-size: 72px;
  line-height: 0.9;
  text-align: left;
  padding-left: 18%;
}
.script span { display: inline-block; padding-left: 14%; }
.date-table {
  width: 100%;
  margin-top: 36px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.date-table th { font-size: 11px; font-weight: 500; padding: 0 12px 6px; border-bottom: 1px solid var(--text); }
.date-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-weight: 400; }

.closing { position: relative; margin: 72px 0 56px; padding: 40px 0; }
.script-bg {
  position: absolute;
  inset: 0;
  padding: 0;
  text-align: center;
  font-size: 92px;
  line-height: 1.15;
  color: #d7a092;
  opacity: 0.75;
  pointer-events: none;
}
.closing-label { position: relative; font-family: var(--en); font-size: 12px; letter-spacing: 0.15em; font-weight: 500; }
.closing-text { position: relative; margin-top: 8px; font-family: var(--serif); font-size: 18px; line-height: 1.75; white-space: pre-line; }

.share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 6px 12px;
  font-size: 14px;
}
.share-link[hidden] { display: none; }
.footer { padding: 8px 0 40px; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- 연락하기 모달 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(30, 26, 24, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
}
.modal-card h3 { font-family: var(--serif); font-weight: 400; text-align: center; margin-bottom: 16px; }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.contact-row small { color: var(--muted); margin-right: 8px; }
.contact-row a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; margin-left: 6px; background: var(--card); }

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

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