/* Original bouquet photographs and vector lettering, with gentle intro motion. */
body.collage-entry {
  --collage-background: #f5f2eb;
  --collage-paper: #fcfbf7;
  --collage-purple: #750f4a;
  --collage-yellow: #ede18b;
  --intro-ease: cubic-bezier(0.77, 0, 0.175, 1);
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--collage-background);
  color: var(--collage-purple);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

.collage-entry *,
.collage-entry *::before,
.collage-entry *::after {
  box-sizing: border-box;
}

.collage-entry .welcome-collage-scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: clip;
  background: var(--collage-background);
}

.collage-entry .bouquet-wall {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 1fr) minmax(0, 22vw)
    minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  column-gap: clamp(14px, 1.8vw, 32px);
  row-gap: clamp(24px, 5.1svh, 50px);
  padding:
    max(clamp(30px, 6.1svh, 64px), calc(env(safe-area-inset-top, 0px) + 24px))
    max(clamp(20px, 3vw, 56px), calc(env(safe-area-inset-right, 0px) + 12px))
    max(clamp(24px, 6.1svh, 64px), calc(env(safe-area-inset-bottom, 0px) + 18px))
    max(clamp(20px, 3vw, 56px), calc(env(safe-area-inset-left, 0px) + 12px));
  pointer-events: none;
}

.collage-entry .bouquet-card {
  position: relative;
  z-index: 0;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(20px, 2.4svh, 30px) 12px 14px;
  border: 1px solid #e9e6df;
  background: var(--collage-paper);
  box-shadow: 0 5px 8px #352e1c13, 0 1px 2px #352e1c0b;
}

.collage-entry .bouquet-card::before,
.collage-entry .bouquet-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid #e6e2d9;
  background: #f8f6ef;
}

.collage-entry .bouquet-card::before {
  z-index: -2;
  inset: 9px -3px -10px -7px;
  transform: rotate(-0.7deg);
  box-shadow: 0 5px 7px #352e1c0c;
}

.collage-entry .bouquet-card::after {
  z-index: -1;
  inset: 5px -6px -5px -3px;
  transform: rotate(0.45deg);
  background: #fbf9f3;
}

.collage-entry .bouquet-card .photo {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
  clip-path: inset(0);
}

/* Also accommodates a .photo wrapper without changing the image contract. */
.collage-entry .bouquet-card .photo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: inherit;
  object-position: inherit;
}

.collage-entry .bouquet-card[data-cropped="true"] {
  padding-bottom: 0;
}

/* This source is an intentional flower close-up, with no photographed vase. */
.collage-entry .bouquet-card[data-bouquet="pink-peonies"] .photo {
  object-fit: cover;
  object-position: center;
}

