:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --alt: #ffffff;
  --ink: #3d3530;
  --muted: #8a7f76;
  --accent: #b08a6e;
  --line: #e6ddd2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-snap-type: y proximity; -webkit-tap-highlight-color: transparent; }
/* 팝업 열렸을 때 뒤 화면 스크롤 막기 */
body:has(.modal:not([hidden])) { overflow: hidden; }
button, a, label { touch-action: manipulation; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Gowun Batang", serif;
  font-size: 15px;
  line-height: 1.9;
  word-break: keep-all;
}
.card { max-width: 480px; margin: 0 auto; background: var(--paper); overflow: hidden; }
/* 컴퓨터에서 열면: 바깥은 옅은 베이지, 가운데에 폰 폭 청첩장 (폰에서는 영향 없음) */
@media (min-width: 520px) {
  body { background: #f3efea; }
  .card { box-shadow: 0 0 40px rgba(61, 53, 48, .10); }
}
/* 섹션 하나가 화면 하나를 꽉 채움 */
section {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 24px; text-align: center; scroll-snap-align: start;
}
section.alt { background: var(--alt); }
/* 흰 배경에서 섹션 구분용 가는 선 */
section { position: relative; }
section + section::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--line); }
h2 { font-size: 19px; font-weight: 700; margin-bottom: 28px; letter-spacing: .02em; }
.label { font-family: "Cormorant Garamond", serif; color: var(--accent); letter-spacing: .25em; font-size: 13px; margin-bottom: 8px; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.btn {
  display: inline-block; align-self: center; margin-top: 32px; padding: 12px 28px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink); text-decoration: none; font-size: 14px;
}

/* 메인 */
.hero { position: relative; padding: 48px 24px 88px; }
/* 메인 영문 문구 */
.hero-en { font-family: "Parisienne", cursive; font-size: clamp(31px, 9.4vw, 40px); line-height: 1.2; color: var(--accent); }
.hero-img { display: block; width: auto; max-width: 100%; height: 52vh; height: 52svh; object-fit: contain; margin: 16px auto 20px; border-radius: 8px; box-shadow: 0 4px 16px rgba(61, 53, 48, .15); }
/* 작은 폰(아이폰 SE 등)에서 SCROLL 글씨와 겹치지 않게 */
@media (max-height: 700px) { .hero-img { height: 44vh; height: 44svh; } }
@media (max-height: 600px) { .hero-img { height: 41vh; height: 41svh; } }
.hero-names { font-size: clamp(21px, 6vw, 24px); font-weight: 400; letter-spacing: .1em; }
.hero-names i { font-style: normal; font-family: "Cormorant Garamond", serif; color: var(--accent); margin: 0 14px; font-weight: 400; }
.hero-date { margin-top: 16px; }
.hero-venue { color: var(--ink); font-size: 15px; }
.scroll-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); font-family: "Cormorant Garamond", serif; font-size: 11px; letter-spacing: .3em; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scroll-hint span { width: 1px; height: 28px; background: var(--muted); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* 인사말 */
.greeting { line-height: 2.2; }
.parents { margin-top: 40px; line-height: 2.2; }
.parents small { color: var(--muted); font-size: 13px; margin-right: 6px; }

/* 달력 */
.cal-title { font-size: 21px; }
.cal-title small { font-size: 15px; color: var(--muted); margin-left: 8px; }
.cal-venue { color: var(--muted); font-size: 15px; }
.cal-photo { width: calc(100% - 48px); height: 300px; margin: 28px auto 32px; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 16px rgba(61, 53, 48, .12); }
/* 얼굴 쪽이 보이도록 위쪽 기준으로 자름 */
.cal-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.cal-month { font-size: 19px; color: var(--accent); margin-bottom: 8px; }
.calendar { width: 100%; max-width: 360px; table-layout: fixed; margin: 0 auto; border-collapse: collapse; }
.calendar th, .calendar td { height: 46px; font-size: 16px; font-weight: 400; }
.calendar th { color: var(--muted); font-size: 14px; }
.calendar .sun { color: #c0645a; }
.calendar .sat { color: #6a83a8; }
/* 예식일: 하트 */
.calendar .on span {
  display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; padding-bottom: 3px;
  color: #fff; font-weight: 700;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f08fa8' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: beat 1.6s ease-in-out infinite;
}
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .calendar .on span { animation: none; } }
.dday { margin-top: 28px; font-size: 16px; }
.dday b { color: var(--accent); }

/* 갤러리 */
/* 3 x 3 그리드 (누르면 크게 보기 + 좌우 넘기기) */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #f6f3ef; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.tile .more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(40, 35, 30, .45); color: #fff; font-size: 18px; pointer-events: none; }

/* 오시는 길 */
.place + .place { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--line); }
.place-label { color: var(--accent); font-size: 13px; letter-spacing: .1em; margin-bottom: 4px; }
.venue-name { font-size: 17px; }
.map { position: relative; z-index: 0; isolation: isolate; width: 100%; height: 240px; margin: 16px 0 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--alt); }
.venue-addr { color: var(--muted); font-size: 14px; }
.copy { font-size: 12px; color: var(--accent); text-decoration: underline; margin-left: 4px; }
.map-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 36px; }
.map-links a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap; }
.map-links svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 340px) { .map-links a { gap: 4px; font-size: 12px; } .map-links svg { width: 16px; height: 16px; } }
.transport { text-align: left; }
.transport dt { font-weight: 700; font-size: 14px; color: var(--accent); }
.transport dd { white-space: pre-line; font-size: 14px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.transport dd:last-child { border-bottom: 0; }

/* 계좌 */
.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; text-align: left; background: var(--paper); }
.acc summary { padding: 14px 18px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "⌄"; color: var(--muted); }
.acc[open] summary::after { content: "⌃"; }
.acc-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.acc-row small { color: var(--muted); }
.acc-row button { font-size: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; flex-shrink: 0; }

