@font-face {
  font-family: "Instrument Serif";
  src: url("instrument-serif.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("instrument-serif-italic.ttf") format("truetype");
  font-style: italic;
  font-display: swap;
}
:root {
  --paper: #fff3d8;
  --pine: #12352f;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Avenir Next", Avenir, system-ui, sans-serif;
  color-scheme: light;
  font: 100%/1.5 var(--sans);
  background: var(--pine);
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
a, button { color: inherit; }
a { text-underline-offset: .3em; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f6bf6e; outline-offset: 4px; }
.scene {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(100svh, 30rem); display: grid;
  grid-template-rows: auto 1fr auto; align-items: center; justify-items: center;
  color: var(--paper); background: #12352f;
}
.street, .shade, .opening { position: absolute; inset: 0; pointer-events: none; }
.street { z-index: -3; overflow: hidden; background: #173c33 url("bethlehem-winter.webp") center 76% / cover; }
#town { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; }
.projected #town { width: 1122px; height: 1402px; transform-origin: top left; }
.walkers { display: none; position: absolute; left: 0; top: 0; width: 256px; height: 342px; transform-origin: 0 0; background: url("walking-couple.webp") 0 0 / 400% 100% no-repeat; }
.projected .walkers { display: block; }
.shade { z-index: -2; background: linear-gradient(0deg,#071a17e8,transparent 27%,transparent 78%,#09251b9c), #14231d2b; }
.playing .shade { opacity: .5; }
.opening { display: none; z-index: -1; }
@media (max-aspect-ratio: 4/5) {
  .playing .opening { display: block; background: #12352f url("bethlehem-portrait.webp") center / cover; }
}
.masthead, .actions { position: relative; z-index: 2; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 1.1rem clamp(1.15rem, 3.5vw, 3.5rem); }
.masthead { align-self: start; min-height: 4.5rem; }
.wordmark { display: flex; align-items: center; gap: .48rem; font: clamp(1.25rem,2vw,1.65rem) var(--serif); text-shadow: 0 1px 4px #10291e; }
.wordmark span { color: #f5ca83; font: 1.65rem Georgia, serif; }
.glass { background: #10332de6; padding: .6rem .92rem; border: 1px solid #f8e8cba1; border-radius: 2rem; font-size: .88rem; }
.glass:hover { background: #305348; }
.sign {
  position: relative; width: min(90vw, 77svh, 52rem); aspect-ratio: 1321/1191;
  color: #fff1d1; container-type: inline-size; z-index: 1;
}
#sign-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.projected .sign { position: absolute; top: 0; left: 0; }
.lettering { position: absolute; inset: 36% 10.5% 7% 6%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.eyebrow, .day, .city { font: 500 2.75cqw/1.3 var(--sans); letter-spacing: .12em; }
.eyebrow, .day { text-transform: uppercase; }
.eyebrow { color: #f2d197; }
h1 { margin: 1.35cqw 0; font: 400 11.3cqw/.99 var(--serif); letter-spacing: -.035em; }
h1 em { color: #f2cf93; font-weight: 400; }
h1:focus { outline: none; }
.day { margin-top: 1.6cqw; font-size: 2.65cqw; }
time { font: 400 7.7cqw/1.1 var(--serif); }
h2 { margin-top: 2cqw; font: 400 5.1cqw/1.1 var(--serif); }
.city { margin-top: .9cqw; font-size: 2.7cqw; letter-spacing: .015em; }
.actions { grid-row: 3; align-self: end; justify-content: center; flex-wrap: wrap; gap: .55rem 2.5rem; background: #0a211be8; border-top: 1px solid #dbc69b52; font-size: .91rem; transition: opacity .45s; }
.guest-actions, .postcard-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .32rem 1.15rem; }
.actions a { padding-block: .5rem; }
.primary, .actions .primary { display: inline-block; padding: .61rem .95rem; border: 0; border-radius: .22rem; color: #13342d; background: var(--paper); font: 600 .88rem/1.45 var(--sans); text-decoration: none; }
.primary:hover { background: #ffdcaa; }
.replay { padding: .45rem 0; border: 0; background: transparent; }
.replay span { font: 1.25rem/1 Georgia, serif; vertical-align: -.05em; }
.replay:hover { text-decoration: underline; text-underline-offset: .25em; }
.playing .actions { opacity: 0; pointer-events: none; transition: none; }
@media (max-width: 42rem) {
  .masthead { min-height: 3.9rem; padding: .9rem; }
  .wordmark { gap: .28rem; }
  .actions { padding: .65rem .6rem max(.65rem, env(safe-area-inset-bottom)); gap: .2rem; flex-direction: column; font-size: .86rem; }
  .guest-actions, .postcard-actions { gap: .1rem .85rem; }
  .glass { padding: .55rem .75rem; font-size: .83rem; }
}
@media (prefers-reduced-motion: reduce) { .actions { transition: none; } }
dialog { width: min(28rem, calc(100% - 2rem)); border: 1px solid #a99977; padding: 2rem; background: #f8f4e9; color: #12342d; box-shadow: 0 1rem 4rem #17281844; }
dialog::backdrop { background: #09231dc9; }
dialog .small { color: #853b30; }
dialog h2 { margin: .7rem 0 1.4rem; font: 2.65rem/1 var(--serif); }
dialog .close { position: absolute; right: .6rem; top: .35rem; border: 0; padding: .2rem .65rem; font-size: 1.75rem; background: transparent; }
dialog label { font-size: .875rem; }
.copy-row { display: flex; gap: .4rem; margin-top: .35rem; }
.copy-row input { width: 0; flex: 1; padding: .4rem; border: 1px solid #b6ad97; background: #fffdf5; font-size: .875rem; }
.copy-row .primary { padding-inline: .8rem; background: #12342d; color: #fff3d8; }
#copy-status { margin-block: .4rem 1rem; font-size: .875rem; }
@media (max-aspect-ratio: 4/5) {
  .playing .sign { opacity: var(--street-opacity, 0); }
}
.static-invitation .lettering { background: #163329; }
.walkers::after {
  content: ""; position: absolute; left: 22%; right: 13%; bottom: 1%; height: 3%;
  background: radial-gradient(ellipse, #3d343e66, transparent 72%);
}
