/* ---------- 기본 & 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #FFF8F0;
  --bg-2: #FFF3E7;
  --pink: #F7C6C7;
  --pink-deep: #F4B0B2;
  --peach: #FBD9B4;
  --sage: #B9D4B5;
  --sage-deep: #9BC098;
  --text: #5C4A3A;
  --text-soft: #8B6F52;
  --card: #FFFFFF;
  --shadow-sm: 0 2px 12px rgba(198, 149, 106, 0.08);
  --shadow-md: 0 12px 40px rgba(198, 149, 106, 0.12);
  --shadow-lg: 0 24px 60px rgba(198, 149, 106, 0.18);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --serif: 'Gowun Batang', 'Cormorant Garamond', serif;
  --sans: 'Gowun Dodum', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { height: auto; }

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* ---------- 페이지 & 배경 장식 ---------- */
body {
  background:
    radial-gradient(circle at 8% 5%, rgba(247, 198, 199, 0.28), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(185, 212, 181, 0.22), transparent 32%),
    radial-gradient(circle at 12% 85%, rgba(251, 217, 180, 0.25), transparent 30%),
    radial-gradient(circle at 90% 95%, rgba(247, 198, 199, 0.2), transparent 28%),
    var(--bg);
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- 공통 섹션 카드 ---------- */
.hero, .info-card, .directions, .rsvp, .attendees {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 40px 26px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.section-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--pink-deep);
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  text-align: center;
  margin: 0 0 28px;
  letter-spacing: -0.5px;
}

/* ---------- 히어로 ---------- */
.hero {
  text-align: center;
  padding: 56px 26px 48px;
  background: linear-gradient(180deg, #FFFDFA 0%, #FFF8F0 100%);
}

.hero-decor {
  position: absolute;
  width: 70px;
  height: 70px;
  opacity: 0.55;
  pointer-events: none;
}
.hero-decor.top-left  { top: 14px; left: 14px; }
.hero-decor.top-right { top: 14px; right: 14px; transform: scaleX(-1); }

.hero-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--sage-deep);
  margin: 0 0 20px;
}

.baby-photo {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--bg-2);
  box-shadow:
    0 0 0 6px #fff,
    0 0 0 8px var(--pink),
    0 12px 30px rgba(198, 149, 106, 0.2);
}
.baby-photo svg { display: block; width: 100%; height: 100%; }

.baby-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 44px;
  color: var(--text);
  margin: 8px 0 4px;
  letter-spacing: -1px;
  line-height: 1.1;
}
.baby-name-kr {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-soft);
  margin-left: 6px;
  letter-spacing: 0;
}

.hero-message {
  font-size: 15px;
  color: var(--text-soft);
  margin: 16px 0 24px;
  line-height: 1.8;
}
.hero-message strong { color: var(--text); font-weight: 700; }

.hero-date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid rgba(197, 149, 106, 0.25);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}
.hero-date .sep { color: var(--pink-deep); }

.hero-family {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.5px;
}

/* ---------- 정보 카드 ---------- */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: var(--bg-2);
  border-radius: var(--radius);
}

.info-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--pink-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.info-icon svg { width: 22px; height: 22px; }

.info-body { min-width: 0; }
.info-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--sage-deep);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.info-value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  line-height: 1.4;
}
.info-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* ---------- 오시는 길 ---------- */
.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(198, 149, 106, 0.1);
  margin-bottom: 22px;
  background: var(--bg-2);
}
.map-frame svg { display: block; width: 100%; height: auto; }

.transport {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.transport-item {
  padding: 16px 18px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--sage);
}
.transport-item:nth-child(2) { border-left-color: var(--pink); }
.transport-item:nth-child(3) { border-left-color: var(--peach); }

.transport-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.transport-item p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.7;
}
.transport-item strong {
  color: var(--text);
  font-weight: 700;
}

.map-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0 auto;
  width: fit-content;
}
.map-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ---------- RSVP 폼 ---------- */
.rsvp-sub {
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
  margin: -12px 0 28px;
}
.rsvp-sub strong { color: var(--pink-deep); font-weight: 700; }

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.5px;
}

