/* =========================================================
   지훈 & 은지 모바일 청첩장
   팔레트: 종이 아이보리 + 라벤더 + 노을 코랄
   ========================================================= */
:root {
  --paper: #f7f4ee;
  --paper-2: #f1ede5;
  --ink: #3f3a4a;
  --ink-soft: #6e6878;
  --lavender: #7b68a6;
  --lavender-deep: #5b4b86;
  --lavender-pale: #e9e3f2;
  --sunset: #e98c7c;
  --sunset-soft: #f6c7a8;
  --blossom: #f4c9d3;
  --line: rgba(123, 104, 166, .22);
  --card-max: 480px;
  --serif-ko: "Gowun Batang", "Nanum Myeongjo", serif;
  --myeongjo: "Nanum Myeongjo", "Gowun Batang", serif;
  --serif-en: "Cormorant Garamond", "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif-ko);
  color: var(--ink);
  line-height: 1.9;
  word-break: keep-all;
  /* 데스크톱에서는 카드 바깥이 은은한 노을빛 */
  background:
    radial-gradient(120% 80% at 50% 110%, #f7d6c6 0%, transparent 60%),
    linear-gradient(180deg, #ece7f3 0%, #f4eee9 55%, #f6e3dc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

#petal-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ===== 카드(모바일 폭 고정, 데스크톱에서는 중앙 카드) ===== */
.card {
  position: relative;
  max-width: var(--card-max);
  margin: 0 auto;
  background: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .35 0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  box-shadow: 0 0 60px rgba(91, 75, 134, .12);
  overflow: hidden;
}

@media (min-width: 720px) {
  .card {
    margin: 40px auto;
    border-radius: 6px;
    box-shadow: 0 30px 80px rgba(91, 75, 134, .18), 0 0 0 1px rgba(255,255,255,.6) inset;
  }
}

/* ===== 라벤더 꽃 프레임 (업로드 이미지 사용) ===== */
/* 좌/우 가장자리에 라벤더 줄기만 가늘게 배치 (이미지를 작게 축소해 세로로 이어 붙임) */
.floral-frame { position: relative; isolation: isolate; --frame-w: 15%; }
.floral-frame::before,
.floral-frame::after {
  content: "";
  position: absolute; top: 0; bottom: 0;
  width: var(--frame-w);
  background-image: url("../images/lavender-bg.png");
  /* 이음새가 생기지 않도록 한 장으로 세로를 채우고, 가장자리 바깥쪽 줄기만 보여 줌 */
  background-repeat: no-repeat;
  background-size: auto 100%;
  z-index: -1;
  pointer-events: none;
  opacity: .9;
}
.floral-frame::before {
  left: 0;
  background-position: left top;
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent);
          mask-image: linear-gradient(90deg, #000 60%, transparent);
}
.floral-frame::after {
  right: 0;
  background-position: right top;
  -webkit-mask-image: linear-gradient(270deg, #000 60%, transparent);
          mask-image: linear-gradient(270deg, #000 60%, transparent);
}

/* ===== COVER ===== */
.cover {
  min-height: min(100vh, 900px);
  min-height: min(100svh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 라벤더 영역만큼 좌우 여백을 두어 글씨·그림을 가리지 않게 */
  padding: 56px calc(var(--frame-w) + 2%) 72px;
  text-align: center;
}


.eyebrow {
  font-family: var(--serif-en);
  font-size: 13px;
  letter-spacing: .38em;
  color: var(--lavender);
  text-indent: .38em;
}

.hall {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 26px auto 10px;
  aspect-ratio: 1024 / 777;
}
.hall > * {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hall-sketch {
  /* SVG 필터로 흰 종이를 투명 처리 → 베이지 배경과 노을이 그대로 비침 */
  z-index: 2;
  user-select: none;
  -webkit-user-drag: none;
}
.hall-scene { z-index: 1; }
.hall-lights { z-index: 3; mix-blend-mode: screen; }

.lamp { animation: flicker 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.lamp.l2 { animation-delay: -1.2s; }
.lamp.l3 { animation-delay: -2.4s; }
.lamp.l4 { animation-delay: -3.3s; }
@keyframes flicker {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.sun { animation: sunset 14s ease-in-out infinite alternate; }
@keyframes sunset {
  from { transform: translateY(-14px); }
  to   { transform: translateY(16px); }
}
.clouds { animation: drift 30s linear infinite alternate; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.floor-light { animation: glow 14s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 1; } to { opacity: .55; } }

.blossom-tree { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite alternate; }
.blossom-tree:nth-child(2n) { animation-duration: 9s; animation-delay: -3s; }
@keyframes sway { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }

.cover-text { margin-top: 14px; }
.names {
  font-family: var(--myeongjo);
  font-weight: 400;
  font-size: clamp(21px, 6.2vw, 30px);
  letter-spacing: .1em;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
}
.names .amp {
  font-family: var(--serif-en);
  font-style: italic;
  color: var(--sunset);
  font-size: .9em;
  letter-spacing: 0;
}
.cover-date {
  margin-top: 14px;
  font-family: var(--serif-en);
  font-size: clamp(14px, 4vw, 17px);
  letter-spacing: .14em;
  color: var(--lavender-deep);
}
.cover-venue {
  font-size: clamp(12.5px, 3.5vw, 14px);
  color: var(--ink-soft);
  letter-spacing: .05em;
}

.scroll-hint {
  position: absolute;
  bottom: 22px; left: 50%;
  width: 22px; height: 36px;
  margin-left: -11px;
  border: 1px solid var(--lavender);
  border-radius: 12px;
  opacity: .6;
}
.scroll-hint span {
  position: absolute; top: 7px; left: 50%;
  width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px;
  background: var(--lavender);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ===== 공통 섹션 ===== */
.section {
  padding: 88px 32px;
  text-align: center;
  position: relative;
}
.section + .section::before {
  content: "";
  position: absolute; top: 0; left: 50%;
  width: 1px; height: 44px;
  background: linear-gradient(var(--line), transparent);
}
.title {
  font-family: var(--myeongjo);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: .18em;
  margin-top: 10px;
  color: var(--ink);
}
.sub {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.sprig { color: var(--lavender); margin: 18px auto 30px; width: 120px; opacity: .8; }

/* ===== 인사말 ===== */
.poem p {
  font-size: 15.5px;
  line-height: 2.15;
  color: var(--ink);
}
.poem p + p { margin-top: 26px; }
.poem em {
  font-style: normal;
  color: var(--sunset);
  background: linear-gradient(transparent 62%, rgba(244, 201, 211, .55) 62%);
}

.parents {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  font-size: 15.5px;
}
.parents .rel { color: var(--ink-soft); font-size: 13.5px; margin: 0 8px 0 4px; }
.parents strong { font-weight: 700; color: var(--lavender-deep); letter-spacing: .08em; }

/* ===== 달력 ===== */
.when { background: linear-gradient(180deg, transparent, rgba(233, 227, 242, .45) 30%, rgba(246, 199, 168, .18) 100%); }
.calendar {
  margin: 36px auto 0;
  max-width: 330px;
  padding: 22px 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cal-head, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.cal-head span { font-size: 12.5px; color: var(--ink-soft); padding-bottom: 10px; }
.cal-grid span {
  font-family: var(--serif-en);
  font-size: 16px;
  line-height: 40px;
  height: 40px;
  position: relative;
}
.sun-day, .cal-grid span.sun { color: #c9767a; }
.sat-day, .cal-grid span.sat { color: var(--lavender); }
.cal-grid span.wedding { color: #fff; font-weight: 500; }
.cal-grid span.wedding::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: linear-gradient(160deg, #9a7bc4, var(--sunset) 75%, #f7b277);
  z-index: -1;
  box-shadow: 0 6px 14px rgba(233, 140, 124, .4);
}
.cal-grid span.wedding::after {
  content: "6:30 PM";
  position: absolute;
  left: 50%; bottom: -14px;
  transform: translateX(-50%);
  font-size: 9.5px; line-height: 1;
  color: var(--sunset);
  white-space: nowrap;
  letter-spacing: .04em;
}
.cal-grid { isolation: isolate; }

.countdown {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}
.countdown div {
  min-width: 54px;
  display: flex; flex-direction: column; align-items: center;
}
.countdown b {
  font-family: var(--serif-en);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  color: var(--lavender-deep);
}
.countdown small { font-family: var(--serif-en); font-size: 10.5px; letter-spacing: .2em; color: var(--ink-soft); }
.countdown i { font-style: normal; font-size: 22px; color: var(--line); line-height: 1.5; }
.dday-msg { margin-top: 18px; font-size: 14.5px; color: var(--ink-soft); }
.dday-msg b { color: var(--sunset); font-weight: 700; }

/* ===== 오시는 길 ===== */
.venue-name { margin-top: 26px; font-size: 17px; font-weight: 700; color: var(--ink); }
.venue-addr { font-size: 14.5px; color: var(--ink-soft); }
.btn-text {
  margin-left: 6px;
  font: inherit; font-size: 12px;
  color: var(--lavender);
  background: none; border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer; line-height: 1.2;
}
.map {
  margin: 24px -32px 0;
  height: 260px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.75) sepia(.08); }
.map-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 -32px;
  border-bottom: 1px solid var(--line);
}
.map-links a {
  padding: 13px 0;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background .2s;
}
.map-links a + a { border-left: 1px solid var(--line); }
.map-links a:hover, .map-links a:active { background: var(--lavender-pale); }

.transport { list-style: none; text-align: left; margin-top: 18px; }
.transport li { padding: 24px 2px; border-bottom: 1px dashed var(--line); }
.transport li:last-child { border-bottom: 0; }
.transport h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--lavender-deep);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.transport .ico { font-size: 15px; filter: grayscale(.3); }
.transport p { font-size: 14.5px; line-height: 1.85; }
.muted { color: var(--ink-soft); font-size: 13.5px !important; }
.tag {
  display: inline-block;
  font-size: 11px; line-height: 1;
  padding: 4px 6px 3px;
  border-radius: 3px;
  color: #fff;
  margin-right: 4px;
  vertical-align: 2px;
}
.tag-green { background: #7fa77a; }
.tag-blue { background: #6f86b8; }

/* ===== 계좌 ===== */
.gift { background: linear-gradient(180deg, transparent, rgba(233, 227, 242, .4)); }
.accordion { margin-top: 32px; display: grid; gap: 12px; text-align: left; }
details {
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
summary {
  list-style: none;
  padding: 15px 18px;
  font-size: 15px;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1px solid var(--lavender);
  border-bottom: 1px solid var(--lavender);
  transform: rotate(45deg) translateY(-3px);
  transition: transform .3s;
}
details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.acc-list { list-style: none; border-top: 1px solid var(--line); }
.acc-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  font-size: 14.5px;
  line-height: 1.6;
}
.acc-list li + li { border-top: 1px dashed var(--line); }
.acc-list small { color: var(--lavender); font-size: 12px; margin-right: 4px; }
.acc { font-size: 13px; color: var(--ink-soft); }
.btn-copy {
  flex-shrink: 0;
  font: inherit; font-size: 12.5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--lavender-deep);
  cursor: pointer;
}
.btn-copy:active { background: var(--lavender-pale); }

/* ===== 마무리 ===== */
.closing {
  padding: 110px calc(var(--frame-w) + 2%) 70px;
  text-align: center;
}

.closing-eng {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 34px;
  color: var(--lavender);
}
.closing-msg { margin-top: 14px; font-size: 15px; line-height: 2.1; }
.closing-names { margin-top: 18px; font-size: 14px; color: var(--ink-soft); letter-spacing: .1em; }
.share { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn {
  width: 220px;
  padding: 13px 0;
  font: inherit; font-size: 14.5px;
  border-radius: 30px;
  border: 1px solid var(--lavender-deep);
  background: var(--lavender-deep);
  color: #fff;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(91, 75, 134, .25); }
.btn-ghost { background: rgba(255,255,255,.7); color: var(--lavender-deep); }
.copy {
  display: block;
  margin-top: 54px;
  font-family: var(--serif-en);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ink-soft);
  opacity: .7;
}

/* ===== 토스트 ===== */
.toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(63, 58, 74, .88);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 스크롤 등장 애니메이션 ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ===== 반응형 ===== */
@media (max-width: 360px) {
  .section { padding: 72px 22px; }
  .map, .map-links { margin-left: -22px; margin-right: -22px; }
  .poem p { font-size: 14.5px; }
  .countdown div { min-width: 46px; }
  .countdown b { font-size: 24px; }
}

/* 가로로 긴 모바일 화면(가로모드)에서 커버 조정 */
@media (max-height: 520px) and (orientation: landscape) {
  .cover { min-height: auto; padding: 40px 0 60px; }
  .hall { width: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  #petal-canvas { display: none; }
}
