:root {
  color-scheme: light;
  --page: #efe8d8;
  --paper: #fffefa;
  --paper-soft: #f8f8f3;
  --sage: #a7ba83;
  --sage-dark: #6f835d;
  --line: #e5e3dc;
  --ink: #42453f;
  --muted: #8b8d86;
  --warm: #bd9463;
  --shadow: 0 18px 45px rgba(69, 80, 58, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.invite {
  position: relative;
  width: min(100%, 448px);
  min-height: 100vh;
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  min-height: auto;
  padding: max(50px, env(safe-area-inset-top) + 34px) 22px max(70px, env(safe-area-inset-bottom) + 58px);
  color: #4f554d;
  background: linear-gradient(#fffefa, #fbfbf7);
  isolation: isolate;
  overflow: hidden;
}

.hero__date {
  position: relative;
  z-index: 3;
  text-align: center;
}

.hero__date p {
  margin: 0;
  color: #55614c;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(31px, 7.6vw, 38px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.hero__date span {
  display: block;
  margin-top: 10px;
  color: #72865c;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 3px;
}

.hero__photo {
  position: relative;
  z-index: 1;
  width: min(100%, 306px);
  margin: clamp(34px, 5.6svh, 48px) auto clamp(33px, 4.9svh, 45px);
  aspect-ratio: 0.73 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f6ef;
  box-shadow: 0 10px 24px rgba(91, 106, 77, 0.08);
}

.hero__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 44%;
  filter: saturate(0.88) contrast(0.98);
}

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
}

.hero h1 {
  margin: 0;
  color: #4d514a;
  font-size: clamp(19px, 5vw, 23px);
  font-weight: 500;
  line-height: 1.35;
}

.hero h1 span {
  margin: 0 12px;
  color: #a2a79e;
  font-weight: 300;
}

.hero__event {
  width: min(100%, 340px);
  margin: 30px auto 0;
  padding: 0 8px;
}

.hero__event p {
  margin: 8px 0;
  color: #6f736b;
  font-size: 16px;
  line-height: 1.55;
}

.music-toggle {
  position: absolute;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top) + 12px);
  right: 17px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 246, 239, 0.86);
  color: #72865c;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(70, 77, 66, 0.08);
}

.music-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 18px;
}

.music-bars::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 9px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 25%, 38% 25%, 100% 0, 100% 100%, 38% 75%, 0 75%);
}

.music-bars::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  opacity: 0.82;
}

.music-bars b {
  display: block;
  width: 0;
  height: 0;
  overflow: hidden;
}

.music-toggle[aria-pressed="true"] .music-bars::after {
  animation: sound-wave 1.1s ease-in-out infinite;
}

@keyframes sound-wave {
  0%, 100% { opacity: 0.42; transform: scaleX(0.78); }
  50% { opacity: 0.95; transform: scaleX(1); }
}

