.page {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  min-height: 100vh;
  overflow: hidden;
}

.section {
  padding: var(--section-pad-y) 24px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.section--flush {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.divider {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  height: 1px;
  background: var(--line);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__mark {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--cool-deep);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  color: var(--white);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43, 46, 51, 0.72) 0%, rgba(43, 46, 51, 0.15) 45%, rgba(43, 46, 51, 0.05) 100%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 190px 28px 32px;
  width: 100%;
  text-align: center;
}

.hero__eyebrow {
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 18px;
}

.hero__names {
  font-family: var(--font-serif-kr);
  font-size: clamp(2rem, 9vw, 2.8rem);
  line-height: 1.3;
  margin-bottom: 18px;
}

.hero__date {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

.hero__scroll {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, transparent, var(--white) 60%, transparent);
}

.hero__scroll::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  animation: scrollDot 2s var(--ease) infinite;
}

@keyframes scrollDot {
  0% { top: 0; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 34px; opacity: 0; }
}

/* ---------- Reveal ----------
   기본은 항상 보이는 상태. JS가 초기화될 때만 reveal-armed를 붙여
   스크롤 애니메이션을 켠다. 그래야 JS가 실패해도 콘텐츠가 영구히
   숨겨지는 일이 없다. */
.reveal.reveal-armed {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.reveal-armed.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Greeting ---------- */
.greeting {
  text-align: center;
}

.greeting__message {
  white-space: pre-line;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 32px;
}

.family-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.family-line + .family-line {
  margin-top: 14px;
}

.family-line strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Calendar / Countdown ---------- */
.save-the-date {
  text-align: center;
}

.calendar {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.calendar__month {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--cool-deep);
  margin-bottom: 16px;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 0.85rem;
}

.calendar__dow {
  color: var(--ink-soft);
  font-size: 0.75rem;
  padding-bottom: 6px;
}

.calendar__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
}

