/* Background layer: guest comments and photos drift in and out around the scroll */
/* Anchored to the desk (not the viewport) so it scrolls away with the scroll instead of covering the sections below. */
.chatter { position: absolute; inset: 0; z-index: 0; pointer-events: none; --cw: min(290px, calc(50vw - 370px)); }
.parchment { z-index: 1; }

.drift {
  position: absolute;
  width: var(--cw);
  margin: 0;
  opacity: 0;
  transform: translate(var(--nudge, 0), 16px) rotate(var(--rot, 0deg)) scale(.96);
  transition: opacity .75s ease, transform .75s ease;
}
.drift.in { opacity: .96; transform: translate(var(--nudge, 0), 0) rotate(var(--rot, 0deg)); }
.drift.entry { box-shadow: 0 16px 30px rgba(0, 0, 0, .5), inset 0 0 22px rgba(125, 88, 30, .22); }

.slot-0, .slot-1, .slot-2 { right: calc(50% + 350px); }
.slot-3, .slot-4, .slot-5 { left: calc(50% + 350px); }
.slot-0 { top: 4%; }
.slot-1 { top: 36%; }
.slot-2 { top: 66%; }
.slot-3 { top: 12%; }
.slot-4 { top: 42%; }
.slot-5 { top: 70%; }