.petals {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.petals i {
  position: absolute;
  top: -6%;
  width: 8px;
  height: 13px;
  border-radius: 90% 12% 90% 12%;
  background: rgba(167, 186, 131, 0.24);
  box-shadow: 0 0 10px rgba(255, 255, 250, 0.72);
  animation: petal 11s linear infinite;
}

.petals i:nth-child(1) { left: 8%; animation-delay: 0s; }
.petals i:nth-child(2) { left: 18%; animation-delay: 4s; animation-duration: 13s; }
.petals i:nth-child(3) { left: 36%; animation-delay: 1.8s; animation-duration: 12s; }
.petals i:nth-child(4) { left: 50%; animation-delay: 6s; animation-duration: 14s; }
.petals i:nth-child(5) { left: 66%; animation-delay: 2.8s; }
.petals i:nth-child(6) { left: 76%; animation-delay: 7.2s; animation-duration: 12.5s; }
.petals i:nth-child(7) { left: 88%; animation-delay: 3.4s; animation-duration: 13.5s; }
.petals i:nth-child(8) { left: 94%; animation-delay: 8s; animation-duration: 15s; }

@keyframes petal {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  8% { opacity: 1; }
  100% {
    transform: translate3d(-52px, 112vh, 0) rotate(280deg);
    opacity: 0.2;
  }
}

.section {
  position: relative;
  padding: 88px 32px;
  text-align: center;
}

.section + .section {
  border-top: 1px solid rgba(229, 227, 220, 0.68);
}

.section-label {
  margin: 0 0 16px;
  color: var(--sage-dark);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
}

.section h2 {
  margin: 0 0 13px;
  font-size: 18px;
  font-weight: 400;
  color: #62665e;
}

.section-subtitle {
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.intro {
  padding-top: 96px;
  background: linear-gradient(#fff9ef, #fffaf4);
}

.intro p {
  margin: 0 auto 22px;
  color: #6b655c;
}

.intro .poem {
  margin-bottom: 34px;
  color: #8c7865;
  font-size: 18px;
  line-height: 1.9;
}

.couple-line {
  margin-top: 34px !important;
  color: #4d514a !important;
  font-weight: 500;
}

.soft-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 43%;
  margin-top: 44px;
  border-radius: 8px;
  filter: saturate(0.88) contrast(0.98);
}

.calendar-section {
  min-height: 720px;
  padding-top: 96px;
  background: #f7f7f5;
}

.date-title {
  color: #777a74 !important;
  font-size: 15px !important;
}

.date-subtitle {
  margin: 0 auto 40px;
  color: #babdb6;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17px;
}

.calendar-month {
  margin: 0 auto 16px;
  color: #71835d;
  font-size: 16px;
  font-weight: 500;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px 9px;
  width: 100%;
  max-width: 338px;
  margin: 0 auto 48px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: #b7bbb4;
  font-size: 13px;
}

.calendar span,
.calendar time {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 30px;
}

.calendar .sun {
  color: #d8aaa0;
}

.calendar .wedding-day {
  width: 31px;
  height: 31px;
  margin: 0 auto;
  border-radius: 50%;
  background: #dce6cf;
  color: #71835d;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto 24px;
  max-width: 330px;
}

.countdown span {
  display: block;
  padding: 13px 4px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(70, 77, 66, 0.06);
}

.countdown strong {
  display: block;
  color: #83966b;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.countdown small {
  display: block;
  margin-top: 3px;
  color: #aaaea6;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
}

.d-day {
  margin: 0;
  color: #858980;
}

.d-day span {
  color: #71835d;
}

.d-day i {
  margin: 0 4px;
  color: #a8b98b;
  font-style: normal;
}

.d-day b {
  color: #71835d;
  font-weight: 500;
}

.family-section {
  background: var(--paper);
}

.family-line {
  margin: 0 auto 30px;
}

.family-line p {
  margin: 0 0 8px;
  color: #797d75;
}

.family-line i {
  margin: 0 8px;
  color: #c2c5be;
  font-style: normal;
}

.family-line strong {
  margin-right: 4px;
  color: #55614c;
  font-size: 23px;
  font-weight: 500;
}

.family-line em {
  color: #a2a79e;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: normal;
  font-size: 20px;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  max-width: 100%;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: #f4f6ef;
  color: #69745e;
  box-shadow: 0 10px 24px rgba(70, 77, 66, 0.1);
}

.gift-section {
  padding-top: 72px;
  background: #fffefa;
  color: #22241f;
}

.script-label {
  margin: 0 0 24px;
  color: #6f8c60;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1px;
}

.gift-section h2 {
  margin-bottom: 0;
  color: #151713;
  font-size: 20px;
  font-weight: 600;
}

.gift-section h2::after {
  content: "";
  display: block;
  width: 100%;
  margin: 32px 0 40px;
  border-top: 1px dashed #d8e1cf;
}

.gift-message {
  margin: 0 auto 42px;
  color: #20221f;
  font-size: 16px;
  line-height: 1.9;
}

.gift-groups {
  display: grid;
  gap: 10px;
}

.gift-group {
  overflow: hidden;
  border: 1px solid #dfe5da;
  border-radius: 6px;
  background: #f8faf6;
  text-align: left;
}

.gift-group summary {
  position: relative;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 44px;
  color: #1f231d;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.gift-group summary::-webkit-details-marker {
  display: none;
}

.gift-group summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #6f8c60;
  border-bottom: 1.5px solid #6f8c60;
  transform: translateY(-65%) rotate(45deg);
}

.gift-group[open] summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.gift-list {
  border-top: 1px solid #e5ebe1;
}

.gift-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px 15px;
}

.gift-row + .gift-row {
  border-top: 1px dashed #dfe5da;
}

.gift-row p {
  min-width: 0;
  margin: 0;
  color: #171916;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.55;
}

.gift-row strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.gift-row span {
  display: block;
  overflow-wrap: anywhere;
}

.gift-actions {
  display: grid;
  gap: 7px;
}

.gift-actions button {
  width: 72px;
  height: 32px;
  border-radius: 8px;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 13px;
  line-height: 1;
}

.pay-button {
  position: relative;
  border: 0;
  background: #ffdc00;
  color: #12120f;
  font-weight: 700;
  padding-left: 19px;
}

.pay-button::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 8px;
  border-radius: 50%;
  background: #191a17;
  transform: translateY(-50%);
}

.pay-button::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  border-top: 4px solid #191a17;
  border-right: 4px solid transparent;
}

.copy-button {
  position: relative;
  border: 1px solid #e2e6dd;
  background: #fff;
  color: #22241f;
  padding-left: 23px;
}

.copy-button::before,
.copy-button::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 9px;
  border: 1px solid #676b64;
  border-radius: 1px;
}

.copy-button::before {
  left: 15px;
  top: 10px;
  background: #fff;
}

.copy-button::after {
  left: 18px;
  top: 13px;
  background: #fff;
}

.gallery-section {
  padding-left: 0;
  padding-right: 0;
  background: var(--paper);
}

.gallery-section .section-subtitle {
  margin-bottom: 42px;
  padding: 0 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
}

