:root {
  --bg: #f4f3f0;
  --card-bg: #f4f3f0;
  --ink: #14151a;
  --ink-soft: #838383;
  --line: #dedcd8;
  --accent: #35342f;
  --accent-soft: #e4e2dd;
  --serif-en: 'Cormorant Garamond', serif;
  --serif-display: 'Playfair Display', serif;
  --serif-kr: 'Noto Serif KR', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-kr);
  -webkit-font-smoothing: antialiased;
  /* 한글이 '감사하겠습니 / 다.' 처럼 낱글자로 끊기지 않고
     띄어쓰기 단위(어절)로 줄바꿈되도록 합니다 */
  word-break: keep-all;
  /* 다만 띄어쓰기 없이 아주 긴 문자열(주소 등)은 넘치지 않게 잘라줍니다 */
  overflow-wrap: break-word;
}

/* 마지막 줄에 한 단어만 덩그러니 남는 것을 브라우저가 알아서 피해줍니다
   (지원하지 않는 브라우저는 무시하고 기존대로 동작) */
.section-subtitle,
.greeting-text,
.rsvp-caption,
.account-caption,
.account-note,
.dday-caption,
.intro-invite,
.venue-address,
.transport-item p,
.form-success {
  text-wrap: pretty;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  background: var(--card-bg);
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
  overflow: hidden;
}

.section {
  padding: 72px 32px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.section-label {
  font-family: var(--serif-en);
  letter-spacing: 0.06em;
  font-size: 34px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 14px;
}

.section-subtitle {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 인트로 */
.intro {
  padding: 0;
  border-bottom: none;
  position: relative;
}

.intro-photo {
  height: 100vh;
  min-height: 640px;
  background: linear-gradient(190deg, #2b2b2b, #4d4d4d 55%, #1c1c1c);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 로딩이 끝나면 천천히 떠오르듯 나타납니다 */
  opacity: 0;
  transition: opacity 1.6s ease;
}

.intro-photo.has-photo .intro-img { opacity: 1; }

/* 실제 사진이 들어오면 글자가 잘 보이도록 어두운 그라데이션을 덮습니다 */
.intro-photo.has-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.05) 35%, rgba(0,0,0,0.55) 88%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.petal-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.intro-photo .intro-overlay { z-index: 2; }

/* ── 오프닝 문구 애니메이션 ──────────────────────────────
   페이지가 열리면 위 문구부터 차례로 떠오릅니다. */
@keyframes introRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.intro-tagline,
.intro-names,
.intro-invite {
  animation: introRise 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* 손글씨가 다 쓰인 뒤에 이어서 떠오릅니다 */
.intro-tagline { animation-delay: 2.9s; }
.intro-names   { animation-delay: 3.35s; }
.intro-invite  { animation-delay: 3.65s; }

/* 사진도 아주 천천히 확대되며 시작 */
.intro-photo.has-photo .intro-img {
  animation: introZoom 11s ease-out both;
}

@keyframes introZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

.intro-eyebrow {
  font-family: 'Great Vibes', var(--serif-display), cursive;
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.95);
  margin: 0 0 10px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.45);
}

/* 왼쪽에서 오른쪽으로 획이 그어지듯 글씨가 쓰이는 효과.
   흘림체라 글자가 이어져 있어서, 좌우 마스크만으로 손으로 쓰는 것처럼 보입니다. */
.intro-eyebrow .ink {
  display: inline-block;
  /* 흘림체의 위아래 획이 잘리지 않도록 여유를 둡니다
     (inset() 은 음수를 받지 않으므로 여백으로 확보) */
  padding: 0.12em 0.08em 0.3em;
  clip-path: inset(0 100% 0 0);
  animation: writeInk 2.6s cubic-bezier(0.62, 0.02, 0.36, 1) 0.35s forwards;
}

@keyframes writeInk {
  to { clip-path: inset(0 0 0 0); }
}

/* 애니메이션을 원하지 않는 사용자 설정을 존중합니다 */
@media (prefers-reduced-motion: reduce) {
  .intro-tagline,
  .intro-names,
  .intro-invite,
  .intro-eyebrow .ink,
  .intro-photo.has-photo .intro-img {
    animation: none;
  }
  .intro-eyebrow .ink { clip-path: none; }
  .intro-img { transition: none; }
}

.photo-placeholder-text {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 8px 16px;
  border-radius: 999px;
}

.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 64px 24px 0;
  text-align: center;
  color: #fff;
}

/* 실제 사진이 있으면 문구를 아래쪽으로 옮겨 인물이 가려지지 않게 합니다 */
.intro-photo.has-photo .intro-overlay {
  top: auto;
  bottom: 0;
  padding: 0 24px 118px; /* 하단 고정 버튼(공유하기/목차)에 가리지 않도록 */
}

.intro-tagline {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.25;
  margin: 0 0 20px;
}

.intro-photo.has-photo .intro-tagline {
  font-size: 38px;
  margin: 0 0 14px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.35);
}

.intro-photo.has-photo .intro-names,
.intro-photo.has-photo .intro-invite {
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
}

