html:has(#gift-dialog[open], #midnight-dialog[open]) { overflow: hidden; }
.intro-preferences { display: flex; justify-content: center; gap: .12rem; }
#intro-motion {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #f0cfbc;
  padding: .2rem .7rem;
  font-size: .89rem;
  text-decoration: underline;
  text-underline-offset: .2em;
  animation: line-in .75s 1.55s both;
}
#intro-motion:focus-visible { animation: none; }
#intro-motion[aria-pressed=true] { color: #ffe0a2; text-decoration-style: double; }
.site-controls { display: flex; align-items: center; flex: none; gap: .43rem; }
#motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  min-height: 44px;
  padding-inline: .69rem;
  border: 1px solid #d5b7a8;
  border-radius: 999px;
  color: #612e44;
  background: #fffaf4;
  font: .85rem/1.15 var(--sans);
}
#motion-toggle[aria-pressed=true] { background: #632942; color: #fff2e2; border-color: #632942; }
.birthday-replay { margin-block-start: 1rem; }
#countdown[data-phase=birthday] {
  background:
    radial-gradient(ellipse at 25% 50%,#edd0bb66,transparent 44%),
    radial-gradient(ellipse at 73% 10%,#e6bebb76,transparent 62%),
    #fff5ea;
}

#midnight-dialog {
  width: min(61rem, calc(100% - 1.3rem));
  max-height: calc(100dvh - 1.25rem);
  padding: 0;
  border: 1px solid #ba9279;
  border-radius: .65rem;
  background: #200c19;
  color: #fff4e6;
  overscroll-behavior: contain;
  box-shadow: 0 1.2rem 6rem #110718bf;
}
#midnight-dialog[open] { animation: midnight-dialog-in .5s ease-out both; }
@keyframes midnight-dialog-in { from { opacity: 0; transform: scale(.965); } to { opacity: 1; transform: none; } }
.midnight-film {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem) clamp(.95rem, 4vw, 3rem);
  min-height: min(37rem, calc(100dvh - 1.35rem));
}
.midnight-film::before { content: ''; position: absolute; inset: .65rem; border: 1px solid #e6bc839c; pointer-events: none; z-index: -1; }
.midnight-flora {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 51% 49%,#200e1ce0 25%,#26131f77 72%),
    linear-gradient(45deg,#23151ab3,#3210116e), url('./assets/hero.webp') left 48%/cover no-repeat;
  animation: midnight-camera 9s ease-out both;
}
@keyframes midnight-camera { from { scale: 1.12; opacity: .6; } to {scale: 1; opacity: 1;} }
.midnight-stars { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.midnight-stars i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffdd9c;
  box-shadow: 0 0 12px 3px #eabb668f;
  animation: midnight-shine 3.4s var(--delay, 0s) ease-out both;
}
@keyframes midnight-shine { from { opacity: 0; transform: translateY(32px) scale(.55); } 32% {opacity: .96;} to { opacity: .52; transform: translateY(-16px) scale(.64); } }
.midnight-copy { max-width: 40rem; }
.midnight-sigil {
  display: inline-grid;
  place-items: center;
  width: clamp(3.25rem, 9vw, 5.2rem);
  height: clamp(3.25rem, 9vw, 5.2rem);
  border: 1px solid #ffe0ae;
  border-radius: 50%;
  font-size: clamp(1.85rem, 5vw, 3.1rem);
  line-height: 1;
  color: #ffdfab;
  box-shadow: 0 0 2.7rem #f4c38237, inset 0 0 1.7rem #f4c38225;
}
#midnight-date { margin: .85rem auto .25rem; color: #f0cb9f; font-size: .93rem; }
#midnight-title { margin: .1rem 0 .8rem; font: 600 clamp(2.38rem, 7.2vw, 5.3rem)/1.24 var(--serif); text-wrap: balance; }
#midnight-lines p { margin: .35rem 0; font-size: clamp(1.02rem, 2.5vw, 1.28rem); color: #f9ddd2; text-wrap: balance; }
#midnight-close { margin-block-start: 1.24rem; }
#midnight-dialog[open] #midnight-title { animation: midnight-line .65s .08s both; }
#midnight-dialog[open] #midnight-lines p:nth-child(1) { animation: midnight-line .7s .36s both; }
#midnight-dialog[open] #midnight-lines p:nth-child(2) { animation: midnight-line .7s .66s both; }
@keyframes midnight-line { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  #motion-toggle .motion-label { display: none; }
  #motion-toggle { padding: 0; justify-content: center; min-width: 44px; }
}
@media (max-width: 510px) {
  .site-controls { gap: .28rem; }
  .sound-label { display: none; }
  .site-header { min-height: 58px; }
  #sound-volume { width: max(44px, 11vw); }
}
@media (max-width: 365px) {
  .site-header { padding-inline: .38rem; gap: .05rem; }
  .brand { font-size: .83rem; }
  .brand span { width: 1.35rem; height: 1.35rem; }
  #mobile-menu summary { padding-inline: .24rem; font-size: .83rem; }
}
@media (prefers-reduced-motion: reduce) {
  .vg-heart-path { animation-duration: .001ms !important; }
}
html[data-motion=reduce] { scroll-behavior: auto; }
html[data-motion=reduce] *, html[data-motion=reduce] *::before, html[data-motion=reduce] *::after {
  animation-duration: .001ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html[data-motion=reduce] .petals i { display: none; }
:is(html[data-motion=reduce] .is-traced) .vg-heart-path { opacity: 1; stroke-dashoffset: 0; }
