/* A paper invitation at the doorway to a little world of birthday magic. */
.birthday-opening {
  --opening-gold: #dfc6a0;
  --opening-plum: #291723;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
  overscroll-behavior: contain;
  color: #f7ede2;
  isolation: isolate;
  background: #291723;
  -webkit-overflow-scrolling: touch;
}
.opening-door {
  position: fixed;
  inset-block: 0;
  width: 50.1%;
  z-index: -2;
  background: #291723;
  pointer-events: none;
}
.opening-door-left { left: 0; background: radial-gradient(ellipse at 100% 47%, #593044 0, #352033 45%, #211720 100%); }
.opening-door-right { right: 0; background: radial-gradient(ellipse at 0% 47%, #593044 0, #352033 45%, #211720 100%); }
.opening-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.opening-sky::before,
.opening-sky::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  border: 1px solid #dfc6a01a;
  border-radius: 50%;
  width: min(112vw, 1150px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.opening-sky::after { width: min(93vw, 950px); border-color: #dfc6a012; }
.opening-constellations { position: absolute; width: 100%; height: 100%; opacity: .7; }
.opening-star { position: absolute; color: var(--opening-gold); font: 28px/1 var(--serif, Georgia, serif); opacity: .6; }
.opening-star:nth-of-type(1) { top: 17%; left: 19%; font-size: 34px; }
.opening-star:nth-of-type(2) { top: 32%; right: 11%; font-size: 20px; }
.opening-star:nth-of-type(3) { bottom: 20%; left: 12%; font-size: 20px; }
.opening-star:nth-of-type(4) { bottom: 16%; right: 20%; font-size: 34px; }
.opening-shell {
  min-height: 100%;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 30px 48px 22px;
}
.opening-masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #e8d1bc; }
.opening-brand { display: inline-flex; align-items: center; gap: 12px; }
.opening-brand svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.25; }
.opening-private { font-size: 9px; letter-spacing: .17em; color: #d4b7b5; }
.opening-stage { position: relative; display: grid; justify-items: center; align-content: center; width: 100%; padding: 8px 0; }
.opening-invitation {
  position: relative;
  width: min(100%, 464px);
  padding: 36px 42px 30px;
  text-align: center;
  color: #532331;
  border-radius: 230px 230px 8px 8px;
  background: radial-gradient(ellipse at 50% 0%, #fffdf7, #f8f2e8 75%);
  box-shadow: 0 32px 90px #0b070d60, 0 0 0 1px #f4dcc133, inset 0 0 30px #a36d4b0a;
}
.opening-invitation::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #b995704d;
  border-radius: 219px 219px 2px 2px;
  pointer-events: none;
}
.opening-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border: 3px double #c98a85;
  border-radius: 47% 53% 50% 46% / 48% 46% 53% 52%;
  background: linear-gradient(135deg, #974c5c, #702b3e 62%, #8a4353);
  color: #f3d5b3;
  box-shadow: 0 3px 5px #53233126, inset 0 1px 4px #f5bca955;
  transform: rotate(-8deg);
}
.opening-seal svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.15; }
.opening-eyebrow { font-size: 9px; font-weight: 600; letter-spacing: .23em; text-transform: uppercase; color: #815c57; margin-bottom: 12px; }
.opening-title { font: 400 clamp(56px, 5.3vw, 72px)/.95 var(--serif, Georgia, serif); letter-spacing: -.045em; color: #532331; }
.opening-title span { display: block; animation: none; }
.opening-title em { font-weight: 400; }
.birthday-opening .opening-title:focus { outline: none; }
.opening-dedication { margin: 18px 0 22px; color: #7a6057; font-size: 13px; line-height: 1.75; }
.opening-dedication span { display: block; }
.opening-password-label { display: block; color: #603b43; font-size: 11px; font-weight: 600; letter-spacing: .03em; margin-bottom: 11px; }
.opening-password-wrap { position: relative; width: min(100%, 310px); height: 52px; margin: 0 auto; border-radius: 8px; }
.opening-password-wrap input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  font-size: 22px;
  letter-spacing: 1em;
  padding: 0;
  box-shadow: none;
}
.opening-password-wrap input:focus { outline: none; }
.opening-password-wrap:focus-within { outline: 2px solid #8c5360; outline-offset: 5px; }
.opening-password-wrap input::selection { background: transparent; color: transparent; }
.opening-password-wrap input::-ms-reveal { display: none; }
.opening-password-wrap input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #faf5ec inset; -webkit-text-fill-color: transparent; }
.opening-slots { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; height: 100%; pointer-events: none; }
.opening-slot { display: grid; place-items: center; border: 1px solid #d6c4b4; border-radius: 7px; background: #fffdf840; color: #722d3f; font: 500 23px/1 var(--sans, Arial, sans-serif); box-shadow: 0 2px 2px #6b493105; }
.opening-slot::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #b9a392; }
.opening-slot.is-filled::before { display: none; }
.opening-password-wrap:focus-within .opening-slot.is-current { border-color: #89515e; background: #fffdf8; }
.opening-password-wrap.is-invalid .opening-slot { border-color: #a15a66; }
.opening-password-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(100%, 310px); margin: 6px auto 0; }
.opening-password-meta p { font-size: 10px; line-height: 1.5; color: #7a6258; text-align: left; }
.opening-visibility { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 59px; min-height: 44px; padding: 0; background: none; border: 0; color: #72434d; font-size: 10px; }
.opening-visibility svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.35; }
.opening-status { min-height: 33px; margin: 1px 0 5px; color: #8c354a; font-size: 11px; line-height: 1.45; }
.opening-submit { display: flex; align-items: center; justify-content: center; gap: 16px; width: min(100%, 310px); min-height: 52px; padding: 12px 18px; margin: 0 auto; border: 1px solid #7a3547; border-radius: 99px; background: #722d3f; color: #fff8ee; font-size: 12px; font-weight: 500; box-shadow: 0 5px 12px #722d3f12; transition: background .2s, transform .2s; }
.opening-submit svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.opening-submit:hover:not(:disabled) { background: #592335; transform: translateY(-1px); }
.opening-submit:active:not(:disabled) { transform: translateY(0); }
.opening-hint { margin: 7px auto 0; color: #80645a; font-size: 11px; }
.opening-hint summary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; cursor: pointer; list-style: none; text-decoration: underline; text-decoration-color: #cdbbac; text-underline-offset: 4px; }
.opening-hint summary::-webkit-details-marker { display: none; }
.opening-hint p { font-size: 11px; line-height: 1.5; padding-bottom: 5px; }
.opening-hint p span { display: block; font-size: 10px; letter-spacing: .1em; margin-top: 3px; }
.opening-card-footer { display: flex; justify-content: center; align-items: center; gap: 9px; font: italic 17px/1.3 var(--serif, Georgia, serif); color: #80645a; margin-top: 6px; }
.opening-card-footer::before,
.opening-card-footer::after { content: ""; width: 28px; height: 1px; background: #d4bfa9; }
.opening-footnote { text-align: center; font: italic 18px/1.4 var(--serif, Georgia, serif); letter-spacing: .01em; color: #dcbdae; }
.opening-noscript { font-size: 12px; margin: 14px auto 0; color: #8c354a; }
.opening-welcome { position: fixed; z-index: 5; inset: 0; display: grid; place-content: center; gap: 24px; padding: 28px; text-align: center; pointer-events: none; opacity: 0; color: #fff4dd; }
.opening-welcome svg { width: 48px; height: 48px; margin: 0 auto; fill: none; stroke: #f1d49e; stroke-width: 1; }
.opening-welcome p { font: 400 clamp(37px, 5.2vw, 65px)/1.05 var(--serif, Georgia, serif); letter-spacing: -.025em; text-wrap: balance; text-shadow: 0 2px 14px #29172350; }
.opening-welcome p span { display: block; font-style: italic; }
.birthday-opening.is-unlocking { background: transparent; pointer-events: none; }
.birthday-opening.is-unlocking .opening-shell,
.birthday-opening.is-unlocking .opening-sky { animation: opening-invitation-away .36s ease forwards; }
.birthday-opening.is-unlocking .opening-door-left { animation: opening-left-door .85s .42s cubic-bezier(.65, 0, .22, 1) forwards; }
.birthday-opening.is-unlocking .opening-door-right { animation: opening-right-door .85s .42s cubic-bezier(.65, 0, .22, 1) forwards; }
.birthday-opening.is-unlocking .opening-welcome { animation: opening-welcome 1.32s ease both; }
.birthday-opening :focus-visible { outline: 2px solid #8c5360; outline-offset: 4px; }
@keyframes opening-invitation-away { to { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes opening-left-door { to { transform: translateX(-100%); } }
@keyframes opening-right-door { to { transform: translateX(100%); } }
@keyframes opening-welcome { 0% { opacity: 0; transform: translateY(10px); } 25%, 65% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes opening-twinkle { 0%, 100% { opacity: .3; transform: scale(.9); } 50% { opacity: .75; transform: scale(1.1); } }
@keyframes opening-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: no-preference) {
  .opening-star { animation: opening-twinkle 5s ease-in-out infinite; }
  .opening-star:nth-of-type(2n) { animation-delay: -2.5s; }
  .opening-password-wrap.is-shaking { animation: opening-shake .3s ease; }
}
@media (max-width: 600px) {
  .opening-shell { padding: 20px 22px 18px; gap: 22px; }
  .opening-masthead { justify-content: center; }
  .opening-private { display: none; }
  .opening-invitation { padding: 30px 28px 24px; border-radius: 190px 190px 7px 7px; }
  .opening-invitation::before { inset: 10px; border-radius: 180px 180px 2px 2px; }
  .opening-title { font-size: 62px; }
  .opening-seal { width: 48px; height: 48px; margin-bottom: 15px; }
  .opening-eyebrow { font-size: 8px; margin-bottom: 10px; }
  .opening-dedication { margin: 15px 0 19px; font-size: 12px; }
  .opening-slots { gap: 6px; }
  .opening-password-meta p { max-width: 160px; font-size: 9px; }
  .opening-footnote { font-size: 17px; }
  .opening-star:nth-of-type(1) { left: 6%; top: 10%; }
  .opening-star:nth-of-type(2) { right: 4%; top: 33%; }
  .opening-star:nth-of-type(3) { left: 5%; bottom: 11%; }
  .opening-star:nth-of-type(4) { right: 5%; bottom: 7%; }
}
@media (max-width: 359px) {
  .opening-shell { padding-inline: 14px; gap: 18px; }
  .opening-invitation { padding-inline: 24px; }
  .opening-title { font-size: 54px; }
  .opening-password-wrap { height: 46px; }
  .opening-slots { gap: 5px; }
  .opening-password-meta p { max-width: 140px; }
  .opening-masthead { font-size: 9px; }
}
@media (max-height: 760px) and (min-width: 601px) {
  .opening-shell { gap: 16px; padding-top: 20px; padding-bottom: 16px; }
  .opening-invitation { padding-top: 28px; padding-bottom: 22px; }
  .opening-title { font-size: 60px; }
  .opening-seal { width: 45px; height: 45px; margin-bottom: 12px; }
  .opening-dedication { margin-block: 13px 15px; }
  .opening-status { min-height: 24px; }
  .opening-hint summary { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .birthday-opening *, .birthday-opening *::before, .birthday-opening *::after { animation: none !important; transition: none !important; }
}
.motion-reduced .birthday-opening *,
.birthday-opening.is-reduced-motion * { animation: none !important; transition: none !important; }
.birthday-opening.is-reduced-motion.is-unlocking .opening-shell,
.birthday-opening.is-reduced-motion.is-unlocking .opening-sky,
.birthday-opening.is-reduced-motion.is-unlocking .opening-door { opacity: 0; }
