:root {
  --ink: #322f2c;
  --muted: #77716c;
  --line: #e8e0d8;
  --paper: #fffdf9;
  --blush: #f4e8e2;
  --sage: #cbd8cf;
  --gold: #b89764;
  --shadow: 0 18px 50px rgba(48, 43, 38, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #e7e3dd;
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.opening {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: end center;
  color: white;
  text-align: center;
  isolation: isolate;
}

.opening img,
.closing img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opening__shade,
.closing::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.56));
}

.opening__content {
  position: relative;
  z-index: 2;
  justify-self: center;
  width: calc(100% - 48px);
  margin-bottom: 42px;
  padding: 28px 16px;
  border: 2px solid rgba(255, 255, 255, 0.56);
}

.eyebrow,
.script {
  margin: 0;
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  letter-spacing: 0;
}

.opening .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.opening h1 {
  margin: 16px 0 22px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 82px;
  line-height: 0.86;
  letter-spacing: 0;
}

.couple,
.venue {
  margin: 0;
  line-height: 1.8;
}

.couple span {
  color: rgba(255, 255, 255, 0.58);
  margin: 0 8px;
}

.section {
  padding: 72px 22px;
  text-align: center;
}

.section h2 {
  margin: 8px 0 28px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0;
}

.intro p {
  color: var(--muted);
  line-height: 2;
}

.parents {
  display: grid;
  gap: 10px;
  margin-top: 36px;
  color: var(--ink);
}

.parents p {
  margin: 0;
}

.parents span {
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
}

.about {
  background: #f8f2ee;
}

.profile {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 16px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border-radius: 8px;
  background: white;
  text-align: left;
  box-shadow: 0 10px 26px rgba(77, 64, 56, 0.08);
}

.profile--reverse {
  grid-template-columns: 1fr 42%;
  text-align: right;
}

.profile--reverse img {
  order: 2;
}

.profile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
}

.profile h3 {
  margin: 8px 0;
  font-size: 18px;
}

.profile p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.groom {
  background: var(--sage);
}

.bride {
  background: var(--blush);
}

.tags {
  color: var(--gold) !important;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin: 28px auto;
  max-width: 330px;
}

.calendar__month {
  grid-column: 1 / -1;
  padding-bottom: 12px;
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
}

.calendar__week,
.calendar__day {
  display: grid;
  place-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 14px;
}

.calendar__day.is-muted {
  color: #c8c0b8;
}

.calendar__day.is-wedding {
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 700;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.countdown div {
  padding: 13px 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.countdown span {
  color: var(--muted);
  font-size: 11px;
}

.count-message {
  margin-top: 18px;
  color: var(--muted);
}

.location {
  background: #f4f7f2;
}

.location h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.copy-btn,
.account button,
.guestbook button,
.closing button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.map-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 30px;
}

.map-actions a {
  padding: 10px 4px;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.info-list {
  text-align: left;
}

.info-list h4 {
  margin: 22px 0 6px;
  color: var(--gold);
}

.info-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.interview details {
  border-top: 1px solid var(--line);
  text-align: left;
}

.interview details:last-child {
  border-bottom: 1px solid var(--line);
}

.interview summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 500;
}

.interview details p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.8;
}

.middle-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.together strong {
  display: block;
  margin-top: 18px;
  color: var(--gold);
  font-size: 30px;
}

.gallery {
  background: #f8f2ee;
}

.photo-upload {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.photo-upload p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.photo-upload small {
  color: #aaa19a;
  font-size: 12px;
}

.photo-upload__button {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

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

.gallery-grid button {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-grid button:hover img {
  transform: scale(1.04);
}

.account p {
  color: var(--muted);
  line-height: 1.8;
}

.account-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: #f7f4ef;
  text-align: left;
}

.account-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.account button {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0 12px;
  text-align: left;
}

.guestbook {
  background: #f4f7f2;
}

.guestbook form {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.guestbook input,
.guestbook textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: white;
  color: var(--ink);
}

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

.guestbook form button {
  background: var(--ink);
  color: white;
}

.guest-list {
  display: grid;
  gap: 10px;
  text-align: left;
}

.guest-card {
  padding: 14px;
  border-radius: 8px;
  background: white;
}

.guest-card strong {
  display: block;
  margin-bottom: 6px;
}

.guest-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.guest-card time {
  display: block;
  margin-top: 8px;
  color: #aaa19a;
  font-size: 12px;
}

.closing {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: end center;
  color: white;
  text-align: center;
}

.closing div {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 24px 42px;
}

.closing p {
  margin: 0 0 24px;
  font-size: 20px;
  line-height: 1.8;
}

.closing button {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.9);
}

.closing small {
  display: block;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.75);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, 18px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(40, 36, 33, 0.92);
  color: white;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
}

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

dialog {
  width: min(92vw, 430px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

dialog img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateX(var(--drag-x, 0));
  opacity: 1;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
}

dialog img.is-dragging {
  cursor: grabbing;
  transition: none;
}

dialog img.is-returning {
  --drag-x: 0px;
}

dialog img.slide-out-left {
  transform: translateX(-42px);
  opacity: 0;
}

dialog img.slide-out-right {
  transform: translateX(42px);
  opacity: 0;
}

dialog img.slide-in-left {
  animation: gallery-slide-in-left 0.24s ease both;
}

dialog img.slide-in-right {
  animation: gallery-slide-in-right 0.24s ease both;
}

#closeDialog,
.gallery-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

#closeDialog span,
.gallery-nav span {
  display: block;
  line-height: 1;
}

#closeDialog {
  top: -46px;
  right: 0;
  font-size: 32px;
}

#closeDialog span {
  transform: translateY(-2px);
}

.gallery-nav {
  top: 50%;
  transform: translateY(-50%);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.32);
  font-size: 34px;
}

.gallery-nav--prev {
  left: 10px;
}

.gallery-nav--prev span {
  transform: translate(-1px, -2px);
}

.gallery-nav--next {
  right: 10px;
}

.gallery-nav--next span {
  transform: translate(1px, -2px);
}

.gallery-count {
  position: absolute;
  left: 50%;
  bottom: -38px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: white;
  font-size: 13px;
  backdrop-filter: blur(6px);
}

@media (min-width: 700px) {
  .phone-shell {
    margin-block: 28px;
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .section,
  .middle-photo,
  .closing {
    animation: fade-up 0.7s ease both;
    animation-timeline: view();
    animation-range: entry 0% cover 24%;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gallery-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-42px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gallery-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(42px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog img {
    transition: none;
  }

  dialog img.slide-in-left,
  dialog img.slide-in-right {
    animation: none;
  }
}
