:root {
  --pink-bg: #f7dede;
  --pink-soft: #fbeaea;
  --ink: #4a4340;
  --ink-soft: #8a7f7a;
  --line: #e3cfcf;
  --white: #ffffff;
  --gold: #b98b6d;
  --serif-kr: 'Pretendard', sans-serif;
  --serif-en: 'Pretendard', sans-serif;
  --batang: 'Pretendard', sans-serif;
  --title-serif: 'Playfair Display', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(160deg, #f3e6e3, #eae2dd 55%, #e7ded9);
  color: var(--ink);
  font-family: var(--serif-kr);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  overflow: hidden;
}

/* 데스크톱(태블릿 이상)에서는 모서리가 둥글게 말린 카드 형태로 떠 보이게 처리 */
@media (min-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    padding: 48px 0;
  }

  .page {
    min-height: auto;
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(80, 50, 45, 0.18), 0 2px 10px rgba(80, 50, 45, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
  }
}

section {
  padding: 88px 28px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

/* ===================== SCROLL REVEAL ===================== */
.cover-photo {
  opacity: 0;
  animation: coverIn 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes coverIn {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  transform: translateY(20px) translateX(-36px);
}

.reveal-left.is-visible {
  transform: translateY(0) translateX(0);
}

.reveal-right {
  transform: translateY(20px) translateX(36px);
}

.reveal-right.is-visible {
  transform: translateY(0) translateX(0);
}

.reveal-scale {
  transform: translateY(20px) scale(0.94);
}

.reveal-scale.is-visible {
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .cover-photo,
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ===================== INTRO SPLASH ===================== */
html.intro-lock,
html.intro-lock body {
  overflow: hidden;
  height: 100%;
}

.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(243, 230, 227, 0.75), rgba(234, 226, 221, 0.8) 55%, rgba(231, 222, 217, 0.8));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.intro-splash.intro-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-splash-inner {
  text-align: center;
}

.intro-splash-label {
  font-family: 'Fredoka', var(--title-serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 9vw, 2.5rem);
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 20px;
  white-space: nowrap;
}

.intro-letter {
  display: inline-block;
  opacity: 0;
  animation: introLetterPop 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-splash-deco {
  width: 1px;
  height: 0;
  background: var(--gold);
  opacity: 0;
  margin: 0 auto 20px;
  animation: introLine 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.intro-splash-names {
  font-family: var(--batang);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 10px;
  opacity: 0;
  animation: introFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.intro-splash-names span {
  color: var(--gold);
  margin: 0 6px;
}

.intro-splash-date {
  font-family: var(--serif-en);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  animation: introFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.0s forwards;
}

@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introLetterPop {
  from { opacity: 0; transform: translateY(12px) scale(0.4) rotate(-10deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes introLine {
  from { opacity: 0; height: 0; }
  to { opacity: 0.5; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-splash {
    transition: none;
  }
  .intro-letter,
  .intro-splash-deco,
  .intro-splash-names,
  .intro-splash-date {
    animation: none !important;
    opacity: 1 !important;
    height: auto !important;
    transform: none !important;
  }
}

.section-title {
  font-family: var(--title-serif);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 6px;
}

.section-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin: 0 0 32px;
}

/* ===================== COVER ===================== */
.cover {
  padding: 0;
  background: #fbfaf8;
  border-bottom: none;
}

.cover-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1203 / 1770;
}

.cover-photo .ph-img,
.cover-photo .photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===================== 떠오르는 골드 반짝이 효과 ===================== */
.gold-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.gold-sparkles .spark {
  position: absolute;
  top: 108%;
  background: radial-gradient(circle at 50% 35%, #fff8e6 0%, #f0cf8e 60%, #d9a95e 100%);
  clip-path: polygon(50% 15%, 61% 4%, 76% 4%, 90% 15%, 95% 30%, 90% 46%, 50% 82%, 10% 46%, 5% 30%, 10% 15%, 24% 4%, 39% 4%);
  filter: drop-shadow(0 0 3px rgba(240, 207, 142, 0.85));
  opacity: 0;
  animation-name: sparkleRise;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity, top;
}

@keyframes sparkleRise {
  0% { top: 108%; opacity: 0; transform: translateX(0) scale(0.4); }
  15% { opacity: 1; }
  50% { top: 50%; opacity: 0.35; transform: translateX(var(--driftX)) scale(1); }
  65% { opacity: 1; }
  100% { top: -8%; opacity: 0; transform: translateX(calc(var(--driftX) * 1.6)) scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .gold-sparkles .spark { display: none; }
}

.cover-date-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 34px 0 0;
}

.cover-diamond {
  font-size: 0.5rem;
  color: var(--gold);
}

.cover-date-num {
  font-family: var(--serif-en);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
}

.cover-date-line {
  width: 1px;
  height: 18px;
  background: var(--ink);
  opacity: 0.4;
}

.cover-names {
  text-align: center;
  font-family: var(--batang);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 32px 0 14px;
}

.cover-date-en {
  text-align: center;
  font-family: var(--serif-en);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.cover-venue {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ===================== INTRO ===================== */
.intro-eng {
  font-family: var(--title-serif);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 28px;
}

.intro-text {
  font-family: var(--batang);
  font-size: 0.98rem;
  line-height: 2;
  color: var(--ink);
  margin: 0 0 32px;
}

.intro-names {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.intro-names .dot { margin: 0 10px; color: var(--gold); }

/* ===================== WHEN / CALENDAR / COUNTDOWN ===================== */
.when-date {
  font-size: 1.05rem;
  margin: 4px 0 2px;
}

.when-date-en {
  font-family: var(--serif-en);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 36px;
}

.calendar {
  background: var(--pink-soft);
  border-radius: 12px;
  padding: 24px 16px;
  margin: 0 0 36px;
}

.calendar-month {
  font-family: var(--serif-en);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
  color: var(--ink);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 12px;
  font-size: 0.8rem;
}

.calendar-grid.dow {
  color: var(--ink-soft);
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.calendar-grid.dow .sun { color: #d98a8a; }
.calendar-grid.dow .sat { color: #7a94b8; }

.calendar-grid.dates span {
  position: relative;
  padding: 4px 0;
  color: var(--ink);
}

.calendar-grid.dates span.empty { visibility: hidden; }

.calendar-grid.dates span.highlight {
  color: var(--white);
  font-weight: 600;
}

.calendar-grid.dates span.highlight::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  background: var(--gold);
  border-radius: 50%;
  z-index: -1;
}

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

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

.cd-num {
  font-family: var(--serif-en);
  font-size: 1.6rem;
  color: var(--ink);
}

.cd-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-top: 4px;
}

.dday-text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ===================== FAMILY ===================== */
.family {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-top: 72px;
  padding-bottom: 72px;
}

.family-block { flex: 1; }

.family-role {
  font-size: 0.95rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.family-role b { font-weight: 600; }

.family-parents {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.family-divider {
  font-family: var(--serif-en);
  font-size: 1.3rem;
  color: var(--gold);
}

/* ===================== GALLERY (풀와이드 가로 스와이프) ===================== */
.gallery-viewer {
  position: relative;
  margin: 0 -28px 14px;
  overflow: hidden;
}

.gallery-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.gallery-scroll .photo-box {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.gallery-nav:active {
  background: rgba(0, 0, 0, 0.55);
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.gallery-hint-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.66rem;
  line-height: 1.4;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.gallery-hint-badge.hide {
  opacity: 0;
}

.gallery-hint-badge .hint-icon {
  font-size: 1.1rem;
}

.gallery-counter {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}

/* ===================== shared photo box ===================== */
.photo-box {
  position: relative;
  background: var(--pink-soft);
}

.photo-box .ph-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7dede, #f0e4df);
  color: #b39a94;
  font-size: 0.68rem;
  line-height: 1.6;
  text-align: center;
  padding: 6px;
}

/* ===================== LOCATION ===================== */
.location-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 4px 0 6px;
}

.location-address {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.map-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.kakao-map {
  width: 100%;
  height: 100%;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #f3e9e4, #f3e9e4 10px, #ede0da 10px, #ede0da 20px);
  color: #a4938c;
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
  padding: 12px;
}

.map-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 36px;
}

.map-btn {
  flex: 1;
  padding: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
}

.transport {
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.transport-item {
  display: block;
  background: var(--pink-soft);
  border-radius: 12px;
  padding: 16px 16px 18px;
}

.transport-item + .transport-item { margin-top: 14px; }

.transport-badge {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.transport-body {
  min-width: 0;
}

.transport-desc {
  display: flex;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #2b2523;
  margin: 0 0 8px;
}

.transport-desc:last-child { margin-bottom: 0; }

.transport-desc .num {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 700;
}

.transport-desc .desc-text {
  flex: 1;
  min-width: 0;
}

.transport-desc b {
  color: #1c1816;
  font-weight: 700;
}

.transport-note {
  font-size: 0.7rem;
  line-height: 1.6;
  color: #b09a8f;
  margin: 8px 0 0;
}

/* ===================== ACCOUNT ===================== */
.account-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.accordion {
  border-top: 1px solid var(--line);
}

.accordion:last-of-type { border-bottom: 1px solid var(--line); }

.acc-header {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--serif-kr);
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}

.acc-arrow {
  transition: transform 0.25s ease;
  color: var(--ink-soft);
}

.acc-header.open .acc-arrow { transform: rotate(180deg); }

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  text-align: left;
}

.acc-body-inner,
.acc-body {
  padding-bottom: 4px;
}

.acc-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  margin: 14px 4px;
  box-shadow: 0 4px 14px rgba(120, 90, 90, 0.06);
}

.acc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.acc-card-header .role {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.acc-card-header .name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.acc-bank-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--pink-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.acc-bank-name {
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin: 0 0 3px;
}

.acc-bank-num {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
}

.copy-icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.copy-icon-btn:active {
  background: var(--pink-bg);
  color: var(--ink);
}

/* ===================== SHARE ===================== */
.share {
  padding-bottom: 80px;
  background: var(--pink-soft);
}

.share-dday {
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0 0 20px;
}

.share-quote {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.share-btn {
  padding: 14px 0;
  border-radius: 8px;
  border: none;
  font-family: var(--serif-kr);
  font-size: 0.85rem;
  cursor: pointer;
}

.share-btn.kakao { background: #fee500; color: #3c1e1e; }
.share-btn.copy { background: var(--white); color: var(--ink); border: 1px solid var(--line); }

.footer-credit {
  font-family: var(--serif-en);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ===================== LIGHTBOX ===================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92%;
  max-height: 88%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,30,0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 360px) {
  section { padding: 48px 18px; }
  .cover-frame { min-height: 560px; }
}

/* 갤러리 사진은 잘리지 않고 원본 비율 그대로 전체가 보이게 */
.gallery-scroll .photo-box {
  aspect-ratio: 2 / 3;
  background: #fff;
}
.gallery-scroll .photo-box .ph-img {
  object-fit: contain;
}

/* 손가락 확대·더블탭 확대 막기 (스크롤과 갤러리 스와이프는 그대로) */
html, body {
  touch-action: pan-x pan-y;
}
.lightbox, .lightbox img {
  touch-action: none;
}
img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}
