/* =========================================================
   이종원 ♥ 장윤희 · 모바일 청첩장
   타이포 = 내추럴(고운바탕 + Pinyon Script) / 베이스 = 화이트(모던)
   포인트 = 일러스트와 어울리는 블러시 핑크
   ========================================================= */

/* 폰트는 index.html <head>의 <link>로 병렬 로드 (CSS @import 직렬화 회피) */

:root {
  --sans: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', sans-serif;
  --serif: 'Gowun Batang', serif;
  --latin: 'Cormorant Garamond', serif;
  --script: 'Pinyon Script', cursive;

  --page-bg: #ffffff;
  --soft-bg: #fbf6f5;
  --accent: #d28b94;
  --accent-deep: #b4707b;
  --accent-soft: #f6e4e6;
  --leaf: #8aa873;
  --text: #3a3330;
  --sub: #9c8e89;
  --line: #efe6e3;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 460px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 50% -8%, #fdf1f0 0%, transparent 60%),
    #f3ebe8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 본문 = 모바일 폭의 흰 카드, 데스크톱에선 가운데 정렬 */
.invite {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--page-bg);
  min-height: 100vh;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(80, 55, 50, .35);
}

/* ---------- 공통 섹션 ---------- */
.sec { padding: 62px 32px; position: relative; text-align: center; }
.sec.soft { background: var(--soft-bg); }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 16px;
}
.eyebrow.latin { font-family: var(--latin); font-size: 16px; letter-spacing: 0.3em; font-weight: 600; }
.eyebrow.latin.big {
  font-family: var(--script); font-size: 34px; letter-spacing: 0;
  text-transform: none; font-weight: 400; line-height: 1; margin-bottom: 18px;
}
.sec-title {
  font-family: var(--serif); font-size: 25px; font-weight: 700;
  color: var(--text); margin: 0 0 14px; line-height: 1.4;
}
.sec-lead {
  font-size: 14.5px; line-height: 1.9; color: var(--sub);
  margin: 0 auto 26px; max-width: 300px;
}

/* reveal on scroll */
html.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
html.js [data-reveal].in { opacity: 1; transform: none; }
/* JS 미사용/로드 실패 안전장치 — 무조건 표시 */
html.reveal-fallback [data-reveal] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ===================== COVER ===================== */
.cover { padding-top: 64px; padding-bottom: 52px; }
.cover-eyebrow {
  font-family: var(--latin); font-size: 17px; letter-spacing: 0.34em; font-weight: 500;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.cover-illust {
  position: relative; width: 100%; max-width: 330px; margin: 0 auto;
}
.cover-illust::before {
  content: ""; position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fbe7ea 0%, rgba(251,231,234,0) 70%);
  z-index: 0;
}
.cover-illust img { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 11 / 16; }

