@charset "UTF-8";
:root {
  --paper: #f4efe6;
  --card-paper: #fffbf3;
  --card-back: #e5eade;
  --ink: #2d4036;
  --botanical: #596650;
  --muted: #596650;
  --envelope: #a8b5a6;
  --envelope-lining: #8c9c90;
  --envelope-light: #bdc7b7;
  --envelope-flap-shade: #a0af9f;
  --envelope-shadow: #8c9c90;
  --envelope-fold: #a1b19f;
  --envelope-bottom-light: #c2cdbb;
  --envelope-bottom: #acbba6;
  --lining-stripe: #5e74662b;
  --wax-light: #936168;
  --wax: #86505a;
  --wax-edge: #6f4049;
  --wax-border: #bd9292;
  --wax-ink: #fff6eb;
  --wax-shadow: #532a354d;
  --wax-glint: #edc6bd66;
  --action: #344b3f;
  --action-hover: #233a2d;
  --focus: #6f4049;
  --sprig: #839078;
  --rule: #b9c1ac;
  --hairline: #2d403624;
  --card-border: #89977d52;
  --envelope-lift-shadow: #26392b28;
  --card-shadow: #26392b24;
  --card-contact-shadow: #26392b20;
  --dialog-shadow: #20312740;
  --backdrop: #2031278c;
  --photo-label-shadow: #12281c55;
  --photo-back-scrim: #142b20c7;
  --selection: #dfc4c1;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22,.68,0,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 170px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; user-select: none; -webkit-user-select: none; }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
[hidden] { display: none !important; }
a { color: inherit; }
::selection { background: var(--selection); color: var(--ink); }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.masthead { min-height: 76px; margin: 0 5%; padding: 16px 0; display: flex; gap: 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hairline); }
.monogram { text-decoration: none; font-size: 28px; letter-spacing: .04em; }
.header-date { font-family: var(--sans); font-size: 16px; }
.invitation { position: relative; isolation: isolate; padding: 26px 20px 0; overflow: hidden; }
.intro { position: relative; z-index: 10; text-align: center; }
.intro h1 { font-size: clamp(27px, 3.5vw, 38px); font-weight: 400; letter-spacing: -.025em; line-height: 1.2; margin: 0; text-wrap: balance; }
.intro h1 em { margin-left: .12em; color: var(--botanical); font-weight: 400; }
.intro-caption { font-family: var(--sans); color: var(--muted); font-size: 15px; line-height: 1.6; margin: 12px 0 0; }
.stationery { position: relative; display: grid; place-items: center; width: min(100%, 820px); margin: 0 auto; padding: 48px 0; perspective: 1600px; }
.card-area { position: relative; width: min(100%, 420px); z-index: 2; perspective: 1400px; }
.card-rotator { display: grid; position: relative; }
/* Keep the unused face out of paint, including its positioned title. Both faces
   retain their layout size; the turn swaps them only when the card is edge-on. */
