/* 표지와 맺음은 크림색, 가운데 구역은 흰색. 크림색 포인트는 신랑·신부 칸과 지도 버튼, 강조는 살구색(달력 하트와 표지 테이프) */
@font-face {
  font-family: "HallymGothic";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2204@1.0/HallymGothic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  --ink: #231815;
  --sub: #6a625c;
  --muted: #b9b3a6;
  --line: rgba(35, 24, 21, 0.14);
  --block: #ececec;
  --road: #cfcfcf;
  --heart: #f1cdb3;
  --bg: #faf0d1;
  --white: #ffffff;
  --outside: #f3e8c4;
  --serif: "DM Serif Display", "Times New Roman", serif;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--outside);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, figure, blockquote { margin: 0; }
h1, h2 { text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

.page {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  text-align: center;
  overflow: hidden;
}

/* 표지: 손글씨 한 줄, 테이프로 붙인 사진, 날짜, 이름 */
.cover {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100svh;
  padding: 72px 28px 80px;
  padding-top: calc(72px + env(safe-area-inset-top));
}
.cover__photo { position: relative; margin: 44px 34px 0; }
.cover__photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
/* 테이프: 달력 하트와 같은 색 */
.cover__photo::before {
  content: "";
  position: absolute; z-index: 1;
  top: -17px; left: 50%;
  width: 46%; height: 34px;
  transform: translateX(-58%) rotate(-3deg);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.28) 0 18%, transparent 30% 62%, rgba(255, 255, 255, 0.2) 74% 100%),
    var(--heart);
  opacity: 0.94;
  box-shadow: 0 1px 2px rgba(35, 24, 21, 0.12);
  clip-path: polygon(0 6%, 2% 0, 98% 3%, 100% 10%, 99% 52%, 100% 94%, 97% 100%, 3% 98%, 0 90%, 1% 48%);
}
.cover__date { margin-top: 36px; font-family: var(--serif); font-size: 19px; line-height: 1.15; letter-spacing: 0.01em; }
/* 구역 제목(Invitation 등)과 같은 글씨 */
.cover__lead { font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1.15; letter-spacing: 0.01em; }

