@font-face {
  font-family: "Halvar Breitschrift";
  src: url(HalvarBreit-Rg.woff2) format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Halvar Breitschrift";
  src: url(HalvarBreit-Md.woff2) format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Halvar Breitschrift";
  src: url(HalvarBreit-Bd.woff2) format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Ceremonious One";
  src: url(ceremoniousone.woff2) format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: dark;
  font-family: "Halvar Breitschrift", Arial, Helvetica, sans-serif;
  color: #eae8db;
  background: #0a241b;
  --cream: #eae8db;
  --red: #871010;
  --board-unit: clamp(.55px, .052083vw, 1px);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
body:has(dialog[open]) { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button, .gift-link { text-align: center; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #ffe168; outline-offset: 5px; }

.intro {
  position: relative;
  overflow: hidden;
  background: #103827;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(desktop-pattern.png) no-repeat top center / min(100%, 1920px) auto;
  pointer-events: none;
}

.masthead {
  position: relative;
  z-index: 2;
  padding-top: clamp(20px, 3.8vw, 73px);
}
.masthead-inner {
  position: relative;
  min-height: clamp(44px, 3.2vw, 62px);
  border-block: 1px solid #eae8db55;
  display: grid;
  place-items: center;
}
.masthead-art {
  position: absolute;
  inset-inline: 3.3%;
  top: 50%;
  max-width: 1795px;
  margin-inline: auto;
  transform: translateY(-50%);
  pointer-events: none;
}
.masthead-art img, .hero-title img { display: block; width: 100%; height: auto; }
.masthead-date { position: relative; font-size: clamp(.83rem, 1.2vw, 1.44rem); }
.masthead-home {
  position: absolute;
  top: 50%;
  left: max(3.3%, calc((100% - 1795px) / 2));
  width: clamp(44px, 5vw, 88px);
  height: 44px;
  transform: translateY(-50%);
}
.masthead-home-word {
  right: max(3.3%, calc((100% - 1795px) / 2));
  left: auto;
}
.brand-mark {
  display: block;
  width: clamp(27px, 2.4vw, 47px);
  aspect-ratio: 234 / 217;
  background: url(footer-imgLogo331.png) no-repeat left top / 231.08% 100%;
  justify-self: start;
}

.hero {
  position: relative;
  display: grid;
  align-items: start;
  max-width: 1920px;
  min-height: clamp(480px, 54.9vw, 1050px);
  margin-inline: auto;
  padding: clamp(100px, 10.5vw, 200px) 7.15% 48px;
}
.hero-copy { position: relative; width: 52%; z-index: 1; }
.hero-date {
  color: var(--cream);
  margin: 0;
  width: 91%;
  border-bottom: 1px solid #eae8db76;
  padding-bottom: .48em;
  font-size: clamp(1.4rem, 2.8vw, 3.45rem);
  letter-spacing: .035em;
}
.hero-title { margin: .75rem 0 0; max-width: 844px; }
.hero-title picture { display: block; }
.hero-description {
  max-width: 57ch;
  font-size: clamp(1rem, 1.22vw, 1.45rem);
  letter-spacing: .01em;
  line-height: 1.4;
}
.hero-description { margin: 1.7em 0 0; }

.hero-candle {
  position: absolute;
  top: max(-251px, -13.07vw);
  left: 49.48%;
  width: 56.15%;
  aspect-ratio: 1078 / 1141;
}
.hero-candle img { position: absolute; display: block; height: auto; pointer-events: none; }
.candle-glow { top: -8.65%; left: -9.05%; width: 118.12%; }
.candle-flare { top: 25.8%; left: 22.14%; width: 43.86%; }
.candle-body { top: 54.78%; left: 40.44%; width: 17.07%; }
.candle-holder { top: 73.28%; left: 19.94%; width: 78.02%; }
.candle-rays { top: 19.63%; left: 21.71%; width: 55.2%; }
.candle-flame { top: 34.9%; left: 43.41%; width: 10.6%; }
.layer-overlay { mix-blend-mode: overlay; }
.layer-dodge { mix-blend-mode: color-dodge; }

.calendar { background: linear-gradient(180deg, #103827 0%, #215f40 41%, #0c2d21 100%); }
.toolbar {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 6px 3.8vw 12px;
  border-bottom: 1px solid #eae8db45;
}
.outline-button {
  color: var(--cream);
  background: transparent;
  border: 1px solid #eae8db66;
  border-radius: 100px;
  min-height: 44px;
  padding: .45em 1.15em;
  font-size: clamp(.95rem, 1.15vw, 1.4rem);
  letter-spacing: .02em;
  cursor: pointer;
}
.outline-button:hover { background-color: #eae8db18; }
.outline-button:disabled { opacity: .35; cursor: default; }
.direction-controls { display: flex; gap: 8px; }
.direction-button { min-width: 44px; padding: 0; font-size: 1.7rem; line-height: 1; }

.garland-lane {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #eae8db66 #103827;
  scrollbar-width: thin;
}
.garland-track {
  position: relative;
  width: calc(7830 * var(--board-unit));
  height: calc(1040 * var(--board-unit));
  isolation: isolate;
}
.garland-cord, .garland-toys {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
}
.garland-cord {
  left: calc(-483 * var(--board-unit));
  top: calc(10 * var(--board-unit));
  width: calc(8310 * var(--board-unit));
  aspect-ratio: 8310 / 817;
  background-image: url(desktop-cord.svg);
}
.garland-toys {
  left: calc(490.35 * var(--board-unit));
  top: calc(62.25 * var(--board-unit));
  width: calc(6326 * var(--board-unit));
  aspect-ratio: 6326 / 870;
  background-image: url(desktop-toys.svg);
}
.garland-toys-dimmed { opacity: .66; }
.garland-available {
  position: absolute;
  inset: 0;
  clip-path: url(#available-days);
  pointer-events: none;
}
.garland-defs { position: absolute; pointer-events: none; }
.garland {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ornament, .day-glow {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: var(--h);
}
.day-glow {
  transform: scale(1.65);
  pointer-events: none;
  background: radial-gradient(ellipse, #ffdc62e0 0%, #ffa628b8 29%, #fa98175c 48%, #fc8e1a18 60%, transparent 72%);
}
.day {
  appearance: none;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 13%;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.day:disabled { cursor: default; }

.closing {
  text-align: center;
  background: linear-gradient(#0c2d21, #09231a 64%);
  padding: clamp(46px, 6vw, 115px) 6% 60px;
}
.closing h2 { font-size: clamp(1.3rem, 2.8vw, 3.36rem); font-weight: 400; margin: 0 0 clamp(32px, 5vw, 96px); line-height: 1.1; }
.footer-mark { width: clamp(48px, 8.5vw, 165px); opacity: .45; margin: 0 auto 52px; }
.closing small { display: block; max-width: 1000px; margin-inline: auto; opacity: .64; line-height: 1.4; }
.no-script { text-align: center; padding: 1rem; }

.gift-dialog {
  width: min(92vw, calc(91dvh * 1.125), 1100px);
  max-width: none;
  max-height: unset;
  overflow: visible;
  color: var(--red);
  border: none;
  padding: 0;
  background: transparent;
}
.gift-dialog::backdrop { background: #06271db8; }
.letter {
  position: relative;
  aspect-ratio: 1.126;
  isolation: isolate;
  background: url(letter-img51.png) center / contain no-repeat;
  filter: drop-shadow(0 12px 36px #06190c5c);
}
.letter-close {
  position: absolute;
  display: grid;
  place-items: center;
  top: 4.8%;
  right: 12%;
  z-index: 3;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.letter-close img { width: 18px; }
.letter-close:hover { background: #87101015; }
.letter-close:focus-visible, .gift-link:focus-visible { outline-color: #871010; outline-offset: 2px; }
.letter-scroll {
  position: absolute;
  inset: 8% 16% 44% 14%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b96b54 transparent;
  padding: 6px 13px 14px 3px;
  color-scheme: light;
}
.letter-date { font-size: .83rem; font-weight: 700; margin: 0 40px .5rem 0; }
.letter h2 { font-family: "Ceremonious One", "Snell Roundhand", Georgia, serif; font-weight: 400; font-style: normal; margin: 0 36px .6rem 0; line-height: .99; font-size: clamp(2rem, 4vw, 3.5rem); }
.gift-content { font-size: clamp(.94rem, 1.23vw, 1.13rem); line-height: 1.38; }
.gift-content p { margin: 0 0 .75rem; white-space: pre-line; }
.gift-content h3 { font-size: 1em; margin: .8rem 0 .35rem; }
.gift-content ul { margin: 0 0 .75rem; padding-inline-start: 1.25em; }
.gift-content li + li { margin-top: .2em; }
.signature { font-weight: 500; }
.gift-content blockquote { margin: .7em 0; border-left: 3px solid #8916158c; padding: .1em 0 .1em .85em; white-space: pre-line; }
.gift-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1em; }
.gift-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #871010;
  color: #fff5e3;
  min-height: 44px;
  padding: .55em 1em;
  border-radius: 30px;
  text-decoration: none;
}
.gift-link:hover { background: #6c0d0d; }
.gift-video, .gift-image { display: block; width: 100%; border: 0; margin: 12px 0; }
.gift-video { aspect-ratio: 16 / 9; background: #3f1917; }
.gift-image { max-height: 300px; object-fit: contain; }
.letter-envelope { position: absolute; inset: 59% 40% auto; pointer-events: none; }
.letter-envelope img { display: block; width: 75%; margin-inline: auto; }
.letter-clip { display: none; }

@media (max-width: 720px) {
  :root { --board-unit: calc(min(100vw, 540px) / 360); }
  .masthead { padding-top: calc(10 * var(--board-unit)); }
  .masthead-inner { min-height: calc(36 * var(--board-unit)); }
  .masthead-art { inset-inline: 5.3%; max-width: 483px; }
  .masthead-home { left: max(5.3%, calc((100% - 483px) / 2)); }
  .masthead-home-word { right: max(5.3%, calc((100% - 483px) / 2)); left: auto; }
  .brand-mark { width: 25px; }
  .intro::before { background-image: url(mobile-pattern.png); background-size: min(100%, 540px) auto; }
  .hero {
    max-width: 540px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 30px;
  }
  .hero-candle { position: relative; width: 88.89%; top: auto; left: auto; margin-top: calc(-49 * var(--board-unit)); }
  .hero-copy { width: 86.11%; text-align: center; margin-top: calc(40 * var(--board-unit)); }
  .hero-date { display: none; }
  .hero-title { margin: 0 auto; }
  .hero-description { margin: calc(16 * var(--board-unit)) auto 0; max-width: 34ch; }
  .calendar { background: linear-gradient(180deg, #103827, #103828 81%, #0c2d21); }
  .toolbar { justify-content: center; border: none; padding-bottom: 16px; }
  .direction-controls { display: none; }
  .garland-lane { overflow: clip; max-width: 540px; margin-inline: auto; }
  .garland-track { width: 100%; height: calc(2308 * var(--board-unit)); }
  .garland-cord {
    inset: 0 auto auto 0;
    width: 100%;
    aspect-ratio: 360 / 2294;
    background-image: url(mobile-cord.svg);
  }
  .garland-toys {
    left: calc(21 * var(--board-unit));
    top: calc(19 * var(--board-unit));
    width: calc(331 * var(--board-unit));
    aspect-ratio: 331 / 2273;
    background-image: url(mobile-toys.svg);
  }
  .closing { padding-top: 58px; }
  .footer-mark { width: 57px; margin: 0 auto 24px; }

  .gift-dialog {
    width: min(86.73vw, 420px);
    transform: translateY(-12px);
  }
  .gift-dialog::backdrop { background: #061f18a6; }
  .letter {
    --perforation: clamp(6px, 2.45vw, 12px);
    aspect-ratio: 312 / 451;
    max-height: calc(100dvh - 60px);
    background: none;
    filter: drop-shadow(0 10px 20px #091d1470);
  }
  .letter::before,
  .letter::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  .letter::before {
    z-index: -2;
    inset: 5% -4% -3% 5%;
    background: #a52220;
    transform: rotate(-3.5deg);
  }
  .letter::after {
    z-index: -1;
    inset: 0;
    background: #fbf5ed;
    mask:
      radial-gradient(circle at center top, transparent var(--perforation), #000 calc(var(--perforation) + .5px))
        center top / calc(100% / 12) 100% repeat-x,
      radial-gradient(circle at center bottom, transparent var(--perforation), #000 calc(var(--perforation) + .5px))
        center bottom / calc(100% / 12) 100% repeat-x,
      radial-gradient(circle at left center, transparent var(--perforation), #000 calc(var(--perforation) + .5px))
        left center / 100% calc(100% / 16) repeat-y,
      radial-gradient(circle at right center, transparent var(--perforation), #000 calc(var(--perforation) + .5px))
        right center / 100% calc(100% / 16) repeat-y;
    mask-composite: intersect;
  }
  .letter-clip {
    display: block;
    position: absolute;
    z-index: 2;
    left: 5.925%;
    top: 0;
    width: 15.413%;
    aspect-ratio: 97 / 147;
    background: url(mobile-letter-clip.png) center / contain no-repeat;
    transform: translateY(-22.49%);
    pointer-events: none;
  }
  .letter-close { top: 4px; right: 5px; }
  .letter-scroll {
    inset: clamp(32px, 11.3vw, 50px) 10.5% 8% 9.8%;
    padding: 0 3px 2px 0;
  }
  .letter-date, .letter-envelope { display: none; }
  .letter h2 {
    margin: 0 2px clamp(18px, 7.8vw, 32px) 0;
    /* Keep overhanging glyphs inside the scroll area. */
    padding-inline-start: .3em;
    font-size: clamp(1.8rem, 10.9vw, 3.125rem);
    overflow-wrap: anywhere;
  }
  .gift-content {
    margin-inline-start: clamp(10px, 4vw, 20px);
    font-size: clamp(.6875rem, 3.06vw, .9rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
  }
  .gift-content p { margin-bottom: .65em; }
  .gift-link { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
