/* Layout: 왼쪽 정렬 에디토리얼. 큰 라틴 세리프 제목, 가는 선으로 나눈 정보 행, 가로로 넘기는 갤러리. */
:root {
  --ground: #dfe6ef;
  --bg: #f5f7fa;
  --ink: #1f2838;
  --brown: #263535; /* 제목·로딩 선과 봉인에 쓰는 짙은 청록 */
  --muted: #7f8a9b;
  --line: #dce3ec;
  --accent: #5f82c0;
  --photo: #d6dfeb;
  --ph: #e6ecf4;
  --ph-ink: #6f84a8;
  --display: "Hanken Grotesk", "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --sans: "Hanken Grotesk", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: only light;
}
* { box-sizing: border-box; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14.5px;
  line-height: 1.8;
  letter-spacing: -.01em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
.card { max-width: 440px; margin: 0 auto; background: var(--bg); overflow: hidden; }
.pad {
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
p { margin: 0; }
.ph { background: var(--ph); color: var(--ph-ink); padding: 0 5px; white-space: nowrap; font-size: .92em; }

/* 표지 */
.top {
  display: flex; justify-content: space-between;
  padding-block: 18px;
  font-size: 11px; font-weight: 400; letter-spacing: .16em;
}
.photo {
  aspect-ratio: 3 / 4;
  max-width: 100%;
  background: var(--photo);
  position: relative;
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero { position: relative; margin-bottom: 64px; }
.photo::before, .photo::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.photo::before { top: 0; height: 30%; background: linear-gradient(to bottom, rgba(24, 34, 60, .22), transparent); }
.photo::after { bottom: 0; height: 42%; background: linear-gradient(to bottom, rgba(245, 247, 250, 0) 0%, rgba(245, 247, 250, .75) 55%, var(--bg) 92%); }
.hero-top { position: absolute; top: 0; left: 0; right: 0; padding-top: 36px; }
.hero-top .kicker { color: rgba(255, 255, 255, .85); padding-top: 0; }
.hero-top .title { color: #fff; font-size: 40px; text-shadow: 0 1px 18px rgba(20, 30, 60, .18); }
.hero-top .title .amp { color: rgba(255, 255, 255, .7); }
.hero-bottom { position: absolute; left: 0; right: 0; bottom: 0; }
.hero-bottom .cover-meta { margin-top: 0; padding-block: 14px 8px; }
.photo .tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; letter-spacing: .2em; color: var(--bg);
}
.kicker {
  padding-top: 36px;
  font-size: 10.5px; font-weight: 400; letter-spacing: .28em; color: var(--muted);
}
.title {
  font-family: var(--display);
  font-weight: 300;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -.035em;
  margin: 10px 0 0;
}
.title .amp { color: var(--muted); font-weight: 200; padding-inline: .08em; }
.cover-meta {
  margin-top: 32px;
  padding-block: 14px 56px;
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--ink);
  font-size: 13px;
}
.cover-meta p:last-child { text-align: right; }

/* 섹션 공통 */
section { padding-block: 0 72px; }
.head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: 36px;
}
.head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
}
.head small { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* 인사말 */
.lead {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.guest { margin-bottom: 14px; font-size: 13px; color: var(--accent); letter-spacing: .02em; }
.guest b { font-weight: 500; color: var(--ink); }
.body { margin-top: 24px; color: #46505f; max-width: 32em; }

/* 정보 행 */
.rows { margin-top: 40px; border-top: 1px solid var(--ink); }
.rows > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
}
.rows dt, .rows .k { font-size: 12px; color: var(--muted); padding-top: 2px; }
.rows .v { min-width: 0; }
.late { font-size: 11px; color: var(--muted); margin-right: 2px; }

/* 달력 */
.month { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.month b { font-family: var(--display); font-weight: 300; font-size: 22px; letter-spacing: -.03em; }
.month span { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .08em; color: var(--accent); }
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}
.count { margin: -16px 0 13px; font-size: 13.5px; letter-spacing: -.01em; color: var(--muted); font-variant-numeric: tabular-nums; }
.count b { font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: -.01em; color: var(--ink); margin-right: 1px; }
.count b[data-u="s"] { display: inline-block; min-width: 2ch; text-align: right; }
.cal .dow { font-size: 10px; letter-spacing: .14em; color: var(--muted); padding-bottom: 10px; }
.cal .d { height: 38px; display: grid; place-items: center; }
.cal .off { color: var(--muted); }
.cal .the { position: relative; }
.cal .the b { position: relative; font-weight: 500; color: var(--brown); }
/* 20일: 연한 하늘색 하트가 콩닥 하고 떠올라요 */
.cal .heart { position: absolute; left: 50%; top: 50%; width: 40px; height: 37px; margin: -17px 0 0 -20px; fill: #dde7f4; transform: scale(0); }
.cal.drawn .heart { animation: heart-in 1.2s .2s ease forwards; }
@keyframes heart-in { 0% { transform: scale(0); } 35% { transform: scale(1.15); } 50% { transform: scale(.95); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }


/* 갤러리 */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  scroll-padding-left: max(24px, env(safe-area-inset-left, 0px));
}
.rail::-webkit-scrollbar { display: none; }
.rail div {
  aspect-ratio: 3 / 4;
  background: var(--photo);
  scroll-snap-align: start;
  position: relative;
}
.rail div::after {
  content: attr(data-n);
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--display); font-weight: 300; font-size: 13px; letter-spacing: .08em; color: var(--bg);
}
.rail-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
  font-size: 12px; color: var(--muted);
}
.bar { flex: 1; height: 1px; background: var(--line); margin-inline: 16px; position: relative; }
.bar i { position: absolute; left: 0; top: -.5px; height: 2px; background: var(--ink); width: 11.1%; transition: left .25s; }

/* 오시는 길 */
.venue { font-size: 20px; font-weight: 400; letter-spacing: -.035em; }
.addr { margin-top: 4px; color: #46505f; }
.links { margin-top: 28px; border-top: 1px solid var(--ink); }
.links a, .links button {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
  padding-block: 14px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none;
  font: inherit; font-size: 14px; color: var(--ink);
  text-decoration: none; text-align: left;
  cursor: pointer;
}
.links a::after { content: "↗"; color: var(--muted); }
.links button::after { content: "COPY"; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.links a:hover, .links button:hover { color: var(--accent); }
.links .maps { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.links .maps a { justify-content: center; gap: 6px; border-bottom: 0; font-size: 13.5px; }
.links .maps a + a { border-left: 1px solid var(--line); }
.links .maps a::after { font-size: 11px; }

/* 계좌 */
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 15px;
  cursor: pointer;
  font-size: 14.5px; font-weight: 400;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--display); font-weight: 200; font-size: 22px; line-height: 1; color: var(--muted); transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
.acct {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-block: 10px;
  font-size: 13.5px;
}
.acct:last-child { padding-bottom: 18px; }
.acct > div { min-width: 0; }
.acct small { display: block; font-size: 11.5px; color: var(--muted); }
.copy {
  flex: none;
  border: 1px solid var(--ink);
  background: none;
  padding: 5px 12px;
  font: inherit; font-size: 11.5px; color: var(--ink);
  cursor: pointer;
}
.copy:hover { background: var(--ink); color: var(--bg); }
.note { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* 방명록 */
.gb-form { margin-top: 32px; padding: 20px 20px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.gb-title { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--brown); letter-spacing: .02em; }
.gb-form input, .gb-form textarea {
  display: block; width: 100%; box-sizing: border-box;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; padding: 14px 0;
  font: inherit; font-size: 14px; color: var(--ink);
  resize: none; outline: none;
}
.gb-form input:focus, .gb-form textarea:focus { border-bottom-color: var(--accent); }
.gb-form ::placeholder { color: var(--muted); }
.gb-id { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.gb-form .gb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb-row { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.gb-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gb-form .copy:disabled { opacity: .5; cursor: default; }
.gb-msg { min-height: 1em; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.gb-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.gb-list li { padding: 16px 0; border-bottom: 1px solid var(--line); animation: gb-in .4s ease; }
.gb-list .gb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gb-list b { font-size: 14px; font-weight: 500; color: var(--ink); }
.gb-list time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gb-list p { margin: 6px 0 0; font-size: 13.5px; color: #46505f; white-space: pre-wrap; word-break: break-word; }
.gb-list .gb-empty { padding: 24px 0; text-align: center; font-size: 13px; color: var(--muted); border: 0; }
.gb-pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 20px; }
.gb-pager:empty { display: none; }
.gb-pager button { min-width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; font-family: var(--display); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; cursor: pointer; }
.gb-pager button:hover:not(:disabled) { color: var(--ink); }
.gb-pager button[aria-current="page"] { background: var(--ink); color: var(--bg); }
.gb-pager button:disabled { opacity: .3; cursor: default; }
.gb-act { display: flex; gap: 12px; margin-top: 8px; }
.gb-act button { border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.gb-act button:hover { color: var(--accent); }
.gb-edit { margin-top: 10px; }
.gb-edit textarea, .gb-edit input { display: block; width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 0; font: inherit; font-size: 13.5px; color: var(--ink); resize: none; outline: none; }
.gb-edit textarea:focus, .gb-edit input:focus { border-bottom-color: var(--accent); }
.gb-edit .gb-row { padding-top: 10px; gap: 8px; justify-content: flex-end; }
.gb-edit .gb-err { margin-right: auto; font-size: 12px; color: #b4534b; }
@keyframes gb-in { from { opacity: 0; transform: translateY(6px); } }

a:focus-visible, button:focus-visible, summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

footer { position: relative; }
.end-photo { position: relative; aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; }
.end-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.end-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--bg) 0%, rgba(245, 247, 250, .2) 38%, rgba(245, 247, 250, .2) 62%, var(--bg) 100%); }
.end-art { padding-top: 32px; display: flex; justify-content: center; }
.end-text { padding-block: 16px 88px; text-align: center; }
.end-text .thanks { font-size: 15px; line-height: 2; color: #46505f; }
.end-text .sign { margin-top: 28px; font-size: 15px; font-weight: 400; letter-spacing: .02em; }
.end-text .sign span { color: var(--muted); font-weight: 300; padding-inline: 6px; }
.end-text .date { margin-top: 10px; font-size: 10.5px; letter-spacing: .28em; color: var(--muted); }

.toast {
  position: fixed; left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  font-size: 12.5px; padding: 10px 18px;
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .kicker, .title { opacity: .2; }
  .ready .kicker, .ready .title { animation: up 1s cubic-bezier(.2,.7,.2,1) both; }
  .ready .title { animation-delay: .08s; }
  @keyframes up { from { opacity: .2; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.map {
  margin-top: 28px;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  background: var(--photo);
  display: grid; place-items: center;
  font-size: 12.5px; color: var(--muted); text-align: center;
}
.map .pin {
  padding: 6px 12px;
  background: var(--ink); color: var(--bg);
  font-family: var(--sans); font-size: 12px; font-weight: 400;
  white-space: nowrap; transform: translateY(-46px);
}
.links .maps button { justify-content: center; gap: 6px; border-bottom: 0; font-size: 13.5px; text-align: center; }
.links .maps button + button { border-left: 1px solid var(--line); }
.links .maps button::after { content: "↗"; font-size: 11px; letter-spacing: 0; }
.rows a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }

/* 로딩 화면 */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 28px;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  transition: opacity .9s ease, visibility .9s ease;
  cursor: pointer;
}
.loader.done { opacity: 0; visibility: hidden; }
.stage { position: relative; display: flex; align-items: flex-end; justify-content: center; width: min(340px, 86vw); padding-top: 42%; }
.stage .who { display: block; animation-duration: 1s; animation-timing-function: cubic-bezier(.2,.8,.2,1); animation-fill-mode: both; }
.stage .who img { display: block; width: 100%; height: auto; transform-origin: 50% 100%; animation: sway 1.2s ease-in-out infinite alternate; }
.stage .b img { animation-delay: -.6s; }
.heart { position: absolute; top: 4px; left: 50%; width: 180px; height: 150px; transform: translateX(-50%); }
.heart.full { animation: beat .7s ease-in-out 2; }
.hn {
  position: absolute; transform: translate(-50%, -50%) scale(0);
  font-family: var(--display); font-size: 15px; line-height: 1; color: var(--ink);
  animation: pop .45s cubic-bezier(.3,1.6,.5,1) forwards;
}
.hn.alt { color: var(--accent); }
@keyframes pop { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes beat { 50% { transform: translateX(-50%) scale(1.1); } }
.fw { position: absolute; top: -4%; left: -12%; width: 124%; height: 56%; pointer-events: none; }
.mn {
  position: absolute; z-index: 1;
  font-family: var(--display); line-height: 1; color: var(--ink);
  opacity: 0; animation: mn-in .8s ease forwards, mn-bob 2.6s ease-in-out infinite alternate;
}
.mn.sky { color: var(--accent); }
@keyframes mn-in { to { opacity: .9; } }
@keyframes mn-bob { from { translate: 0 0; rotate: -8deg; } to { translate: 0 -8px; rotate: 8deg; } }
.stage .g { width: 52%; margin-right: -6%; animation: in-left .9s cubic-bezier(.2,.8,.2,1) both; }
.stage .b { width: 46%; animation: in-right .9s cubic-bezier(.2,.8,.2,1) both; }
.mnote {
  position: absolute; top: 40px; left: 47%;
  font-family: var(--display); font-size: 22px; color: var(--ink);
  opacity: 0; animation: float 2.4s ease-out infinite;
}
.mnote.n2 { left: 6%; animation-delay: .8s; font-size: 18px; }
.mnote.n3 { left: 88%; animation-delay: 1.6s; }
.loader-text { text-align: center; opacity: 0; animation: fade 1s .7s ease forwards; }
.loader-text p { font-size: 10.5px; font-weight: 400; letter-spacing: .28em; color: var(--muted); }
.loader-text h2 { margin: 6px 0 0; font-family: var(--display); font-weight: 300; font-size: 28px; letter-spacing: -.035em; }
.loader-text h2 span { color: var(--muted); font-weight: 200; }
.loader-text .loader-invite { margin: 12px 0 0; font-size: 14px; font-weight: 300; letter-spacing: -.01em; color: var(--ink); }
.loader-invite b { font-weight: 500; }
.loader-bar { transition: opacity .5s ease; }
.loader.ready .loader-bar { opacity: 0; height: 0; margin: 0; }
.loader-text .loader-open { display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0; padding: 12px 24px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; letter-spacing: .02em; cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.loader-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.loader.ready .loader-open { opacity: 1; transform: none; pointer-events: auto; animation: open-breathe 2.4s 1s ease-in-out infinite; }
@keyframes open-breathe { 50% { box-shadow: 0 0 0 8px rgba(31,40,56,.08); } }
.loader.ready { cursor: default; }
body.ready main.card { animation: card-in 1.4s .2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes card-in { from { opacity: 0; transform: scale(.985); } }
.loader-bar { width: 120px; height: 1px; background: var(--line); margin: 18px auto 0; overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; animation: grow 3.5s linear forwards; }
@keyframes in-left { from { opacity: 0; transform: translateX(-40%); } to { opacity: 1; transform: none; } }
@keyframes in-right { from { opacity: 0; transform: translateX(40%); } to { opacity: 1; transform: none; } }
/* 로딩 화면 연출: 두 사람이 양쪽에서 통통 걸어와 만나면 하트가 피어나요 */
.loader .stage .g { animation: walk-l 1.6s cubic-bezier(.35,.55,.4,1) both; }
.loader .stage .b { animation: walk-r 1.6s cubic-bezier(.35,.55,.4,1) both; }
.loader .stage .who img { animation: hop .2s ease-in-out 8 alternate, sway 1.2s 1.75s ease-in-out infinite alternate; }
.loader .stage .b img { animation-delay: .1s, 2.35s; }
@keyframes walk-l { from { opacity: 0; transform: translateX(-85%); } 15% { opacity: 1; } to { transform: none; } }
@keyframes walk-r { from { opacity: 0; transform: translateX(85%); } 15% { opacity: 1; } to { transform: none; } }
@keyframes hop { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-7px) rotate(2deg); } }
.meet { position: absolute; left: 50%; top: 20%; width: 44px; height: 44px; margin-left: -22px; pointer-events: none; z-index: 2; }
.meet svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #f0a3b4; stroke: #2a3346; stroke-width: 1.3; stroke-linejoin: round; transform: scale(0); opacity: 0; }
.meet .h0 { animation: heart-pop .7s 1.6s cubic-bezier(.3,1.7,.5,1) forwards, heart-beat 1.1s 2.4s ease-in-out infinite; }
.meet .h1, .meet .h2, .meet .h3 { width: 40%; height: 40%; left: 30%; top: 30%; inset: auto; fill: #f6c7d1; }
.meet .h1 { animation: heart-fly 1.6s 1.75s ease-out forwards; --x: -46px; --y: -30px; }
.meet .h2 { animation: heart-fly 1.6s 1.85s ease-out forwards; --x: 44px; --y: -38px; fill: #c9d8f0; }
.meet .h3 { animation: heart-fly 1.6s 1.95s ease-out forwards; --x: 6px; --y: -58px; fill: #f3dd9b; }
@keyframes heart-pop { to { transform: scale(1); opacity: 1; } }
@keyframes heart-beat { 0%, 100% { transform: scale(1); opacity: 1; } 15% { transform: scale(1.14); opacity: 1; } 30% { transform: scale(1); opacity: 1; } }
@keyframes heart-fly { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .loader .stage .who, .loader .stage .who img { animation: none !important; } .meet .h0 { animation: none; transform: none; opacity: 1; } }
@keyframes sway { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(-5px); } }
@keyframes float { 0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); } 20% { opacity: .8; } 100% { opacity: 0; transform: translate(14px, -56px) rotate(10deg); } }
@keyframes fade { to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .stage .who, .stage .who img { animation: none !important; }
  .mn { animation: none; opacity: .9; }
  .fw { display: none; }
}
body.loading { overflow: hidden; }

/* 표지: 춤추는 두 사람 */
.cover { padding-block: 28px 0; text-align: center; }
.cover .stage { margin: 0 auto; padding-top: 30%; }
.cover .fw { top: -2%; height: 46%; }
.cover .kicker { padding-top: 28px; }
.cover .title { margin-top: 8px; }
.cover .cover-meta { margin-top: 36px; text-align: left; }
.rail img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* 갤러리: 바둑판 + 크게 보기 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.cell {
  aspect-ratio: 1; max-width: 100%; padding: 0; border: 0; cursor: pointer;
  background: var(--photo); overflow: hidden; display: grid; place-items: center;
}
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.cell:hover img { transform: scale(1.04); }
.cell span { font-family: var(--display); font-weight: 300; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.grid-note { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.viewer { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.vbar {
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: env(safe-area-inset-top, 0px) max(4px, env(safe-area-inset-right, 0px)) 0 max(4px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line); text-align: center; font-size: 15px;
}
.vbar b { font-weight: 500; }
.vback { width: 48px; height: 48px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--ink); cursor: pointer; }
.vfeed { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.vfeed-in { max-width: 440px; margin: 0 auto; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.post { padding-bottom: 20px; scroll-margin-top: 0; }
.phead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; outline: 1.5px solid var(--accent); outline-offset: 2px; flex: none; }
.phead b { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.phead small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.pwrap { position: relative; }
.pcar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.pcar::-webkit-scrollbar { display: none; }
.pimg { aspect-ratio: 4 / 5; max-width: 100%; background: var(--photo); display: grid; place-items: center; overflow: hidden; scroll-snap-align: center; user-select: none; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
/* 사진 보호: 길게 눌러 저장, 끌어서 저장, 핀치 확대를 막아요 */
.cell img, .pimg img, .phead .avatar { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.viewer, .pcar { touch-action: pan-x pan-y; }
.pimg .empty { font-family: var(--display); font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.pbadge {
  position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(18, 24, 36, .6); color: #fff; font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.big { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; transform: translate(-50%, -50%) scale(0); opacity: 0; fill: #fff; filter: drop-shadow(0 4px 18px rgba(0,0,0,.25)); pointer-events: none; }
.big.on { animation: big .9s ease forwards; }
.pdots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.pdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s; }
.pdots i.on { background: var(--accent); }
.pact { position: relative; }
@keyframes big { 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(.95); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
.pact { display: flex; align-items: center; gap: 16px; padding: 10px 14px 6px; }
.pact .like { line-height: 0; }
.pact button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); line-height: 0; }
.pact svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.pact .like svg { fill: #e0445a; stroke: #e0445a; }
@keyframes tap { 50% { transform: scale(1.25); } }
.pliked { padding: 0 14px; font-size: 13px; font-weight: 500; }
.pcap { padding: 4px 14px 0; font-size: 13.5px; line-height: 1.6; }
.pcap b { font-weight: 500; margin-right: 6px; }
.pdate { padding: 6px 14px 0; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
body.viewing { overflow: hidden; }

/* 배경 풀밭 */
.stage .who { position: relative; }
.scenery { position: absolute; inset: 0; pointer-events: none; }
.scenery .ground { position: absolute; left: -14%; width: 128%; bottom: -8px; height: auto; overflow: visible;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.ground .soil { fill: url(#soilg); }
.ground .rim { fill: none; stroke: #2a3346; stroke-width: 1.4; stroke-linecap: round; }
.ground .rim2 { fill: none; stroke: #8fae7a; stroke-width: 1.2; stroke-linecap: round; }
.ground .tuft path { fill: none; stroke: #4f7f57; stroke-width: 1.4; stroke-linecap: round; }
.ground .tuft { animation: blow 2.4s ease-in-out infinite alternate; }
.ground .fl circle { fill: #fff; stroke: #2a3346; stroke-width: .9; }
.ground .fl.y circle { fill: #f3dd6b; }
.ground .fl.b circle { fill: #c9d8f0; }
.ground .fl .ctr { fill: #e8c95a; stroke: none; }
.ground .fl.y .ctr { fill: #fff; }
.ground .fl .st { fill: none; stroke: #4f7f57; stroke-width: 1.2; }
@keyframes blow { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .ground .tuft { animation: none; } }

/* 배경음악 버튼 */
.bgm { position: fixed; z-index: 30; top: calc(14px + env(safe-area-inset-top)); right: max(14px, calc(50% - 220px + 14px)); width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--ink); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .6s; }
body.ready .bgm { opacity: 1; }
.bgm svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bgm .slash { stroke: var(--ink); }
.bgm:not(.on) svg { color: var(--muted); }
.bgm.on .slash { display: none; }
.bgm.on svg { animation: bgm-bob 1.6s ease-in-out infinite; }
@keyframes bgm-bob { 50% { transform: translateY(-2px) rotate(-6deg); } }
body.viewing .bgm { display: none; }

/* 로딩 화면: 흰 카드 한 장. 가운데 선과 봉인이 그어지고, "청첩장 열기"를 누르면 선을 따라 위아래로 갈라지며 열려요 */
.loader.env { display: block; padding: 0; background: transparent; cursor: default; --env: #ffffff; --env-ink: #1f2838; --env-mute: #7f8a9b; --env-line: #1f2838; }
.env .half { position: absolute; left: 0; right: 0; height: 50.2%; background: var(--env); color: var(--env-ink); display: flex; justify-content: center; transition: transform 1.3s cubic-bezier(.7,0,.2,1); }
.env .half.top { top: 0; align-items: flex-start; }
.env .half.bot { bottom: 0; align-items: flex-end; background: var(--env); }
.env .half-in { width: min(440px, 100%); padding: 0 24px; text-align: center; }
.env .top .half-in { padding-top: max(14vh, calc(env(safe-area-inset-top) + 56px)); padding-bottom: 7vh; display: flex; flex-direction: column; align-items: center; min-height: 100%; }
.env .bot .half-in { padding-bottom: max(9vh, calc(env(safe-area-inset-bottom) + 40px)); display: flex; flex-direction: column; align-items: center; min-height: 100%; }
.env-kicker { margin: 0; font-size: 10.5px; letter-spacing: .34em; color: var(--env-mute); }
.env-title { margin: 14px 0 0; font-family: var(--display); font-weight: 200; font-size: 34px; letter-spacing: -.035em; color: var(--env-ink); }
.env-title span { color: var(--env-mute); }
.env-names { margin: auto 0 0; font-size: 15px; font-weight: 300; letter-spacing: .5em; color: var(--env-ink); }
.env-names i { display: inline-block; width: 4px; height: 4px; margin: 0 .5em 0 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.env .loader-invite { margin: 18px 0 0; font-size: 14px; font-weight: 300; color: var(--env-ink); }
.env .loader-invite b { color: var(--env-ink); font-weight: 500; }
.env-date { margin: auto 0 0; font-family: var(--display); font-weight: 300; font-size: 14px; letter-spacing: .14em; color: var(--env-ink); }
.env-venue { margin: 8px 0 0; font-size: 13px; letter-spacing: .08em; color: var(--env-mute); }
.env .loader-open { margin: 56px 0 0; padding: 11px 26px; border: 1px solid var(--env-ink); border-radius: 999px; background: transparent; color: var(--env-ink); font: inherit; font-size: 13.5px; letter-spacing: .12em; cursor: pointer;
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1), background .3s; }
.env.ready .loader-open { opacity: 1; transform: none; pointer-events: auto; animation: env-breathe 2.6s 1s ease-in-out infinite; }
.env .loader-open:active { background: rgba(31,40,56,.06); }
@keyframes env-breathe { 50% { box-shadow: 0 0 0 7px rgba(31,40,56,.07); } }
.seam { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; z-index: 2; }
.seam .ln { position: absolute; top: -.5px; height: 1px; width: 50%; background: var(--env-line); transform: scaleX(0); transition: opacity .4s; }
.seam .l { right: 50%; transform-origin: right; animation: line-draw 1.1s .5s cubic-bezier(.6,0,.2,1) forwards; }
.seam .r { left: 50%; transform-origin: left; animation: line-draw 1.1s .5s cubic-bezier(.6,0,.2,1) forwards; }
.seal { position: absolute; left: 50%; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--env-ink); box-shadow: 0 0 0 4px var(--env), 0 0 0 5px var(--env-line); display: grid; place-items: center; transform: scale(0); animation: seal-in .6s 1.4s cubic-bezier(.3,1.6,.5,1) forwards; transition: transform .45s ease, opacity .45s ease; }
.seal svg { width: 15px; height: 15px; fill: #fff; }
@keyframes line-draw { to { transform: scaleX(1); } }
@keyframes seal-in { to { transform: scale(1); } }
.env .top .half-in > *, .env .bot .env-date, .env .bot .env-venue { opacity: 0; animation: env-up .9s ease forwards; }
.env-kicker { animation-delay: .1s !important; } .env-title { animation-delay: .25s !important; } .env-names { animation-delay: 1.5s !important; }
.env .loader-invite { animation-delay: 1.8s !important; } .env-date { animation-delay: 1.7s !important; } .env-venue { animation-delay: 1.85s !important; }
@keyframes env-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* 열기: 봉인이 살짝 커졌다 사라지고 → 선을 따라 위는 위로, 아래는 아래로 */
.env.opening .seal { animation: none; transform: scale(1.35); opacity: 0; }
.env.opening .seam .ln { opacity: 0; }
.env.opening .loader-open { animation: none; opacity: 0; transition-duration: .3s; }
.env.part .half.top { transform: translateY(-101%); }
.env.part .half.bot { transform: translateY(101%); }
.env.part .half { box-shadow: 0 0 30px rgba(31,40,56,.12); }
@media (prefers-reduced-motion: reduce) { .env .half { transition: none; } .env.part { opacity: 0; transition: opacity .4s; } }

/* 제목과 로딩 화면 선·봉인: 짙은 갈색 */
.title, .head h2, .env-title { color: var(--brown); }
.loader.env { --env-line: var(--brown); }
.seal { background: var(--brown); }