.names {
  margin: 18px 0 0; font-family: var(--serif); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 34px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.1;
}
.names .amp {
  font-family: var(--script); font-size: 38px; font-weight: 400;
  color: var(--accent); cursor: pointer; line-height: 1; transform: translateY(-2px);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cover-meta { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cm-date { font-family: var(--latin); font-size: 24px; letter-spacing: 0.2em; font-weight: 500; color: var(--text); }
.cm-rule { width: 28px; height: 1px; background: var(--accent); opacity: .55; }
.cm-sub { font-family: var(--latin); font-size: 14px; letter-spacing: 0.08em; color: var(--sub); }
.cover-dday {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--sub);
  background: var(--accent-soft); padding: 8px 16px; border-radius: 9999px;
}
.cover-dday b { color: var(--accent-deep); font-weight: 700; font-variant-numeric: tabular-nums; }

.scroll-cue { margin-top: 34px; display: flex; justify-content: center; }
.scroll-cue .sc-line {
  width: 1px; height: 32px; background: linear-gradient(var(--accent), transparent);
  animation: cuePulse 1.8s var(--ease) infinite;
}
@keyframes cuePulse { 0%,100% { opacity: .25; transform: scaleY(.7); } 50% { opacity: 1; transform: scaleY(1); } }

/* ===================== 인사말 ===================== */
.greeting-body { font-family: var(--serif); font-size: 16px; line-height: 2.15; color: var(--text); margin: 0 auto 36px; max-width: 300px; }
.hosts { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.host-row {
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 7px;
  font-size: 15px; color: var(--text);
}
.host-parents { color: var(--sub); font-size: 14px; }
.host-rel { color: var(--sub); font-size: 13px; }
.host-child { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.ho { color: var(--sub); font-size: 12px; margin-right: 3px; opacity: .85; }

/* ===================== 캘린더 ===================== */
.when-line { font-family: var(--latin); font-size: 19px; letter-spacing: 0.06em; color: var(--text); margin-bottom: 26px; }
.when-line .dot { color: var(--accent); margin: 0 4px; }
.calendar { max-width: 320px; margin: 0 auto; padding: 24px 18px; border-radius: 16px; background: var(--page-bg); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 0; }
.cal-h { font-size: 12px; color: var(--sub); font-weight: 600; padding-bottom: 8px; }
.cal-h.sun, .cal-d.sun { color: var(--accent-deep); }
.cal-d { font-size: 14px; color: var(--text); height: 34px; display: grid; place-items: center; position: relative; z-index: 0; }
.cal-d.mark { color: #fff; font-weight: 700; }
.cal-d.mark::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); z-index: -1;
}
.dday-line { margin-top: 22px; font-size: 14px; color: var(--text); }
.dday-line b { color: var(--accent-deep); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===================== 갤러리 ===================== */
.gallery-viewport {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; margin: 8px -32px 0; padding: 6px 32px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.gallery-viewport::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 76%; scroll-snap-align: center; aspect-ratio: 4 / 5;
  border-radius: 14px; overflow: hidden; background: var(--accent-soft);
  display: grid; place-items: center;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-slide .ph { color: var(--accent-deep); font-size: 13px; opacity: .7; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gallery-slide .ph svg { width: 30px; height: 30px; opacity: .6; }
.gallery-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.g-arrow {
  appearance: none; border: 1px solid var(--line); background: var(--page-bg); cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: background .15s var(--ease);
}
.g-arrow:hover { background: var(--soft-bg); }
.g-arrow::before { content: ""; width: 8px; height: 8px; border-top: 1.5px solid var(--text); border-right: 1.5px solid var(--text); }
#gPrev::before { transform: rotate(-135deg); margin-left: 3px; }
#gNext::before { transform: rotate(45deg); margin-right: 3px; }
.gallery-dots { display: flex; gap: 0; }
.gallery-dots .dot { width: 7px; height: 7px; padding: 11px 6px; box-sizing: content-box; background-clip: content-box; border-radius: 9999px; background-color: var(--line); cursor: pointer; transition: width .25s var(--ease), background-color .25s var(--ease); }
.gallery-dots .dot.active { background-color: var(--accent); width: 20px; }

/* ===================== 오시는 길 ===================== */
.venue-name { font-family: var(--serif); font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.venue-addr { font-size: 13.5px; color: var(--sub); line-height: 1.7; margin-bottom: 4px; }
.venue-tel { display: inline-block; font-family: var(--latin); font-size: 15px; letter-spacing: 0.04em; color: var(--accent-deep); text-decoration: none; margin-bottom: 22px; }
.map { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.map img { width: 100%; height: auto; display: block; aspect-ratio: 2386 / 1795; }
.map-btns { display: flex; gap: 8px; margin-top: 14px; }
.map-btns .mbtn {
  flex: 1; border: 1px solid var(--line); background: var(--page-bg); color: var(--text);
  font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 12px 0; border-radius: 10px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all .15s var(--ease);
}
.map-btns .mbtn:hover { background: var(--soft-bg); border-color: var(--accent-soft); }

.dir-list { max-width: 330px; margin: 26px auto 0; text-align: left; }
.dir-item { display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: start; padding: 16px 2px; }
.dir-k { font-size: 13px; font-weight: 700; color: var(--accent-deep); padding-top: 1px; }
.dir-v { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.dir-v b { font-weight: 700; }
.dir-v .muted { color: var(--sub); font-size: 12.5px; }
.dir-divider { height: 1px; background: var(--line); }

/* ===================== 안내 말씀 ===================== */
.info-card { max-width: 340px; margin: 8px auto 0; padding: 26px 24px; border-radius: 16px; background: var(--soft-bg); border: 1px solid var(--line); text-align: center; }
.info-item { padding: 6px 0; }
.info-k { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--accent-deep); margin-bottom: 10px; }
.info-v { font-size: 14px; line-height: 1.85; color: var(--text); }
.info-time { margin-top: 12px; font-family: var(--latin); font-size: 16px; letter-spacing: 0.04em; color: var(--accent-deep); }
.info-divider { height: 1px; background: var(--line); margin: 18px auto; max-width: 200px; }

/* ===================== 계좌 ===================== */
.acc-group { max-width: 330px; margin: 8px auto 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.acc { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--page-bg); }
.acc-head {
  width: 100%; appearance: none; border: 0; background: var(--page-bg); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 17px 18px; font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--text);
}
.acc-head .chev { width: 9px; height: 9px; border-right: 1.5px solid var(--sub); border-bottom: 1.5px solid var(--sub); transform: rotate(45deg); transition: transform .3s var(--ease); }
.acc.open .acc-head .chev { transform: rotate(-135deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.acc-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-top: 1px solid var(--line); }
.al-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.al-bank { font-size: 12.5px; color: var(--sub); }
.al-num { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.al-name { font-size: 12.5px; color: var(--sub); }
.copy-btn {
  flex: 0 0 auto; appearance: none; border: 1px solid var(--accent); color: var(--accent); background: var(--page-bg);
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; padding: 8px 13px; border-radius: 9px; cursor: pointer;
  transition: all .15s var(--ease); white-space: nowrap;
}
.copy-btn:hover { background: var(--accent); color: #fff; }

/* ===================== RSVP ===================== */
.rsvp-card { max-width: 340px; margin: 8px auto 0; padding: 24px 22px; border-radius: 16px; background: var(--page-bg); border: 1px solid var(--line); text-align: left; }
.rsvp-field { margin-bottom: 18px; }
.rsvp-field:last-child { margin-bottom: 0; }
.rf-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 9px; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; appearance: none; border: 1px solid var(--line); background: var(--page-bg); color: var(--text);
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; padding: 11px 0; border-radius: 10px; cursor: pointer; transition: all .15s var(--ease);
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.rsvp-input {
  width: 100%; appearance: none; border: 1px solid var(--line); border-radius: 10px; background: var(--page-bg);
  font-family: var(--sans); font-size: 14px; color: var(--text); padding: 12px 14px;
}
.rsvp-input::placeholder { color: #c6b8b3; }
.rsvp-input:focus { outline: none; border-color: var(--accent); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { appearance: none; border: 0; background: var(--page-bg); width: 44px; height: 44px; font-size: 18px; color: var(--text); cursor: pointer; line-height: 1; }
.stepper button:hover { background: var(--soft-bg); }
.stepper .count { min-width: 46px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rsvp-submit {
  width: 100%; margin-top: 6px; appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-family: var(--sans); font-size: 15px; font-weight: 700;
  padding: 15px 0; border-radius: 11px; transition: filter .15s var(--ease);
}
.rsvp-submit:hover { filter: brightness(.97); }
.rsvp-submit:disabled { opacity: .6; cursor: default; }
.rsvp-done { text-align: center; padding: 12px 0; }
.rsvp-done .rd-check { width: 50px; height: 50px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; font-size: 24px; }
.rsvp-done .rd-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.rsvp-done .rd-sub { font-size: 13px; color: var(--sub); line-height: 1.6; }

/* ===================== 연락처 ===================== */
.contact-grid { display: flex; flex-direction: column; gap: 12px; max-width: 330px; margin: 6px auto 0; }
.contact-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--page-bg);
}
.cc-role { font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); padding: 4px 10px; border-radius: 9999px; }
.cc-name { font-family: var(--serif); font-size: 16px; font-weight: 700; flex: 1; text-align: left; }
.cc-btns { display: flex; gap: 8px; }
.cc-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--page-bg);
  display: grid; place-items: center; text-decoration: none; color: var(--accent-deep); font-size: 11px; font-weight: 600; transition: all .15s var(--ease);
}
.cc-btn:hover { background: var(--soft-bg); }

/* ===================== 공유 / QR ===================== */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px auto 24px; }
.qr-wrap[hidden] { display: none; }
.qr-wrap img { width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.qr-cap { font-size: 12px; color: var(--sub); }
.share-btns { display: flex; gap: 10px; justify-content: center; }
.share-btn {
  appearance: none; border: 0; cursor: pointer; background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 14px; font-weight: 600; padding: 13px 26px; border-radius: 9999px; transition: filter .15s var(--ease);
}
.share-btn:hover { filter: brightness(.97); }
.share-btn.ghost { background: var(--page-bg); color: var(--text); border: 1px solid var(--line); }
.share-btn.ghost:hover { background: var(--soft-bg); filter: none; }

/* ===================== CLOSING ===================== */
.closing { padding-bottom: 84px; }
.thanks { font-family: var(--script); font-size: 42px; color: var(--accent); margin-bottom: 16px; line-height: 1; }
.closing-msg { font-family: var(--serif); font-size: 15px; line-height: 2; color: var(--sub); margin: 0 auto 22px; max-width: 280px; }
.closing-names { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0.05em; }
.closing-foot { font-family: var(--latin); font-size: 13px; letter-spacing: 0.06em; color: var(--sub); margin-top: 10px; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; left: 50%; bottom: calc(32px + env(safe-area-inset-bottom)); transform: translate(-50%, 18px);
  z-index: 200; background: rgba(40, 32, 30, .94); color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 20px; border-radius: 9999px; opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); white-space: nowrap; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== 이스터에그 꽃잎 ===================== */
.petals { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.petal { position: absolute; top: -24px; font-size: 18px; will-change: transform; animation: fall linear forwards; }
@keyframes fall {
  0%   { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(110vh) translateX(var(--drift, 40px)) rotate(540deg); opacity: 0; }
}