.rsvp-form input[type="text"],
.rsvp-form textarea,
.rsvp-form input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(198, 149, 106, 0.2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 15px;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
}
.rsvp-form input:focus,
.rsvp-form textarea:focus {
  border-color: var(--pink-deep);
  background: #fff;
}
.rsvp-form textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* chip 그룹 (관계) */
.chip-group {
  display: flex;
  gap: 10px;
}
.chip {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.chip span {
  display: block;
  text-align: center;
  padding: 12px 10px;
  border: 1.5px solid rgba(198, 149, 106, 0.2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-soft);
  transition: all 0.2s ease;
}
.chip input:checked + span {
  background: var(--pink);
  border-color: var(--pink-deep);
  color: var(--text);
  font-weight: 700;
}

/* 인원 스텝퍼 */
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(198, 149, 106, 0.2);
  width: fit-content;
}
.step-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--pink-deep);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.step-btn:hover { background: var(--pink); transform: scale(1.05); }
.step-btn:active { transform: scale(0.95); }
.stepper input {
  width: 44px !important;
  text-align: center;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 17px !important;
  font-weight: 700;
  color: var(--text);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.step-suffix {
  padding-right: 10px;
  font-size: 13px;
  color: var(--text-soft);
}

/* 참석 토글 */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toggle {
  position: relative;
  cursor: pointer;
}
.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.toggle span {
  display: block;
  text-align: center;
  padding: 16px 12px;
  border: 1.5px solid rgba(198, 149, 106, 0.2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-soft);
  transition: all 0.2s ease;
}
.toggle.attend input:checked + span {
  background: linear-gradient(135deg, var(--sage) 0%, #A6C7A2 100%);
  border-color: var(--sage-deep);
  color: #fff;
}
.toggle.decline input:checked + span {
  background: linear-gradient(135deg, var(--peach) 0%, #F4C88A 100%);
  border-color: #E9B476;
  color: var(--text);
}

/* 제출 버튼 */
.submit-btn {
  margin-top: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(244, 176, 178, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(244, 176, 178, 0.5);
}
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.7; cursor: wait; }
.submit-heart { color: #fff; font-size: 18px; }

.form-feedback {
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--pink-deep);
  font-weight: 700;
}
.form-feedback.success { color: var(--sage-deep); }

/* ---------- 참석자 명단 ---------- */
.attend-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 20px 12px;
  background: linear-gradient(135deg, var(--bg-2) 0%, #FFEFDD 100%);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.stat { text-align: center; flex: 1; }
.stat-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}
.stat.divider {
  flex: 0 0 1px;
  height: 32px;
  background: rgba(198, 149, 106, 0.2);
  width: 1px;
  padding: 0;
}

.attendee-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attendee-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 13.5px;
  background: var(--bg-2);
  border-radius: var(--radius);
  line-height: 1.8;
}

.attendee-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--sage);
  animation: slideIn 0.4s ease both;
}
.attendee-item.declined { border-left-color: var(--peach); }

.attendee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.attendee-item.declined .attendee-avatar {
  background: linear-gradient(135deg, var(--peach) 0%, #F4C88A 100%);
}

.attendee-info { flex: 1; min-width: 0; }
.attendee-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.attendee-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.attendee-meta {
  font-size: 12px;
  color: var(--text-soft);
}
.attendee-message {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
  line-height: 1.5;
  word-break: break-word;
}

.attendee-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}
.attendee-badge.attend {
  background: rgba(185, 212, 181, 0.35);
  color: var(--sage-deep);
}
.attendee-badge.decline {
  background: rgba(251, 217, 180, 0.55);
  color: #B57C3A;
}

/* ---------- 푸터 ---------- */
.footer {
  text-align: center;
  padding: 20px;
  font-family: var(--serif);
  color: var(--text-soft);
}
.footer-heart {
  color: var(--pink-deep);
  font-size: 24px;
  margin-bottom: 8px;
  animation: pulseHeart 2s ease-in-out infinite;
}
.footer-lines {
  font-style: italic;
  font-size: 14px;
}
.footer-family {
  font-size: 16px;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: 3px;
  font-weight: 700;
}

/* ---------- 확인 모달 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(92, 74, 58, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  color: var(--text-soft);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease;
}
.modal-close:hover { background: var(--pink); color: var(--text); }

.modal-icon {
  font-size: 44px;
  margin-bottom: 12px;
  animation: bounceIn 0.5s ease both;
}
.modal-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  margin: 0 0 8px;
}
.modal-message {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 24px;
  line-height: 1.6;
}
.modal-btn {
  padding: 12px 32px;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 1px;
  transition: transform 0.15s ease;
}
.modal-btn:hover { transform: translateY(-1px); }

/* ---------- 하트 이펙트 ---------- */
.heart-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.heart-particle {
  position: absolute;
  font-size: 24px;
  color: var(--pink-deep);
  pointer-events: none;
  animation: floatUp 1.4s ease-out forwards;
  will-change: transform, opacity;
}

/* ---------- 애니메이션 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5) rotate(var(--r, 0deg));
  }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--x, 0px)), calc(0px - var(--y, 200px)))
      scale(1.2) rotate(var(--r, 0deg));
  }
}

/* ---------- 반응형 ---------- */
@media (max-width: 380px) {
  body { padding: 16px 10px 30px; }
  .hero, .info-card, .directions, .rsvp, .attendees {
    padding: 32px 20px;
  }
  .baby-name { font-size: 38px; }
  .baby-photo { width: 150px; height: 150px; }
  .hero-date { font-size: 16px; letter-spacing: 2px; padding: 10px 18px; }
  .section-title { font-size: 20px; }
  .info-row { padding: 14px; gap: 12px; }
  .attend-stats { padding: 16px 8px; }
  .stat-num { font-size: 24px; }
}

@media (min-width: 720px) {
  .page { max-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
