:root {
  --color-primary: #F7F3EE;
  --color-secondary: #AEB8A3;
  --color-accent: #B8A47E;
  --color-accent-strong: #6f613f;
  --color-bg: #F7F3EE;
  --color-text: #3A3632;
  --color-muted: #8B837A;
  --color-muted-readable: #6f6961;
  --color-surface: #FFFFFF;
  --color-line: rgba(184, 164, 126, 0.3);
  --color-shadow: rgba(58, 54, 50, 0.1);

  --font-ko-serif: "Noto Serif KR", serif;
  --font-en-serif: "Cormorant Garamond", "Times New Roman", serif;

  --max-w: 480px;
  --side-pad: 28px;
  --section-gap: 72px;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-soft-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 160ms;
  --dur-base: 400ms;
  --dur-reveal: 700ms;
  --dur-reveal-long: 800ms;
  --dur-bg-loop: 48s;
  --stagger-tight: 80ms;
  --stagger-base: 120ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: #ebe5dc;
  color: var(--color-text);
  font-family: var(--font-ko-serif);
  font-size: 16px;
  line-height: 1.85;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(184, 164, 126, 0.14), transparent 34%),
    radial-gradient(circle at 86% 76%, rgba(174, 184, 163, 0.1), transparent 36%);
  opacity: 0.45;
  transform: translate3d(-2%, -1%, 0) scale(1.02);
  animation: lightLeakDrift var(--dur-bg-loop) ease-in-out infinite alternate;
}

body::after {
  z-index: 30;
  opacity: 0.035;
  background-image:
    radial-gradient(circle at 16px 20px, rgba(58, 54, 50, 0.42) 0 0.65px, transparent 0.75px),
    radial-gradient(circle at 74px 58px, rgba(58, 54, 50, 0.32) 0 0.55px, transparent 0.7px),
    radial-gradient(circle at 112px 92px, rgba(58, 54, 50, 0.24) 0 0.5px, transparent 0.65px);
  background-size: 140px 140px;
  mix-blend-mode: multiply;
  animation: grainShift 7s steps(2, end) infinite;
}

@keyframes lightLeakDrift {
  to {
    opacity: 0.65;
    transform: translate3d(2%, 1%, 0) scale(1.04);
  }
}

@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-2%, 1%, 0); }
  100% { transform: translate3d(1%, -2%, 0); }
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

p,
li {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border: 1px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  transform: none;
}

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

.page {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-w));
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: 0 0 60px var(--color-shadow);
}

.en {
  font-family: var(--font-en-serif);
  font-style: italic;
}

.section,
.footer {
  position: relative;
  padding: var(--section-gap) var(--side-pad);
  text-align: center;
}

.section::before,
.footer::before {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin: 0 auto 34px;
  background: var(--color-line);
}

