/* The secret experience is isolated from the existing website. */
.sd-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(var(--sd-bottom, 22px), calc(16px + env(safe-area-inset-bottom)));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: #537c68;
  color: #fff;
  box-shadow: 0 6px 24px rgba(36, 65, 48, .23);
  font: 700 12px/1.2 "DM Sans", system-ui, sans-serif;
  letter-spacing: .12em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s ease, box-shadow .2s ease;
}
.sd-launcher:hover { background: #426753; box-shadow: 0 8px 28px rgba(36, 65, 48, .3); }
.sd-launcher svg { width: 19px; height: 19px; flex: none; }
.sd-launcher:focus-visible, .sd-dialog :focus-visible { outline: 3px solid #ad7b2a; outline-offset: 4px; }
.sd-dialog {
  width: min(590px, calc(100% - 32px));
  max-width: 960px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfd5c4;
  border-radius: 24px;
  background: #fbf7ef;
  color: #2f4137;
  box-shadow: 0 28px 100px rgba(13, 26, 19, .35);
  font: 400 15px/1.6 "DM Sans", system-ui, sans-serif;
  text-align: center;
  overscroll-behavior: contain;
  color-scheme: light;
}
.sd-dialog:not([open]), .sd-dialog [hidden] { display: none !important; }
.sd-dialog::backdrop { background: rgba(21, 35, 28, .72); backdrop-filter: blur(5px); }
.sd-dialog.sd-revealed { width: min(960px, calc(100% - 32px)); }
.sd-scroll { max-height: calc(100dvh - 34px); overflow-y: auto; overscroll-behavior: contain; padding: 32px 36px; scrollbar-gutter: stable; }
.sd-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e4dbcd;
  border-radius: 50%;
  background: #fbf7ef;
  color: #344c3e;
  cursor: pointer;
}
.sd-close:hover { background: #efe9de; }
.sd-close svg { width: 20px; height: 20px; }
.sd-header { padding: 0 24px; }
.sd-kicker { margin: 0 0 9px; color: #7a674b; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.sd-title { margin: 0; color: #365641; font: 500 clamp(27px, 4.5vw, 38px)/1.15 "Fraunces", Georgia, serif; letter-spacing: .015em; }
.sd-hint { margin: 11px 0 22px; color: #6e6c61; font-size: 14px; font-style: italic; }
.sd-layout { display: grid; align-items: center; gap: 28px; }
.sd-scene {
  position: relative;
  isolation: isolate;
  width: min(100%, 400px, calc((100svh - 220px) * .91387));
  aspect-ratio: 1199 / 1312;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: #e6ddcf;
  box-shadow: 0 12px 30px rgba(69, 51, 28, .14);
  perspective: 1200px;
}
.sd-room {
  position: absolute;
  left: 25.02%;
  top: 8.54%;
  width: 52.38%;
  height: 89.17%;
  display: grid;
  place-items: center;
  background: #dfd6c7;
  transition: left .65s ease, top .65s ease, width .65s ease, height .65s ease;
}
.sd-room img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; filter: brightness(1.12) contrast(.92); }
.sd-frame, .sd-threshold {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("/assets/secret-door.webp") center / 100% 100% no-repeat;
  pointer-events: none;
  transition: opacity .65s ease;
}
/* Keep the supplied architectural frame; only its real leaves move. */
.sd-frame { clip-path: polygon(0 0, 100% 0, 100% 100%, 77.4% 100%, 77.4% 8.54%, 25.02% 8.54%, 25.02% 100%, 0 100%); }
.sd-threshold { clip-path: inset(97.71% 0 0); }
.sd-leaf {
  position: absolute;
  top: 8.54%;
  height: 89.17%;
  z-index: 3;
  background-image: url("/assets/secret-door.webp");
  background-repeat: no-repeat;
  background-size: var(--sd-bg-width) 112.145%;
  background-position: var(--sd-bg-x) 79.034%;
  backface-visibility: hidden;
  transform: rotateY(0deg);
  transition: transform 1.8s cubic-bezier(.32, .03, .2, 1), filter 1.8s ease, opacity .5s ease;
  will-change: transform;
}
.sd-left {
  left: 25.02%;
  width: 26.61%;
  --sd-bg-width: 375.8%;
  --sd-bg-x: 34.09%;
  transform-origin: left center;
}
.sd-right {
  left: 51.63%;
  width: 25.77%;
  --sd-bg-width: 388.05%;
  --sd-bg-x: 69.56%;
  transform-origin: right center;
}
.sd-handle {
  position: absolute;
  left: 0;
  top: 47.5%;
  width: 38%;
  height: 18%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 38%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.sd-handle::after { content: ""; position: absolute; inset: 15% 5%; border-radius: 50%; box-shadow: 0 0 16px 5px rgba(233, 186, 85, .28); transition: box-shadow .2s; }
.sd-handle:hover::after { box-shadow: 0 0 20px 7px rgba(233, 186, 85, .55); }
.sd-handle:focus-visible { outline-offset: -2px; }
.sd-scene.sd-opening .sd-left { transform: rotateY(-100deg); filter: brightness(.72); }
.sd-scene.sd-opening .sd-right { transform: rotateY(100deg); filter: brightness(.72); }
.sd-scene.sd-open .sd-room { left: 0; top: 0; width: 100%; height: 100%; }
.sd-scene.sd-open .sd-frame, .sd-scene.sd-open .sd-threshold, .sd-scene.sd-open .sd-leaf { opacity: 0; }
.sd-revealed .sd-layout { grid-template-areas: "welcome" "photo" "details" "notes"; gap: 20px; }
.sd-revealed .sd-scene { grid-area: photo; width: 100%; aspect-ratio: 1; background: transparent; }
.sd-revealed .sd-room { background: transparent; }
.sd-invitation { grid-area: details; text-align: left; animation: sd-welcome .55s ease both; }
.sd-invitation-title { grid-area: welcome; margin: 0; color: #365641; font: 500 clamp(27px, 3vw, 34px)/1.16 "Fraunces", Georgia, serif; letter-spacing: -.025em; text-align: center; animation: sd-welcome .55s ease both; }
.sd-invitation-footer { grid-area: notes; text-align: center; animation: sd-welcome .55s ease both; }
.sd-invitation p { margin: 0 0 14px; }
.sd-invitation strong { font-weight: 700; }
.sd-password-box { margin: 20px 0 16px; padding: 15px; border: 1px solid #d7c6a7; border-radius: 12px; background: #f4ecdd; text-align: center; }
.sd-password-box span { display: block; margin-bottom: 5px; color: #6c675c; font-size: 12px; }
.sd-password-box strong { display: block; color: #3e5d47; font: 500 27px/1.3 "Fraunces", Georgia, serif; letter-spacing: .07em; user-select: all; }
.sd-invitation .sd-password-note { font-size: 13px; color: #676b61; }
.sd-actions { display: grid; gap: 10px; margin-top: 20px; }
.sd-action { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 15px; border: 1px solid #537c68; border-radius: 999px; font: 700 11px/1.45 "DM Sans", system-ui, sans-serif; letter-spacing: .06em; text-align: center; text-decoration: none; cursor: pointer; }
.sd-copy { background: transparent; color: #42634f; }
.sd-copy:hover { background: #edf0e8; }
.sd-claim { background: #537c68; color: white; }
.sd-claim:hover { background: #426753; }
.sd-action svg { width: 16px; height: 16px; flex: none; }
.sd-invitation-footer .sd-message-note { margin: 0 0 8px; color: #6b6d64; font-size: 11px; }
.sd-invitation-footer .sd-status { margin: 8px 0; color: #42634f; font-size: 12px; }
.sd-invitation-footer .sd-status:empty { display: none; }
.sd-invitation-footer .sd-terms { margin: 0; color: #6b6d64; font-size: 11px; font-style: italic; }
@keyframes sd-welcome { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 741px) { .sd-revealed .sd-layout { grid-template-columns: 1fr 1fr; grid-template-areas: "welcome welcome" "photo details" "notes notes"; gap: 20px 34px; } }
@media (max-width: 740px) {
  .sd-launcher { right: max(12px, env(safe-area-inset-right)); padding: 12px 17px; }
  .sd-dialog, .sd-dialog.sd-revealed { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 20px; }
  .sd-scroll { max-height: calc(100dvh - 22px); padding: 28px 20px; scrollbar-gutter: auto; }
  .sd-header { padding: 0 18px; }
  .sd-kicker { font-size: 9px; }
  .sd-hint { font-size: 12px; }
  .sd-close { top: 6px; right: 6px; width: 40px; height: 40px; }
  .sd-revealed .sd-scene { width: min(100%, 300px); }
  .sd-invitation { max-width: 430px; margin: auto; }
  .sd-invitation-title { font-size: 29px; }
}
@media (max-width: 680px) {
  .sd-launcher {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    width: max-content;
    max-width: 100%;
    min-height: 44px;
    padding: 9px 14px;
    gap: 7px;
    font-size: 11px;
    box-shadow: 0 3px 12px rgba(36, 65, 48, .16);
    animation: sd-mobile-pulse 4s ease-in-out 1.5s infinite;
  }
  .sd-launcher svg { width: 16px; height: 16px; }
  .sd-launcher:hover, .sd-launcher:focus-visible { animation: none; }
}
@keyframes sd-mobile-pulse { 0%, 100% { background-color: #537c68; } 50% { background-color: #496f5c; } }
@media (prefers-reduced-motion: reduce) {
  .sd-launcher, .sd-dialog *, .sd-dialog *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