.drift-photo { width: calc(var(--cw) * .66); padding: 7px 7px 18px; background: #f7f3e6; box-shadow: 0 16px 30px rgba(0, 0, 0, .55); }
.drift-photo img { width: 100%; height: auto; aspect-ratio: 1.15; object-fit: cover; filter: sepia(.12); }
.drift-tag { position: absolute; top: 14px; left: 14px; padding: .15em .6em; font-family: var(--caps); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; }
.drift-tag-before { background: var(--wax); color: #f3d9cf; }
.drift-tag-after { background: var(--emerald); color: var(--parch-light); }

/* Phones: a continuous ticker of slips and photos above the scroll */
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker-set { display: flex; gap: 12px; padding-right: 12px; }
.ticker-card { flex: none; height: 116px; overflow: hidden; }
.ticker-card.entry { width: 262px; box-shadow: 0 8px 18px rgba(0, 0, 0, .45), inset 0 0 22px rgba(125, 88, 30, .22); }
.ticker-card .entry-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticker-card .entry-reply { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-card .entry-meta, .ticker-card .entry-status:not(.bad) { display: none; }
.ticker-card.drift-photo { width: 116px; margin: 0; padding: 5px; position: relative; }
.ticker-card.drift-photo img { width: 100%; height: 100%; aspect-ratio: auto; }
@keyframes ticker { to { transform: translateX(-50%); } }

@media (max-width: 1179px) {
  .chatter { position: relative; inset: auto; height: 132px; margin: 0 -16px 10px; padding: 8px 0; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .chatter { overflow-x: auto; }
}

/* Guest slips (shared by the background layer and the full list) */
.entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px 11px 12px;
  color: var(--ink);
  background: var(--grain), linear-gradient(175deg, #f6ebcd, var(--parch));
  box-shadow: 0 10px 20px rgba(0, 0, 0, .4), inset 0 0 22px rgba(125, 88, 30, .22);
}
.avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(42, 28, 15, .55); background: #cbb98a; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initial { background: radial-gradient(circle at 35% 30%, var(--wax-light), var(--wax) 60%, #4f1010); color: #f0cdbf; font-family: var(--caps); font-size: 1.3rem; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.entry-name { font-family: var(--caps); font-size: 1rem; letter-spacing: .05em; overflow-wrap: break-word; min-width: 0; }
.entry-status { flex: none; font-family: var(--caps); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; padding: .12em .55em; border: 1px solid currentColor; color: var(--emerald); }
.entry-status.bad { color: var(--wax); }
.entry-msg { margin: 3px 0 0; font-style: italic; font-size: 1.04rem; line-height: 1.35; overflow-wrap: anywhere; }
.entry-meta { margin: 5px 0 0; font-size: .82rem; color: var(--ink-soft); }
.entry-reply { margin: 7px 0 0; padding: 1px 0 1px 10px; border-left: 2px solid var(--emerald); color: var(--emerald); font-size: .98rem; }
.entry-reply b { font-family: var(--caps); font-weight: 400; letter-spacing: .05em; }

/* The full guest list, shown after the RSVP */
.tally { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 22px; }
.tally-chip { padding: .4em .9em; border: 1px solid var(--gold-soft); font-family: var(--caps); font-size: .92rem; letter-spacing: .08em; color: var(--parch-light); background: rgba(201, 162, 75, .07); }
.tally-chip b { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; color: var(--gold); margin-left: .35em; }
.tally-chip.lead-day { background: rgba(201, 162, 75, .2); border-color: var(--gold); }

.comment-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 4fr) auto; gap: 10px; max-width: 680px; }
.comment-form input {
  min-width: 0;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  padding: .5em .7em;
  background: var(--parch-light);
  border: 1.5px solid rgba(42, 28, 15, .6);
  border-radius: 2px;
}
.comment-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.comment-form .btn { box-shadow: none; border-color: var(--gold-soft); }
.form-msg { grid-column: 1 / -1; margin: 0; font-style: italic; font-size: .95rem; color: #e39a8d; }
.form-msg.ok { color: #9cc9b3; }
.form-msg:empty { display: none; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.preview-note { margin: 12px 0 0; font-style: italic; font-size: .88rem; color: #8f846a; }

.entries { list-style: none; margin: 30px 0 0; padding: 0; columns: 2; column-gap: 20px; }
.entries .entry { break-inside: avoid; margin: 0 0 16px; }
.entries .entry.fresh { animation: slip-in .5s ease both; }
@keyframes slip-in { from { opacity: 0; transform: translateY(-10px); } }

/* After the RSVP: the details */
.residence-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 60px); align-items: center; margin-top: 26px; }

.plate {
  margin: 0;
  padding: 12px;
  background: var(--grain), var(--parch);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .5);
  transform: rotate(-2deg);
}
.plate img { width: 100%; height: auto; outline: 1px solid rgba(42, 28, 15, .5); outline-offset: -1px; }

.facts { margin: 0; display: grid; gap: 0; }
.facts div { padding: 16px 0; border-bottom: 1px dashed var(--gold-soft); }
.facts div:first-child { border-top: 1px dashed var(--gold-soft); }
.facts dt { font-family: var(--caps); font-size: .82rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.facts dd { margin: 3px 0 0; font-size: 1.15rem; color: var(--parch-light); }

/* The party venue: shows the horror version, stamps it "just kidding", then wipes to the real room. Loops on its own. */
.venue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 44px); margin-top: 26px; }
.venue { margin: 0; padding: 12px; background: var(--grain), var(--parch); box-shadow: 0 22px 40px rgba(0, 0, 0, .5); }
.venue:first-child { transform: rotate(-1.2deg); }
.venue-late { transform: rotate(1deg); }
.venue-frame { position: relative; aspect-ratio: 1; overflow: hidden; background: #000; }
.venue-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.venue-before { filter: saturate(.75) contrast(1.12) brightness(.92); }
.venue-after { clip-path: circle(0% at 50% 50%); }
.venue-tag { position: absolute; left: 12px; bottom: 12px; padding: .25em .8em; font-family: var(--caps); font-size: .86rem; letter-spacing: .16em; text-transform: uppercase; }
.venue-tag-before { background: var(--wax); color: #f3d9cf; }
.venue-tag-after { background: var(--emerald); color: var(--parch-light); opacity: 0; }
.venue-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: .1em .5em;
  font-family: var(--caps);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffd9d0;
  background: rgba(124, 29, 29, .88);
  border: 4px double #ffd9d0;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(3);
}

.block.seen .venue-before { animation: venue-shake 10s linear infinite; }
.block.seen .venue-after { animation: venue-reveal 10s cubic-bezier(.6, 0, .3, 1) infinite; }
.block.seen .venue-stamp { animation: venue-stamp 10s ease-in infinite; }
.block.seen .venue-tag-before { animation: venue-tag-out 10s linear infinite; }
.block.seen .venue-tag-after { animation: venue-tag-in 10s linear infinite; }
.block.seen .venue-late :is(.venue-before, .venue-after, .venue-stamp, .venue-tag) { animation-delay: 1.4s; }

@keyframes venue-shake {
  0%, 22%, 30%, 100% { transform: none; }
  23% { transform: translate(-6px, 3px) rotate(-.6deg); }
  25% { transform: translate(6px, -3px) rotate(.6deg); }
  27% { transform: translate(-4px, 2px); }
}
@keyframes venue-stamp {
  0%, 21% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(3); }
  24%, 40% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
  46%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
}
@keyframes venue-reveal {
  0%, 38% { clip-path: circle(0% at 50% 50%); }
  50%, 93% { clip-path: circle(75% at 50% 50%); }
  100% { clip-path: circle(0% at 50% 50%); }
}
@keyframes venue-tag-out { 0%, 40% { opacity: 1; } 44%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes venue-tag-in { 0%, 46% { opacity: 0; } 50%, 93% { opacity: 1; } 97%, 100% { opacity: 0; } }

/* Featured amenities: the house, one mundane detail at a time */
.row-label { margin: 56px 0 18px; font-family: var(--caps); font-size: .9rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.amenities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.amenity { margin: 0; padding: 8px 8px 4px; background: #f7f3e6; color: #3b2c1c; box-shadow: 0 12px 24px rgba(0, 0, 0, .45); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.amenity:nth-child(odd) { transform: rotate(-1.2deg); }
.amenity:nth-child(3n) { transform: rotate(1.4deg); }
.amenity:hover { transform: scale(1.06) rotate(0); position: relative; z-index: 2; }
.amenity img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.amenity figcaption { padding: 7px 2px 5px; text-align: center; font-family: var(--caps); font-size: .86rem; letter-spacing: .1em; }

/* Closing note */
.closing { text-align: center; padding-top: 120px; padding-bottom: 120px; }
.closing-seal {
  width: 110px;
  aspect-ratio: 1;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  border-radius: 46% 54% 51% 49% / 52% 47% 53% 48%;
  background: radial-gradient(circle at 35% 30%, var(--wax-light), var(--wax) 55%, #4f1010);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .4), 0 8px 18px rgba(0, 0, 0, .5);
  color: #e9b8a8;
  font-family: var(--script);
  font-size: 2.5rem;
}
.block h2.closing-thanks { margin: 0; font-size: clamp(4rem, 15vw, 9rem); line-height: .95; color: var(--parch-light); text-shadow: 0 0 40px rgba(201, 162, 75, .35); }
.closing-sign { margin: 26px 0 0; font-family: var(--script); font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1; color: var(--gold); }
.closing-addr { margin: 14px 0 0; font-family: var(--caps); font-size: .85rem; letter-spacing: .28em; text-transform: uppercase; color: #8f846a; }

@media (max-width: 820px) {
  .residence-grid { grid-template-columns: 1fr; }
  .plate { max-width: 420px; margin: 0 auto; }
  .venue-grid { grid-template-columns: 1fr; }
  .amenities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .venue:first-child, .venue-late { transform: none; }
  .entries { columns: 1; }
  .block { padding-top: 64px; }
}

@media (max-width: 480px) {
  .comment-form { grid-template-columns: 1fr; }
}

.drift .entry-status:not(.bad) { display: none; }

@media (prefers-reduced-motion: reduce) {
  .venue-after { clip-path: none; }
  .venue-tag-before { opacity: 0; }
  .venue-tag-after { opacity: 1; }
}

@media (max-width: 640px) {
  .comment-form { grid-template-columns: 1fr; }
  .comment-form input, .comment-form .btn { min-height: 50px; }
  .facts dd { font-size: 1.08rem; }
  .amenity figcaption { font-size: .78rem; letter-spacing: .06em; }
  .closing { padding-top: 80px; padding-bottom: 90px; }
}

@media (max-width: 640px) {
  .chatter { height: 118px; padding: 6px 0; margin-bottom: 6px; }
  .ticker-card { height: 104px; }
  .ticker-card.drift-photo { width: 104px; }
  .ticker-card.entry { width: 250px; padding-top: 9px; }
}

/* Ticker slips: centre the avatar and text in the card so short comments don't leave a gap underneath. */
.ticker-card.entry { align-items: center; align-content: center; padding-top: 10px; padding-bottom: 10px; }
.ticker-card .entry-body { align-self: center; }
