:root {
  --paper: #f5efe4;
  --paper-deep: #e9decd;
  --ink: #3c2d26;
  --muted: #8b786b;
  --burgundy: #702f3b;
  --brass: #a9865b;
  --shadow: rgba(60, 45, 38, .16);
  --serif: "Noto Serif KR", Georgia, serif;
  --display: "Cormorant Garamond", "Noto Serif KR", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #ded2c0; }
body { margin: 0; min-width: 320px; color: var(--ink); font-family: var(--serif); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.paper-grain { position: fixed; inset: 0; pointer-events: none; opacity: .28; z-index: 100; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }

.opening { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; min-height: 100svh; padding: 24px; overflow: hidden; background: radial-gradient(circle at 50% 42%, #fbf7ee 0, var(--paper) 48%, #eadfce 100%); }
.opening[hidden], .opening.is-finished { display: none !important; visibility: hidden !important; pointer-events: none !important; }
.opening::after { content: ""; position: absolute; width: min(88vw, 440px); height: 100px; left: 50%; top: calc(50% + 130px); transform: translateX(-50%); border-radius: 50%; background: rgba(67, 42, 31, .12); filter: blur(28px); }
.opening-whisper { position: absolute; top: max(42px, env(safe-area-inset-top)); margin: 0; color: var(--muted); font: italic 17px/1 var(--display); letter-spacing: .12em; }
.opening-guide { position: absolute; bottom: max(52px, calc(env(safe-area-inset-bottom) + 24px)); margin: 0; color: #79685d; font-size: 12px; letter-spacing: .16em; animation: breathe 2.4s ease-in-out infinite; }

.envelope { position: relative; width: min(82vw, 390px); aspect-ratio: 1.48; padding: 0; border: 0; background: transparent; perspective: 1000px; cursor: pointer; filter: drop-shadow(0 24px 24px rgba(54, 34, 22, .18)); }
.envelope:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 12px; border-radius: 4px; }
.envelope-back, .envelope-pocket, .envelope-flap { position: absolute; inset: 0; display: block; }
.envelope-back { background: linear-gradient(145deg, #e9dcc8, #d9c7ae); border: 1px solid rgba(90, 65, 48, .15); border-radius: 4px; }
.envelope-pocket { z-index: 4; overflow: hidden; border-radius: 0 0 4px 4px; background: linear-gradient(155deg, transparent 49.5%, #ddcbb2 50%) left/50.2% 100% no-repeat, linear-gradient(205deg, transparent 49.5%, #e4d4bd 50%) right/50.2% 100% no-repeat, linear-gradient(to top, #d7c3a8 0 51%, transparent 51%); }
.envelope-flap { z-index: 5; height: 61%; transform-origin: top center; background: linear-gradient(150deg, #eadcc7, #d7c3a8); clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; }
.letter-preview { position: absolute; z-index: 2; left: 7%; right: 7%; bottom: 4%; height: 88%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fbf7ee; border: 1px solid rgba(94, 69, 52, .12); box-shadow: 0 3px 10px rgba(65, 45, 30, .08); }
.preview-mark { color: var(--burgundy); font: 500 34px/1 var(--display); letter-spacing: .12em; }
.preview-mark i { color: var(--brass); font-weight: 400; }
.preview-date { margin-top: 12px; color: var(--muted); font: 10px/1 var(--serif); letter-spacing: .22em; }
.wax-seal { position: absolute; z-index: 7; left: 50%; top: 49%; width: 68px; height: 68px; display: grid; place-items: center; transform: translate(-50%, -50%); border-radius: 46% 54% 48% 52%; color: #dbc1a6; background: radial-gradient(circle at 36% 31%, #9a5360, var(--burgundy) 48%, #55222c); box-shadow: 0 5px 10px rgba(70, 22, 32, .25), inset 0 0 0 5px rgba(74, 24, 35, .15), inset 0 0 0 7px rgba(232, 199, 168, .18); }
.wax-seal::before, .wax-seal::after { content: ""; position: absolute; inset: -3px; border: 1px solid rgba(84, 30, 39, .45); border-radius: 52% 45% 55% 48%; }
.wax-seal::after { inset: 9px; border-color: rgba(232, 199, 168, .28); }
.wax-seal span { font-size: 20px; }

.letter { position: relative; z-index: 2; width: min(100%, 520px); min-height: 100vh; margin: 0 auto; overflow: hidden; pointer-events: auto; background: #f9f4ea; box-shadow: 0 0 55px rgba(60, 45, 38, .12); opacity: 0; visibility: hidden; transform-origin: top center; }
.letter-edge { position: absolute; inset: 0; pointer-events: none; border-left: 1px solid rgba(90, 64, 46, .08); border-right: 1px solid rgba(90, 64, 46, .08); }
.letter section { position: relative; padding: 112px 34px; text-align: center; }
.section-number { margin: 0 0 30px; color: var(--brass); font: 500 11px/1 var(--display); letter-spacing: .28em; }
.letter h2 { margin: 0; font-size: clamp(25px, 7vw, 34px); font-weight: 400; line-height: 1.65; letter-spacing: -.04em; }
.eyebrow { margin: 0 0 46px; color: var(--muted); font-size: 12px; letter-spacing: .18em; }

.hero { display: flex; flex-direction: column; justify-content: center; min-height: 100svh; background: radial-gradient(circle at 50% 36%, #fffdf7, transparent 55%); }
.hero h1 { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0; font-size: clamp(30px, 9vw, 43px); font-weight: 400; letter-spacing: .05em; }
.hero h1 i { color: var(--burgundy); font: italic 400 37px/1 var(--display); }
.hero-date { margin: 26px 0 0; color: var(--muted); font: 400 15px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.fine-rule { display: flex; align-items: center; justify-content: center; height: 80px; margin-top: 50px; }
.fine-rule::before, .fine-rule::after { content: ""; width: 54px; height: 1px; background: #cdbda8; }
.fine-rule span { width: 5px; height: 5px; margin: 0 13px; transform: rotate(45deg); background: var(--burgundy); }

.invitation { background: #f4ecdf; }
.invitation::before { content: "“"; display: block; height: 45px; margin-bottom: 28px; color: rgba(112, 47, 59, .28); font: 70px/1 var(--display); }
.invitation-copy { margin: 42px 0 0; color: #594941; font-size: 14px; font-weight: 300; line-height: 2.25; word-break: keep-all; }
.signature { margin: 55px 0 0; font-size: 15px; letter-spacing: .08em; }
.signature i { margin: 0 9px; color: var(--muted); font-size: 10px; font-style: normal; }

.portrait { padding: 72px 24px 86px !important; }
.photo-frame { position: relative; aspect-ratio: 4/5; overflow: hidden; background: linear-gradient(145deg, #c9b8a4, #766357); }
.photo-frame::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.48); pointer-events: none; }
.photo-frame img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.78) sepia(.1); }
.photo-fallback { position: absolute; inset: 0; display: none; flex-wrap: wrap; align-content: center; justify-content: center; gap: 14px; color: rgba(255,255,255,.88); background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.16), transparent 48%); font: 400 64px/1 var(--display); }
.photo-fallback i { color: #d8b68e; font-size: 42px; }
.photo-fallback small { flex-basis: 100%; margin-top: 20px; font: 10px/1 var(--serif); letter-spacing: .32em; }
.caption { margin: 22px 0 0; color: var(--muted); font: italic 15px/1.4 var(--display); letter-spacing: .04em; }

.date-section { color: #f5ebdd; background: var(--burgundy); }
.date-section .section-number, .date-kicker { color: #d5b99b; }
.date-kicker { margin: 0 0 28px; font: 12px/1 var(--display); letter-spacing: .28em; }
.big-date { display: grid; justify-content: center; }
.big-date span { font: 400 17px/1 var(--display); letter-spacing: .42em; transform: translateX(.21em); }
.big-date strong { margin: 10px 0 8px; font: 400 clamp(63px, 19vw, 92px)/.85 var(--display); letter-spacing: -.06em; }
.big-date em { color: #d5b99b; font: 400 14px/1 var(--display); letter-spacing: .4em; transform: translateX(.2em); }
.date-note { margin: 45px 0 0; color: #e4d4c6; font-size: 13px; letter-spacing: .04em; }

.event-list { max-width: 360px; margin: 48px auto 0; border-top: 1px solid #d8cab7; }
.event-list div { display: grid; grid-template-columns: 72px 1fr; padding: 20px 4px; border-bottom: 1px solid #d8cab7; text-align: left; }
.event-list dt { color: var(--muted); font-size: 12px; }
.event-list dd { margin: 0; font-size: 14px; }

.location { background: #eee4d5; }
.location .venue { margin: 42px 0 8px; font-size: 17px; font-weight: 600; }
.address { margin: 0; color: var(--muted); font-size: 13px; }
.outline-button { position: relative; z-index: 2; width: min(100%, 300px); min-height: 54px; margin: 34px auto 0; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #9f8977; color: var(--ink); text-decoration: none; font-size: 13px; }
.outline-button span { color: var(--burgundy); }
.location-note { margin: 24px auto 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.contact > p:not(.section-number) { margin: 35px 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.contact-buttons { display: grid; gap: 10px; max-width: 340px; margin: 0 auto; }
.contact-buttons a { position: relative; z-index: 2; min-height: 58px; padding: 0 20px; display: flex; align-items: center; border: 1px solid #c6b6a3; color: var(--ink); text-decoration: none; font-size: 13px; }
.contact-buttons span { width: 48px; margin-right: 14px; padding-right: 14px; border-right: 1px solid #d8cab7; color: var(--burgundy); font-size: 11px; }
.contact-buttons b { margin-left: auto; color: var(--brass); font-weight: 400; }

.closing { display: flex; min-height: 92svh; flex-direction: column; justify-content: center; color: #f6ecdf; background: #3c2d26; }
.closing-mark { margin: 0 0 52px; color: #d1ad85; font: 38px/1 var(--display); letter-spacing: .14em; }
.closing-mark i { font-weight: 400; }
.closing > p:not(.closing-mark) { margin: 38px 0 0; color: #cdbfb2; font-size: 12px; line-height: 2; }
.replay { align-self: center; min-width: 150px; min-height: 48px; margin-top: 60px; display: grid; place-items: center; border: 1px solid rgba(238,220,201,.38); color: #eadbcb; background: transparent; font-size: 11px; letter-spacing: .12em; text-decoration: none; cursor: pointer; }

.music-control { position: fixed; z-index: 80; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px)); width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid rgba(74,53,44,.18); border-radius: 50%; color: var(--ink); background: rgba(249,244,234,.88); box-shadow: 0 8px 28px rgba(60,45,38,.13); backdrop-filter: blur(10px); cursor: pointer; opacity: 0; visibility: hidden; }
.music-bars { height: 13px; display: flex; align-items: end; gap: 2px; }
.music-bars i { width: 2px; height: 5px; background: var(--burgundy); }
.music-control.is-playing .music-bars i { animation: music 1s ease-in-out infinite alternate; }
.music-control.is-playing .music-bars i:nth-child(2) { animation-delay: -.4s; }
.music-control.is-playing .music-bars i:nth-child(3) { animation-delay: -.7s; }
.music-label { font: 8px/1 var(--display); letter-spacing: .15em; }

@keyframes breathe { 50% { opacity: .45; transform: translateY(3px); } }
@keyframes music { to { height: 13px; } }
@media (hover:hover) { .outline-button:hover, .contact-buttons a:hover, .replay:hover { border-color: var(--burgundy); } }
@media (max-width: 370px) { .letter section { padding-left: 25px; padding-right: 25px; } .envelope { width: 88vw; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
