/* Layout unit: 1 design px. Mirrors Canva's scaling: full size on wide screens,
   ~0.93 on laptops, and proportional below the 676px mobile breakpoint. */
:root {
  --u: min(1px, max(100vw / 1366, min(100vw / 676, 0.94px)));
  --serif: 'Gilda Display', 'Cormorant Garamond', Georgia, serif;
  --script: 'Parisienne', 'Great Vibes', cursive;
  --ink: rgb(91, 86, 74);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #fff; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

.sec {
  position: relative;
  width: 100%;
  height: calc(var(--h) * var(--u));
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.sec.full { min-height: 100vh; min-height: 100svh; }

/* Every design element is absolutely placed by its centre (--x relative to the
   page centre, --y from the section top) and its unrotated size. */
.el {
  position: absolute;
  left: calc(50% + (var(--x) - var(--w) / 2) * var(--u));
  top: calc((var(--y) - var(--h) / 2) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  transform: rotate(calc(var(--r, 0) * 1deg)) scaleX(var(--fx, 1));
}
.el.edge-l { left: calc((var(--ex) - var(--w) / 2) * var(--u)); }
.el.edge-r { left: auto; right: calc((var(--ex) - var(--w) / 2) * var(--u)); }
.el > img, .el > video { display: block; width: 100%; height: 100%; }
.el.clip { overflow: hidden; }
.el.clip > img {
  position: absolute;
  width: calc(var(--iw) * var(--u));
  height: calc(var(--ih) * var(--u));
  max-width: none;
  left: calc(50% + (var(--dx) - var(--iw) / 2) * var(--u));
  top: calc(50% + (var(--dy) - var(--ih) / 2) * var(--u));
  transform: scaleX(var(--ifx, 1));
}
.el > svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Text */
.t {
  margin: 0;
  white-space: pre;
  font-size: calc(var(--fs) * var(--u));
  line-height: calc(var(--lh) * var(--u));
  letter-spacing: calc(var(--ls, 0) * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.t.serif { font-family: var(--serif); }
.t.script { font-family: var(--script); }
.t sup { font-size: 0.6em; line-height: 0; vertical-align: super; }
a.t, a.hit { cursor: pointer; }
a.hit { display: block; }
a.t:hover, .btn:hover .t { opacity: 0.75; }
.t, .btn .t { transition: opacity 0.2s; }

/* Entrance animations (rise / drop + fade), triggered per section */
.el[data-a] {
  opacity: 0;
  translate: 0 calc(var(--ady) * var(--u));
  transition:
    opacity calc(var(--adur) * 1ms) ease-out calc(var(--adel) * 1ms),
    translate calc(var(--adur) * 1ms) cubic-bezier(0.22, 0.8, 0.3, 1) calc(var(--adel) * 1ms);
}
.sec.in .el[data-a] { opacity: 1; translate: 0 0; }

/* Photobooth strip dispensing out of the slot */
.strip-win { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--st) * var(--u)); overflow: hidden; }
.strip-win > .strip { position: absolute; inset: 0; translate: 0 calc(-324 * var(--u)); }
.sec.in .strip { animation: dispense 2.8s linear 0.2s forwards; }

/* Record keeps spinning unless a guest turns the song off with the speaker */
.vinyl > img { animation: spin 2.6s linear infinite; }
body.stopped .vinyl > img { animation-play-state: paused; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Speaker beside the tonearm: waves while the song plays, muted otherwise */
.vol-btn {
  border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  color: #6b6458; opacity: 0.85;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s, scale 0.15s;
}
.vol-btn::after { content: ''; position: absolute; inset: -40%; }
.vol-btn:hover { opacity: 1; }
.vol-btn:active { scale: 0.9; }
.vol-btn svg { display: block; width: 100%; height: 100%; }
.vol-btn .w1, .vol-btn .w2 { display: none; }
body.playing .vol-btn .w1, body.playing .vol-btn .w2 { display: block; animation: wave 1.6s ease-in-out infinite; }
body.playing .vol-btn .w2 { animation-delay: 0.25s; }
body.playing .vol-btn .x { display: none; }
@keyframes wave { 50% { opacity: 0.35; } }

/* Flowers and leaves sway in a light breeze */
.sway > img {
  transform-origin: var(--so, 50% 100%);
  animation: sway var(--sd, 5s) ease-in-out var(--sdel, 0s) infinite alternate;
}
@keyframes sway {
  0% { rotate: calc(var(--sa, 2.5deg) * -1); translate: 0 0; }
  50% { rotate: calc(var(--sa, 2.5deg) * 0.3); translate: calc(var(--sa, 2.5deg) / 1deg * 0.25px) 0; }
  100% { rotate: var(--sa, 2.5deg); translate: 0 0; }
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(7, auto);
  justify-content: center; align-content: start;
  column-gap: calc(5 * var(--u));
  height: 100%; padding-top: calc(14 * var(--u));
  font-family: 'Times New Roman', Times, serif; color: #5c5a56;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
}
.countdown .num, .countdown .colon { font-size: calc(60 * var(--u)); line-height: 1; text-align: center; }
.countdown .colon { font-size: calc(50 * var(--u)); align-self: center; padding: 0 calc(3 * var(--u)); }
.countdown .num { min-width: calc(76 * var(--u)); }
.countdown .num.s { color: #b8ab92; }
.countdown .lbl { margin-top: calc(6 * var(--u)); font-size: calc(18 * var(--u)); text-align: center; }

/* Guest details form */
.rsvp {
  height: 100%;
  padding: calc(40 * var(--u)) calc(52 * var(--u));
  font-family: 'Questrial', 'Helvetica Neue', Arial, sans-serif;
  color: #4a463f;
  display: flex; flex-direction: column;
}
.rsvp label { display: block; font-size: max(14px, calc(17 * var(--u))); margin: 0 0 calc(12 * var(--u)); }
.rsvp .field { margin-bottom: calc(40 * var(--u)); }
.rsvp input, .rsvp textarea {
  display: block; width: 100%;
  font: inherit; font-size: max(16px, calc(17 * var(--u))); color: inherit;
  height: calc(52 * var(--u)); min-height: 40px;
  padding: 0 calc(14 * var(--u));
  border: 1px solid #9a948a; border-radius: calc(8 * var(--u));
  background: #fff;
}
.rsvp textarea { padding-top: calc(12 * var(--u)); resize: vertical; }
.rsvp input:focus, .rsvp textarea:focus { outline: 2px solid #c9bfae; outline-offset: 1px; }
.rsvp button {
  margin-top: calc(56 * var(--u));
  width: 100%; height: calc(58 * var(--u)); min-height: 42px;
  border: 0; border-radius: 999px;
  background: #e8e1d7; color: #4a463f;
  font: inherit; font-size: max(16px, calc(22 * var(--u))); cursor: pointer;
  transition: background 0.2s;
}
.rsvp button:hover { background: #ddd3c5; }
.rsvp button:disabled { opacity: 0.6; cursor: default; }
.rsvp .note { text-align: center; font-size: calc(12 * var(--u)); margin-top: calc(12 * var(--u)); color: #6b665e; min-height: 1.2em; }
.rsvp .hp { position: absolute; left: -9999px; }
.rsvp.sent .field, .rsvp.sent button { display: none; }
.rsvp .thanks { display: none; text-align: center; margin: auto 0; font-family: var(--serif); letter-spacing: calc(2 * var(--u)); font-size: calc(18 * var(--u)); line-height: 1.7; color: rgb(102, 102, 102); }
.rsvp.sent .thanks { display: block; }

/* Phone layout: Canva switches some sections to a separately arranged mobile
   design below ~480px. Positions come from that layout (measured at 390px). */
@media (max-width: 480px) {
  .sec.m { --um: calc(100vw / 390); --u: calc(var(--um) * 0.8); height: calc(var(--mhs) * var(--um)); }
  .sec.m .el[style*="--mx"] {
    --u: calc(var(--um) * var(--k));
    left: calc(50% + (var(--mx) - var(--mw) / 2) * var(--um));
    right: auto;
    top: calc((var(--my) - var(--mh) / 2) * var(--um));
    width: calc(var(--mw) * var(--um));
    height: calc(var(--mh) * var(--um));
    transform: rotate(calc(var(--mr, 0) * 1deg)) scaleX(var(--fx, 1));
  }
  .sec.m .strip-win { top: calc(var(--stm) * var(--um)); }
}

@media (prefers-reduced-motion: reduce) {
  .el[data-a] { transition: none; opacity: 1; translate: 0 0; }
  .sec.in .strip { animation: none; translate: 0 0; }
  .vinyl > img, .sway > img, .vol-btn path { animation: none; }
}

/* Screens (single-page app) */
.screen[hidden] { display: none; }
.sec.reset .el[data-a] { transition: none; }

/* Intro: only the brass button is tappable */
a.el.tap { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a.el.tap::after { content: ''; position: absolute; inset: -60%; }
a.el.tap:hover { filter: brightness(1.12); }
a.el.tap:active { scale: 0.92; }

/* Slot front overlay: only its solid wood, so the box's drop shadow isn't drawn twice */
.el.band { clip-path: inset(0 10.4% 0 10.1%); }

/* Photo wall between the countdown and the guest details: 2 rows of 3, no frame */
.sec.gallery { height: auto; padding: calc(30 * var(--u)) 0 calc(120 * var(--u)); background: url(/assets/img/eb82069f677ab89ba58b52177fe69143.jpg) center / cover; }
.pol-grid {
  display: grid;
  grid-template-columns: repeat(3, calc(200 * var(--u)));
  gap: calc(30 * var(--u)) calc(26 * var(--u));
  justify-content: center;
}
.pol {
  margin: 0;
  box-shadow: 0 calc(4 * var(--u)) calc(12 * var(--u)) rgba(60, 45, 30, 0.22), 0 1px 2px rgba(0, 0, 0, 0.12);
  rotate: var(--tilt);
  opacity: 0;
  translate: 0 calc(40 * var(--u));
  transition: opacity 0.9s ease-out calc(var(--i) * 110ms), translate 1s cubic-bezier(0.22, 0.8, 0.3, 1) calc(var(--i) * 110ms);
}
.pol img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #e9e4da; }
.sec.in .pol { opacity: 1; translate: 0 0; }
.sec.reset .pol { transition: none; }
/* Photographer credit under the photo wall: a small annotation */
.credit {
  margin: calc(30 * var(--u)) 0 0; text-align: center;
  font-family: var(--serif); color: #8a8478;
  font-size: max(9px, calc(11 * var(--u))); letter-spacing: calc(1.6 * var(--u)); text-transform: uppercase;
  opacity: 0; transition: opacity 1s ease-out 0.9s;
}
.sec.in .credit { opacity: 1; }
.sec.reset .credit { transition: none; }
@media (prefers-reduced-motion: reduce) { .pol, .credit { transition: none; opacity: 1; translate: 0 0; } }

/* Thank-you popup after the guest details are sent */
.ty {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(40, 34, 26, 0.45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: ty-fade 0.35s ease-out;
}
.ty[hidden] { display: none; }
.ty-card {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(100svh - 40px); overflow: auto;
  padding: 26px 26px 22px;
  background: #fbf8f2 url(/assets/img/eb82069f677ab89ba58b52177fe69143.jpg) center / cover;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(30, 22, 12, 0.35);
  text-align: center; color: #5b564a;
  font-family: var(--serif);
  animation: ty-rise 0.5s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.ty-photo {
  margin: 0 auto 6px; width: 92%;
  padding: 8px 8px 26px; background: #fff;
  box-shadow: 0 4px 14px rgba(60, 45, 30, 0.25);
  rotate: -2deg;
}
.ty-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ty h2 { font-family: var(--script); font-weight: 400; font-size: 40px; line-height: 1.2; margin: 14px 0 8px; color: #5b564a; }
.ty p { margin: 0 0 10px; font-size: 13px; letter-spacing: 1.4px; line-height: 1.75; text-transform: uppercase; }
.ty .ty-sent { font-size: 11.5px; color: #8a8478; text-transform: none; letter-spacing: 0.4px; }
.ty .ty-sent b { font-weight: 400; color: #5b564a; word-break: break-all; }
.ty-close {
  margin-top: 10px; padding: 10px 22px;
  border: 1px solid #9c8c86; border-radius: 5px; background: transparent;
  font: inherit; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #5b564a;
  cursor: pointer; transition: background 0.2s;
}
.ty-close:hover { background: rgba(156, 140, 134, 0.12); }
@keyframes ty-fade { from { opacity: 0; } }
@keyframes ty-rise { from { opacity: 0; translate: 0 24px; scale: 0.96; } }
@media (prefers-reduced-motion: reduce) { .ty, .ty-card { animation: none; } }
