/* ---------- Theme (여기만 바꿔도 분위기가 바뀜) ---------- */
:root {
  --bg: #f3f1ed;       /* 따뜻한 아이보리 그레이 */
  --ink: #2a2a2b;
  --muted: #8b8883;
  --line: #dcd8d1;
  --accent: #7f8c99;   /* 겨울 느낌의 차분한 블루그레이 */
  --serif: 'Cormorant Garamond', serif;
  --sans: 'Jost', sans-serif;
  --gap: 80px;         /* 섹션 위아래 여백: 이 값 하나로 전체 리듬 조절 */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; z-index:1}
html { -webkit-text-size-adjust: 100%;}
body {
  background: var(--bg); color: var(--ink);
  font: 300 15px/1.85 var(--sans); letter-spacing: .02em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body:has(dialog[open]) { overflow: hidden; }   /* 라이트박스 열렸을 때 뒤 스크롤 잠금 */
img, video { display: block; width: 100%; }
p { margin-top: 1.3em; }
hr { border: 0; border-top: 1px solid var(--line); width: 40px; margin: 48px auto; }

section { max-width: 520px; margin: auto; padding: var(--gap) 28px; text-align: center;}
section.wide { max-width: 900px; padding-inline: 14px;}

.eyebrow { font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--muted); }
h2 { font: 300 36px/1.2 var(--serif); margin-top: .3em; }

.btn {
  display: inline-block; margin-top: 1.8em; padding: 13px 30px;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  transition: .4s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.cal-btns { display: flex; justify-content: center; gap: 12px; margin-top: 1.2em; }
.cal-btns .btn { margin-top: 0; padding-inline: 26px; }

footer {
  padding: 26px 0 calc(64px + env(safe-area-inset-bottom));
  text-align: center; font: italic 300 22px var(--serif); color: var(--muted);
}

/* ---------- Hero ---------- */
 .hero {
  position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden;
  display: grid; align-items: end; text-align: center; color: #fff;
  clip-path: inset(0);   /* fixed 사진을 hero 영역 안에서만 보이게 자름 (빠른 스크롤에도 뒤에 비치지 않음) */
}
/* 모바일 브라우저는 주소창이 오르내리면 화면 높이가 계속 바뀜 → height:100%/inset:0 로 두면 사진이 그때마다 다시 맞춰지며 튐.
   그래서 높이를 "변하지 않는 값"으로 고정: lvh = 주소창이 접힌 최대 높이, svh = 주소창이 펼쳐진 최소 높이 (미지원 브라우저는 vh 로 대체) */
.hero-bg, .hero-img { position: fixed; top: 0; left: 0; width: 100%; }
.hero-bg {        /* 뒤: 화면을 꽉 채우고 흐리게 (blur 가장자리가 비지 않게 살짝 키움) */
  height: 100vh; height: 100lvh;
  object-fit: cover; filter: blur(30px) brightness(.85); transform: scale(1.15);
}
.hero-img {       /* 앞: 확대/크롭 없이 통째로 선명하게. padding 으로 가장자리 여백, 그림자로 살짝 띄움 */
  height: 100vh; height: 100svh;
  object-fit: contain; object-position: var(--focus, center);
  padding: clamp(16px, 4vw, 40px);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .25)) brightness(1.15);
  animation: zoom 8s ease-out both;
}

.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(20, 22, 26, .6)); z-index:1}
.hero-text { position: relative; z-index: 2; padding-bottom: calc(8vh + env(safe-area-inset-bottom)); }
.hero-text .eyebrow { color: rgba(255, 255, 255, .85); }
.hero h1 { font: 300 clamp(48px, 12vw, 84px)/1.1 var(--serif); margin: .2em 0 .3em; }
.hero h1 em { font-size: .6em; padding: 0 .1em; }
.hero-text > * { animation: up 1.6s ease both; }
.hero-text > :nth-child(2) { animation-delay: .4s; }
.hero-text > :nth-child(3) { animation-delay: .8s; }

@keyframes zoom { from { transform: scale(1.06); } }
@keyframes up   { from { opacity: 0; transform: translateY(20px); } }

main { background: var(--bg);}   /* hero-img(fixed)를 덮는 역할 */

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.2s ease, transform 1.2s ease; }
.reveal.show { opacity: 1; transform: none; z-index:2}

/* ---------- Video (작고 귀여운 폴라로이드 느낌) ---------- */
video {
  width: min(400px, 90%); margin: auto; background: #e6e2db;
  border: 8px solid #fff; border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12); transform: rotate(-2deg);
  margin-top: 60px;
}

.sound {
  display: block; margin: 28px auto 0; padding: 4px 0; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font: 300 11px var(--sans); letter-spacing: .3em; text-transform: uppercase;
}

