@font-face {
  font-family: "Invitation Glossy Magazine";
  src: local("Glossy Magazine Regular"), local("GlossyMagazine-Regular"),
       local("Glossy Magazine Trial Regular"), local("GlossyMagazineTrial-Regular");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Invitation Glossy Magazine";
  src: local("Glossy Magazine Regular Italic"), local("GlossyMagazine-RegularItalic"),
       local("Glossy Magazine Trial Regular Italic"), local("GlossyMagazineTrial-RegularItalic");
  font-style: italic;
  font-weight: 400;
}

:root {
  color-scheme: light;
  background-color: #f3eddf;
  color: #363725;
  font-family: "Invitation Glossy Magazine", Baskerville, "Times New Roman", serif;
  font-size: 112.5%;
  font-weight: 400;
  font-kerning: none;
}

body {
  margin: 0;
  min-height: 100vh;
}

.invitation {
  box-sizing: border-box;
  width: min(348px, calc(100% - 48px));
  min-height: 100vh;
  margin-inline: auto;
  padding-block: 67px 80px;
  overflow-wrap: break-word;
}

@media (min-width: 720px) {
  :root {
    font-size: 118.75%;
  }

  .invitation {
    width: 384px;
  }
}

.invitation-title {
  text-align: start;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.39;
}

.invitation-copy {
  margin-top: 102px;
  line-height: 1.39;
}

.invitation-copy p {
  position: relative;
  display: flow-root;
  margin: 0;
  text-align: justify;
  text-align-last: start;
}

.invitation-copy p + p {
  margin-top: 1.39em;
}

.drop-cap {
  display: block;
  float: left;
  width: 4em;
  height: auto;
  aspect-ratio: 1;
  margin: .12em .65em 0 0;
}

.drop-cap-letter,
.is-typeset .copy-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.is-typeset .drop-cap {
  position: absolute;
  inset: 0 auto auto 0;
}

.typeset-lines,
.typeset-line {
  display: block;
}

.typeset-line {
  text-align: start;
  text-align-last: start;
  white-space: nowrap;
}

.venue,
#attendance {
  font-family: "Courier New", Courier, monospace;
  font-size: 14pt;
}

.venue {
  margin-top: 1.39rem;
  text-align: start;
  font-style: normal;
}

.venue-line {
  display: block;
}

.ink-filter {
  position: absolute;
  pointer-events: none;
}

.reply {
  margin-top: 2.7rem;
  line-height: 1.39;
}

.reply h2 {
  margin: 0 0 1.25rem;
  text-align: start;
  font-weight: 400;
  font-size: inherit;
  font-style: italic;
}

.reply-label {
  margin: 1.15rem 0 0;
  cursor: text;
}

.reply-line {
  min-height: 1.6em;
  padding: .16em 0 .1em;
  border-bottom: 1px solid #36372570;
  cursor: text;
  overflow-wrap: anywhere;
}

.reply-line:focus {
  border-bottom-color: #363725;
  outline: none;
}

.reply-line[aria-invalid="true"] {
  border-bottom-color: #86372b;
}

.attendance-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15em .5em;
  margin-top: 1.15rem;
}

.attendance-row .reply-label {
  margin: 0;
}

#attendance {
  display: inline-block;
  min-width: 9ch;
  max-width: 100%;
  cursor: text;
  overflow-wrap: anywhere;
}

#attendance:empty::before,
#attendance:has(> br:only-child)::before {
  content: attr(data-placeholder);
  pointer-events: none;
}

#attendance:focus {
  outline: none;
  background-color: #36372512;
}

#attendance[aria-invalid="true"] {
  color: #86372b;
}

.reply-seal {
  display: block;
  width: min(8rem, 100%);
  margin: clamp(2.75rem, 5vw, 3.5rem) auto 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.reply-seal img {
  display: block;
  width: 100%;
  height: auto;
}

.reply-seal:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.reply-seal:active img {
  filter: brightness(.92);
}

.reply-seal:disabled {
  opacity: .65;
  cursor: progress;
}

.rsvp-status {
  margin: .75rem 0 0;
}

.rsvp-status:empty {
  margin: 0;
}

@media screen and (forced-colors: none) {
  :root {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 .39 0 0 0 0 .27 0 0 0 0 .13 .18 0 0 0 -.055'/%3E%3C/filter%3E%3Cpath fill='white' d='M0 0h192v192H0z' filter='url(%23grain)'/%3E%3C/svg%3E"),
      radial-gradient(ellipse at 42% 18%, #f7f1e5, transparent 72%),
      radial-gradient(ellipse at 82% 73%, #eadeca66, transparent 65%);
  }

  .invitation-title,
  .copy-text,
  .typeset-lines,
  .reply h2,
  .reply-label {
    filter: url("#printed-ink");
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ink-line {
    animation: ink-appear 300ms cubic-bezier(.23, 1, .32, 1) var(--ink-delay, 0ms) backwards;
  }

  @keyframes ink-appear {
    from {
      opacity: .35;
      transform: translateY(12%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