.collage-entry .paperclip {
  position: absolute;
  z-index: 2;
  top: -29px;
  left: 57%;
  display: block;
  width: 31px;
  height: 77px;
  overflow: visible;
  color: #8c8d82;
  transform: rotate(26deg);
  transform-origin: center;
  filter: drop-shadow(1px 2px 1.3px #28281c25);
  pointer-events: none;
}

.collage-entry [data-bouquet="blue-dahlias"] { grid-area: 1 / 1; }
.collage-entry [data-bouquet="green-studio"] { grid-area: 1 / 2; }
.collage-entry [data-bouquet="pink-peonies"] { grid-area: 1 / 4; }
.collage-entry [data-bouquet="autumn-callas"] { grid-area: 1 / 5; }
.collage-entry [data-bouquet="red-berries"] { grid-area: 2 / 1; }
.collage-entry [data-bouquet="glass-orchids"] { grid-area: 2 / 2; }
.collage-entry [data-bouquet="mixed-white-vase"] { grid-area: 2 / 4; }
.collage-entry [data-bouquet="goblet"] { grid-area: 2 / 5; }

.collage-entry [data-bouquet="blue-dahlias"] .paperclip,
.collage-entry [data-bouquet="pink-peonies"] .paperclip,
.collage-entry [data-bouquet="mixed-white-vase"] .paperclip {
  transform: rotate(-25deg);
}

.collage-entry .welcome-invitation {
  position: absolute;
  z-index: 3;
  top: 48%;
  left: 50%;
  display: block;
  width: min(25.3vw, calc((100svh - 48px) * .677419), 440px);
  max-width: calc(100% - 32px);
  aspect-ratio: 420 / 620;
  transform: translate(-50%, -50%);
  border-radius: 1px;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  filter: drop-shadow(0 9px 12px #38281125);
}

.collage-entry .welcome-invitation > svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 420 / 620;
  object-fit: contain;
  -webkit-user-drag: none;
  overflow: visible;
  pointer-events: none;
}

/* Motion lives inside a fixed link, so Enter stays easy to click and focus. */
.collage-entry .welcome-collage-scene:is([data-motion="running"], [data-motion="paused"]) .welcome-invitation > svg {
  animation: invitation-drift 8s var(--intro-ease) -2s infinite;
}

.collage-entry .welcome-collage-scene:is([data-motion="running"], [data-motion="paused"]) :is(
  .invitation-name, .invitation-flowers, .invitation-orchid,
  .invitation-enter, .invitation-underline, .invitation-tagline
) {
  transform-box: fill-box;
  transform-origin: center;
  animation: invitation-letter-flow 6s var(--intro-ease) -1.5s infinite;
}

.collage-entry .welcome-collage-scene[data-motion] .invitation-flowers {
  animation-duration: 7s;
  animation-delay: -4s;
  animation-direction: reverse;
}

.collage-entry .welcome-collage-scene[data-motion] .invitation-orchid {
  transform-origin: center 85%;
  animation-name: invitation-orchid-flow;
  animation-duration: 8s;
  animation-delay: -3s;
}

.collage-entry .welcome-collage-scene[data-motion] .invitation-enter {
  animation-duration: 5.5s;
  animation-delay: -2.5s;
}

.collage-entry .welcome-collage-scene[data-motion] .invitation-underline {
  animation-name: invitation-underline-flow;
  animation-duration: 5.5s;
  animation-delay: -2.5s;
}

.collage-entry .welcome-collage-scene[data-motion] .invitation-tagline {
  animation-name: invitation-small-flow;
  animation-duration: 7s;
  animation-delay: -2s;
}

.collage-entry .welcome-collage-scene:is([data-motion="running"], [data-motion="paused"]) :is(
  .invitation-border-edges, .invitation-border-corners, .invitation-border-rule
) {
  animation: invitation-lace-breathe 8s var(--intro-ease) -3s infinite;
}

.collage-entry .welcome-collage-scene[data-motion="paused"] .welcome-invitation > svg,
.collage-entry .welcome-collage-scene[data-motion="paused"] .welcome-invitation svg g {
  animation-play-state: paused;
}

@keyframes invitation-drift {
  0%, 100% { transform: translateY(-3px) rotate(-.3deg); }
  50% { transform: translateY(3px) rotate(.3deg); }
}

@keyframes invitation-letter-flow {
  0%, 100% { transform: translateY(-3px) rotate(-.45deg); }
  50% { transform: translateY(3px) rotate(.45deg); }
}

@keyframes invitation-orchid-flow {
  0%, 100% { transform: translateY(-3px) rotate(-1.2deg); }
  50% { transform: translateY(3px) rotate(1.2deg); }
}

@keyframes invitation-underline-flow {
  0%, 100% { transform: translateY(-3px) rotate(-.45deg) scaleX(.98); }
  50% { transform: translateY(3px) rotate(.45deg) scaleX(1.02); }
}

@keyframes invitation-small-flow {
  0%, 100% { transform: translateY(-1.5px); }
  50% { transform: translateY(1.5px); }
}

@keyframes invitation-lace-breathe {
  0%, 100% { opacity: .82; }
  50% { opacity: 1; }
}

.collage-entry .intro-motion-toggle {
  position: absolute;
  z-index: 4;
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 2px;
  background: var(--collage-background);
  color: var(--collage-purple);
  font: 14px/1.4 Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.collage-entry .intro-motion-toggle[hidden] { display: none; }

.collage-entry .intro-motion-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .collage-entry .welcome-invitation > svg,
  .collage-entry .welcome-invitation svg g {
    animation: none !important;
  }
}

.collage-entry .welcome-invitation:focus-visible {
  outline: 3px solid var(--collage-purple);
  outline-offset: 8px;
  box-shadow: 0 0 0 12px var(--collage-yellow);
}

.collage-entry .welcome-invitation:active {
  filter: drop-shadow(0 4px 7px #38281135);
}

@media (hover: hover) and (pointer: fine) {
  .collage-entry .welcome-invitation:hover {
    filter: drop-shadow(0 12px 15px #38281138);
  }
}

.collage-entry .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .collage-entry .bouquet-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    column-gap: clamp(10px, 3vw, 18px);
    row-gap: clamp(10px, 1.8svh, 16px);
    padding:
      calc(env(safe-area-inset-top, 0px) + 27px)
      calc(env(safe-area-inset-right, 0px) + 14px)
      calc(env(safe-area-inset-bottom, 0px) + 18px)
      calc(env(safe-area-inset-left, 0px) + 14px);
  }

  .collage-entry .bouquet-card {
    padding: 13px 7px 7px;
    box-shadow: 0 3px 5px #352e1c12, 0 1px 2px #352e1c08;
  }

  .collage-entry .bouquet-card::before {
    inset: 5px -2px -5px -4px;
  }

  .collage-entry .bouquet-card::after {
    inset: 3px -3px -3px -2px;
  }

  .collage-entry .paperclip {
    top: -20px;
    left: 61%;
    width: 20px;
    height: 50px;
    filter: drop-shadow(1px 1px .8px #28281c20);
  }

  .collage-entry [data-bouquet="blue-dahlias"] { grid-area: 1 / 1; }
  .collage-entry [data-bouquet="green-studio"] { grid-area: 1 / 2; }
  .collage-entry [data-bouquet="pink-peonies"] { grid-area: 2 / 1; }
  .collage-entry [data-bouquet="autumn-callas"] { grid-area: 2 / 2; }
  .collage-entry [data-bouquet="red-berries"] { grid-area: 3 / 1; }
  .collage-entry [data-bouquet="glass-orchids"] { grid-area: 3 / 2; }
  .collage-entry [data-bouquet="mixed-white-vase"] { grid-area: 4 / 1; }
  .collage-entry [data-bouquet="goblet"] { grid-area: 4 / 2; }

  .collage-entry .welcome-invitation {
    top: 48%;
    width: clamp(218px, 60vw, 290px);
    max-width: min(calc(100% - 32px), calc(75svh * .677419));
    max-height: 75svh;
    filter: drop-shadow(0 7px 10px #38281130);
  }
}

/* A short phone viewport keeps the photographs in two rows. */
@media (max-width: 900px) and (max-height: 450px) and (min-width: 500px) {
  .collage-entry .bouquet-wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 12px;
  }

  .collage-entry [data-bouquet="blue-dahlias"] { grid-area: 1 / 1; }
  .collage-entry [data-bouquet="green-studio"] { grid-area: 1 / 2; }
  .collage-entry [data-bouquet="pink-peonies"] { grid-area: 1 / 3; }
  .collage-entry [data-bouquet="autumn-callas"] { grid-area: 1 / 4; }
  .collage-entry [data-bouquet="red-berries"] { grid-area: 2 / 1; }
  .collage-entry [data-bouquet="glass-orchids"] { grid-area: 2 / 2; }
  .collage-entry [data-bouquet="mixed-white-vase"] { grid-area: 2 / 3; }
  .collage-entry [data-bouquet="goblet"] { grid-area: 2 / 4; }
}