/* ---------- BGM 버튼 (화면 오른쪽 위에 고정, 재생 중엔 막대가 춤추고 꺼져 있으면 사선) ---------- */
.bgm {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 24px; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20, 22, 26, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bgm i { width: 2px; height: 6px; border-radius: 1px; background: #fff; opacity: .7; }
.bgm.on i { opacity: 1; animation: eq 1s ease-in-out infinite alternate; }
.bgm.on i:nth-child(2) { animation-delay: -.4s; }
.bgm.on i:nth-child(3) { animation-delay: -.7s; }
.bgm:not(.on)::after { content: ""; position: absolute; width: 22px; height: 1px; background: #fff; opacity: .8; transform: rotate(-45deg); }
@keyframes eq { to { height: 16px; } }

/* ---------- Gallery (배치는 Masonry가 담당, 칸 수/간격만 여기서) ---------- */
.gallery { --cols: 3; --gut: 8px; margin-top: 32px; }
.gallery .gut { width: var(--gut); }
.gallery .col, .gallery img { width: calc((100% - (var(--cols) - 1) * var(--gut)) / var(--cols)); }
.gallery .col { height: 0; }
.gallery img { margin-bottom: var(--gut); aspect-ratio: auto 2 / 3; background: #e6e2db; cursor: pointer; }
@media (min-width: 720px) { .gallery { --cols: 4; --gut: 12px; } }

/* View more: 접혀 있다가 슬라이드처럼 열림 (높이는 script.js 가 계산해서 max-height 로 지정) */
.gallery-wrap { position: relative; overflow: hidden; transition: max-height 1.8s cubic-bezier(.45, .05, .2, 1); }
.gallery-wrap::after {   /* 접혀 있을 때 아래쪽이 배경색으로 서서히 사라지는 효과 */
  content: ""; position: absolute; inset: auto 0 0; height: 180px; z-index: 3; pointer-events: none;
  background: linear-gradient(transparent, var(--bg) 85%); transition: opacity .8s ease;
}
.gallery-wrap.open::after { opacity: 0; }
.more-button {                  /* 페이드 위에 살짝 겹쳐 놓음 (음수 margin) */
  display: block; position: relative; z-index: 4; margin: -60px auto 0; 
  background: none; border: 0; 
  cursor: pointer;
  font: 300 11px var(--sans); letter-spacing: .3em; text-transform: uppercase;
  /* text-decoration: underline; */
  width:100%;
  height:40px;
}
.more {border:0; border-bottom: 1px solid var(--ink); padding: 4px 0;color: var(--ink);
  transition: margin-top 1.8s cubic-bezier(.45, .05, .2, 1), letter-spacing .4s ease;
  display:inline;
}
.gallery-wrap.open + .more-button { margin-top: 0px; }   /* 펼쳐지면 사진 바로 아래로 */
.more:hover { letter-spacing: .38em; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 0; margin-top: 28px; font-size: 14px; }
.calendar b { font-weight: 400; font-size: 11px; letter-spacing: .15em; color: var(--muted); }
.calendar span { display: grid; place-items: center; height: 38px; width: 38px; margin: auto; border-radius: 50%; }
.calendar .on { background: var(--accent); color: #fff; animation: pulse 3s ease-in-out infinite; }
.countdown { font: italic 300 22px var(--serif); color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(127, 140, 153, .18); } }

/* ---------- Closing photo (가로 사진) ---------- */
.closing { max-width: 360px; margin: 0 auto; padding: 0 14px; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; background: rgba(20, 22, 26, .95);
  touch-action: none;   /* 크게 본 상태에서 핀치/더블탭 확대 방지 (좌우 스와이프는 script.js 가 직접 처리) */
}
.lightbox img { height: 100%; object-fit: contain; }
.lightbox button {
  position: fixed; background: none; border: 0; color: #fff; font-size: 34px; line-height: 1;
  width: 56px; height: 56px; cursor: pointer;
}
.lightbox [data-go="-1"] { left: 0; top: calc(50% - 28px); }
.lightbox [data-go="1"]  { right: 0; top: calc(50% - 28px); }
.lightbox [data-go="0"]  { right: 0; top: env(safe-area-inset-top); font-size: 22px; }

/* ---------- 모션 줄이기 설정 존중 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}


/* ---------- Closing composition ---------- */
/* Give the venue and RSVP an intentional relationship: one information chapter. */
.venue-section { padding-bottom: 0; }
.venue-divider {
  width: 32px;
  margin: 52px auto 44px;
}

.rsvp-block { padding: 0; }
.rsvp-block .eyebrow { margin-top: 0; color: var(--accent); }
.rsvp-block h2 { margin-top: 11px; }
.rsvp-block .rsvp-copy { margin-top: 22px; }

.rsvp-btn {
  margin-top: 27px;
  padding: 14px 32px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: .18em;
}
.rsvp-btn:hover { background: transparent; color: var(--ink); }

.rsvp-deadline {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

/* A quiet transition into the closing portrait, not another full section. */
.closing-rule {
  width: 1px;
  height: 36px;
  margin: 68px auto 54px;
  background: var(--line);
}

/* The first RSVP link is a discreet shortcut, not a second CTA button. */
.rsvp-teaser { margin-top: 32px; }
.rsvp-teaser a {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
  text-decoration: none;
  font: 400 11px var(--sans);
  letter-spacing: .18em;
  transition: color .3s ease, letter-spacing .3s ease;
}
.rsvp-teaser a:hover { color: var(--accent); letter-spacing: .21em; }
.rsvp-teaser a:focus-visible,
.rsvp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

@media (max-width: 480px) {
  .closing-rule { margin-top: 62px; margin-bottom: 48px; }
  .rsvp-block h2 { font-size: clamp(30px, 9vw, 36px); }
}