.card-rotator[data-face="front"] .card-back,
.card-rotator[data-face="back"] .card-front { visibility: hidden; }
.card { grid-area: 1 / 1; min-width: 0; padding: 18px; background: var(--card-paper); box-shadow: 0 18px 40px var(--card-shadow), 0 2px 5px var(--card-contact-shadow); text-align: center; outline: none; }
.photo-frame { position: relative; aspect-ratio: 1.12; overflow: hidden; background: var(--card-back); }
.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 56%; }
.photo-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #142b20b3, #142b203d 34%, transparent 60%); pointer-events: none; }
.photo-title { position: absolute; top: 16px; left: 18px; z-index: 1; text-align: left; color: var(--card-paper); font-size: 42px; letter-spacing: -.03em; line-height: 1; margin: 0; text-shadow: 0 1px 14px var(--photo-label-shadow); }
.photo-title em { font-size: 34px; font-weight: 400; }
.card-copy { padding: 24px 8px 12px; }
.couple-names { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: center; font-size: 42px; font-weight: 400; letter-spacing: -.03em; margin: 0 0 14px; line-height: 1.15; }
.couple-names em { font-size: 30px; color: var(--botanical); }
.card-invitation { font-size: 16px; line-height: 1.6; max-width: 32ch; margin: 0 auto 24px; color: var(--muted); }
.date-line { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
.card-location { font-size: 19px; line-height: 1.4; margin: 0; }
.formal-note { font-size: 15px; color: var(--muted); margin: 22px 0 0; line-height: 1.5; font-style: italic; }
.card-back { background: var(--card-back); }
.back-photo { display: block; width: 100%; height: auto; }
.back-copy { padding: 20px 6px 12px; }
.back-copy h2 { font-size: 30px; font-weight: 400; font-style: italic; line-height: 1.25; margin: 0 0 16px; }
.back-date { font-size: 23px; line-height: 1.3; margin: 0 0 7px; }

/* The same real card sits behind the envelope pocket before it is extracted. */
.envelope-layer { position: absolute; left: 50%; top: 50%; width: min(570px, calc(100% - 16px)); aspect-ratio: 1.52; transform: translate(-50%, -50%) rotate(-4deg); pointer-events: none; }
.envelope-back { z-index: 1; background: var(--envelope-lining); border-radius: 3px; box-shadow: 0 12px 22px var(--envelope-lift-shadow), inset 0 1px #eff2e6; }
.envelope-front { z-index: 3; }
.envelope-fold-left, .envelope-fold-right, .envelope-bottom { position: absolute; inset: 0; }
.envelope-fold-left { clip-path: polygon(0 0, 54% 60%, 0 100%); background: linear-gradient(120deg, var(--envelope-light), var(--envelope)); }
.envelope-fold-right { clip-path: polygon(100% 0, 46% 60%, 100% 100%); background: linear-gradient(235deg, var(--envelope-fold), var(--envelope-shadow)); }
.envelope-bottom { clip-path: polygon(0 100%, 50% 43%, 100% 100%); background: linear-gradient(170deg, var(--envelope-bottom-light), var(--envelope-bottom)); }
.envelope-address { position: absolute; left: 20px; right: 20px; bottom: 26px; text-align: center; font-size: 16px; line-height: 1.5; }
.address-script { display: block; font-size: 24px; font-style: italic; margin-top: 2px; }
.envelope-flap { z-index: 4; perspective: 1000px; }
.flap-paper { height: 63%; width: 100%; transform-origin: center top; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(155deg, var(--envelope-light), var(--envelope-flap-shade)); backface-visibility: visible; box-shadow: inset 0 1px #eef1e6; }
.seal { position: absolute; left: 50%; top: 50%; z-index: 5; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 47% 52% 46% 50% / 50% 46% 53% 48%; background: radial-gradient(ellipse at 35% 20%, var(--wax-light), var(--wax) 65%, var(--wax-edge)); box-shadow: 2px 5px 6px var(--wax-shadow), inset 1px 2px 2px var(--wax-glint), inset -2px -3px 4px var(--wax-edge); outline: 1px solid var(--wax-border); outline-offset: -7px; transition: scale 160ms var(--ease); }
.seal span { font-size: 28px; color: var(--wax-ink); text-shadow: 0 1px var(--wax-edge); }
.seal:active { scale: .97; }
.opening-actions { position: absolute; left: 50%; z-index: 8; transform: translateX(-50%); width: max-content; max-width: 100%; text-align: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 14px 20px; border: 1px solid transparent; border-radius: 4px; font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.3; text-align: center; transition: transform 160ms var(--ease), background-color 160ms ease, border-color 160ms ease; }
.button-primary { background: var(--action); color: var(--card-paper); }
.button-secondary { border-color: var(--botanical); color: var(--ink); background: var(--card-paper); }
.button:active { transform: scale(.98); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; background: transparent; border: 0; padding: 10px 14px; font-family: var(--sans); font-size: 15px; line-height: 1.4; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--rule); }
.text-button:active { background: var(--card-back); }
.card-controls { position: fixed; z-index: 30; bottom: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 10px; border: 1px solid var(--rule); background: var(--card-paper); border-radius: 8px; box-shadow: 0 6px 24px var(--card-shadow); }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calendar-feedback, .dialog-calendar-feedback { font-family: var(--sans); font-size: 14px; line-height: 1.5; margin: 10px 4px 2px; color: var(--ink); }
footer { margin: 8px 5% 0; padding: 20px 12px 160px; border-top: 1px solid var(--hairline); text-align: center; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.footer-note { font-size: 16px; line-height: 1.5; color: var(--muted); margin: 14px 0; }
footer small { display: block; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); }
dialog { border: 1px solid var(--rule); background: var(--card-paper); color: var(--ink); padding: 48px 32px 30px; max-width: 500px; width: calc(100% - 32px); max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; text-align: center; box-shadow: 0 25px 80px var(--dialog-shadow); }
dialog::backdrop { background: var(--backdrop); }
.dialog-close { display: grid; place-items: center; position: absolute; right: 8px; top: 8px; width: 48px; height: 48px; background: transparent; border: 0; border-radius: 4px; }
.dialog-close:active { background: var(--card-back); }
dialog h2 { font-size: 36px; font-weight: 400; line-height: 1.15; margin: 4px 0 20px; }
dialog p { font-size: 16px; line-height: 1.65; color: var(--muted); }
dialog .dialog-date { font-size: 25px; line-height: 1.5; color: var(--ink); }
.dialog-date span { font-size: 19px; }
dialog .button { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noscript-note { font-size: 16px; text-align: center; margin: 20px auto; max-width: 32ch; line-height: 1.6; }
body:not(.enhanced) .envelope-layer { display: none; }
body:not(.enhanced) .card-back { display: none; }
.enhanced .card-area { visibility: hidden; }
.enhanced .stationery[data-ready] .card-area { visibility: visible; }
@media (hover: hover) and (pointer: fine) {
  .seal:hover { scale: 1.04; }
  .button-primary:hover { background: var(--action-hover); }
  .button-secondary:hover, .dialog-close:hover { background: var(--card-back); }
  .text-button:hover { text-decoration-color: var(--ink); }
}
@media (max-width: 650px) {
  .masthead { margin: 0 6%; min-height: 68px; padding: 14px 0; }
  .monogram { font-size: 25px; }
  .header-date { font-size: 15px; }
  .invitation { padding: 24px 16px 0; }
  .intro h1 { max-width: 18ch; margin: auto; }
  .intro-caption { font-size: 14px; }
  .stationery { padding: 42px 0; }
  .card { padding: 15px; }
  .card-copy { padding: 22px 4px 12px; }
  .couple-names { font-size: 36px; gap: 8px; }
  .couple-names em { font-size: 27px; }
  .card-invitation { font-size: 16px; margin-bottom: 22px; }
  .date-line { font-size: 26px; }
  .card-location { font-size: 18px; }
  .formal-note { font-size: 15px; margin-top: 20px; }
  .photo-title { font-size: 38px; left: 15px; top: 15px; }
  .photo-title em { font-size: 31px; }
  .back-copy h2 { font-size: 28px; }
  .envelope-address { bottom: 12px; font-size: 15px; }
  .envelope-address > span:first-child { display: none; }
  .address-script { font-size: 20px; line-height: 1.3; margin-top: 0; }
  .seal { width: 72px; height: 72px; }
  .seal span { font-size: 25px; }
  .opening-actions .button { min-width: 200px; }
  .button { padding: 13px 12px; font-size: 15px; gap: 7px; }
  .card-controls { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 20px); padding: 8px; }
  .action-row { gap: 8px; }
  .action-row .icon { width: 19px; height: 19px; }
  footer { margin: 6px 6% 0; padding-bottom: 180px; }
  dialog { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 359px) {
  .couple-names { font-size: 32px; gap: 6px; }
  .action-row .button { font-size: 14px; padding-left: 8px; padding-right: 8px; }
  .action-row .icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .seal { transition: background-color 120ms ease, border-color 120ms ease; }
  .button:active { transform: none; }
  .seal:active, .seal:hover { scale: 1; }
}