/* 엔딩 */
.ending { color: var(--muted); }

/* 모달 */
.modal { position: fixed; inset: 0; background: rgba(30, 25, 20, .55); display: flex; z-index: 10; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.modal[hidden] { display: none; }
.modal-box { margin: auto; position: relative; background: var(--paper); border-radius: 14px; width: 100%; max-width: 360px; padding: 32px 24px 20px; text-align: center; }
.modal-box h3 { font-size: 17px; margin-bottom: 16px; }
.close { position: absolute; top: 8px; right: 14px; font-size: 26px; color: var(--muted); }
.contact-group { padding: 12px 0; border-top: 1px solid var(--line); }
.contact-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.contact-row small { color: var(--muted); margin-right: 6px; }
.contact-row a { margin-left: 12px; color: var(--accent); text-decoration: none; font-size: 13px; }

/* 참석 여부 팝업 */
.rsvp-box { max-width: 310px; text-align: left; padding: 24px 20px 14px; }
.rsvp-box .label, .rsvp-box h3 { text-align: center; }
.rsvp-box .label { margin-bottom: 0; font-size: 11px; }
.rsvp-box h3 { font-size: 16px; margin-bottom: 4px; }
.rsvp-desc { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 16px; }
/* 항목 이름 | 입력칸 을 한 줄로 */
.field { display: grid; grid-template-columns: 60px 1fr; align-items: center; margin-bottom: 8px; }
.if-attend[hidden] { display: none; }
.field > span { font-size: 13px; color: var(--muted); }
.field input:not([type="radio"]) {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
/* 참석 인원 드롭다운 */
.dd { position: relative; }
.dd-btn {
  width: 100%; height: 36px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b08a6e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 11px no-repeat;
  font-size: 14px; text-align: left; transition: border-color .2s;
}
.dd.open .dd-btn { border-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='%23b08a6e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.dd-list {
  position: absolute; z-index: 2; top: calc(100% + 4px); left: 0; right: 0; list-style: none;
  padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(61, 53, 48, .12); display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
}
.dd-list[hidden] { display: none; }
.dd-list li { height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 14px; cursor: pointer; }
.dd-list li:hover { background: #f6f3ef; }
.dd-list li[aria-selected="true"] { background: var(--accent); color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg b { display: flex; align-items: center; justify-content: center; height: 36px; border: 1px solid var(--line); border-radius: 6px; font-weight: 400; font-size: 13px; cursor: pointer; }
.seg input:checked + b { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + b { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit { width: 100%; margin-top: 8px; padding: 11px 0; border-radius: 6px; background: var(--ink); color: #fff; font-size: 15px; }
.submit:disabled { opacity: .6; }
.skip { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); cursor: pointer; }

/* 사진 크게 보기: 샘플처럼 흰 화면 + 옆으로 넘기기 + 아래 진행바·장수 */
.lightbox { padding: 0; background: #fff; display: block; overflow: hidden; }
.lb-top, .lb-track, .lb-bottom { max-width: 480px; margin: 0 auto; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; z-index: 1; height: calc(56px + env(safe-area-inset-top)); }
.lightbox .close { top: calc(8px + env(safe-area-inset-top)); right: 14px; color: #8a8a8a; font-size: 32px; font-weight: 300; line-height: 1; padding: 6px; }
.lb-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-track figure { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; padding: 64px 0 80px; }
.lb-track img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.lb-bottom { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.lb-bar { height: 3px; background: #e4e4e4; overflow: hidden; margin-bottom: 10px; }
.lb-bar i { display: block; height: 100%; background: var(--accent); opacity: .7; transition: transform .3s; }
.lb-count { color: #8a8a8a; font-size: 13px; letter-spacing: .1em; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 44px; height: 64px; }
.lightbox .nav::before { content: ""; display: block; width: 11px; height: 11px; margin: auto; border: solid #fff; border-width: 0 1.5px 1.5px 0; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45)); }
.lightbox .prev::before { transform: rotate(135deg); }
.lightbox .next::before { transform: rotate(-45deg); }
.lightbox .prev { left: max(0px, calc(50% - 240px)); }
.lightbox .next { right: max(0px, calc(50% - 240px)); }

.bgm { position: fixed; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 253, 249, .9); border: 1px solid var(--line); z-index: 5; }
.bgm.off { opacity: .45; text-decoration: line-through; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(40, 35, 30, .85); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* 화면에 들어오면 안의 요소들이 차례로 떠오름 */
.fade > * { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.fade.in > * { opacity: 1; transform: none; }
.hero .scroll-hint { transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { .fade > * { opacity: 1; transform: none; transition: none; } }
