:root {
  --bg: #f8f8f4;
  --text: #667e6b;
  --text-dark: #5c6f5a;
  --text-body: #333333;
  --bracket: #cccccc;
  --cover-tagline-font: clamp(1.35rem, 5.2vw, 1.95rem);
  --cover-tagline-leading: 1.2;
  --cover-tagline-line-height: calc(var(--cover-tagline-font) * var(--cover-tagline-leading));
  --site-max-width: 450px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

.site-wrap {
  max-width: var(--site-max-width);
  width: 100%;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== 커버: 오픈그래프 이미지 ========== */
.cover {
  padding: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.cover-tagline {
  position: absolute;
  z-index: 2;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: 1rem;
  margin: 0;
  margin-left: auto;
  max-width: 75%;
  text-align: right;
  font-family: "Great Vibes", cursive;
  font-size: var(--cover-tagline-font);
  color: var(--text);
  line-height: var(--cover-tagline-leading);
  text-shadow:
    0 0 14px rgba(248, 248, 244, 1),
    0 0 28px rgba(248, 248, 244, 0.85),
    0 1px 2px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.cover-hero-visual {
  position: relative;
  width: 100%;
  min-height: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  background-color: var(--bg);
}

.cover-hero-visual img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center center;
}

.cover-overlay-bottom {
  flex-shrink: 0;
  padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) max(1.15rem, env(safe-area-inset-bottom, 0px)) 1rem;
  text-align: right;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
  pointer-events: none;
  background: var(--bg);
}

.cover-overlay-bottom .venue {
  font-size: 0.85rem;
  font-weight: 400;
}

.cover-overlay-bottom .datetime {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ========== 초대장 본문 (두 번째 디자인) ========== */
.invitation {
  padding: 3rem 1.5rem 4rem;
  max-width: 480px;
  margin: 0 auto;
}

.invitation-title-row {
  --invitation-title-size: clamp(1.35rem, 5.2vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35em;
  margin-bottom: 2.5rem;
}

.invitation-title {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--invitation-title-size);
  color: var(--text-dark);
  text-align: center;
  letter-spacing: 0.12em;
  margin: 0;
}

.invitation-body {
  text-align: center;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.9;
  font-weight: 300;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.invitation-body p {
  margin-bottom: 1.25rem;
}

.invite-part {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.invite-part.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 키워드(소망·사랑·믿음): 상승은 부모와 역보정으로 고정 + 개별 패이드인 */
.invite-part .pop-word {
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--pop-fade-delay, 0.14s);
}

.invite-part:not(.is-visible) .pop-word {
  transform: translateY(-1.5rem);
}

.invite-part.is-visible .pop-word {
  transform: translateY(0);
  opacity: 1;
}

.pop-word {
  display: inline-block;
  font-weight: inherit;
  color: inherit;
  font-size: calc(1em + 3px);
  line-height: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  --pop-color: var(--text-body);
}

.pop-word--hope  { --pop-color: #eab308; --pop-fade-delay: 0.12s; }
.pop-word--love  { --pop-color: #dc2626; --pop-fade-delay: 0.24s; }
.pop-word--faith { --pop-color: #2563eb; --pop-fade-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  .invite-part .pop-word {
    opacity: inherit;
    transition: none;
    --pop-fade-delay: 0s;
  }

  .invite-part.is-visible .pop-word {
    opacity: 1;
  }

  .pop-word.is-wiggling {
    animation: none;
  }
}

.pop-word.is-wiggling {
  animation: pop-word-wiggle 1.15s ease-in-out;
}

.pop-word.is-popping {
  animation: pop-word 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pop-word-wiggle {
  0%,
  100% { transform: translateY(0) translateX(0); }
  22% { transform: translateY(0) translateX(-0.7px); }
  44% { transform: translateY(0) translateX(0.55px); }
  62% { transform: translateY(0) translateX(-0.35px); }
  78% { transform: translateY(0) translateX(0.22px); }
}

@keyframes pop-word {
  0%   { transform: translateY(0) scale(1);    color: inherit;     font-weight: inherit; }
  40%  { transform: translateY(0) scale(1.35); color: var(--pop-color); font-weight: 600; }
  70%  { transform: translateY(0) scale(1.1);  color: var(--pop-color); font-weight: 500; }
  100% { transform: translateY(0) scale(1);    color: inherit;     font-weight: inherit; }
}

.invitation-body p:last-of-type {
  margin-bottom: 2rem;
}

.names-block {
  text-align: center;
  margin: 2.5rem 0;
}

.names-line {
  display: block;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 2;
  font-weight: 400;
}

.names-line .b {
  font-weight: 700;
}

.details {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.8;
}

.details .datetime {
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.details .venue {
  font-weight: 400;
}

.bus-section {
  margin-top: 2.5rem;
  text-align: left;
}

.bus-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bus-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bus-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.bus-icon img,
.bus-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.bus-icon svg {
  stroke: var(--text-body);
}

.bus-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-body);
}

.bus-separator {
  border: none;
  border-top: 1px dotted #bbb;
  margin: 0 0 1rem 0;
}

.bus-city {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 0.35rem;
}

.bus-route {
  font-size: 0.85rem;
  color: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.bus-route:last-child {
  margin-bottom: 0;
}

/* ========== 스크롤 등장 (참고: 투아게스트 류의 페이드·슬라이드업) ========== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 1.4rem, 0);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.gallery-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 0.65rem, 0) scale(0.98);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-photo-grid img.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .gallery-photo-grid img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.location-section {
  margin-top: 2.5rem;
  text-align: left;
}

.location-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.location-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.location-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-body);
}

.location-separator {
  border: none;
  border-top: 1px dotted #bbb;
  margin: 0 0 1rem 0;
}

.location-address {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 1rem;
  text-align: left;
}

.location-copy-btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-body);
  background: #e8e8e8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.location-copy-btn:active {
  background: #ddd;
}

.location-map-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.location-map-wrap iframe {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
}

/* 모바일 터치: 지도 iframe이 세로 스크롤을 삼켜 아래(전세버스 등)로 못 내려가는 문제 방지 */
@media (hover: none) and (pointer: coarse) {
  .location-map-wrap iframe {
    pointer-events: none;
  }
}

.location-map-links {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.location-map-link {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-body);
  background: #e8e8e8;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-family: inherit;
}

.location-map-link:hover {
  background: #ddd;
}

.gallery-section {
  margin-top: 2.5rem;
  text-align: left;
}

.gallery-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.gallery-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.gallery-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-body);
}

.gallery-separator {
  border: none;
  border-top: 1px dotted #bbb;
  margin: 0 0 1rem 0;
}

.gallery-message {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.8;
}

.gallery-grid-wrap {
  position: relative;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 1rem;
}

.gallery-grid-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gallery-grid-wrap.is-expanded::after {
  opacity: 0;
}

.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.gallery-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0.8rem auto 0;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.gallery-more-btn .chevron {
  display: inline-block;
  font-size: 1.2rem;
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

.gallery-more-btn.is-expanded .chevron {
  transform: rotate(-90deg);
}

.gallery-more-btn.is-hidden {
  display: none;
}

.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: var(--site-max-width);
  width: 100%;
  z-index: 9999;
  background: #fff;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

html:has(body.gallery-lightbox-open) {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}

body.gallery-lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.gallery-lightbox__stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 3.75rem;
  z-index: 1;
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: none;
}

.gallery-lightbox__track {
  display: flex;
  width: 300%;
  height: 100%;
  will-change: transform;
  pointer-events: auto;
  touch-action: pan-y;
}

.gallery-lightbox__track.is-animating {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-lightbox__slide {
  flex: 0 0 calc(100% / 3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(2.75rem, env(safe-area-inset-top)) 1rem 0.5rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  box-sizing: border-box;
}

.gallery-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox__close {
  position: absolute;
  top: max(0.35rem, env(safe-area-inset-top));
  right: max(0.35rem, env(safe-area-inset-right));
  z-index: 3;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  color: #444;
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: none;
}

.gallery-lightbox__close:hover {
  color: #111;
}

.gallery-lightbox__close:focus,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__close:active {
  outline: none;
  box-shadow: none;
}

.gallery-lightbox__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem max(1.25rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  background: #fff;
  box-sizing: border-box;
  border-top: none;
}

.gallery-lightbox__chev {
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0.35rem 0.5rem;
  min-width: 2rem;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.gallery-lightbox__chev:hover {
  color: #444;
}

.gallery-lightbox__chev:active {
  color: #444;
}

.gallery-lightbox__chev:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.gallery-lightbox__count {
  flex: 1;
  text-align: center;
  color: #888;
  font-size: 0.82rem;
  font-weight: 400;
  pointer-events: none;
}

/* ========== 편지 이스터에그 (트리플 탭) ========== */
.letter-secret {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.letter-secret.is-open {
  display: flex;
}

.letter-secret[hidden] {
  display: none !important;
}

body.letter-secret-open {
  overflow: hidden;
}

.letter-secret__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(51, 51, 51, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.letter-secret__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

/* === Envelope === */
.letter-envelope {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: min(900px, calc(100vh - 30px));
  height: min(900px, calc(100dvh - 30px));
  perspective: 1500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-envelope__body {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  bottom: 30px;
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 4px;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.14),
    0 4px 10px rgba(0, 0, 0, 0.06);
  z-index: 10;
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s;
}

.letter-envelope__flap {
  position: absolute;
  inset: 0;
  transition: transform 0.6s ease-in-out;
}

.letter-envelope__flap--left,
.letter-envelope__flap--right {
  display: none;
}

.letter-envelope__flap--top {
  background: linear-gradient(165deg, #ffffff 0%, #f6f6f2 100%);
  clip-path: polygon(0 0, 35% 50%, 65% 50%, 100% 0);
  z-index: 13;
  transform-origin: top;
  border-radius: 4px 4px 0 0;
}

.letter-envelope__flap--bottom {
  background: #ffffff;
  clip-path: polygon(0 100%, 35% 45%, 65% 45%, 100% 100%);
  z-index: 11;
  border-radius: 0 0 4px 4px;
}

.letter-envelope__seam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  overflow: visible;
}

.letter-envelope__seam--bottom {
  z-index: 12;
}

.letter-envelope__seam--top {
  z-index: 14;
}

.letter-envelope__seam polyline {
  fill: none;
  stroke: rgba(160, 160, 160, 0.20);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.letter-envelope__zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88%;
  max-width: 270px;
  height: 130px;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.letter-envelope__zone > * {
  pointer-events: auto;
}

/* === Sealing Wax === */
.letter-seal {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 31;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.letter-seal__round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 80px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e8e8e8 40%, #b8b8b8 100%);
  border-radius: 65% 55% 60% 50% / 45% 55% 48% 52%;
  box-shadow:
    0 8px 15px rgba(0, 0, 0, 0.18),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -4px -4px 10px rgba(0, 0, 0, 0.12),
    inset 0 0 12px rgba(0, 0, 0, 0.08);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.letter-seal__round::before {
  content: '';
  position: absolute;
  width: 105px;
  height: 56px;
  border-radius: 50px / 28px;
  background: rgba(0, 0, 0, 0.02);
  box-shadow:
    inset 3px 3px 6px rgba(0, 0, 0, 0.18),
    inset -2px -2px 4px rgba(255, 255, 255, 0.4);
}

.letter-seal__text {
  font-family: 'Great Vibes', cursive;
  font-size: 1.55rem;
  color: rgba(60, 60, 60, 0.5);
  text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
  transform: translateY(-2px);
  user-select: none;
  white-space: nowrap;
}

.letter-seal:hover .letter-seal__round,
.letter-seal:focus-visible .letter-seal__round {
  transform: scale(1.04) rotate(0.5deg);
}

.letter-seal:focus-visible {
  outline: none;
}

/* === Password Input Layer === */
.letter-password {
  position: absolute;
  width: 100%;
  text-align: center;
  background: transparent;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.letter-envelope.is-input .letter-seal {
  opacity: 0;
  transform: scale(0.5);
  visibility: hidden;
}

.letter-envelope.is-input .letter-password {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0.15s;
}

.letter-password__label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  opacity: 0.85;
}

.letter-password__input {
  width: 200px;
  max-width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #b8b8b8;
  outline: none;
  color: var(--text-body);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.5rem 0;
  transition: border-color 0.3s;
}

.letter-password__input:focus {
  border-color: var(--text-dark);
}

.letter-password__input::placeholder {
  font-size: 0.78rem;
  letter-spacing: normal;
  color: #b8b8b8;
}

.letter-password__hint {
  min-height: 0.95rem;
  font-size: 0.72rem;
  color: #8b3a3a;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0.5rem 0 0;
}

.letter-password__hint:empty {
  visibility: hidden;
}

.letter-password__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.letter-password__btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #999;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.letter-password__btn:hover,
.letter-password__btn:focus-visible {
  color: var(--text-dark);
  outline: none;
}

.letter-password__btn--primary {
  color: var(--text-dark);
}

.letter-envelope.is-shaking .letter-password {
  animation: letter-shake 0.4s ease-in-out;
}

@keyframes letter-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

/* === Letter Paper === */
.letter-paper {
  position: absolute;
  inset: 10px;
  background: var(--bg);
  border: 1px solid #e5dcc3;
  border-radius: 16px;
  padding: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease 0.3s,
    visibility 0.7s ease 0.3s,
    transform 0.7s ease 0.3s;
  overflow: hidden;
  z-index: 5;
}

.letter-envelope.is-open .letter-envelope__body {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
}

.letter-envelope.is-open .letter-envelope__flap--top {
  transform: rotateX(180deg);
}

.letter-envelope.is-open .letter-envelope__zone {
  opacity: 0;
  visibility: hidden;
}

.letter-envelope.is-open .letter-paper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 50;
}

.letter-paper__to {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  color: var(--text-dark);
  text-align: center;
  margin: 0 0 0.75rem;
  padding: 0 1.4rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.letter-paper__body {
  flex: 1 1 auto;
  min-height: 0;
  font-size: 0.95rem;
  line-height: 1.5rem;
  color: #3e2723;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: keep-all;
  overflow-y: auto;
  padding: 0 1.4rem;
  background-image: linear-gradient(#e5dcc3 1px, transparent 1px);
  background-size: 100% 1.5rem;
  background-attachment: local;
  -webkit-overflow-scrolling: touch;
}

.letter-paper__body::-webkit-scrollbar {
  width: 4px;
}

.letter-paper__body::-webkit-scrollbar-thumb {
  background: #e5dcc3;
  border-radius: 10px;
}

.letter-paper__close {
  margin: 1rem auto 0;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--text-dark);
  color: var(--text-dark);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.letter-paper__close:hover {
  background: var(--text-dark);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

/* ========== 배경음악 (콘텐츠 컬럼 좌측 상단 고정, max-width와 동일 기준) ========== */
.bgm-toggle {
  position: fixed;
  z-index: 100;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  left: calc(50vw - min(calc(var(--site-max-width) / 2), 50vw) + max(0.85rem, env(safe-area-inset-left, 0px)));
  width: var(--cover-tagline-line-height);
  height: var(--cover-tagline-line-height);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #242424;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
  -webkit-tap-highlight-color: transparent;
}

.bgm-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.bgm-toggle svg {
  width: calc(var(--cover-tagline-font) * 0.58);
  height: calc(var(--cover-tagline-font) * 0.58);
  display: block;
  margin-left: 1px;
}

.bgm-toggle.is-playing svg {
  margin-left: 0;
}

.bgm-toggle .bgm-icon-pause {
  display: none;
}

.bgm-toggle.is-playing .bgm-icon-play {
  display: none;
}

.bgm-toggle.is-playing .bgm-icon-pause {
  display: block;
}

/* ── Account Section ── */
.account-section {
  margin-top: 4rem;
}

.account-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.account-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-body);
}

.account-separator {
  border: none;
  border-top: 1px dotted #bbb;
  margin: 0 0 1rem 0;
}

.account-desc {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text-body);
  margin-bottom: 1.2rem;
  text-align: center;
}

.account-group {
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.account-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.2rem;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.account-toggle:active {
  background: #f5f5f5;
}

.account-toggle-label {
  font-size: 1rem;
  font-weight: 500;
  color: #7ab8d9;
}

.account-toggle--bride .account-toggle-label {
  color: #d4827e;
}

.account-toggle-chevron {
  font-size: 1.4rem;
  color: #aaa;
  transition: transform 0.3s;
  line-height: 1;
  transform: rotate(90deg);
}

.account-toggle.is-open {
  border-bottom: 1px solid #e0e0e0;
}

.account-toggle.is-open .account-toggle-chevron {
  transform: rotate(-90deg);
}

.account-list {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.account-list.is-open {
  opacity: 1;
}

.account-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-top: 1px solid #f0f0f0;
}

.account-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.account-role {
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  width: fit-content;
  padding-bottom: 1px;
  border-bottom: 1px solid currentColor;
}

.account-role--groom {
  color: #7ab8d9;
}

.account-role--bride {
  color: #d4827e;
}

.account-number {
  font-size: 0.92rem;
  color: #444;
  letter-spacing: 0.02em;
}

.account-bank-name {
  font-size: 0.82rem;
  color: #999;
}

.account-copy-btn {
  margin-left: 1rem;
  margin-top: 0.2rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: #666;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.3rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  align-self: flex-start;
}

.account-copy-btn:active {
  background: #f0f0f0;
}

.account-copy-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.account-copy-toast.is-visible {
  opacity: 1;
}