/* 공통 구역 */
.section { padding: 88px 28px; }
/* 구역 사이 표시선: 가장 얇은 선 (고해상도 화면에서는 0.5px) */
.section, .footer { border-top: 1px solid rgba(35, 24, 21, 0.12); }
@media (min-resolution: 2dppx) { .section, .footer { border-top-width: 0.5px; } }
.section__title { margin-bottom: 52px; font-weight: 400; }
.section__title span { display: block; font-family: var(--serif); font-size: 27px; line-height: 1.15; letter-spacing: 0.01em; }
.section__title small { display: block; margin-top: 12px; font-size: 13.5px; color: var(--sub); line-height: 1.8; }
.section__title--ko { font-size: 17px; font-weight: 600; }
.card { padding: 20px 16px; background: var(--white); }
.section--white { background: var(--white); --line: #e9e6e1; }

/* 초대의 글 */
.verse p, .message { line-height: 2.3; }
/* 말씀 구절만 명조 */
.verse { font-family: "Gowun Batang", "Noto Serif KR", "AppleMyungjo", serif; }
.verse p { font-size: 15.5px; }
.verse cite { font-weight: 700; display: block; margin-top: 14px; font-style: normal; font-weight: 600; }
.message { margin-top: 56px; }
.family { display: grid; grid-template-columns: 1fr 1fr; margin-top: 68px; }
/* 초대 글은 크림색, 신랑·신부 칸만 흰색 띠 */
.section--invite { padding-bottom: 0; background: var(--bg); }
.section--invite .family { margin: 72px -28px 0; padding: 44px 28px; background: var(--white); --line: #e9e6e1; }
.family__col { display: grid; gap: 10px; padding: 4px 8px; }
.family__col + .family__col { border-left: 1px solid var(--line); }
.family__col strong { font-size: 16px; font-weight: 600; }
.family__col span { font-size: 14px; }

/* 달력 */
.calendar__month { font-family: var(--serif); font-size: 15px; font-weight: 400; letter-spacing: 0.2em; margin-right: -0.2em; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  max-width: 330px;
  margin: 16px auto 0;
  padding: 22px 10px 14px;
  background: var(--white);
  font-variant-numeric: tabular-nums;
}
.calendar__dow { padding-bottom: 12px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; }
.calendar__day { display: grid; place-items: center; height: 44px; font-size: 15px; }
.calendar__day--out { color: var(--muted); }
.calendar__day--on {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 44'%3E%3Cpath fill='%23f1cdb3' d='M24 43C14 33 2 25 2 13.5 2 6.6 7.4 2 13.3 2c4.3 0 8.300 2.300 10.700 6.200C26.400 4.300 30.400 2 34.700 2 40.600 2 46 6.600 46 13.500 46 25 34 33 24 43z'/%3E%3C/svg%3E") center / 46px 42px no-repeat;
  font-weight: 600;
  padding-bottom: 4px;
}
.dday { margin-top: 40px; font-size: 14px; color: var(--sub); }
.dday b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 사진: 세 장씩 한 줄 */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 -12px; }
.gallery button { padding: 0; border: 0; background: var(--block); cursor: pointer; aspect-ratio: 3 / 4; -webkit-tap-highlight-color: transparent; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; touch-action: none; }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: rgba(20, 16, 14, 0.94); }
.lightbox img { width: 100%; height: 100%; min-height: 0; object-fit: contain; pointer-events: none; }
.lightbox__bar {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  color: #fff; font-size: 14px; font-variant-numeric: tabular-nums;
}
.lightbox__bar span { min-width: 64px; text-align: center; color: rgba(255, 255, 255, 0.7); }
.lightbox__bar button { min-width: 60px; min-height: 44px; border: 0; background: none; color: #fff; font-size: 14px; cursor: pointer; }
.lightbox__bar button:focus-visible { outline-color: #fff; }
#lightbox-close { margin-left: 12px; border: 1px solid rgba(255, 255, 255, 0.5); }

/* 약도 */
.map { display: block; width: 100%; height: auto; font-family: var(--font); }
.section .card { margin: 0 -12px; padding: 14px 10px; }
.map__road path { fill: none; stroke: var(--road); stroke-width: 3; }
.map__bldg rect { fill: var(--block); }
.map__venue { fill: var(--ink); }
.map__route { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-dasharray: 0.1 4.6; stroke-linecap: round; }
.map__arrow, .map__dot { fill: var(--ink); }
.map__label { font-size: 10px; fill: #4a4542; }
.map__venue-label { font-size: 10px; font-weight: 600; fill: #fff; }
.map__note { font-size: 10px; font-weight: 500; fill: var(--ink); }
.map__exit { font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.map__hint { font-size: 8.5px; fill: #7a7572; }
.map__station { font-size: 10px; fill: var(--ink); }

.map-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 32px; }
.map-links .btn { border: 0; background: var(--bg); }

.info { margin-top: 40px; text-align: left; font-size: 14.5px; }
.info > div { display: grid; grid-template-columns: 64px 1fr; padding: 14px 0; border-top: 1px solid var(--line); }
.info > div:last-child { border-bottom: 1px solid var(--line); }
.info dt { font-weight: 600; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--ink); background: var(--white); color: var(--ink);
  font-size: 14.5px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--ink); color: #fff; }
@media (hover: hover) { .btn:hover { background: var(--ink); color: #fff; } }
.btn--wide { width: 100%; }

.link-btn {
  display: block; margin-top: 4px; padding: 6px 0; min-height: 32px;
  border: 0; background: none; color: var(--sub);
  font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* 계좌 */
.account-note { margin: -16px 0 44px; line-height: 2; }
.account__empty { padding: 14px 0 18px; border-top: 1px solid var(--line); color: var(--sub); font-size: 14px; }
.account { border-top: 1px solid var(--line); text-align: left; }
.account:last-child { border-bottom: 1px solid var(--line); }
.account summary {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 56px; font-weight: 600; cursor: pointer; list-style: none;
}
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: "+"; font-weight: 300; font-size: 20px; }
.account[open] summary::after { content: "−"; }
.account__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.account__row span { display: block; color: var(--sub); font-size: 13.5px; }
.account__row b { display: block; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.account__actions { display: flex; gap: 6px; flex: none; }
.account__row .btn { min-height: 44px; padding: 0 14px; font-size: 13.5px; }

/* 사진 확대 금지 */
.no-zoom, .no-zoom body { touch-action: pan-y; }
.no-zoom img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* 배경음악 버튼 */
.music {
  position: fixed; z-index: 5;
  top: calc(14px + env(safe-area-inset-top));
  right: max(14px, calc(50% - 215px + 14px));
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.music[hidden] { display: none; }
.music.is-on { color: var(--ink); }
.music.is-on .music__slash { display: none; }

/* 맺음 */
.footer {
  padding: 72px 28px 64px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.footer p { margin-bottom: 44px; font-size: 14px; line-height: 2; color: var(--sub); }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  padding: 11px 20px; background: var(--ink); color: #fff; font-size: 14px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 모션 */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heart-pop { 0% { transform: scale(0.5); } 55% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* 첫 인사 화면 */
.intro-screen { display: none; }
.js .intro-screen {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: var(--bg); text-align: center;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.intro-screen p { animation: rise 1.2s ease 0.2s both; }
.intro-screen p { font-family: "HallymGothic", var(--font); font-size: 17px; font-weight: 400; line-height: 1; letter-spacing: 0.06em; }
.intro-screen span { display: flex; align-items: center; justify-content: center; gap: 0.5em; }
.intro-screen span + span { margin-top: 10px; font-size: 14px; }
.intro-screen svg { flex: none; }
.intro-done .intro-screen { opacity: 0; visibility: hidden; pointer-events: none; }

/* 표지: 인사 화면이 걷히면 사진(테이프 포함) → 위아래 글씨 순서로 나타남 */
.js .cover__date, .js .cover__photo, .js .cover__lead { opacity: 0; }
.intro-done .cover__photo { animation: rise 1.3s ease 0.5s both; }
.intro-done .cover__date, .intro-done .cover__lead { animation: rise 1.1s ease 1.6s both; }

/* 스크롤하면 구역 안의 내용이 위에서부터 차례로 나타남 */
.js .reveal > * { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s ease; }
.js .reveal.is-in > * { opacity: 1; transform: none; }
.js .reveal.is-in > :nth-child(2) { transition-delay: 0.18s; }
.js .reveal.is-in > :nth-child(3) { transition-delay: 0.36s; }
.js .reveal.is-in > :nth-child(4) { transition-delay: 0.54s; }
.js .reveal.is-in > :nth-child(n+5) { transition-delay: 0.72s; }

/* 달력 하트가 톡 튀어나옴 */
.js .reveal.is-in .calendar__day--on { animation: heart-pop 0.7s ease 0.9s both; }

/* 사진이 한 줄씩 차례로 나타남 */
.js .reveal .gallery button { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.is-in .gallery button { opacity: 1; transform: none; transition-delay: 0.3s; }
.js .reveal.is-in .gallery button:nth-child(n+4) { transition-delay: 0.55s; }
.js .reveal.is-in .gallery button:nth-child(n+7) { transition-delay: 0.8s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal > *, .js .reveal .gallery button { opacity: 1; transform: none; transition: none; }
  .js .cover__date, .js .cover__photo, .js .cover__lead, .js .reveal.is-in .calendar__day--on, .intro-screen p { opacity: 1; animation: none; }
  .toast, .btn { transition: none; }
}
