@font-face {
  font-family: 'Jua';
  src: url('/fonts/jua-invitation.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #47302a;
  --wine: #883b45;
  --paper: #fff8e8;
  --paper-depth: #e9d7b6;
  --pink: #f0d8d0;
  --check: #ebccc5;
  --line: #b59770;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  color: var(--ink);
  font-family: system-ui, "Malgun Gothic", sans-serif;
  background-color: var(--pink);
  background-image: conic-gradient(var(--check) 25%, transparent 0 50%, var(--check) 0 75%, transparent 0);
  background-size: 36px 36px;
}
main {
  position: relative;
  width: min(100%, 510px);
  min-width: 0;
  text-align: center;
}
.stationery-cover, .mail-front {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 30px clamp(18px, 6vw, 49px) 21px;
  box-shadow: 0 4px 0 #dfcaa9, 0 20px 36px #62412926;
}
.stationery-cover::before, .mail-front::before {
  position: absolute;
  content: '';
  inset: 10px;
  pointer-events: none;
  border: 1px solid #bf9980;
  outline: 1px solid #e3ccb4;
  outline-offset: 3px;
}
.stationery-cover::after, .mail-front::after {
  content: '';
  position: absolute;
  right: 17px;
  bottom: 17px;
  left: 17px;
  height: 3px;
  pointer-events: none;
  background: repeating-linear-gradient(125deg, #986862 0 7px, transparent 7px 14px, #70836a 14px 21px, transparent 21px 28px);
  opacity: .48;
}
.pc-open-hint {
  display: none;
  position: absolute;
  inset: calc(100% + clamp(18px, 4.5svh, 44px)) 0 auto;
  margin: 0;
  color: rgb(255 255 255 / .86);
  font: 400 clamp(1.16rem, 4.5vw, 1.65rem)/1.25 "Jua", "Malgun Gothic", system-ui, sans-serif;
  text-shadow: 0 1px 2px #603638d9, 0 0 6px #603638a6;
  pointer-events: none;
}
.stationery-cover > .pc-open-hint {
  display: block;
  animation: pc-hint-pulse 2.15s ease-in-out 2;
}
@keyframes pc-hint-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
section { position: relative; }
.invite-face { display: grid; justify-items: center; }
.postage {
  position: relative;
  width: 88px;
  height: 69px;
  padding: 6px;
  margin: 0 20px 17px 0;
  justify-self: end;
  transform: rotate(6deg);
  border: 2px dotted #a9846c;
  background: var(--paper);
  box-shadow: 3px 4px 0 #a9606c28;
}
.postage img { display: block; width: 100%; height: 100%; object-fit: cover; }
#invite-title { overflow-wrap: anywhere; }
.postage::before {
  content: '';
  position: absolute;
  width: 35px;
  height: 20px;
  left: -26px;
  top: 14px;
  background: repeating-linear-gradient(0deg, transparent 0 4px, #925d52 5px 6px);
  opacity: .6;
  transform: rotate(-15deg);
}
h1 {
  margin: 0;
  font-family: "Jua", "Malgun Gothic", system-ui, sans-serif;
  font-size: clamp(1.9rem, 8vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  word-break: keep-all;
  outline: none;
}
.invite-face h1 { color: #71353a; }
p { margin: 11px 0 0; line-height: 1.62; word-break: keep-all; }
.invite-face > p { font-size: .95rem; }
.choices {
  position: relative;
  width: min(100%, 293px);
  height: 102px;
  margin-top: 8px;
  --button-top: 15px;
  --yes-w: 108px;
  --yes-h: 48px;
  --yes-font: 18px;
  --no-w: 96px;
  --no-h: 48px;
  --no-font: 17px;
}
button {
  font: inherit;
  font-weight: 750;
  border: 1px solid var(--wine);
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
}
button:focus-visible, input:focus-visible {
  outline: 3px solid #27516b;
  outline-offset: 3px;
}
.choice {
  position: absolute;
  top: var(--button-top);
  display: grid;
  place-items: center;
  padding: 0;
  transition: width .16s, height .16s, font-size .16s;
}
.yes {
  z-index: 9;
  left: 5px;
  width: var(--yes-w);
  height: var(--yes-h);
  font-size: var(--yes-font);
  color: var(--paper);
  background: var(--wine);
  box-shadow: 0 4px #64323a;
  transition: background-color .16s;
  transform: scale(var(--yes-growth, 1));
  transform-origin: left center;
}
.yes-expression { display: none; }
.yes.is-kicking { background: #963548; }
.yes.is-kicking .yes-expression, .yes.is-insisting .yes-expression {
  position: absolute;
  display: block;
  top: -13px;
  right: -11px;
  font-size: 22px;
  line-height: 1;
}
.yes.is-insisting {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 11;
  width: min(46vw, 150px);
  height: 62px;
  font-size: 24px;
  background: #963548;
  transform-origin: center;
  transform: translate(-50%, -50%) scale(var(--insist-growth, 1));
}
.quiet-decline { font-size: .85rem; position: relative; z-index: 12; }
main.is-sulking { animation: letter-sulk 850ms cubic-bezier(.42,0,.7,1) both; }
@keyframes letter-sulk { to { transform: translateY(min(55vh, 400px)) rotate(7deg); opacity: 0; } }
.sulk-message {
  position: fixed;
  z-index: 13;
  inset: 45% 12px auto;
  margin: 0;
  text-align: center;
  font: 400 clamp(2.35rem, 10vw, 4rem)/1.15 "Malgun Gothic", system-ui, sans-serif;
  color: var(--wine);
  animation: sulk-appear 350ms ease both;
}
@keyframes sulk-appear { from { opacity: 0; transform: translateY(12px); } }
#retry-invitation .primary, #resend-invitation .primary { margin-top: 21px; }
#retry-invitation h1, #resend-invitation h1 { font: 800 clamp(1.75rem, 6vw, 2.35rem)/1.22 "Malgun Gothic", system-ui, sans-serif; }
.retry-link { display: inline-block; font-size: .9rem; font-weight: 650; }
.share-status { overflow-wrap: anywhere; font-size: .85rem; }
.answer-mail-note { margin: .55rem 0 .15rem; font-size: .88rem; color: rgb(69 63 64 / .72); }
.reply-share { margin-top: 18px; border-top: 1px solid #d9c1a2; padding-top: 15px; }
.reply-share h2 { margin: 0 0 13px; font-size: 1rem; line-height: 1.4; word-break: keep-all; }
.reply-share .secondary { margin-top: 7px; font-size: .88rem; }
.creator-link { display: grid; place-items: center; margin-top: 17px; border-radius: 8px; text-decoration: none; font-weight: 750; }
.invite-message { white-space: pre-line; overflow-wrap: anywhere; }
#reply-copy-fallback { display: block; margin-top: 8px; text-align: left; font-size: .83rem; }
#reply-copy-text {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #aa6174;
  border-radius: 6px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.no {
  z-index: 10;
  right: 5px;
  width: var(--no-w);
  height: var(--no-h);
  font-size: var(--no-font);
  color: var(--wine);
  background: #fff9ee;
  box-shadow: 0 4px #dac3a4;
}
.no.is-fleeing { position: fixed; inset: 0 auto auto 0; transform: translate3d(var(--flee-x), var(--flee-y), 0); }
main.letter {
  padding: clamp(30px, 7vw, 51px) clamp(17px, 6vw, 45px);
  background: var(--paper);
  border: 1px solid #ba9c76;
  border-radius: 5px;
  box-shadow: 0 5px #e9d8b9, 0 10px #f1e1c6, 0 20px 29px #62412924;
}
main.letter::before {
  position: absolute;
  top: 10px;
  right: 12px;
  left: 12px;
  height: 5px;
  content: '';
  background: repeating-linear-gradient(125deg, #986862 0 7px, transparent 7px 14px, #70836a 14px 21px, transparent 21px 28px);
  opacity: .65;
}
.letter h1 { font-size: clamp(1.9rem, 7vw, 2.75rem); }
.step-count { margin: 0 0 9px; color: var(--wine); font-size: .875rem; font-weight: 750; }
.calendar {
  margin: 17px 0 0;
  padding: 8px 9px 5px;
  border: 1px solid #d9c1a2;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
}
.calendar-header { display: grid; grid-template-columns: 49px 1fr 49px; gap: 5px; align-items: center; margin-bottom: 6px; }
.calendar-header h2 { margin: 0; font-size: .98rem; line-height: 1.25; font-weight: 750; }
.calendar-nav { min-height: 33px; border: 0; background: transparent; color: var(--wine); font-size: .82rem; }
.calendar-nav:disabled { color: #8a796d; opacity: .55; cursor: default; }
.calendar-week, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.calendar-week { color: #705643; margin-bottom: 3px; font-size: .75rem; font-weight: 700; }
.calendar-day {
  display: grid;
  min-height: 35px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.calendar-day:enabled:hover { background: #f0d7cb; }
.calendar-day[aria-current="date"] { border-color: #ad786b; }
.calendar-day[aria-pressed="true"], .calendar-day[aria-pressed="true"]:hover {
  border-color: var(--wine);
  background: var(--wine);
  color: var(--paper);
}
.calendar-day:disabled { cursor: default; opacity: .49; }
#date-error { margin-top: 6px; text-align: left; font-size: .85rem; color: var(--wine); font-weight: 700; }
.fields { margin: 13px 0; text-align: left; }
.fields label { min-width: 0; font-size: .875rem; font-weight: 750; }
.fields input {
  display: block;
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin-top: 5px;
  padding: 6px 8px;
  border: 1px solid #aa6174;
  border-radius: 7px;
  background: #fffdfa;
  color: inherit;
  font: inherit;
}
.primary { width: 100%; min-height: 46px; padding: 8px 12px; background: var(--wine); color: var(--paper); }
.action-button { display: flex; align-items: center; justify-content: center; gap: 7px; padding-block: 5px; }
.action-button img { display: block; width: 35px; height: 35px; object-fit: contain; }
.secondary { margin-top: 12px; padding: 7px 12px; color: var(--ink); background: transparent; border-color: transparent; text-decoration: underline; }
.restart { margin-top: 23px; padding: 10px 16px; background: #f5dbe0; color: var(--ink); }
.drinks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 23px 0 22px; }
.drinks label {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 9px;
  min-height: 100px;
  padding: 3px 0 5px;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.25;
  word-break: keep-all;
}
.drinks img { display: block; width: min(100%, 109px); height: auto; aspect-ratio: 1; object-fit: contain; }
.drinks input:checked + img {
  filter: drop-shadow(2px 0 #ef7aab) drop-shadow(-2px 0 #ef7aab)
    drop-shadow(0 2px #ef7aab) drop-shadow(0 -2px #ef7aab);
}
.drinks input:checked ~ span { color: var(--wine); font-weight: 750; }
.drinks input:focus-visible ~ span { outline: 2px solid #27516b; outline-offset: 4px; border-radius: 2px; }
.drinks input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.drink-option { min-width: 0; overflow-wrap: anywhere; }
.option-link { display: inline-grid; min-height: 44px; align-items: center; font-size: .85rem; color: var(--wine); }
#send-error { color: var(--wine); font-weight: 650; }
button:disabled { opacity: .65; cursor: wait; }
.opening-scene {
  position: fixed;
  inset: 0;
  z-index: 12;
  overflow: clip;
  pointer-events: none;
}
.opening-envelope {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  width: var(--start-width);
  height: var(--start-height);
  perspective: 1200px;
}
main.cover-turning { visibility: hidden; }
.cover-turning .choices { visibility: hidden; }
.mail-turn, .mail-face { position: absolute; inset: 0; }
.mail-turn {
  transform-style: preserve-3d;
  animation: mail-turn 680ms cubic-bezier(.4,.1,.23,1) forwards;
}
.mail-face { backface-visibility: hidden; }
.mail-front { overflow: hidden; }
.mail-front .invite-face { width: 100%; }
.mail-back {
  transform: rotateY(180deg);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fcf1d8;
  perspective: 900px;
  box-shadow: 0 5px 0 #dfcaa9, 0 18px 32px #62412928, inset 0 0 0 9px #f2dfbf;
}
.mail-pocket, .mail-flap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.mail-pocket {
  background: #edddbe;
  clip-path: polygon(0 23%, 50% 65%, 100% 23%, 100% 100%, 0 100%);
}
.mail-pocket::after {
  position: absolute;
  inset: 0;
  content: '';
  background: #f5e9cf;
  clip-path: polygon(0 100%, 50% 57%, 100% 100%);
}
.opening-scene.sheet-out { z-index: 10; }
.foreground-pocket {
  position: fixed;
  inset: auto;
  z-index: 12;
  top: var(--start-y);
  left: var(--start-x);
  width: var(--start-width);
  height: var(--start-height);
  border-radius: 5px;
}
.mail-flap {
  clip-path: polygon(0 0, 100% 0, 50% 65%);
  background: #e6d1a8;
  box-shadow: inset 0 0 0 8px #f1dfbd;
  transform-origin: center top;
}
.opening-scene.is-unsealed .mail-flap {
  animation: open-flap 360ms cubic-bezier(.3,.6,.4,1) both;
}
.mail-seal {
  position: absolute;
  top: 61%;
  left: 50%;
  display: grid;
  width: 51px;
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #ac6860;
  border-radius: 50%;
  background: #954e4d;
  color: #fff2df;
  box-shadow: 0 3px #73403b;
  font-size: 21px;
}
.opening-scene.is-unsealed .mail-seal { animation: seal-release 265ms ease both; }
.rising-note {
  position: fixed;
  z-index: 11;
  top: var(--note-start);
  left: var(--note-left);
  width: var(--note-width);
  height: var(--note-height);
  display: grid;
  align-content: start;
  justify-items: center;
  padding: min(4vh, 28px) 10px 10px;
  background: var(--paper);
  border: 1px solid #ba9c76;
  border-radius: 5px;
  box-shadow: 0 4px #e9d8b9, 0 12px 20px #62412924;
  color: var(--wine);
  font-family: "Jua", "Malgun Gothic", system-ui, sans-serif;
  font-size: clamp(1.1rem, 4.8vw, 1.85rem);
  pointer-events: none;
  animation: note-pop 365ms cubic-bezier(.19,.71,.36,1) both;
}
.rising-note::before {
  position: absolute;
  inset: 7px 9px auto;
  height: 3px;
  content: '';
  background: repeating-linear-gradient(125deg, #986862 0 6px, transparent 6px 12px, #70836a 12px 18px, transparent 18px 24px);
  opacity: .52;
}
main.letter-emerging { z-index: 13; animation: letter-settle 770ms cubic-bezier(.24,.32,.2,1) both; }
.letter-emerging #schedule { animation: letter-ink 770ms ease both; }
.opening-scene.fade-envelope { animation: envelope-out 420ms ease both; }
.dispatch-scene {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  overflow: clip;
  pointer-events: none;
  background: #f4dfd7df;
  animation: dispatch-veil 2850ms ease both;
}
.dispatch-flight {
  position: relative;
  width: min(74vw, 308px);
  aspect-ratio: 1.67;
  perspective: 750px;
  animation: dispatch-fly 2780ms both;
}
.dispatch-back {
  position: absolute;
  inset: 0;
  border: 1px solid #b59770;
  border-radius: 5px;
  background: #f6e5c2;
  box-shadow: 0 15px 26px #673f242b;
}
.dispatch-paper-window {
  position: absolute;
  inset: 1px;
  z-index: 3;
  clip-path: inset(-115% 0 0);
  pointer-events: none;
}
.dispatch-paper {
  position: absolute;
  bottom: 14%;
  left: 13%;
  width: 74%;
  height: 108%;
  z-index: 3;
  border: 1px solid #d0b28a;
  border-radius: 3px;
  transform-origin: center 84%;
  background: var(--paper);
  box-shadow: 0 4px 9px #7a4d3224;
  animation: dispatch-paper 1190ms 200ms both;
}
.dispatch-paper::after {
  position: absolute;
  inset: 18% 16% 22%;
  content: '';
  background: repeating-linear-gradient(#b9897d 0 1px, transparent 1px 15%);
  opacity: .53;
}
.dispatch-paper-top {
  position: absolute;
  inset: 0 0 48%;
  z-index: 1;
  transform-origin: center bottom;
  border-bottom: 1px solid #decaa8;
  background: #fffae9;
  animation: dispatch-fold 420ms 390ms cubic-bezier(.42,0,.25,1) both;
}
.dispatch-pocket {
  z-index: 4;
  border: 1px solid #b59770;
  border-radius: 5px;
}
.dispatch-flap {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 5px;
  background: #e8d3ab;
  clip-path: polygon(0 0, 100% 0, 50% 67%);
  transform-origin: center top;
  animation: dispatch-close 365ms 1320ms both;
}
.dispatch-seal {
  position: absolute;
  top: 56%;
  left: 50%;
  z-index: 6;
  display: grid;
  width: 45px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #ae6860;
  border-radius: 46% 52% 47% 50%;
  background: #95434b;
  color: var(--paper);
  box-shadow: 0 3px #77313b, inset 0 0 0 3px #aa5860;
  font-size: 20px;
  animation: dispatch-seal 395ms 1660ms both;
}
@keyframes dispatch-veil {
  from { opacity: 0; }
  9%, 91% { opacity: 1; }
  to { opacity: 0; }
}
@keyframes dispatch-paper {
  from { transform: translateY(-57%) scale(.94); opacity: 0; }
  22% { transform: translateY(-53%); opacity: 1; }
  53% { transform: translateY(-38%) scaleY(.61); opacity: 1; }
  93% { transform: translateY(42%) scaleY(.60); opacity: 1; }
  to { transform: translateY(53%) scaleY(.57); opacity: 0; }
}
@keyframes dispatch-fold {
  from { transform: rotateX(0); }
  to { transform: rotateX(-166deg); background: #f0dfbf; }
}
@keyframes dispatch-close {
  from { transform: rotateX(170deg); z-index: 2; }
  48% { z-index: 2; }
  52% { z-index: 5; }
  to { transform: rotateX(0); z-index: 5; }
}
@keyframes dispatch-seal {
  from { opacity: 0; transform: translate(-50%, -80%) scale(2); }
  52% { opacity: 1; transform: translate(-50%, -50%) scale(.85); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1.13); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes dispatch-fly {
  0% { opacity: 0; transform: translateY(22px) scale(.95); }
  10%, 75% { opacity: 1; transform: translate(0); }
  82% { opacity: 1; transform: translate(-15px, 12px) rotate(6deg); animation-timing-function: cubic-bezier(.31,.05,.35,1); }
  to { opacity: 0; transform: translate(85vw, -85vh) rotate(-23deg) scale(.72); }
}
@keyframes mail-turn { to { transform: rotateY(180deg); } }
@keyframes open-flap { to { transform: rotateX(170deg); background: #efdfbd; } }
@keyframes seal-release { to { transform: translate(-50%, 25%) rotate(19deg); opacity: 0; } }
@keyframes note-pop {
  from { transform: translateY(0); }
  to { transform: translateY(var(--note-lift)); }
}
@keyframes letter-settle {
  from { transform: translate(var(--sheet-x), var(--sheet-y)) scale(var(--sheet-scale-x), var(--sheet-scale-y)); }
  to { transform: translate(0) scale(1); }
}
@keyframes letter-ink {
  from { opacity: 0; }
  18% { opacity: .15; }
  78%, to { opacity: 1; }
}
@keyframes envelope-out { to { opacity: 0; filter: blur(7px); } }
@media (prefers-reduced-motion: reduce) {
  .stationery-cover > .pc-open-hint,
  .choice, .mail-turn, .opening-scene.is-unsealed .mail-flap,
  .opening-scene.is-unsealed .mail-seal, main.letter-emerging,
  .opening-scene.fade-envelope, .dispatch-scene,
  .dispatch-scene *, .yes.is-kicking, .yes.is-insisting,
  main.is-sulking, .sulk-message, .rising-note, .letter-emerging #schedule {
    animation: none; transition: none;
  }
}
