/* An original, self-contained nighttime celebration. */
dialog.night-show {
  --night-gold: #eed4a0;
  --night-cream: #fff3db;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: var(--night-cream);
  background: #060918;
  font-family: var(--sans, 'DM Sans', sans-serif);
  isolation: isolate;
}
.night-show::backdrop { background: #060918; }
.night-show *, .night-show *::before, .night-show *::after { box-sizing: border-box; }
.night-show [hidden] { display: none !important; }
.night-show__sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 74%, #39265a70, transparent 51%),
    radial-gradient(ellipse at 75% 20%, #29366036, transparent 40%),
    linear-gradient(180deg, #050816 0%, #10132c 56%, #251b39 77%, #070d1e 78%, #080b18 100%);
}
.night-show__stars, .night-show__fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.night-show__stars { opacity: .82; }
.night-show__moon {
  position: absolute;
  top: 22%;
  right: 12%;
  width: clamp(19px, 2.2vw, 32px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff1ca;
  box-shadow: 0 0 23px #ffeac93b, 0 0 90px 24px #e0caff0c;
  opacity: .73;
}
.night-show__moon::after { content: ''; position: absolute; inset: -3px 5px 4px -5px; border-radius: 50%; background: #0e1126; }
.night-show__haze {
  position: absolute;
  inset: 39% -15% 14%;
  background: radial-gradient(ellipse at center bottom, #987cd725, transparent 64%);
  pointer-events: none;
}
.night-show__beams { position: absolute; left: 50%; top: 9%; width: 100%; height: 70%; transform: translateX(-50%); opacity: .25; }
.night-show__beam { position: absolute; inset: 0; transform-origin: 50% 100%; background: linear-gradient(0deg, #e8c9ff3a, transparent 90%); clip-path: polygon(49.5% 100%, 35% 0, 44% 0, 50.5% 100%); }
.night-show__beam:nth-child(2) { transform: rotate(24deg); opacity: .5; }
.night-show__beam:nth-child(3) { transform: rotate(-27deg); opacity: .65; }
.night-show__beam:nth-child(4) { transform: rotate(44deg); opacity: .4; }
.night-show__shore { position: absolute; left: 0; right: 0; top: 77%; height: 2px; background: linear-gradient(90deg, transparent, #c5a5e05c 40%, #f9dab48c 50%, #c5a5e05c 60%, transparent); box-shadow: 0 0 30px #bd78f93b; }
.night-show__castle {
  position: absolute;
  bottom: -3%;
  left: 50%;
  width: min(93vw, 850px, 106vh);
  width: min(93vw, 850px, 106dvh);
  transform: translateX(-50%);
  pointer-events: none;
}
.night-show__castle svg { display: block; width: 100%; height: auto; overflow: visible; }
.night-show__projection { opacity: .56; }
.night-show__header {
  position: absolute;
  z-index: 3;
  left: max(26px, env(safe-area-inset-left));
  top: max(22px, env(safe-area-inset-top));
  right: max(26px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.night-show__brand { margin: 0; font-size: 10px; font-weight: 500; line-height: 1.7; text-transform: uppercase; letter-spacing: .22em; color: #d5c8de; }
.night-show__brand span { display: block; color: var(--night-gold); font-family: var(--serif, 'Cormorant Garamond', Georgia, serif); font-size: 22px; letter-spacing: -.01em; text-transform: none; font-weight: 400; }
.night-show button { min-height: 44px; border: 1px solid #f3debd3d; border-radius: 100px; color: #fff2de; background: #0a0d208c; padding: 10px 17px; font-family: inherit; font-size: 12px; line-height: 1.4; cursor: pointer; transition: background .2s, border-color .2s; }
.night-show button:hover { background: #463756b3; border-color: #f3debd80; }
.night-show button:focus-visible { outline: 2px solid #ffe0ac; outline-offset: 5px; }
.night-show button:disabled { opacity: .45; cursor: default; }
.night-show__close { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.night-show__close svg { width: 14px; height: 14px; }
.night-show__words { position: absolute; z-index: 2; top: 15%; left: 18px; right: 18px; text-align: center; pointer-events: none; }
.night-show__chapter { margin: 0 0 14px; color: #ead3af; text-transform: uppercase; letter-spacing: .3em; font-size: 10px; line-height: 1.7; }
.night-show__title { max-width: 1000px; margin: 0 auto; font-family: var(--serif, 'Cormorant Garamond', Georgia, serif); color: #fff4e3; font-weight: 400; font-size: clamp(36px, 5.7vw, 76px); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; text-shadow: 0 2px 32px #080b22; }
.night-show__subtitle { max-width: 540px; margin: 15px auto 0; font-size: clamp(12px, 1.1vw, 15px); line-height: 1.8; color: #e1d7e6; text-wrap: balance; text-shadow: 0 2px 15px #080b22; }
.night-show__words.is-finale .night-show__title { color: #ffe7b5; }
.night-show__controls {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 35px 18px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #060918cf 40%, #060918f5);
  text-align: center;
}
.night-show__buttons { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.night-show__controls .night-show__replay { background: #efd5a7; color: #20182d; border-color: #efd5a7; }
.night-show__controls .night-show__replay:hover { background: #fff0d6; }
.night-show__status { margin: 12px 0 0; color: #cfc0d6; font-size: 10px; letter-spacing: .1em; line-height: 1.5; }
.night-show__progress { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #dcc1911a; overflow: hidden; }
.night-show__progress span { display: block; width: 100%; height: 100%; background: #e4c894; transform-origin: left; transform: scaleX(0); }
.night-show__sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .night-show:not(.is-still):not(.is-paused) .night-show__projection { animation: night-projection 14s ease-in-out infinite alternate; }
  .night-show:not(.is-still):not(.is-paused) .night-show__beam { animation: night-beam 15s ease-in-out infinite alternate; }
  .night-show:not(.is-still):not(.is-paused) .night-show__beam:nth-child(2) { animation-delay: -6s; }
  .night-show:not(.is-still):not(.is-paused) .night-show__beam:nth-child(3) { animation-delay: -10s; animation-direction: alternate-reverse; }
  .night-show:not(.is-still):not(.is-paused) .night-show__beam:nth-child(4) { animation-delay: -3s; }
  .night-show__words.is-entering { animation: night-words 1.3s ease-out both; }
  @keyframes night-projection { from { opacity: .25; } to { opacity: .9; } }
  @keyframes night-beam { from { transform: rotate(-23deg); opacity: .3; } to { transform: rotate(23deg); opacity: .65; } }
  @keyframes night-words { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 600px) {
  .night-show__header { left: 18px; right: 18px; top: max(17px, env(safe-area-inset-top)); }
  .night-show__brand { font-size: 8px; letter-spacing: .15em; }
  .night-show__brand span { font-size: 19px; }
  .night-show__words { top: 17%; }
  .night-show__chapter { font-size: 8px; letter-spacing: .2em; margin-bottom: 12px; }
  .night-show__subtitle { max-width: 300px; padding: 0 10px; }
  .night-show__castle { bottom: 7%; width: 128vw; max-width: 700px; }
  .night-show__moon { top: 34%; right: 9%; }
  .night-show__controls { padding-left: 12px; padding-right: 12px; padding-top: 29px; }
  .night-show button { font-size: 11px; padding: 10px 13px; }
  .night-show__status { letter-spacing: .035em; }
  .night-show__beams { top: 30%; height: 45%; width: 150%; }
}
@media (max-height: 560px) and (min-width: 600px) {
  .night-show__header { top: 12px; }
  .night-show__words { top: 13%; }
  .night-show__chapter { margin-bottom: 3px; }
  .night-show__title { font-size: 36px; }
  .night-show__subtitle { margin-top: 6px; font-size: 11px; }
  .night-show__castle { width: 100vh; bottom: -6%; }
  .night-show__controls { padding-top: 10px; padding-bottom: 10px; }
  .night-show__status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .night-show *, .night-show *::before, .night-show *::after { animation: none !important; transition: none !important; }
}
