:root {
  color-scheme: light;
  --ink: #741b00;
  --paper: #faf3ee;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: #f1ede3;
}

* { box-sizing: border-box; }
html { min-width: 280px; }
body {
  margin: 0;
  min-height: 100svh;
  background: #f1ede3 url('assets/paper-hires.jpg') center / cover fixed;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.lighting-filters { position: absolute; pointer-events: none; }
.sunlight {
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.leaf-shadows {
  position: absolute;
  inset: -8%;
  background: url('assets/leaf-light.jpg') center / cover no-repeat;
  opacity: .984;
  /* Increase shadow density by 50% while keeping white light transparent in Multiply. */
  filter: url('#shadow-density');
  transform-origin: 80% 15%;
  animation: canopy-sway 8.666667s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes canopy-sway {
  0% { transform: translate3d(-1.5%, -.7%, 0) rotate(-1deg) scale(1.025); }
  45% { transform: translate3d(.5%, 1%, 0) rotate(.5deg) scale(1.04); }
  100% { transform: translate3d(1.8%, -.8%, 0) rotate(1.4deg) scale(1.025); }
}
.wedding {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: clip;
}
.composition {
  position: relative;
  width: min(100%, 177.77778svh);
  aspect-ratio: 16 / 9;
}
.paper-piece {
  display: block;
  position: absolute;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 650ms cubic-bezier(.2,.75,.25,1), box-shadow 650ms ease;
}
.venue {
  left: 54.8106%;
  top: 20.2374%;
  width: 38.1771%;
  transform: rotate(-1.35deg);
  box-shadow: 1px 2px 3px #291d171a, 6px 5px 10px #291d1717, 13px 10px 18px #291d170d;
}
.invitation-back {
  z-index: 2;
  left: 29.7053%;
  top: 22.15%;
  width: 25.1606%;
  transform: rotate(3.11deg);
  box-shadow: 0 2px 5px #29170f4a, 0 8px 8px #29170f42, 0 17px 13px #29170f26, 0 30px 17px #29170f0a;
}
.invitation-front {
  z-index: 3;
  left: 9.575%;
  top: 18.55%;
  width: 25.1606%;
  transform: rotate(-10.65deg);
  box-shadow: 0 1px 2px #29170f63, 0 3px 4px #29170f57, 0 7px 6px #29170f33, 0 12px 9px #29170f0f;
}
@media (hover: hover) and (pointer: fine) {
  .venue:hover { transform: translateY(-5px) rotate(-.5deg); }
  .invitation-back:hover { transform: translateY(-6px) rotate(4deg); }
  .invitation-front:hover { transform: translateY(-6px) rotate(-9.5deg); }
}
.rsvp-wrap {
  position: absolute;
  z-index: 4;
  top: 89.9074%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
.rsvp {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10%;
  width: 9.2448%;
  min-width: 140px;
  min-height: 44px;
  aspect-ratio: 355 / 102;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 2px 2px 4px #29170f1a, 6px 5px 9px #29170f17, 13px 10px 13px #29170f0d;
  text-decoration: none;
  transform: scale(.5);
  transform-origin: top center;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.rsvp::after { content: ''; position: absolute; inset: -22px -12px; }
.rsvp-lettering {
  display: block;
  width: 54.08%;
  height: auto;
  margin-top: 3%;
}
.arrow-wrap { display: block; position: relative; width: 12%; height: 12px; }
.arrow-wrap img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.42); }
.rsvp:hover {
  transform: scale(.5) translateY(-3px);
  background: #fffaf5;
  box-shadow: 2px 3px 5px #29170f20, 7px 8px 12px #29170f20;
}
.rsvp:active { transform: scale(.5); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }

dialog {
  position: fixed;
  width: min(90vw, 480px);
  padding: 48px 28px 36px;
  border: 1px solid #a47757;
  color: var(--ink);
  background: var(--paper) url('assets/paper-hires.jpg') center / cover;
  text-align: center;
  box-shadow: 0 20px 90px #2e130f40;
}
dialog::backdrop { background: #29170f66; backdrop-filter: blur(3px); }
.close-dialog {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
}
.dialog-kicker { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 26px; }
dialog h2 { font-size: clamp(24px, 5vw, 32px); line-height: 1.15; font-weight: normal; margin: 0 0 20px; }
dialog p { font-size: 17px; line-height: 1.65; }
.dialog-date { font-size: 14px; margin: 26px 0; }
.return-button { min-height: 44px; border: 1px solid var(--ink); color: var(--ink); background: var(--paper); padding: 10px 18px; cursor: pointer; }
.noscript-message { text-align: center; padding: 20px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body { position: fixed; inset: 0; background-size: auto 100dvh; }
  .wedding { display: block; height: 100dvh; min-height: 0; }
  .composition {
    --invitation-width: min(58vw, 25dvh);
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
  .invitation-front {
    width: var(--invitation-width);
    left: calc(50% - var(--invitation-width) * .8);
    top: 24%;
    transform: translateY(-50%) rotate(-8deg);
  }
  .invitation-back {
    width: calc(var(--invitation-width) * .97);
    left: calc(50% - var(--invitation-width) * .2);
    top: 25%;
    transform: translateY(-50%) rotate(5deg);
  }
  .venue {
    width: min(80vw, 46dvh);
    left: 50%;
    top: 76%;
    transform: translate(-50%, -50%) rotate(-2deg);
  }
  .rsvp-wrap { top: 50%; transform: translateY(-50%); }
  .rsvp { width: 156px; min-height: 48px; transform-origin: center; }
  @media (hover: hover) and (pointer: fine) {
    .invitation-front:hover { transform: translateY(calc(-50% - 4px)) rotate(-7deg); }
    .invitation-back:hover { transform: translateY(calc(-50% - 4px)) rotate(6deg); }
    .venue:hover { transform: translate(-50%, calc(-50% - 4px)) rotate(-1deg); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