.intro-names {
  font-family: var(--serif-kr);
  font-size: 16px;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

.intro-invite {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.intro-scroll {
  padding: 22px 0;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-align: center;
}

/* 인사말 */
.greeting-text {
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
  margin: 0 0 32px;
}

.family-line {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 24px;
}

.family-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.call-btn {
  flex: 1;
  max-width: 160px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

/* 캘린더 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 320px;
  margin: 0 auto 40px;
  font-family: var(--serif-en);
}

.cal-cell {
  font-size: 13px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.cal-dow {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
}

.cal-cell.is-day {
  color: var(--ink);
}

/* 셀은 가로가 더 넓어 border-radius:50% 만으로는 타원이 되므로
   정사각형 크기를 고정해 완전한 원으로 만듭니다 */
.cal-cell.is-target {
  width: 30px;
  height: 30px;
  justify-self: center;
  align-self: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 600;
}

.dday {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}

.dday-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.dday-item span {
  font-family: var(--serif-en);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
}

.dday-item small {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-top: 4px;
}

.dday-caption {
  font-size: 13px;
  color: var(--ink-soft);
}

/* 갤러리 */
.gallery-slider {
  display: flex;
  gap: 14px;                     /* 넘기는 도중 앞뒤 페이지가 붙어 보이지 않도록 */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-slider::-webkit-scrollbar { display: none; }

/* 한 페이지 = 사진 9장(3x3) */
.gallery-page {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;      /* 한 번에 한 페이지씩만 넘어가도록 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;          /* 마지막 페이지가 9장 미만이어도 위쪽부터 채워지도록 */
}

.gallery-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(20,20,20,0.4);
  cursor: pointer;
}

.gallery-cell.has-photo { background: none !important; }

.gallery-placeholder { pointer-events: none; }

.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* 사진이 준비되면 부드럽게 나타납니다 */
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-user-drag: none;
  user-select: none;
}

.gallery-cell.has-photo img { opacity: 1; }

.gallery-cell.has-photo:active img { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
  .gallery-cell img { transition: none; }
}

/* 아래 점 표시 */
.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
}

.gallery-dots[hidden] { display: none; }

.gallery-dot {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cfccc6;
  transition: background 0.25s ease, transform 0.25s ease;
}

.gallery-dot.is-active::before {
  background: var(--accent);
  transform: scale(1.35);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-dot::before { transition: none; }
}

/* 오시는 길 */
.venue-name {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}

.venue-address {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.map-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.map-links a {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.transport-info {
  text-align: left;
}

.transport-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.transport-item:last-child { padding-bottom: 0; }

.transport-item h3 {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 8px;
}

.transport-item p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}

/* 마음 전하실 곳 */
.account-caption {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
  margin: 0 0 32px;
}

.account-toggle-group {
  text-align: left;
}

.account-toggle-btn {
  width: 100%;
  padding: 16px 4px;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--serif-kr);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.account-toggle-btn:last-of-type { }

.account-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.account-list.open {
  max-height: 400px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  gap: 12px;
}

.account-owner {
  font-size: 13px;
  margin: 0 0 4px;
}

.account-number {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.copy-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.account-note {
  font-size: 11px;
  color: #b5493f;
  margin-top: 20px;
  line-height: 1.6;
}

/* 폼 (방명록 / RSVP) */
.site-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.site-form input[type="text"],
.site-form input[type="tel"],
.site-form textarea,
.site-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--serif-kr);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.site-form textarea { resize: vertical; }

.radio-group {
  display: flex;
  gap: 20px;
  font-size: 14px;
  padding: 4px 2px;
}

.site-form button[type="submit"] {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif-kr);
  font-size: 14px;
  cursor: pointer;
}

.hidden-field { display: none; }

.form-success {
  display: none;
  font-size: 13px;
  color: var(--accent);
  text-align: center;
  margin: 8px 0 0;
}

.form-success.show { display: block; }

.rsvp-caption {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
  margin: 0 0 28px;
}

/* 푸터 */
.footer {
  padding: 40px 0 120px;
  text-align: center;
  font-family: var(--serif-en);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20,18,16,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.lightbox.open { display: flex; }

.lightbox-content {
  width: 86%;
  max-width: 420px;
  max-height: 82vh;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  width: 40px;
  height: 56px;
  border-radius: 6px;
  cursor: pointer;
  display: none;
}

.lightbox.has-nav .lightbox-nav { display: block; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

body.no-scroll { overflow: hidden; }

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* 하단 네비게이션 */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(30,30,30,0.92);
  border-radius: 999px;
  padding: 8px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--serif-kr);
}

.bottom-nav-btn .icon { font-size: 15px; }
.bottom-nav-btn span:last-child { font-size: 10px; }

/* 목차 시트 */
.menu-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 70;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
}

.menu-sheet.open {
  transform: translateY(0);
}

.menu-sheet-inner {
  padding: 24px 32px 100px;
  display: flex;
  flex-direction: column;
}

.menu-link {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

.menu-link:last-child { border-bottom: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 80;
}

.toast.show { opacity: 1; }

/* ── 배경음악 버튼 ────────────────────────────────────── */
.music-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 90;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(20,18,16,0.42);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.music-btn[hidden] { display: none; }

/* 정지 상태: 음표에 사선이 그어진 모양 */
.music-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
}

.music-icon::before {
  content: '♪';
  position: absolute;
  inset: 0;
  color: #fff;
  font-size: 15px;
  line-height: 16px;
  text-align: center;
}

.music-icon::after {
  content: '';
  position: absolute;
  top: 7px;
  left: -2px;
  width: 20px;
  height: 1px;
  background: #fff;
  transform: rotate(-45deg);
  transition: opacity 0.2s ease;
}

.music-btn.is-playing .music-icon::after { opacity: 0; }

.music-btn.is-playing .music-icon::before {
  animation: musicPulse 1.6s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .music-btn.is-playing .music-icon::before { animation: none; }
}