.section-eyebrow {
  margin: 0 0 10px;
  color: var(--color-accent-strong);
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  color: var(--color-text);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.section-note,
.gallery-intro,
.share-intro,
.guestbook-intro,
.information-note {
  margin: 0 auto;
  max-width: 300px;
  color: var(--color-muted-readable);
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
}

[data-reveal] .motion-item {
  opacity: 1;
  transform: none;
}

[data-reveal].is-visible .motion-item {
  animation: revealIn var(--dur-reveal) var(--ease-soft-out) both;
  animation-delay: calc(var(--i, 0) * var(--stagger-base));
}

html.screenshot-mode {
  scroll-behavior: auto;
}

html.screenshot-mode [data-reveal],
html.screenshot-mode [data-reveal] .motion-item,
html.screenshot-mode [data-hero-step],
html.screenshot-mode .hero-media img,
html.screenshot-mode .gallery-open img {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  position: relative;
  display: flex;
  min-height: 94svh;
  flex-direction: column;
  background: var(--color-bg);
}

.hero-media {
  height: 52svh;
  min-height: 400px;
  max-height: 620px;
  overflow: hidden;
  background: #eee8df;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 900ms var(--ease-soft-out),
    transform 900ms var(--ease-soft-out);
}

.hero.is-loaded .hero-media img {
  opacity: 1;
  transform: none;
}

.hero-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 26px var(--side-pad) calc(30px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

[data-hero-step] {
  opacity: 1;
  transform: translateY(14px);
  transition:
    opacity var(--dur-reveal-long) var(--ease-soft-out),
    transform var(--dur-reveal-long) var(--ease-soft-out);
}

.hero.is-loaded [data-hero-step] {
  opacity: 1;
  transform: none;
}

.hero.is-loaded [data-hero-step="1"] { transition-delay: 120ms; }
.hero.is-loaded [data-hero-step="2"] { transition-delay: 260ms; }
.hero.is-loaded [data-hero-step="3"] { transition-delay: 340ms; }
.hero.is-loaded [data-hero-step="4"] { transition-delay: 440ms; }
.hero.is-loaded [data-hero-step="5"] { transition-delay: 520ms; }

.hero-eyebrow {
  margin: 0 0 12px;
  color: var(--color-accent-strong);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.hero-names {
  margin: 0;
  color: var(--color-text);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.hero-headline {
  margin: 14px 0 0;
  color: var(--color-text);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.hero-date,
.hero-caption {
  margin: 0;
  color: var(--color-muted-readable);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.hero-date {
  margin-top: 22px;
}

.hero-caption {
  margin-top: 18px;
  color: var(--color-accent-strong);
}

.music-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: max(12px, calc((100vw - var(--max-w)) / 2 + 12px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(184, 164, 126, 0.46);
  border-radius: 50%;
  background: rgba(247, 243, 238, 0.82);
  color: var(--color-text);
  box-shadow: 0 8px 22px rgba(58, 54, 50, 0.08);
  transition:
    transform var(--dur-fast) var(--ease-standard),
    background var(--dur-fast) var(--ease-standard);
}

.music-toggle:active {
  transform: scale(0.98);
}

.music-eq {
  display: none;
  align-items: end;
  gap: 3px;
  height: 14px;
}

.music-eq i {
  width: 2px;
  border-radius: 999px;
  background: var(--color-accent);
  transform-origin: bottom;
  animation: equalizer 900ms ease-in-out infinite;
}

.music-eq i:nth-child(1) { height: 4px; animation-delay: 0ms; }
.music-eq i:nth-child(2) { height: 10px; animation-delay: 140ms; }
.music-eq i:nth-child(3) { height: 6px; animation-delay: 280ms; }

.music-toggle[aria-pressed="true"] .music-note {
  display: none;
}

.music-toggle[aria-pressed="true"] .music-eq {
  display: inline-flex;
}

@keyframes equalizer {
  0%, 100% { transform: scaleY(0.55); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; }
}

.greeting-copy {
  display: grid;
  gap: 28px;
  max-width: 300px;
  margin: 0 auto;
}

.greeting {
  padding-top: 56px;
}

.greeting-copy p {
  margin: 0;
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 2.1;
}

.couple-name-display {
  margin: 24px 0 30px;
  color: var(--color-accent-strong);
  font-family: var(--font-en-serif);
  font-size: 27px;
  font-style: italic;
  letter-spacing: 0.1em;
}

.couple-list {
  display: grid;
  gap: 14px;
  max-width: 300px;
  margin: 0 auto 30px;
  padding: 24px 0;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.couple-line {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.05em;
}

.gallery-intro {
  margin-top: 24px;
  margin-bottom: 30px;
}

.gallery-stage {
  position: relative;
  max-width: 342px;
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  touch-action: pan-y;
}

.gallery-track {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateX(0);
  transition: transform 280ms var(--ease-standard);
  will-change: transform;
}

.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.gallery-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.01);
  transition:
    opacity var(--dur-reveal-long) var(--ease-soft-out),
    transform var(--dur-reveal-long) var(--ease-soft-out);
}

.gallery-section.is-visible .gallery-open img {
  transform: none;
}

.gallery-nav,
.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 164, 126, 0.34);
  border-radius: 50%;
  background: rgba(247, 243, 238, 0.88);
  color: var(--color-text);
  transition:
    transform var(--dur-fast) var(--ease-standard),
    opacity var(--dur-fast) var(--ease-standard),
    background var(--dur-fast) var(--ease-standard);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  opacity: 0.84;
}

.gallery-prev { left: 9px; }
.gallery-next { right: 9px; }

.gallery-nav:active {
  transform: translateY(-50%) scale(0.98);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
}

.gallery-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.gallery-dot::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(139, 131, 122, 0.38);
  transition:
    width 220ms var(--ease-standard),
    background 220ms var(--ease-standard);
}

.gallery-dot[aria-selected="true"]::before {
  width: 18px;
  background: var(--color-accent);
}

.information-note {
  margin-top: 28px;
  color: var(--color-text);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.guestbook-intro {
  margin-top: 24px;
  margin-bottom: 0;
}

.guestbook-action {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 17px;
  border: 1px solid rgba(184, 164, 126, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--color-text);
  font-size: 14px;
  letter-spacing: 0.03em;
  line-height: 1.35;
  transition:
    transform 120ms var(--ease-standard),
    background var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-text);
}

.btn:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .btn:hover,
  .gallery-nav:hover,
  .lightbox-close:hover,
  .lightbox-nav:hover,
  .music-toggle:hover {
    background: rgba(255, 255, 255, 0.62);
  }

  .btn-primary:hover {
    background: #aa956f;
  }
}

:focus-visible {
  outline: 2px solid rgba(184, 164, 126, 0.9);
  outline-offset: 3px;
}

.hero-copy p,
.section p,
.footer p {
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.share-intro {
  margin-top: 24px;
  margin-bottom: 28px;
}

.footer {
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}

.footer-names {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.12em;
}

.footer-date {
  margin: 12px 0 24px;
  color: var(--color-accent-strong);
  font-family: var(--font-en-serif);
  font-size: 20px;
  font-style: italic;
}

.footer-copy,
.footer-closing {
  margin: 0;
  color: var(--color-muted-readable);
  font-size: 14px;
  line-height: 1.9;
}

.footer-copy {
  margin-bottom: 6px;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 58px 18px;
  background: rgba(26, 24, 22, 0.92);
  opacity: 0;
  transition: opacity 180ms ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 8px;
  object-fit: contain;
  touch-action: none;
  transform-origin: center center;
  transition: transform 180ms var(--ease-standard);
}

.lightbox.is-zooming .lightbox-img {
  transition: none;
}

.lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: 44px;
  height: 44px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.98);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 90;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(58, 54, 50, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

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

@media (max-width: 360px) {
  :root {
    --side-pad: 22px;
  }

  .hero-names {
    font-size: 28px;
  }

  .section,
  .footer {
    padding-left: var(--side-pad);
    padding-right: var(--side-pad);
  }

  .btn {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .page {
    border-radius: 8px;
  }
}

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

  body::before {
    opacity: 0.45;
    transform: translate3d(-2%, -1%, 0) scale(1.02);
    animation: none !important;
  }

  body::after {
    animation: none !important;
  }

  [data-reveal] .motion-item,
  [data-hero-step],
  .hero-media img,
  .gallery-open img {
    transform: none !important;
    animation: none !important;
    transition-property: opacity !important;
  }

  .gallery-track {
    transition: opacity 160ms ease !important;
  }

  .btn:active,
  .music-toggle:active,
  .gallery-nav:active,
  .lightbox-nav:active {
    transform: none !important;
  }

  .music-eq i {
    animation: none !important;
    opacity: 0.85;
  }

  .toast {
    transform: translate(-50%, 0);
  }
}
