:root {
  --olive: #7c836e;
  --paper: #fff;
  --ink: var(--olive);
  --surround: #eeeae2;
  --action-ink: #505944;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surround); color: var(--ink); }
body:not(.is-open) { overflow: hidden; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid #464d3d; outline-offset: 7px; }

.experience { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100svh; padding: 24px 16px; overflow: hidden; }
.scene { position: relative; width: min(470px, 100%, calc((100svh - 110px) * .745)); aspect-ratio: 957 / 1285; flex: none; isolation: isolate; container-type: inline-size; clip-path: inset(-150px 0 0 0); }
.front-cover { position: absolute; z-index: 2; inset: 0; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; background: var(--olive); color: var(--paper); cursor: pointer; box-shadow: 0 16px 48px rgba(52, 58, 45, .17); transition: transform 1150ms cubic-bezier(.72,0,.18,1), box-shadow 500ms; }
.front-cover:hover { box-shadow: 0 20px 58px rgba(52, 58, 45, .24); }
.cover-cutout { position: absolute; top: -10.2%; left: 50%; width: 28%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: var(--paper); }
.cover-middle { position: absolute; top: 45.4%; left: 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
.cover-heart { display: block; width: 14.2%; height: auto; fill: currentColor; }
.cover-date { display: block; margin-top: 4.5%; font: 400 clamp(9px, 2.8cqw, 13px)/1.2 'Times New Roman', Times, serif; letter-spacing: .015em; text-transform: uppercase; white-space: nowrap; }
.open-hint { display: flex; gap: 12px; align-items: center; margin: 18px 0 0; color: var(--action-ink); font: italic 400 12px 'Cormorant Garamond', Georgia, serif; letter-spacing: .12em; transition: opacity 250ms; }
.open-hint span { display: block; width: 24px; height: 1px; background: currentColor; opacity: .55; }

/* The same card stays in the scene; it physically lifts from behind the cover. */
.invitation-paper { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; min-height: 100%; overflow: hidden; background: var(--paper); transform: translateY(44px); transition: transform 1100ms cubic-bezier(.22,.65,.16,1); }
.invitation-paper:focus { outline: none; }
.scene.is-opening .invitation-paper { transform: translateY(-112px); }
.scene.is-opening .front-cover { transform: translateY(104%); box-shadow: none; }
.experience.is-open { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; min-height: 100svh; padding: 20px 16px; overflow: visible; }
.experience.is-open .scene { width: min(100%, 648px); margin-inline: auto; aspect-ratio: 648 / 872; clip-path: none; }
.experience.is-open .invitation-paper { position: relative; min-height: 0; transform: none; box-shadow: 0 12px 55px rgba(60, 59, 47, .08); }
.experience.is-open .front-cover, .experience.is-open .open-hint { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.actions[hidden] { display: none; }
.action-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--action-ink); color: var(--action-ink); background: transparent; text-decoration: none; text-align: center; font: 500 15px/1.2 'Cormorant Garamond', Georgia, serif; letter-spacing: .035em; transition: background 180ms, color 180ms; }
.action-link:hover { background: var(--action-ink); color: white; }
.action-link--primary { background: var(--action-ink); color: white; }
.action-link--primary:hover { background: #394131; }
.action-link:focus-visible { outline: 3px solid #464d3d; outline-offset: 3px; }
.readable-details { width: min(100%, 648px); color: var(--action-ink); font: 400 17px/1.5 'Cormorant Garamond', Georgia, serif; }
.readable-details[hidden] { display: none; }
.readable-details summary { width: fit-content; min-height: 44px; margin-inline: auto; padding: 9px 14px; cursor: pointer; text-align: center; text-decoration: underline; text-underline-offset: 4px; font: 500 17px/1.5 'Cormorant Garamond', Georgia, serif; }
.readable-details summary:focus-visible { outline: 3px solid var(--action-ink); outline-offset: 2px; }
.details-body { margin-top: 12px; padding: 22px clamp(20px, 5vw, 40px); background: var(--paper); box-shadow: 0 8px 28px rgba(60, 59, 47, .07); }
.details-body p { margin: 0 0 14px; }
.details-body h2 { margin: 16px 0 4px; font: 400 32px/1.2 'Italiana', Georgia, serif; }
.details-body dl { margin: 20px 0; }
.details-body dl > div + div { margin-top: 16px; }
.details-body dt { font-weight: 600; }
.details-body dd { margin: 2px 0 0; }
.details-body .details-signoff { margin-bottom: 0; }

/* Position each line against the supplied 648 × 872 card reference. */
.invitation-paper { container-type: inline-size; aspect-ratio: 648 / 872; }
.corner-letter { position: absolute; z-index: 0; display: block; color: var(--olive); white-space: nowrap; pointer-events: none; user-select: none; font: 400 38cqw/.8 'Great Vibes', cursive; }
.corner-letter--top { top: -2cqw; left: -9cqw; font-size: 44cqw; transform: rotate(-12deg); }
.corner-letter--bottom { right: 3cqw; bottom: -8cqw; font-size: 40cqw; transform: rotate(6deg); }
.invitation-content { position: absolute; z-index: 1; inset: 0; text-align: center; }
.arabic { position: absolute; top: 17.3%; width: 100%; margin: 0; font: 400 4cqw/1.45 'Scheherazade New', 'Amiri', serif; }
.invitation-intro { position: absolute; top: 25.1%; width: 100%; margin: 0; font: italic 400 3.05cqw/1.25 'Cormorant Garamond', Georgia, serif; }
.couple { position: absolute; top: 35.1%; left: 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
.person h1, .person h2 { margin: 0; font: 400 7.6cqw/1 'Italiana', 'Times New Roman', serif; text-transform: uppercase; letter-spacing: -.055em; }
.person p { margin: .25cqw 0 0; font: italic 400 3.05cqw/1.12 'Cormorant Garamond', Georgia, serif; }
.ampersand { margin: 1.5cqw 0 .6cqw; font: 400 5.5cqw/.9 'Great Vibes', cursive; }
.date-line { position: absolute; top: 60.2%; width: 100%; margin: 0; font: italic 400 3.25cqw/1.2 'Cormorant Garamond', Georgia, serif; }
.date-line span { padding: 0 .16em; font-style: normal; }
.venue { position: absolute; top: 67%; left: 0; width: 100%; }
.venue h2 { margin: 0; font: 500 3.4cqw/1.1 'Cormorant Garamond', Georgia, serif; text-transform: uppercase; }
.venue p { margin: 1.1cqw 0 0; font: italic 400 3.1cqw/1.16 'Cormorant Garamond', Georgia, serif; }
.regards { position: absolute; top: 77.1%; width: 100%; margin: 0; font: 400 2.85cqw/1.15 'Cormorant Garamond', Georgia, serif; }

@media (max-width: 600px) {
  .experience { padding: 14px; }
  .scene { width: min(100%, calc((100svh - 90px) * .745)); }
  .experience.is-open { padding: 16px 0; }
  .corner-letter--top { left: -9cqw; }
  .corner-letter--bottom { right: 3cqw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