.calendar__cell--target {
  background: var(--warm);
  color: var(--white);
  font-weight: 600;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.countdown__item {
  background: var(--cool-tint);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  min-width: 68px;
}

.countdown__num {
  display: block;
  font-family: var(--font-serif-en);
  font-size: 1.5rem;
  color: var(--cool-deep);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.married-message {
  margin-top: 28px;
  padding: 24px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.married-message__title {
  font-family: var(--font-serif-kr);
  font-size: 1.2rem;
  color: var(--cool-deep);
  margin-bottom: 6px;
}

.married-message__sub {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Petal fall (예식 이후 1회, 은은한 흰 빛방울) ---------- */
.petal-fall {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation-name: sparkle-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes sparkle-fall {
  0% {
    transform: translateY(-20px) translateX(0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(105vh) translateX(var(--drift, 30px)) scale(1.2);
    opacity: 0;
  }
}

/* ---------- Gallery ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gallery__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery__item:hover img,
.gallery__item:focus-visible img {
  transform: scale(1.06);
}

.gallery__more {
  text-align: center;
  margin-top: 20px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 20, 22, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox__img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  color: var(--white);
  font-size: 1.6rem;
  padding: 10px 16px;
  opacity: 0.85;
}

.lightbox__close {
  top: 10px;
  right: 10px;
}

.lightbox__prev {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ---------- Shared album ---------- */
.shared-album {
  text-align: center;
}

.shared-album__action {
  margin-top: 8px;
  margin-bottom: 28px;
}

/* ---------- Location ---------- */
.map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.venue-name {
  text-align: center;
  margin-top: 20px;
  font-family: var(--font-serif-kr);
  font-size: 1.15rem;
}

.venue-address-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.venue-address {
  color: var(--ink-soft);
  font-size: 0.9rem;
  white-space: pre-line;
}

.address-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.address-copy-btn.is-copied {
  color: var(--cool-deep);
  background: var(--cool-tint);
}

.nav-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: nowrap;
  justify-content: center;
}

.nav-buttons .btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.78rem;
  gap: 5px;
  white-space: nowrap;
}


.info-accordion {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--cool-deep);
  color: var(--white);
}

.btn--warm {
  background: var(--warm);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn--outline:hover {
  border-color: var(--cool-deep);
  color: var(--cool-deep);
}

.btn__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ---------- Accordion ---------- */
.accordion {
  border-bottom: 1px solid var(--line);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

.accordion__icon {
  transition: transform 0.3s var(--ease);
  color: var(--cool-deep);
}

.accordion.is-open .accordion__icon {
  transform: rotate(45deg);
}

.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}

.accordion__panel-inner {
  padding: 0 4px 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: pre-line;
}

/* ---------- Accounts ---------- */
.account-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.account-tab {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.account-tab:hover {
  border-color: var(--cool-deep);
  color: var(--cool-deep);
}

.account-tab.is-active {
  background: var(--cool-deep);
  border-color: var(--cool-deep);
  color: var(--white);
}

.account-tab.is-active:hover {
  color: var(--white);
}

.account-panel {
  display: none;
}

.account-panel.is-active {
  display: block;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  gap: 12px;
}

.account-row__who {
  color: var(--ink-soft);
}

.account-row__num {
  font-weight: 500;
}

.copy-btn {
  font-size: 0.75rem;
  color: var(--cool-deep);
  border: 1px solid var(--cool-tint);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

/* ---------- Guestbook ---------- */
.guestbook {
  text-align: center;
}

.guestbook-form {
  text-align: left;
  max-width: var(--content-max);
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guestbook-form__row {
  display: flex;
  gap: 8px;
}

.guestbook-form__row input {
  flex: 1;
  min-width: 0;
}

.guestbook-form input[type="text"],
.guestbook-form input[type="password"],
.guestbook-form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
}

.guestbook-form textarea {
  resize: vertical;
  min-height: 72px;
}

.guestbook-list {
  text-align: left;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guestbook-entry {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.guestbook-entry__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.guestbook-entry__name {
  font-weight: 600;
  color: var(--ink);
}

.guestbook-entry__message {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.guestbook-entry__actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.guestbook-entry__actions button {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guestbook-entry__edit-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
  resize: vertical;
  min-height: 60px;
}

.guestbook-more {
  display: flex;
  width: fit-content;
  margin: 16px auto 0;
}

/* ---------- Password modal ---------- */
.password-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 22, 0.5);
}

.password-modal__box {
  position: relative;
  width: min(320px, calc(100% - 48px));
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 20px;
  text-align: center;
}

.password-modal__label {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 14px;
}

.password-modal__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.2em;
  color: var(--ink);
  background: var(--white);
}

.password-modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.password-modal__actions .btn {
  flex: 1;
}

/* ---------- Share ---------- */
.share {
  text-align: center;
}

.share__buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 60px 24px 40px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer__mark {
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--cool-deep);
  margin-bottom: 10px;
}

/* ---------- Map shortcut FAB ---------- */
/* .page의 max-width(720px)를 넘는 화면에서도 카드 바깥으로 나가지 않도록 오른쪽 위치를 계산한다 */
.map-fab {
  position: fixed;
  bottom: 40px;
  right: max(18px, calc(50% - 360px + 18px));
  z-index: 150;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 플로팅 버튼들을 묶는 컨테이너 */
.fab-container {
  position: fixed;
  bottom: 40px; /* 원래 있던 오시는길 버튼 높이에 맞춤 */
  
  /* 카드의 중앙 정렬을 버튼 컨테이너에도 똑같이 적용 */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px; /* ★ 이 부분을 480px에서 카드 크기와 똑같은 720px로 수정 ★ */
  
  display: flex;
  flex-direction: column;
  align-items: flex-end; 
  padding-right: 18px; /* ★ 원래 버튼 위치에 맞춰 우측 여백 18px로 수정 ★ */
  box-sizing: border-box;
  gap: 12px;
  z-index: 100;
  pointer-events: none; 
}

/* 개별 버튼의 기존 고정 속성 해제 및 색상 통일 */
.fab-container .map-fab {
  position: relative !important; 
  bottom: auto !important;
  right: auto !important;
  pointer-events: auto;
  color: var(--cool-deep); /* 아이콘 색상 통일 */
}

/* ---------- BGM toggle ---------- */
.bgm-toggle {
  position: fixed;
  top: 18px;
  right: max(18px, calc(50% - 360px + 18px));
  z-index: 150;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Language toggle (히어로 카드 안쪽에 고정, 스크롤에 안 따라옴) ---------- */
.lang-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.82rem;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 560px) {
  .page {
    margin: 24px auto;
    border-radius: 24px;
    min-height: auto;
  }
}
