@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 600; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/eb-garamond-italic-latin.woff2") format("woff2");
  font-style: italic; font-weight: 400 600; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("assets/fonts/source-sans-3-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 600; font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fcf7f2; --ink: #3a302f; --muted: #6d625e;
  --ornament: #c7b6a3; --emboss-light: #fffdf9; --field: #fffaf580;
  --romance: #8d5c59; --accent: #694d49; --backdrop: #e8dfdc; --grain-opacity: .035;
  --card-gutter: clamp(0px, calc(20vw - 120px), 32px);
  --card-total-gutter: clamp(0px, calc(40vw - 240px), 64px);
  --paper-min-height: min(960px, calc(100svh - var(--card-total-gutter)));
  --serif: "EB Garamond", "Baskerville", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  font-family: var(--serif); font-synthesis: none;
  background: var(--backdrop); color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100svh; background: var(--backdrop); overflow-x: clip; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
main { position: relative; width: 100%; min-height: 100svh; display: flex; align-items: center; justify-content: center; }
.card-stage { width: min(820px, calc(100% - var(--card-total-gutter))); margin-block: var(--card-gutter); perspective: 9000px; }
.invitation-card { position: relative; display: grid; width: 100%; min-height: var(--paper-min-height); transform-style: preserve-3d; transform-origin: center center; transition: transform .95s cubic-bezier(.42,.02,.18,1); }
.invitation-card.is-flipped { transform: rotateY(-180deg); }
.invitation-card.is-relayout, .is-relayout .card-face { transition: none !important; animation: none !important; }
.card-face { position: relative; grid-area: 1 / 1; min-width: 0; overflow: clip; border-radius: 32px; background-color: var(--paper); -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: inset 0 0 0 1px #cbb8ad4d, 0 20px 32px #48403229; }
/* A pre-rendered tile, rasterized once; a live filter here would be redrawn on every frame of the turn. */
.card-face::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E"); opacity: var(--grain-opacity); pointer-events: none; mix-blend-mode: multiply; }
.card-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, #ffffff45, transparent 45%, #b47e760b); pointer-events: none; }
/* Safari ignores backface-visibility on stacked descendants unless each face has its own 3D transform. */
.card-front { transform: rotateY(0deg); }
.card-back { transform: rotateY(180deg); }
.turn-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: linear-gradient(90deg, #362a1c30, #fffdf36b 14%, transparent 37%, #51452c0b 80%, #362a1c21); }
.is-turning .turn-shade { animation: paper-shade .95s ease both; }
.ornament { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ornament[data-draw-state="pending"] { opacity: 0; }
.emboss-highlight { stroke: var(--emboss-light); stroke-width: 1.5; transform: translate(.5px, .5px); }
.emboss-shadow { stroke: var(--ornament); stroke-width: 1; opacity: .24; }
.ink-trace { stroke: #a88b77; stroke-width: .9; opacity: .83; }
.ink-trace [data-part="inner"] { stroke: #baa18e; stroke-width: .75; opacity: .88; }
.ink-trace [data-part="detail"] { stroke: #9e7866; stroke-width: .8; opacity: .9; }
.corner-art { position: absolute; z-index: 0; height: auto; pointer-events: none; user-select: none; }
.corner-art--upper-left { top: 0; left: 0; width: clamp(182px, 53%, 350px); }
.corner-art--upper-right { top: 0; right: 0; width: clamp(170px, 45%, 305px); transform: scaleX(-1); }
.corner-art--lower-left { bottom: 0; left: 0; width: clamp(170px, 46%, 310px); transform: scaleX(-1); }
.corner-art--lower-right { bottom: 0; right: 0; width: clamp(185px, 57%, 365px); }
.card-back .corner-art { opacity: .55; }
.front-content { position: relative; z-index: 1; width: min(100%, 660px); min-height: var(--paper-min-height); margin-inline: auto; padding: 112px 52px 96px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.front-content > *, .back-content > * { flex-shrink: 0; }
.eyebrow { font-size: 20px; font-style: italic; line-height: 1.4; margin: 0; color: var(--romance); }
.eyebrow-script { display: block; font-size: clamp(34px, 3vw, 40px); line-height: 1.1; }
.eyebrow-subline { display: block; margin-top: 10px; color: var(--ink); font-size: 15px; font-style: normal; letter-spacing: .18em; }
.couple { margin: 25px 0 30px; max-width: 100%; font-size: clamp(31px, 3.2vw, 43px); font-weight: 500; line-height: 1.12; letter-spacing: .17em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.couple > span[data-copy] { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.ampersand { font-size: .65em; font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--romance); }
.invitation-copy { font-size: 17px; line-height: 1.7; letter-spacing: .1em; margin: 0; }
.date-lockup { width: min(100%, 440px); display: flex; flex-direction: column; gap: 2px; margin: 24px 0 22px; padding: 0; font-family: var(--serif); line-height: 1.5; letter-spacing: .08em; }
.date-full { font-size: 18px; font-weight: 400; }
.ceremony-time { font-size: 16px; color: var(--muted); }
.venue p { margin: 0; }
.venue-name { font-size: 34px; font-style: italic; line-height: 1.2; }
.venue-address { font-family: var(--serif); font-size: 16px; padding-top: 12px; line-height: 1.5; letter-spacing: .09em; }
.reception-note { font-size: 17px; font-style: normal; padding-top: 24px; line-height: 1.5; letter-spacing: .1em; color: var(--ink); }
.rsvp-area { margin-top: 30px; }
.ink-button { min-height: 52px; background: var(--accent); color: var(--paper); border: 1px solid var(--accent); padding: 13px 32px; font-family: var(--sans); font-weight: 500; font-size: 16px; letter-spacing: .035em; transition: background .2s, transform .2s; }
.ink-button span { display: inline-block; margin-left: 18px; font-size: 18px; transition: transform .2s; }
.ink-button:hover { background: #513936; }
#open-rsvp, #venue-map { width: min(230px, calc(100vw - 110px)); }
#open-rsvp { min-height: 56px; font-weight: 600; }
.ink-button:hover span { transform: translateX(3px); }
.ink-button:active { transform: translateY(1px); }
.deadline { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; }
.back-content { position: relative; z-index: 1; width: min(100%, 620px); min-height: var(--paper-min-height); margin-inline: auto; padding: 78px 44px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.back-button { display: block; min-height: 44px; margin: 0 auto 20px; padding: 8px 4px; background: none; border: 0; color: var(--muted); font-family: var(--sans); font-size: 15px; }
.back-button span { margin-right: 7px; }
.form-heading { font-size: clamp(38px, 3.5vw, 48px); line-height: 1.15; font-weight: 400; letter-spacing: -.02em; margin: 10px 0; }
.form-heading:focus, .confirmation h3:focus { outline: none; }
.form-intro { font-family: var(--sans); font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0 0 28px; text-wrap: balance; }
form { text-align: left; font-family: var(--sans); }
.field { margin-bottom: 20px; }
.field label { font-size: 16px; font-weight: 500; display: block; margin-bottom: 8px; line-height: 1.5; }
.label-note { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 4px; }
.field input, .field textarea { display: block; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #c1b0a8; border-radius: 2px; background: var(--field); color: var(--ink); font-size: 17px; line-height: 1.5; transition: border-color .2s, background .2s; }
.field input:focus, .field textarea:focus { background: #fffdfb; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { resize: vertical; min-height: 90px; max-height: 220px; }
.field input[aria-invalid="true"] { border-color: #995546; }
.field-error { font-size: 14px; line-height: 1.5; color: #894734; display: block; margin-top: 6px; }
.field-error:empty { display: none; }
.guest-list { padding: 0; border: 0; margin: 0; }
.guest-hint { padding: 0; margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.guest + .guest { margin-top: 10px; }
.guest-check { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 16px; border: 1px solid #cbb8adb3; border-radius: 2px; background: var(--field); cursor: pointer; transition: border-color .2s, background .2s; }
.guest-check:has(input:checked) { border-color: var(--accent); background: #555e4d0a; }
.guest-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.guest-check input { appearance: none; flex-shrink: 0; width: 22px; height: 22px; margin: 0; border: 1.5px solid #b3a097; border-radius: 50%; background: #fffdfb center / 14px no-repeat; transition: background-color .2s, border-color .2s; }
.guest-check input:focus-visible { outline: none; }
.guest-check input:checked { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.4l2.6 2.6L11 4.4' fill='none' stroke='%23fcf7f2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.guest-name { min-width: 0; font-family: var(--serif); font-size: 21px; font-style: italic; line-height: 1.3; overflow-wrap: anywhere; }
.guest-dietary { margin-top: 8px; }
.guest-dietary input { display: block; width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid #c1b0a8; border-radius: 2px; background: var(--field); color: var(--ink); font-size: 16px; line-height: 1.5; transition: border-color .2s, background .2s; }
.guest-dietary input:focus { background: #fffdfb; border-color: var(--accent); }
.guest-dietary input::placeholder { color: var(--muted); opacity: 1; }
.submit-button { display: block; width: 100%; margin-top: 26px; }
.submit-button:disabled { opacity: .75; cursor: progress; }
.send-error { margin-top: 10px; text-align: center; }
.confirmation { padding: 24px 0; }
.confirmation-flower { font-size: 58px; color: var(--ornament); }
.confirmation h3 { font-size: 38px; line-height: 1.2; font-weight: 400; margin: 20px 0 16px; }
.confirmation > p { font-family: var(--sans); font-size: 17px; line-height: 1.7; }
.storage-note { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink); padding: 12px; border: 1px solid var(--ornament); }
.practical-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; margin-top: 16px; }
.practical-links button, .practical-links a { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; padding: 5px 0; background: none; border: 0; text-decoration: none; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--muted); }
.practical-links button:hover, .practical-links a[href]:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.practical-links svg { flex-shrink: 0; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.2; }
#venue-map { justify-content: center; min-height: 52px; padding: 10px 20px; border: 1px solid var(--ornament); color: var(--accent); font-size: 16px; font-weight: 500; letter-spacing: .02em; transition: background .2s, border-color .2s, transform .2s; }
#venue-map svg { width: 19px; height: 19px; }
#venue-map[href]:hover { background: #694d4912; border-color: var(--accent); color: var(--accent); text-decoration: none; }
#venue-map[href]:active { transform: translateY(1px); }
.practical-links a[aria-disabled="true"] { cursor: default; }
.sample-link-note { font-size: 14px; }
.link-divider { width: 1px; height: 15px; background: var(--ornament); }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes reveal { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes paper-shade { 0%, 100% { opacity: 0; } 45%, 55% { opacity: 1; } }
@keyframes mobile-page-out-left {
  0%, 99% { visibility: visible; }
  0% { transform: rotateY(0); }
  100% { visibility: hidden; transform: rotateY(-90deg); }
}
@keyframes mobile-page-in-right {
  0% { visibility: hidden; transform: rotateY(90deg); }
  1%, 100% { visibility: visible; }
  100% { transform: rotateY(0); }
}
@keyframes mobile-page-out-right {
  0%, 99% { visibility: visible; }
  0% { transform: rotateY(0); }
  100% { visibility: hidden; transform: rotateY(90deg); }
}
@keyframes mobile-page-in-left {
  0% { visibility: hidden; transform: rotateY(-90deg); }
  1%, 100% { visibility: visible; }
  100% { transform: rotateY(0); }
}
.entrance { animation: reveal .5s ease both; }
.entrance-1 { animation-delay: .08s; }.entrance-2 { animation-delay: .16s; }.entrance-3 { animation-delay: .24s; }.entrance-4 { animation-delay: .32s; }.entrance-5 { animation-delay: .4s; }.entrance-6 { animation-delay: .48s; }
.has-entered .entrance { animation: none; }
@media (max-width: 759px) {
  :root { --paper-min-height: min(960px, max(900px, 100svh)); }
  .front-content { padding: clamp(112px, calc(283px - 22.5vw), 148px) 44px clamp(96px, calc(400px - 40vw), 160px); }
  .couple { gap: 5px; font-size: clamp(29px, 8vw, 37px); margin: 21px 0 25px; }
  .ampersand { line-height: 1; margin: 2px 0; }
  .eyebrow-script { font-size: 36px; }
  .eyebrow-subline { font-size: 14px; }
  .invitation-copy { font-size: 16px; line-height: 1.6; letter-spacing: .06em; }
  .date-lockup { width: min(90%, 300px); margin: 18px 0 20px; gap: 3px; }
  .date-full { font-size: 16px; }
  .venue-name { font-size: 30px; }
  .reception-note { font-size: 16px; padding-top: 16px; }
  .rsvp-area { margin-top: 25px; }
  .practical-links { gap: 16px; margin-top: 12px; }
  /* The frame inset is clamp(14px, 4.5%, 32px) of the card width (script.js); keep fields clear of its side accents. */
  .back-content { width: 100%; padding: 74px calc(clamp(14px, 4.5%, 32px) + 40px); }
}
@media (max-width: 600px) {
  :root { --paper-min-height: 100svh; }
  body { background: var(--paper); }
  .card-stage { width: 100%; margin: 0; }
  .card-face { border-radius: 0; box-shadow: inset 0 0 0 1px #cbb8ad4d; }
  .practical-links { flex-direction: column; gap: 2px; margin-top: 18px; }
  .link-divider { display: none; }
  /* Leave room for the lower florals below the form. */
  .back-content { padding-block: 72px 112px; }
    .card-back .corner-art--upper-left { width: 40%; }
  .card-back .corner-art--lower-right { width: 44%; }
}
@media (max-width: 420px) {
  .front-content { padding-inline: 40px; }
  .couple { font-size: 31px; }
  .invitation-copy { font-size: 16px; }
  .practical-links { gap: 2px; }
  .practical-links button, .practical-links a { font-size: 14px; gap: 6px; }
  .sample-link-note { margin-left: -2px; }
  .field { margin-bottom: 18px; }
}
@media (max-width: 360px) {
  .front-content { padding-inline: 36px; }
  .form-heading { font-size: 32px; }
  .submit-button { padding-inline: 16px; }
}
@media (pointer: coarse) and (max-height: 500px) {
  :root { --paper-min-height: 100svh; }
  body { background: var(--paper); }
  .card-stage { width: 100%; margin: 0; }
  .card-face { box-shadow: inset 0 0 0 1px #cbb8ad4d; }
}
@media (max-width: 759px), (pointer: coarse), (max-width: 1000px) and (max-height: 500px) {
  .card-stage { perspective: none; }
  .invitation-card, .invitation-card.is-flipped { perspective: 4000px; transform: none; transform-style: flat; transition: none; }
  .card-face, .card-back { transform: none; transform-origin: center center; }
  .card-back, .is-flipped .card-front { visibility: hidden; }
  .is-flipped .card-back { visibility: visible; }
  .card-face::before, .turn-shade { display: none; }
  .entrance { animation: none; }
  .is-turning .card-face { will-change: transform; }
  .is-turning.is-flipped .card-front { animation: mobile-page-out-left .32s ease-in both; }
  .is-turning.is-flipped .card-back { animation: mobile-page-in-right .32s ease-out .32s both; }
  .is-turning:not(.is-flipped) .card-back { animation: mobile-page-out-right .32s ease-in both; }
  .is-turning:not(.is-flipped) .card-front { animation: mobile-page-in-left .32s ease-out .32s both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
