@font-face {
  font-family: Lora;
  src: url("/assets/lora.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Lora;
  src: url("/assets/lora-italic.ttf") format("truetype");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Cormorant;
  src: url("/assets/cormorant-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
:root {
  --paper: #fbf4e9; --ink: #38282b; --wine: #722338; --light-wine: #ac6671;
  --rule: #ceafa5; --body: Lora, "Times New Roman", serif; --display: Cormorant, Lora, serif; --gutter: clamp(1.35rem, 6.5vw, 7.5rem);
  color: var(--ink); background: var(--paper); font: 100%/1.65 var(--body);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd, fieldset { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, .open { cursor: pointer; }
:focus-visible { outline: 3px solid #bb6639; outline-offset: 5px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 20; background: white; padding: .6rem 1rem; }
.skip:focus { top: .5rem; }
.mast { padding: .75rem var(--gutter); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); background: #f8eee2; }
.signature { display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; text-decoration: none; color: var(--wine); }
.signature i { font: italic 550 2.55rem/1 var(--display); }
.signature span { font-size: .8em; margin-left: -.28em; }
.mast nav { display: flex; gap: clamp(.8rem, 2.8vw, 3rem); }
.mast nav a, footer a { font-size: .95rem; text-underline-offset: .32em; text-decoration: none; }
.mast nav a { padding: .5rem .15rem; }
.mast nav a:hover, footer a:hover { text-decoration: underline; }
.hero {
  display: grid; grid-template-columns: .99fr 1.01fr; align-items: center;
  min-height: clamp(570px, 77vh, 820px); padding: 3rem var(--gutter) 4.5rem; overflow: hidden;
  background: radial-gradient(ellipse at 84% 70%, #e6c4b6, transparent 50%), linear-gradient(117deg,#fbf5e9 3%, #f8e9dd 57%, #eed3cb);
}
.hero-text { position: relative; z-index: 2; }
.date { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; font-size: 1rem; }
.date span { width: 1.8rem; height: 1px; background: var(--light-wine); }
.occasion { margin: clamp(1.8rem,4vw,4rem) 0 .4rem; font-style: italic; font-size: 1.2rem; }
h1 { font: italic 500 clamp(4rem, 6.9vw, 8.3rem)/1.10 var(--display); color: var(--wine); letter-spacing: -.035em; }
h1 span { display: block; }
h1 i { font-size: .6em; font-weight: 400; }
.greeting { margin: 1.4rem 0; font-size: clamp(1.05rem, 1.4vw, 1.27rem); }
.open, button { display: inline-flex; align-items: center; gap: 1.4rem; padding: .72rem 1.5rem; background: var(--wine); color: #fff7e9; border: 1px solid transparent; text-decoration: none; border-radius: 2px; }
.open:hover, button:not(:disabled):hover { background: #56182a; }
.assembly { display: block; width: 100%; max-width: 40rem; justify-self: center; text-decoration: none; padding: 8% 2% 0 8%; }
.letter { background: #702137; color: #fff3e6; padding: clamp(3rem,6.5vw,6.5rem) var(--gutter); }
.letter-inner { width: min(100%, 48rem); margin: auto; }
.salutation { margin-bottom: 1rem; font: italic 520 clamp(2.05rem,4vw,4rem)/1.23 var(--display); }
.letter-inner > p:nth-child(2) { font-size: clamp(1.12rem,1.7vw,1.43rem); line-height: 1.8; }
.signoff { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; align-items: baseline; margin-top: 1.15rem; }
.signoff span { font-size: 1rem; }
.signoff strong, .signed { font: italic 500 2.1rem/1.25 var(--display); }
.day, .reply { display: grid; grid-template-columns: .9fr 1fr; gap: clamp(2rem,7vw,7rem); padding: clamp(3.3rem,7vw,7rem) var(--gutter); }
h2 { font: italic 550 clamp(3rem,5.2vw,6rem)/1.16 var(--display); letter-spacing: -.035em; color: var(--wine); }
.civil { margin-top: 1.65rem; font-size: 1.22rem; }
.lunar { font-size: 1rem; font-style: italic; }
address { margin-top: 1.55rem; font-style: normal; }
.text-link { display: inline-block; color: var(--wine); text-underline-offset: .25em; margin-top: .5rem; padding-block: .2rem; }
.times { border-top: 1px solid var(--rule); }
.times div { display: grid; grid-template-columns: 1fr 1.5fr; align-items: baseline; border-bottom: 1px solid var(--rule); padding: .65rem 0; }
.times dt { color: var(--wine); font: italic 500 clamp(2.6rem,4.5vw,4.8rem)/1.1 var(--display); }
.times dd { font-size: clamp(1.15rem,1.8vw,1.6rem); }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.65rem; }
h3 { color: var(--wine); font: italic 600 1.7rem/1.2 var(--display); margin-bottom: .35rem; }
.families span { display: block; font-size: .95rem; margin-top: .45rem; font-style: italic; }
.reply { background: #f0ded3; border-block: 1px solid #dbbdb0; }
.reply-intro p { max-width: 27rem; margin: 1rem 0; font-size: 1.15rem; }
.signed { color: var(--wine); }
form { position: relative; }
form label, legend { display: block; }
form label small { color: #594a46; font-size: .9em; }
form input:not([type=radio]), textarea { display: block; width: 100%; margin: .35rem 0 1.15rem; padding: .6rem .75rem; border: 1px solid #aa8c81; color: var(--ink); background: #fffaf1; border-radius: 2px; }
textarea { resize: vertical; }
#guests { max-width: 6rem; }
fieldset { border: 0; padding: 0; margin: .75rem 0 1.1rem; }
legend { padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; }
.choices label { cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; }
input[type=radio] { width: 1.12rem; height: 1.12rem; margin: 0; accent-color: var(--wine); }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button:disabled { opacity: .65; cursor: default; }
#reply-status:not(:empty) { margin-top: .7rem; }
footer { padding: 1.2rem var(--gutter); display: flex; justify-content: space-between; align-items: center; }
footer p { font: italic 550 1.65rem var(--display); color: var(--wine); }
@media (min-width: 1750px) { .hero, .day, .reply, .mast, footer { padding-inline: calc((100vw - 1510px)/2); } }
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.2rem; padding-bottom: 2.9rem; gap: 1.5rem; }
  .hero-text { text-align: center; }
  .date { justify-content: center; font-size: .97rem; }
  .occasion { margin-top: 1.3rem; font-size: 1.07rem; }
  h1 { font-size: clamp(3.6rem,10vw,5rem); }
  .greeting { margin: .85rem 0 1.1rem; }
  .assembly { width: min(72%,330px); padding: 0; }
  .day,.reply { grid-template-columns: 1fr; }
  .day { gap: 2rem; }
  .reply { gap: 1.4rem; }
}
@media (max-width: 380px) { .mast nav { gap: .5rem; } footer { gap: .5rem; } footer p { font-size: 1.25rem; } }
@media (prefers-reduced-motion: reduce) { *, *::after, *::before { scroll-behavior: auto !important; transition: none !important; } }

.times { position: relative; }

@keyframes set-down {
  from { transform: translateY(-10px) rotate(2deg); }
  to { transform: none; }
}
@keyframes trace-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes confirm-reply {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .arrive .assembly { animation: set-down .95s cubic-bezier(.18,.74,.2,1); }
  .drawn::before {
    content: ""; position: absolute; height: 1px; inset: -1px 0 auto;
    background: var(--light-wine); transform-origin: left; animation: trace-rule .85s ease-out;
  }
  .open, form button { transition: background-color .2s ease, translate .2s ease; }
  .open:active, form button:not(:disabled):active { translate: 0 1px; }
  #guests-row:not([hidden]), #rsvp.is-recorded #reply-status { animation: confirm-reply .32s ease-out; }
}

/* Stage the paper object in warm light, with the names in the quieter left half. */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff4dc;
  min-height: clamp(610px, 83svh, 900px);
  background:
    radial-gradient(ellipse at 80% 49%, #dfb395 0%, #b27866 14%, #8e5350 30%, transparent 58%),
    linear-gradient(117deg, #3b1023 5%, #50152d 45%, #6e3441 77%, #472336);
}
.hero::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  opacity: .2;
  background: repeating-linear-gradient(118deg, transparent 0 3px, #240e171f 4px);
}
.hero h1 { color: #fff4df; text-shadow: 0 2px 22px #3a0c1d3b; }
.hero h1 i, .hero .occasion { color: #f5d3ac; }
.hero .date span { background: #e7b790; }
.hero .open { background: #ffe6bd; color: #451627; box-shadow: 0 5px 15px #30081938; }
.hero .open:hover { background: #fff3dc; }
.hero :focus-visible { outline-color: #ffdda5; }
.tilt-hint { display: block; margin-top: .65rem; font-size: .79rem; color: #ffead7; }
.tilt-hint span:last-child { display: none; }
@media (pointer: coarse) {
  .tilt-hint span:first-child { display: none; }
  .tilt-hint span:last-child { display: inline; }
}

/* Seven curled petals form a still life; opening the letter sets them in motion once. */
.petal-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; perspective: 700px; }
.petal-stage i {
  position: absolute;
  left: var(--left); top: var(--top);
  width: var(--size); aspect-ratio: 1.45;
  border-radius: 58% 37% 70% 31% / 62% 45% 64% 33%;
  background:
    radial-gradient(ellipse at 24% 80%, #bc716b 0%, transparent 53%),
    linear-gradient(142deg, #f5cabe 8%, #da938f 47%, #a54c63 77%, #73364c);
  box-shadow: inset 1px 1px 2px #ffe2d77a, inset -2px -2px 3px #7c30473b, 2px 5px 6px #37162245;
  transform: rotateZ(var(--turn)) rotateX(32deg);
}
.petal-stage i:nth-child(1) { --left: 49%; --top: 26%; --size: 17px; --turn: -40deg; --dx: -38px; --dy: -34px; --delay: 0ms; }
.petal-stage i:nth-child(2) { --left: 56%; --top: 77%; --size: 26px; --turn: 25deg; --dx: -49px; --dy: -27px; --delay: 100ms; }
.petal-stage i:nth-child(3) { --left: 88%; --top: 18%; --size: 20px; --turn: 53deg; --dx: 38px; --dy: -30px; --delay: 80ms; }
.petal-stage i:nth-child(4) { --left: 94%; --top: 63%; --size: 29px; --turn: -21deg; --dx: 37px; --dy: -52px; --delay: 20ms; }
.petal-stage i:nth-child(5) { --left: 70%; --top: 86%; --size: 20px; --turn: -57deg; --dx: 28px; --dy: -31px; --delay: 140ms; }
.petal-stage i:nth-child(6) { --left: 7%; --top: 88%; --size: 15px; --turn: 117deg; --dx: 17px; --dy: -20px; --delay: 120ms; }
.petal-stage i:nth-child(7) { --left: 95%; --top: 30%; --size: 12px; --turn: -70deg; --dx: 18px; --dy: -22px; --delay: 180ms; }
@keyframes petal-lift {
  0% { transform: rotateZ(var(--turn)) rotateX(32deg); }
  48% { transform: translate3d(var(--dx), var(--dy), 34px) rotateZ(calc(var(--turn) + 42deg)) rotateY(102deg); }
  100% { transform: translate3d(var(--dx), 12px, 0) rotateZ(calc(var(--turn) + 78deg)) rotateX(36deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero.opened .petal-stage i { animation: petal-lift 1.35s var(--delay) ease-in-out both; }
}
@media (prefers-reduced-motion: reduce) { .tilt-hint { display: none; } }
@media (max-width: 780px) {
  .hero {
    background: radial-gradient(ellipse 78% 44% at 55% 82%, #bf917a 0%, #965e5b 42%, transparent 94%), linear-gradient(145deg,#3c1024,#5b2039 70%,#633849);
  }
  .petal-stage i { scale: .72; }
  .petal-stage i:nth-child(1) { left: 6%; top: 39%; }
  .petal-stage i:nth-child(2) { left: 14%; top: 75%; }
  .petal-stage i:nth-child(3) { top: 49%; }
  .petal-stage i:nth-child(5) { top: 94%; }
}
