/* Invitations use a dedicated, uninterrupted guest view. */
body:has(main > .guest-experience) { background: #e4ddd2; }
body:has(main > .guest-experience) > :is(header,footer) { display: none; }
body:has(main > .guest-experience) > main { max-width: none; padding: 0; }
.guest-experience {
  --guest-width: 100%;
  --scene-height: 100vh;
  --scene-height: 100svh;
  position: relative;
  overflow: clip;
  --guest-paper: var(--theme-paper, #faf6ed);
  --guest-ink: var(--theme-ink, #483a30);
  width: min(100%,var(--guest-width)); margin: 0 auto; background: var(--guest-paper); color: var(--guest-ink);

}
.guest-experience .opening-intro {
  min-height: var(--scene-height); width: 100%; padding: 0;
  display: grid; grid-template: 1fr / 1fr; isolation: isolate; gap: 0;
  background: var(--paper-stock); overflow: hidden;
}
.guest-experience .opening-intro[hidden] { display:none; }
.guest-experience .opening-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guest-experience .opening-trigger {
  grid-area: 1/1; width: 100%; height: 100%; margin: 0; padding: 0; min-height: 0;
  position: relative; display: block; touch-action: manipulation; border-radius: 0;
}
.guest-experience .opening-trigger:focus-visible { outline-offset: -7px; }
.guest-experience .opening-trigger .opening-object {
  position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; filter: none;
}
.guest-experience .opening-postcard {
  inset: 8% 9% auto auto; z-index: 4; width: 13%; height: auto; aspect-ratio: .82;
  background:none; box-shadow:none; transform: rotate(7deg);
}
.guest-experience .opening-postcard img { position: static; width: 100%; transform:none; }
.guest-experience .opening-in-progress .opening-postcard { opacity:0; transition:opacity .3s; }
.guest-experience .opening-intro[data-opening="seal"] .opening-object,
.guest-experience .opening-intro[data-opening="envelope"] .opening-object {
  --envelope-photo: url('/assets/envelopeportrait.webp');
}
.guest-experience :is(.opening-pocket,.opening-flap) { background: var(--envelope-photo) center/100% 100% no-repeat; }
.guest-experience .opening-pocket { clip-path: polygon(0 18%,50% 54%,100% 18%,100% 100%,0 100%); }
.guest-experience .opening-flap { clip-path: polygon(0 0,100% 0,100% 18.4%,50% 54.5%,0 18.4%); transform-origin: center top; }
.guest-experience .opening-seal { left: 50%; top: 53%; translate: -50% -50%; width: clamp(75px,23vmin,158px); }
.guest-experience .opening-intro[data-opening="lace"] .opening-leaf { background-size: cover; background-color: #e3cbbb66; }
.guest-experience .opening-intro[data-opening="ribbon"] .opening-leaf { background-color: #f2dfd8; background-blend-mode: multiply; }
.guest-experience .opening-ribbon { inset: 33% -7% 18%; }
.guest-experience .opening-action {
  position: absolute; z-index: 8; left: 50%; bottom: max(13%,85px); transform: translateX(-50%);
  min-height: 48px; gap: 13px; white-space: nowrap; background: #fdf9ef; color: #4d3e31;
  border: 1px solid #9b8874; border-radius: 0; padding: 0 20px;
}
.guest-experience .opening-intro .opening-skip {
  grid-area: 1/1; place-self: end center; z-index: 9; margin: 0 0 max(16px,env(safe-area-inset-bottom));
  background: #fdf9ef; padding-inline: 14px;
}
.guest-experience .invite {
  width: 100%; max-width: none; margin: 0; padding: 0; background: transparent; color: inherit; box-shadow: none;
}
.guest-experience .invite-cover {
  height: var(--scene-height); display: grid; place-items: center;
  background: #f0e7d8; isolation: isolate; overflow: hidden;
}
.guest-experience .invite-cover .sample.photo {
  height: 100%; width: 100%; max-width: none; aspect-ratio: auto;
  background: linear-gradient(#faf5ead9,#faf5ead9), url('/assets/vellum.webp') center / cover no-repeat;
  outline: none; border: 0;
  --copy-x: 50%; --copy-y: 48%; --copy-w: min(76%,720px);
}

.guest-experience .sample.photo h1 {
  color: inherit; font: italic 400 clamp(32px,9vw,94px)/1.1 Baskerville,Georgia,serif;
  letter-spacing: -.045em; margin: 0; overflow-wrap: anywhere;
}
.guest-experience .sample.photo .long-name h1 { font-size: clamp(22px,6vw,66px); }
.guest-experience[data-size="small"] .sample.photo h1 { font-size: clamp(26px,6vw,68px); }
.guest-experience[data-size="large"] .sample.photo h1 { font-size: clamp(36px,10vw,104px); }
.guest-experience[data-font="classic"] .sample.photo h1 { font-family: Georgia,serif; font-style: normal; }
.guest-experience[data-font="roman"] .sample.photo h1 { font-family: Palatino,'Times New Roman',serif; font-style: normal; }
.guest-experience[data-surface="paper"] .invite-cover .sample.photo {
  height: 100%; width: 100%; aspect-ratio: auto; background: #faf6eb;
}
.guest-experience .cover-scroll {
  bottom: max(28px,env(safe-area-inset-bottom)); min-height: 46px; display: inline-flex; align-items: center; gap: 10px;
  color: #46372b; background: #fdf9ef; text-decoration: none;
}
.guest-experience .paper { width: min(100%,660px); margin: 0 auto; padding: 44px clamp(22px,8%,42px) 52px; background: var(--guest-paper); color: inherit; box-shadow: none; border: 0; }
.guest-experience .paper::before { display:none; }
.guest-experience .guest-section { padding: 27px 0 23px; border-top: 1px solid #bbad994f; }
.guest-experience .guest-section h2 { font-size: clamp(30px,7vw,43px); }
.guest-date { font-family: Georgia,serif; }
.guest-maps { display:flex; flex-wrap:wrap; justify-content:center; column-gap:20px; }
.guest-maps a { min-height:44px; display:inline-flex; align-items:center; text-decoration:underline; text-underline-offset:4px; }
.guest-experience .paper form { margin: 0 auto; text-align:left; }
.guest-experience .paper form :is(input,select,textarea,button) { min-height:44px; }
.guest-experience .opening-replay { padding: 8px 14px 20px; }
body:has(main > .guest-experience) .demo-next { margin:0; padding:14px; }

.guest-experience :is(h1,h2)[tabindex="-1"]:focus { outline: none; }

/* The envelope overlays the real cover. The cover stays in the same position. */
.guest-experience[data-scene] .opening-intro {
  position: absolute; inset: 0 0 auto; height: var(--scene-height); z-index: 4;
}
.guest-experience[data-scene] .opening-card { visibility: hidden; }
.guest-experience[data-scene="closed"] .paper,
.guest-experience[data-scene="closed"] ~ .demo-next { display: none; }


.guest-experience .invite-cover .sample-copy { z-index: 1; gap: clamp(12px,3vh,26px); }
.guest-experience .invite-cover .sample.photo small { font-size: clamp(11px,1.6vw,14px); }
.guest-experience .invite-cover .sample.photo .date { font-size: clamp(13px,2vw,17px); }
.guest-experience .invite-cover .sample.photo::before,
.guest-experience .invite-cover .sample.photo::after {
  display: block; content: ''; position: absolute; pointer-events: none;
  width: clamp(125px,37vw,460px); height: clamp(140px,36vh,390px); aspect-ratio: auto; z-index: 0;
}
.guest-experience .invite-cover .sample.photo::before {
  inset: -6% auto auto -6%; transform: rotate(-20deg);
  background: url('/assets/threadlace.webp') center / contain no-repeat; opacity: .6;
}
.guest-experience .invite-cover .sample.photo::after {
  inset: auto -7% -5% auto; transform: rotate(-23deg);
  background: url('/assets/peonyspray.webp') center / contain no-repeat;
}
.guest-experience[data-surface="paper"] .invite-cover .sample.photo::before {
  width: 54px; height: 65px; inset: 6% 8% auto auto; transform: rotate(7deg); opacity: 1;
  background: url('/assets/stamp.webp') center / contain no-repeat;
}
.guest-experience[data-surface="paper"] .invite-cover .sample.photo::after { display: none; }
.guest-experience .opening-pocket { transform-origin: center bottom; }
.guest-experience .opening-intro:is([data-opening="seal"],[data-opening="envelope"]) .opening-object {
  perspective: max(800px,105vw);
}

@media (min-width:600px) {
  html:has(.guest-experience[data-scene]) { scrollbar-gutter: stable; }
}
@media (prefers-reduced-motion:no-preference) {
  .guest-experience[data-scene] .opening-in-progress {
    background: transparent; pointer-events: none;
  }
  .guest-experience[data-scene] .opening-in-progress .opening-action,
  .guest-experience[data-scene] .opening-in-progress .opening-skip {
    opacity: 0; transition: opacity .18s;
  }
  .guest-experience[data-scene] .opening-in-progress .opening-lining {
    opacity: 0; transition: opacity .22s ease .2s;
  }
  .guest-experience[data-scene] .opening-in-progress .opening-seal {
    animation: guest-seal-release .32s ease-out both;
  }
  .guest-experience[data-scene] .opening-in-progress .opening-flap {
    backface-visibility: hidden;
    animation: guest-unfold-top .88s .18s cubic-bezier(.38,.09,.3,1) both;
  }
  .guest-experience[data-scene] .opening-in-progress .opening-pocket {
    backface-visibility: hidden;
    animation: guest-unfold-bottom 1.02s .46s cubic-bezier(.4,.12,.22,1) both;
  }
  @keyframes guest-seal-release { to { opacity: 0; scale: .94; } }
  @keyframes guest-unfold-top { to { transform: rotateX(135deg); } }
  @keyframes guest-unfold-bottom { to { transform: rotateX(-124deg); } }
}

.guest-experience .attendance-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 18px 0; padding: 0; border: 0; }
.guest-experience .attendance-choices legend { margin-bottom: 8px; font-size: 13px; }
.guest-experience .attendance-choices label { position: relative; margin: 0; }
.guest-experience .attendance-choices label:last-child { grid-column: 1/-1; }
.guest-experience .attendance-choices input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; }
.guest-experience .attendance-choices span { display: grid; place-items: center; min-height: 46px; padding: 8px; text-align: center; border: 1px solid #b4a38d; cursor: pointer; }
.guest-experience .attendance-choices :checked + span { background: #514238; border-color: #514238; color: #fff9ef; }
.guest-experience .attendance-choices :focus-visible + span { outline: 2px solid #84634f; outline-offset: 2px; }
.guest-experience .guest-stepper { display: grid; grid-template-columns: auto minmax(48px,90px) auto; justify-content: start; }
.guest-experience .guest-stepper button { width: 46px; padding: 0; font-size: 21px; }
.guest-experience .guest-stepper button:disabled { opacity: .5; cursor: default; }
.guest-experience .guest-stepper input { margin: 0; text-align: center; }
.guest-experience .guest-stepper label { margin-bottom: 6px; }
.guest-experience .paper { animation: none; }
.memory-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr)); gap:10px; margin:16px 0; }
.memory-grid img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; }
.memory-grid button { width:100%; margin-top:6px; }
.guest-experience.laceblush { background:#fbefea; }
.guest-experience.laceblush .invite-cover .sample.photo { background:linear-gradient(#f9e4dfdf,#f9e4dfdf),url('/assets/vellum.webp') center / cover no-repeat; }
.guest-experience.laceblush[data-surface="paper"] .invite-cover .sample.photo { background:#fbefea; }
.guest-experience.laceblush :is(.opening-flap,.opening-pocket) { filter:sepia(.1) saturate(1.2); background-color:#e5b0a8; background-blend-mode:multiply; }
.guest-experience .linked-event { margin-top: 20px; scroll-margin-top: 16px; }
.match-grid { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:8px; margin:16px auto; max-width:400px; }
.match-tile { aspect-ratio:1; display:grid; place-items:center; min-height:44px; padding:7px; }
.match-tile img { display:block; width:100%; height:100%; aspect-ratio:1; object-fit:contain; }
.match-tile[data-face="down"] { background: #eddfcd; }
.match-tile[data-face="down"] img { visibility:hidden; }
.match-tile:disabled { background:#edeadd; opacity:.75; }

.guest-experience .invite-cover {
  height: auto; min-height: var(--scene-height); place-items: stretch;
}
.guest-experience .invite-cover .sample.photo {
  min-height: var(--scene-height); height: auto; display: grid; place-items: center;
  padding: clamp(36px,9svh,100px) clamp(22px,8vw,110px) clamp(96px,14svh,148px);
}
.guest-experience .invite-cover .sample-copy {
  position: relative; inset: auto; transform: none; width: min(100%,740px);
}
.cover-place { display: grid; gap: 7px; text-align: center; overflow-wrap: anywhere; }
.guest-experience .cover-venue { font: 600 clamp(15px,2.3vw,24px)/1.35 Georgia,serif; }
.guest-experience .cover-address { max-width: 48ch; font-size: clamp(12px,1.8vw,15px); line-height: 1.5; }
.guest-experience .sample.photo .date { max-width: 30ch; line-height: 1.55; }
.editor-preview .cover-place,.opening-preview-dialog .sample .cover-place { font-size: clamp(7px,2.7cqw,13px); line-height: 1.35; }
.editor-preview .cover-venue,.opening-preview-dialog .cover-venue { font-weight: 600; }

.guest-experience[data-surface="photo"]:is(.toile,.velvet,.olive) .invite-cover .sample.photo {
  background: var(--photo) center/100% 100% no-repeat;
}
.guest-experience[data-surface="photo"]:is(.toile,.velvet,.olive) .invite-cover .sample.photo::before,
.guest-experience[data-surface="photo"]:is(.toile,.velvet,.olive) .invite-cover .sample.photo::after { display:none; }
.guest-experience.velvet .opening-leaf { background:linear-gradient(110deg,#481321,#7c3043,#481321); border:double 6px #bb9a67; }
.guest-experience.toile .opening-ribbon { filter:hue-rotate(190deg) saturate(.75); }

.guest-experience[data-surface="photo"]:is(.berceau,.grenat,.dahlia) .invite-cover .sample.photo {
  background:var(--photo) center / cover no-repeat;
}
.guest-experience[data-surface="photo"]:is(.berceau,.grenat,.dahlia) .sample.photo::before,
.guest-experience[data-surface="photo"]:is(.berceau,.grenat,.dahlia) .sample.photo::after { display:none; }
@media(min-aspect-ratio:1/1) {
  .guest-experience[data-surface="photo"]:is(.berceau,.grenat,.dahlia) .invite-cover .sample.photo {
    background-image: var(--wide-paper);
    background-size:cover;
  }
}
.guest-experience.grenat :is(.opening-pocket,.opening-flap) { background-color:#84343e; background-blend-mode:multiply; }
.guest-experience.dahlia .opening-ribbon { filter:sepia(.6) saturate(.85); }

/* Carry each collection's materials through to the live printed surface. */
.guest-experience[data-surface="photo"]:is(.minimal,.garden,.ribbon,.white,.dentelle) .invite-cover .sample.photo::before {
  background-image:none; transform:none; opacity:1; inset:3%; width:auto; height:auto; border:1px solid var(--theme-line);
}
.guest-experience.minimal[data-surface="photo"] .invite-cover .sample.photo::after { background-image:url('/assets/motif-archive.webp'); transform:none; }
.guest-experience.garden[data-surface="photo"] .invite-cover .sample.photo::after { background-image:url('/assets/motif-nacre.webp'); transform:none; }
.guest-experience.ribbon[data-surface="photo"] .invite-cover .sample.photo::after { background-image:url('/assets/silkribbon.webp'); }
.guest-experience.dentelle[data-surface="photo"] .invite-cover .sample.photo::after { background-image:url('/assets/threadlace.webp'); }
.guest-experience[data-surface="photo"]:is(.minimal,.garden,.ribbon,.white,.dentelle) .invite-cover .sample.photo::after {
  right:0; bottom:0; width:min(36vw,330px); height:min(29svh,250px);
}

.cachetolive :is(.opening-pocket,.opening-flap) {
  background-image:url('/assets/olive-envelope.webp');
  background-size:100% 100%;
  background-blend-mode:normal;
}
.guest-experience.cachetolive :is(.opening-pocket,.opening-flap) { background-image:url('/assets/olive-envelope.webp'); background-blend-mode:normal; }
.guest-experience.cachetolive .opening-flap { clip-path:polygon(0 0,100% 0,100% 23%,50% 55%,0 23%); }
.guest-experience.cachetolive .opening-pocket { clip-path:polygon(0 22.8%,50% 54.8%,100% 22.8%,100% 100%,0 100%); }
.guest-experience :is(#attendance,.linked-event) {
  background:var(--guest-paper); border:1px solid var(--theme-line,#bfae9d);
  border-radius:2px; padding:clamp(16px,5vw,32px); margin-block:26px;
}
.guest-experience :is(#attendance,.linked-event) h2 { font-family:Baskerville,Georgia,serif; text-wrap:balance; }
.guest-experience .reply-note { font:italic 1.05rem/1.5 Georgia,serif; white-space:pre-line; overflow-wrap:anywhere; }
.guest-experience .countdown { font-variant-numeric:tabular-nums; }
[data-quiz] fieldset,.quiz-editor fieldset { margin:14px 0; padding:12px 16px; min-width:0; border:1px solid var(--theme-line,#b8a99a); }
[data-quiz] legend { padding:0 5px; font-family:Georgia,serif; }
.guest-experience [data-quiz] label { display:flex; align-items:center; gap:10px; min-height:44px; margin:0; cursor:pointer; }
.guest-experience [data-quiz] input { width:20px; height:20px; min-height:0; margin:0; }
[data-quiz] [data-feedback] { font-weight:600; }
.guest-experience :is(#attendance,.linked-event)::before {
  content:''; display:block; margin:0 auto 8px; width:76px; height:46px;
  background:var(--edition-motif,url('/assets/threadlace.webp')) center/contain no-repeat;
}
.guest-experience :is(#attendance,.linked-event) { background-image:linear-gradient(125deg,#fff5,transparent 45%); }
.invitation-signature {
  position:absolute; z-index:2; inset:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) auto auto;
  display:inline-flex; gap:6px; align-items:center; min-height:44px; padding:2px 7px;
  color:#513e33; background:#fffaf1eb; border:1px solid #bfa994;
  font:400 13px/1 Baskervville,Georgia,serif;
}
.invitation-signature span { font-size:20px; line-height:1; }
.guest-experience[data-scene="closed"] .invitation-signature { visibility:hidden; }
[data-quiz] summary {
  cursor:pointer; padding-block:10px; font:400 clamp(24px,5vw,34px)/1.2 Baskervville,Georgia,serif;
}
