:root {
  --paper: #f7f2e8;
  --paper-2: #efe6d3;
  --card: #fffdf8;
  --ink: #2f2a22;
  --ink-soft: #6b6255;
  --muted: #a39a8b;
  --line: #e4dac7;
  --canola: #f2c230;
  --canola-soft: #fbe9a6;
  --sunset: #e0702b;
  --film: #17130e;
  --stamp: #ff8a2a;
  --serif: "Gowun Batang", "Nanum Myeongjo", serif;
  --type: "Courier Prime", ui-monospace, monospace;
  --hand: "Homemade Apple", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--film);
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* 필름 입자 */
.grain {
  position: fixed; inset: 0; z-index: 400; pointer-events: none;
  opacity: .14; mix-blend-mode: multiply;
  background: 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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .16 0 0 0 0 .1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  width: 100%; max-width: 420px; margin: 0 auto;
  background: var(--paper);
  overflow: hidden; position: relative;
}

/* 날짜 도장 (필름 카메라 날짜 표시) */
.stamp {
  font-family: "Share Tech Mono", monospace;
  color: var(--stamp);
  letter-spacing: .08em;
  text-shadow: 0 0 2px rgba(255,120,30,.9), 0 0 8px rgba(255,110,20,.55);
}

/* ---------- 오프닝: 필름 리더 ---------- */
.opening {
  position: fixed; inset: 0; z-index: 100;
  background: var(--film);
  color: #f3eadb;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 1.1s cubic-bezier(.75,0,.2,1);
}
.opening.is-opening { transform: translateY(-100%); pointer-events: none; }
.opening.is-gone { display: none; }
.opening__sprockets {
  position: absolute; top: 0; bottom: 0; width: 14px;
  background: repeating-linear-gradient(180deg, transparent 0 10px, #e9dfcc 10px 24px, transparent 24px 32px);
  border-radius: 2px;
  opacity: .85;
  animation: roll 1.8s linear infinite;
}
.opening__sprockets--l { left: max(10px, calc(50% - 200px)); }
.opening__sprockets--r { right: max(10px, calc(50% - 200px)); }
.opening.is-opening .opening__sprockets { animation-duration: .35s; }
@keyframes roll { to { background-position: 0 -32px; } }
.opening__copy { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 0 40px; }
.opening__roll { font-family: var(--type); font-size: 11px; letter-spacing: .3em; color: #b9ac95; }
.opening__names { font-family: var(--hand); font-size: 25px; line-height: 1.9; margin: 30px 0 12px; color: #fbf3e2; white-space: nowrap; }
.opening__stamp { font-size: 22px; }
.opening__btn {
  margin-top: 60px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: .04em; color: #d9cdb7;
  padding: 10px 20px; border: 1px solid rgba(233,223,204,.35); border-radius: 999px;
  animation: breathe 2.4s ease-in-out infinite;
}
.opening__btn svg { width: 14px; height: 14px; }
@keyframes breathe { 50% { opacity: .55; } }

/* ---------- 커버 ---------- */
.cover { position: relative; height: min(100svh, 760px); min-height: 600px; overflow: hidden; background: var(--film); }
.cover__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform: scale(1.06); }
.cover.is-live .cover__photo { animation: settle 2.6s ease-out forwards; }
@keyframes settle { to { transform: scale(1); } }
.cover__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15,12,8,.55) 0%, rgba(15,12,8,0) 32%, rgba(15,12,8,0) 70%, rgba(15,12,8,.55) 100%),
    radial-gradient(120% 90% at 50% 55%, transparent 60%, rgba(0,0,0,.35));
}
.cover__head { position: absolute; top: 46px; left: 0; right: 0; text-align: center; color: #fbf3e2; }
.cover__kicker { font-family: var(--type); font-size: 11px; letter-spacing: .32em; padding-left: .32em; opacity: .9; }
.cover__names { font-family: var(--hand); font-weight: 400; font-size: 26px; line-height: 2; margin-top: 16px; white-space: nowrap; }
.cover__foot { position: absolute; left: 22px; right: 22px; bottom: 26px; display: flex; justify-content: space-between; align-items: flex-end; color: #fbf3e2; }
.cover__ko { font-size: 15px; letter-spacing: .06em; }
.cover__stamp { font-size: 20px; }
.bgm {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20,16,10,.4); color: #fff;
}
.bgm svg { width: 16px; height: 16px; fill: currentColor; }
.bgm .bgm__on { display: none; }
.bgm.is-on .bgm__on { display: block; }
.bgm.is-on .bgm__off { display: none; }

.petals { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.petal {
  position: absolute; top: -20px;
  width: 9px; height: 7px;
  background: var(--canola);
  border-radius: 70% 10% 70% 10%;
  box-shadow: 0 0 6px rgba(242,194,48,.5);
  animation: fall linear infinite;
}
@keyframes fall {
  0% { transform: translate3d(0,0,0) rotate(0deg); opacity: 0; }
  10% { opacity: .95; }
  100% { transform: translate3d(var(--dx), 780px, 0) rotate(var(--rot)); opacity: .3; }
}

/* ---------- 공통 ---------- */
.sec { padding: 64px 22px; text-align: center; }
.label { font-family: var(--type); font-size: 11px; letter-spacing: .32em; padding-left: .32em; color: var(--sunset); }
.title { font-size: 20px; font-weight: 400; line-height: 1.6; margin: 8px 0 26px; }
.body { font-size: 15px; line-height: 1.85; }
.flower {
  display: block; width: 26px; height: 26px; margin: 0 auto 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg fill='%23f2c230'%3E%3Cellipse cx='13' cy='6.5' rx='4' ry='5.5'/%3E%3Cellipse cx='13' cy='19.5' rx='4' ry='5.5'/%3E%3Cellipse cx='6.5' cy='13' rx='5.5' ry='4'/%3E%3Cellipse cx='19.5' cy='13' rx='5.5' ry='4'/%3E%3C/g%3E%3Ccircle cx='13' cy='13' r='3' fill='%23d98e10'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn-basic {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 50px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px;
}
.btn-icon { justify-content: space-between; padding: 0 22px; }
.btn-icon svg { width: 18px; height: 18px; color: var(--ink-soft); }
.btn-dark {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 50px; padding: 0 22px;
  background: var(--film); color: #f3eadb; border-radius: 12px;
  font-size: 14px;
}
.btn-dark svg { width: 18px; height: 18px; }

/* 날짜·장소 */
.sec--intro { padding: 54px 22px 6px; }
.intro__date { font-size: 17px; line-height: 1.9; }
.intro__venue { font-size: 15px; line-height: 1.9; color: var(--ink-soft); }

/* 인사말 */
.sec--greeting { padding-top: 58px; }
.greeting__body { font-size: 15px; line-height: 1.95; }
.greeting__body p + p { margin-top: 26px; }
.taped-wrap { margin: 52px auto 44px; width: 72%; }
.taped {
  position: relative;
  background: var(--card); padding: 10px 10px 34px;
  box-shadow: 0 6px 18px rgba(60,45,20,.16);
  transform: rotate(-2.2deg);
}
.taped img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.taped::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px;
  transform: translateX(-50%) rotate(3deg);
  background: rgba(242,194,48,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.couple { display: grid; grid-template-columns: auto auto; justify-content: center; column-gap: 16px; row-gap: 6px; font-size: 16px; line-height: 1.7; }
.couple .role { color: var(--muted); font-size: 14px; }

/* 달력 */
.sec--calendar { background: var(--paper-2); }
.cal__big { font-size: 26px; line-height: 1.4; margin-top: 12px; }
.cal__time { font-size: 15px; margin-top: 6px; color: var(--ink-soft); }
.cal { margin-top: 24px; background: var(--card); border-radius: 14px; padding: 20px 10px 12px; box-shadow: 0 2px 10px rgba(60,45,20,.06); }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__week span { font-family: var(--type); font-size: 12px; padding-bottom: 14px; color: var(--ink-soft); }
.cal__grid span { font-size: 14px; height: 40px; display: grid; place-items: center; }
.cal .sun { color: var(--sunset); }
.cal__grid .dim { color: #cfc5b3; }
.cal__grid .dim.sun { color: #ecc0a3; }
.cal__grid .day b {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--canola); color: var(--ink); font-weight: 700;
  box-shadow: 0 0 0 4px var(--canola-soft);
}
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.cd { height: 74px; border-radius: 12px; background: var(--film); color: #f3eadb; display: flex; flex-direction: column; justify-content: center; }
.cd span { font-family: var(--type); font-size: 10px; letter-spacing: .14em; color: #b9ac95; }
.cd b { font-family: "Share Tech Mono", monospace; font-size: 24px; font-weight: 400; line-height: 1.4; color: var(--stamp); text-shadow: 0 0 6px rgba(255,110,20,.5); }
.dday { margin-top: 26px; font-size: 15px; line-height: 1.8; }
.dday .heart { color: var(--sunset); margin: 0 4px; }
.dday em { font-style: normal; color: var(--sunset); font-weight: 700; }

/* 갤러리 */
.prints { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.print {
  position: relative;
  background: var(--card); padding: 8px 8px 26px;
  box-shadow: 0 4px 14px rgba(60,45,20,.14);
  cursor: zoom-in;
}
.print img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.print .stamp { position: absolute; right: 15px; bottom: 33px; font-size: 11px; }
.print:first-child { grid-column: 1 / -1; transform: rotate(-1deg); padding: 10px 10px 30px; }
.print:first-child .stamp { font-size: 15px; bottom: 42px; right: 22px; }
.print:nth-child(4n+2) { transform: rotate(1.8deg); }
.print:nth-child(4n+3) { transform: rotate(-1.6deg); }
.print:nth-child(4n+4) { transform: rotate(-1.2deg); }
.print:nth-child(4n+5) { transform: rotate(1.4deg); }
.print.is-hidden { display: none; }
#galleryMore { margin-top: 18px; }

/* 비디오 */
.video { border-radius: 8px; overflow: hidden; background: var(--film); aspect-ratio: 16/9; }
.video video, .video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 계좌 (설정했을 때만) */
.acc { margin-bottom: 14px; text-align: left; }
.acc__head { width: 100%; height: 50px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.acc__head svg { width: 18px; height: 18px; transition: transform .25s; }
.acc.is-closed .acc__head svg { transform: rotate(180deg); }
.acc__list { list-style: none; padding: 4px 16px 8px; }
.acc.is-closed .acc__list { display: none; }
.acc__item { display: flex; justify-content: space-between; gap: 10px; padding: 14px 0; }
.acc__item + .acc__item { border-top: 1px solid var(--line); }
.acc__item p { font-size: 15px; line-height: 1.8; }
.acc__btns { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.btn-small { height: 24px; padding: 0 12px; border-radius: 999px; background: var(--paper-2); font-size: 12px; color: var(--ink-soft); }
.btn-pay { height: 24px; padding: 0 12px; border-radius: 999px; background: #ffeb00; color: #111; display: inline-flex; align-items: center; font: 800 13px/1 -apple-system, sans-serif; }

/* 위치 */
.loc__name { font-size: 17px; line-height: 1.8; }
.loc__addr { font-size: 15px; line-height: 1.8; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }
.loc__addr svg { width: 13px; height: 13px; }
.loc__tel { display: block; font-family: var(--type); font-size: 13px; color: var(--ink-soft); margin: 2px 0 20px; }
.map { position: relative; height: 280px; border-radius: 14px 14px 0 0; overflow: hidden; border: 1px solid var(--line); border-bottom: 0; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; filter: sepia(.25) saturate(.9); }
.map__guard {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(247,242,232,.3);
  font-size: 13px; color: var(--ink);
  transition: opacity .3s;
}
.map__guard span { background: rgba(255,253,248,.94); padding: 8px 14px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.map__guard.is-off { opacity: 0; pointer-events: none; }
.navs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.navs a { height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; position: relative; }
.navs a + a::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.navs img { width: 16px; height: 16px; }
#transport { margin-top: 12px; }
.trans { text-align: left; padding: 20px 2px; border-bottom: 1px dashed var(--line); }
.trans:last-child { border-bottom: 0; }
.trans__head { display: flex; align-items: center; gap: 10px; }
.trans__icon { width: 30px; height: 30px; border-radius: 50%; background: var(--canola-soft); display: grid; place-items: center; color: var(--ink); }
.trans__icon svg { width: 16px; height: 16px; }
.trans__head h3 { font-size: 15px; font-weight: 700; }
.trans__body { margin-top: 10px; font-size: 14px; line-height: 1.85; white-space: pre-line; color: var(--ink-soft); word-break: keep-all; }

/* 필름 띠 */
.film { background: var(--film); padding: 44px 0 46px; overflow: hidden; }
.film__strip { background: #241c13; transform: rotate(-2deg); margin: 0 -12px; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.film__edge {
  position: relative; height: 34px;
  display: flex; justify-content: space-around;
  font-family: var(--type); font-size: 9px; letter-spacing: .1em; color: #e08a2e;
}
.film__edge::before {
  content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 12px;
  background: repeating-linear-gradient(90deg, transparent 0 8px, #0f0b07 8px 18px, transparent 18px 26px);
}
.film__edge span { position: relative; z-index: 1; align-self: flex-end; line-height: 1; }
.film__edge--top span { align-self: flex-end; padding-bottom: 1px; }
.film__edge--top::before { top: 4px; }
.film__edge--bottom span { align-self: flex-start; padding-top: 1px; }
.film__edge--bottom::before { top: auto; bottom: 4px; }
.film__frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 18px; }
.film__frames img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.film__text { font-family: var(--hand); font-size: 18px; color: #f3eadb; text-align: center; margin-top: 34px; }

/* 게스트 스냅 */
.print--snap { width: 64%; margin: 30px auto 28px; cursor: default; transform: rotate(1.5deg); }
.print--snap img { aspect-ratio: 1; }
#snapNote { margin-bottom: 22px; }

/* 방명록 */
.board { list-style: none; text-align: left; display: grid; gap: 12px; }
.board li { position: relative; padding: 20px 22px 18px; background: var(--card); border-radius: 4px; box-shadow: 0 2px 8px rgba(60,45,20,.08); }
.board li:nth-child(odd) { transform: rotate(-.6deg); }
.board li:nth-child(even) { transform: rotate(.5deg); }
.board__from { display: flex; align-items: center; gap: 10px; }
.board__from i { font-style: normal; font-family: var(--type); font-size: 10px; letter-spacing: .14em; color: var(--sunset); }
.board__from b { font-size: 15px; }
.board__msg { margin-top: 10px; font-size: 15px; line-height: 1.7; white-space: pre-line; word-break: keep-all; }
.board__del { position: absolute; right: 16px; top: 16px; width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.board__del svg { width: 13px; height: 13px; stroke-width: 2; }
.board li.board__empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 0; transform: none; background: transparent; box-shadow: none; border: 1px dashed var(--line); }
.board__more { margin: 22px auto 0; display: block; font-size: 14px; color: var(--ink-soft); }
.row2 { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 공유 */
.sec--share { padding: 8px 22px 44px; display: grid; gap: 10px; }
.film ~ .sec--share { padding-top: 44px; }
.sec--guestbook:not([hidden]) ~ .sec--share { padding-top: 8px; }

.footer { background: var(--film); color: #b9ac95; text-align: center; padding: 44px 16px 64px; }
.footer__names { font-family: var(--hand); font-size: 16px; color: #f3eadb; }
.footer__date { margin-top: 16px; font-family: "Share Tech Mono", monospace; font-size: 13px; letter-spacing: .14em; color: var(--stamp); }

/* 화환 */
.gift {
  position: fixed; left: 50%; bottom: 22px; z-index: 20; transform: translateX(-50%);
  height: 50px; padding: 0 24px; display: inline-flex; align-items: center;
  background: var(--canola); border-radius: 999px; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}

/* 사진 크게 보기 */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(15,12,8,.95); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; user-select: none; }
.lightbox__close { position: absolute; top: 16px; right: 18px; color: #fff; font-size: 22px; width: 40px; height: 40px; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 40px; width: 48px; height: 64px; opacity: .8; }
.lightbox__nav--prev { left: 4px; }
.lightbox__nav--next { right: 4px; }
.lightbox__count { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; font-family: "Share Tech Mono", monospace; color: var(--stamp); font-size: 14px; letter-spacing: .14em; }

/* 시트 */
.sheet { position: fixed; inset: 0; z-index: 150; }
.sheet__dim { position: absolute; inset: 0; background: rgba(15,12,8,.5); animation: fade .2s ease; }
.sheet__panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 420px; max-height: 86vh;
  background: var(--paper); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 100%); } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.sheet__head h3 { font-size: 18px; font-weight: 400; }
.sheet__head button { width: 32px; height: 32px; font-size: 16px; }
.sheet__body { overflow-y: auto; padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); }
.form { display: grid; gap: 10px; }
.form input, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px; letter-spacing: inherit; color: var(--ink);
  background: var(--card);
}
.form textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--canola); }
.form .btn-dark { justify-content: center; margin-top: 6px; }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 300;
  transform: translate(-50%, 20px);
  background: rgba(23,19,14,.92); color: #f3eadb;
  font-size: 13px; letter-spacing: 0;
  padding: 11px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .petal, .opening__btn, .opening__sprockets { animation: none; }
  .petal { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