.gallery-grid button {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.84) brightness(1.05);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.gallery-grid button:active img {
  transform: scale(1.04);
  opacity: 0.82;
}

.location-section {
  background: #fbfbf7;
}

.address-copy {
  margin: 4px auto 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e625b;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef2e8;
}

.map-frame .root_daum_roughmap {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0 !important;
  width: 100% !important;
  height: 100%;
  background: transparent;
}

.map-frame .root_daum_roughmap .wrap_map,
.map-frame .root_daum_roughmap .map {
  width: 100% !important;
  height: 100% !important;
}

.map-frame .root_daum_roughmap > .wrap_controllers,
.map-frame .root_daum_roughmap > .cont {
  display: none !important;
}

.kakao-static-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  background: #eef2e8;
}

.root_daum_roughmap:not(:empty) ~ .kakao-static-map {
  display: none;
}

.kakao-static-map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kakao-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #2d8cff;
  box-shadow: 0 2px 7px rgba(24, 73, 132, 0.32);
  transform: translate(-50%, -76%) rotate(-45deg);
}

.kakao-map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.kakao-map-open {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px 0 27px;
  border-radius: 4px;
  background: rgba(45, 52, 45, 0.84);
  color: #fff;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 7px rgba(27, 33, 27, 0.18);
}

.kakao-map-open::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50% 50% 50% 0;
  background: #ffec3d;
  transform: translateY(-58%) rotate(-45deg);
}

.kakao-map-open::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(45, 52, 45, 0.84);
  transform: translateY(-62%);
}

.map-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 34px;
}

.map-actions a {
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #dfe4d6;
  background: #fff;
  color: #69745e;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(70, 77, 66, 0.06);
}

.route-list {
  display: grid;
  gap: 14px;
  text-align: left;
}

.route-list article {
  padding: 19px 18px 18px;
  border-top: 1px solid var(--line);
}

.route-list h3 {
  margin: 0 0 7px;
  color: #72865c;
  font-size: 15px;
  font-weight: 500;
}

.route-list p {
  margin: 0 0 10px;
  color: #6f736b;
  line-height: 1.7;
}

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

.info-section {
  background: #f8f8f3;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.notice-card {
  margin: 28px auto 0;
  padding: 28px 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 9px 20px rgba(70, 77, 66, 0.07);
}

.notice-card span {
  color: #788a63;
  font-size: 16px;
}

.notice-card p {
  margin: 16px 0 0;
  color: #6f736b;
}

.modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background: rgba(35, 39, 33, 0.44);
  display: grid;
  place-items: center;
}

.modal[hidden],
.lightbox[hidden] {
  display: none;
}

.modal__panel {
  position: relative;
  width: min(100%, 390px);
  max-height: min(760px, calc(100svh - 44px));
  overflow: auto;
  padding: 34px 24px 28px;
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal__panel h2 {
  margin: 0 0 24px;
  color: #586050;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
}

.modal__subtitle {
  margin: -10px 0 22px;
  color: #858b80;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

.modal__close,
.lightbox button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #53584f;
  font-size: 26px;
  line-height: 1;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.contact-list a,
.contact-placeholder {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 2px 10px;
  min-width: 0;
  padding: 15px 14px;
  border-radius: 8px;
  background: #f7f8f2;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.contact-list span {
  grid-row: span 2;
  color: #849372;
  font-size: 13px;
}

.contact-list strong {
  min-width: 0;
  color: #4f554d;
  font-weight: 500;
}

.contact-list em {
  min-width: 0;
  color: #8b8f86;
  font-style: normal;
  font-size: 13px;
}

.lightbox {
  background: rgba(20, 22, 19, 0.78);
}

.lightbox img {
  display: block;
  width: auto;
  max-width: min(100%, 430px);
  max-height: calc(100svh - 84px);
  border-radius: 8px;
  object-fit: contain;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(360px, calc(100vw - 34px));
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(45, 49, 43, 0.88);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

#youtube-player {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 374px) {
  body {
    font-size: 14px;
  }

  .section {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero {
    min-height: 620px;
  }

  .hero__content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section-label {
    font-size: 32px;
  }

  .calendar {
    gap: 13px 6px;
  }

  .countdown {
    gap: 6px;
  }

  .countdown strong {
    font-size: 24px;
  }

  .contact-list a,
  .contact-placeholder {
    grid-template-columns: 84px 1fr;
  }
}

@media (max-height: 820px) {
  .hero {
    padding-top: max(34px, env(safe-area-inset-top) + 24px);
    padding-bottom: max(44px, env(safe-area-inset-bottom) + 34px);
  }

  .hero__date span {
    margin-top: 8px;
  }

  .hero__photo {
    margin: 28px auto 27px;
    aspect-ratio: 0.8 / 1;
  }

  .hero__event {
    margin-top: 20px;
  }

  .hero__event p {
    margin: 5px 0;
    font-size: 15px;
  }
}

@media (min-width: 449px) {
  body {
    padding: 0 0 40px;
  }

  .invite {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
