/* Single owner of the invitation collage's geometry and typography.
   Grid rows grow with their text. Only the decorative paper overlap is
   negative; viewport height never scales down text or the entire collage. */
.step-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 22%, rgba(255,246,226,.13), transparent 38%), var(--ivory);
  color: var(--paper);
  text-align: center;
}
.invitation-lead { display: contents; }
.invitation-lead .kicker, .invitation-lead h2, .invitation-lead .date-display,
.address-prompt { display: none; }
.paper-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: min(100%, clamp(480px, calc((100svh - 120px) * .9), 620px));
  margin: 0 auto 24px;
  flex: none;
  isolation: isolate;
}
.paper-collage .paper-card { position: relative; min-width: 0; }
.paper-collage .paper-card small { font-size: .6875rem; line-height: 1.4; letter-spacing: .08em; }
.save-card {
  grid-area: 1 / 2 / 2 / 11;
  z-index: 2;
  padding: 24px 19% 24px 7%;
  transform: rotate(-3deg);
  text-align: center;
}
.save-card strong {
  display: block;
  margin: 14px 0 12px;
  font: clamp(3.1rem, 8.5vw, 4.25rem)/.8 "Italiana", serif;
  letter-spacing: -.05em;
}
.save-card strong em { font: .56em "Allura", cursive; }
.save-card > span {
  position: relative;
  left: 6px;
  display: inline-block;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid #292c28;
  border-radius: 50%;
  font: 1.5rem/1.2 "Allura", cursive;
}
.note-card {
  grid-area: 2 / 4 / 3 / 13;
  z-index: 1;
  margin-top: -18px;
  padding: 42px 9% 52px 14%;
  transform: rotate(3deg);
  text-align: left;
  overflow-wrap: anywhere;
}
.postcard-head { position: relative; display: grid; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid rgba(35,48,31,.2); }
.postcard-head b { font: 500 1rem/1.4 "DM Sans", sans-serif; letter-spacing: .01em; }
.postcard-countdown { font: 400 .875rem/1.4 "DM Sans", sans-serif; }
.postcard-countdown > span { font: inherit; }
.postcard-stamp { position: absolute; top: -25px; right: 0; width: 36px; opacity: .6; }
.postcard-stamp svg { display: block; width: 100%; height: auto; }
.note-card p { margin: 14px 0; color: #34492f; font: 1.8rem/1.45 "Allura", cursive; }
.note-card > span { display: block; font-size: .75rem; line-height: 1.5; letter-spacing: .06em; }
.collage-strip {
  grid-area: 2 / 1 / 3 / 4;
  /* Keep square photos in their own left-hand lane. Bottom alignment lets
     the strip retain its natural height independently of the written card. */
  position: absolute;
  inset: auto 5px 10px 9px;
  width: calc(100% - 14px);
  max-width: 112px;
  z-index: 4;
  display: grid;
  gap: 5px;
  padding: 6px 6px 12px;
  margin: 0;
  transform: rotate(-8deg);
  background: var(--paper-grain), #f2efe7;
  background-blend-mode: var(--paper-grain-blend), normal;
  box-shadow: 0 12px 26px rgba(0,0,0,.4);
}
.collage-strip figure { margin: 0; aspect-ratio: 1; min-height: 0; overflow: hidden; background: #b8b7b1; }
.collage-strip img, .collage-polaroid img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.collage-polaroid {
  grid-area: 1 / 10 / 2 / 13;
  z-index: 5;
  align-self: center;
  aspect-ratio: .83;
  min-width: 0;
  margin: 24px 2px 0 -12px;
  padding: 6px 6px 20px;
  background: var(--paper-grain), #f1eee7;
  background-blend-mode: var(--paper-grain-blend), normal;
  box-shadow: 0 14px 28px rgba(0,0,0,.4);
  transform: rotate(8deg);
}
.collage-callas { position: absolute; z-index: 6; right: -4px; bottom: -44px; width: 23%; height: auto; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(20,34,18,.3)); }
.venue-display { order: 1; margin: 0 0 12px; font-size: 1rem; line-height: 1.5; }
.address-jump { order: 2; min-height: 48px; max-width: 100%; margin: 0; padding: 12px 22px; font-size: .875rem; line-height: 1.5; }
.address-jump span { margin-left: 7px; }
#cards-contact { order: 3; display: flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; margin: 4px 0 0; padding: 10px 12px; font-size: .75rem; background: transparent; border-color: transparent; box-shadow: none; }
#step-cards, #step-cards * { animation: none; }

/* Width controls composition; height controls surplus surrounding space.
   Short viewports simply scroll. Paper and photos use the same twelve columns. */
@media (max-width: 650px) {
  /* A normal block flow measures the grid at its final width before placing
     the venue and buttons. Older Safari can reserve too little height when
     this content-sized grid is a column-flex item. */
  .step-cards { display: block; padding-top: max(18px, env(safe-area-inset-top)); }
  .invitation-lead { display: none; }
  .address-jump { display: block; margin-inline: auto; }
  #cards-contact { margin-inline: auto; }
  .paper-collage { margin-bottom: 52px; }
  .save-card { grid-column-start: 1; padding: 20px 20% 22px 6%; }
  .save-card strong { font-size: clamp(3rem, 12vw, 3.6rem); }
  .note-card { padding: 40px 8% 48px 14%; }
  .note-card p { font-size: 1.65rem; }
  .collage-strip { left: 8px; right: 1px; padding: 5px 5px 10px; gap: 4px; }
}
