:root {
  --ink: #53634d;
  --sage: #78906e;
  --sage-dark: #4f6650;
  --paper: #f8f8f1;
  --gold: #b99a4c;
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--ink);
  background: #edf3e6;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 4%, rgba(255,255,255,.9), transparent 29%),
    radial-gradient(circle at 90% 93%, rgba(174,199,158,.28), transparent 34%),
    linear-gradient(150deg, #f7f9f2 0%, #e6efe0 52%, #f5f7ef 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.invitation-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: clamp(8px, 1.6svh, 16px);
  padding: max(14px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  color: rgba(66, 82, 63, .72);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  animation: settle .8s ease both;
}

.flip-card {
  display: block;
  width: min(100%, calc((100svh - 112px) * .709375));
  max-width: 460px;
  aspect-ratio: 1135 / 1600;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  perspective: 1600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 18px 28px rgba(64, 78, 54, .2));
  animation: card-arrival 1s cubic-bezier(.2,.8,.2,1) both;
}

.flip-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }

.flip-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2,.72,.18,1);
}

.flip-card.is-flipped .flip-card__inner { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  background: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-face--front img,
.backdrop {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-face--back { transform: rotateY(180deg); }
.backdrop { position: absolute; inset: 0; }

.back-copy {
  position: absolute;
  inset: 22.5% 8% 3.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #536049;
  text-align: center;
  text-shadow: 0 1px rgba(255,255,255,.8);
}

.back-kicker {
  margin-bottom: 2.2%;
  font-size: clamp(7px, 2.1vw, 12px);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.back-copy strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(28px, 8.8vw, 54px);
  font-weight: 500;
  line-height: .84;
  letter-spacing: -.03em;
}

.ornament { margin: 4.5% 0 3.5%; color: var(--gold); font-size: clamp(8px, 2vw, 12px); }

.back-message {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(15px, 4.2vw, 24px);
  line-height: 1.18;
}

.back-message b { font-weight: 600; color: #445440; }

.address {
  margin-top: 3.2%;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(20px, 6vw, 35px);
  font-weight: 600;
  line-height: .82;
}

.address small {
  font-family: "Montserrat", sans-serif;
  font-size: .34em;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.drink-note {
  margin-top: 3.2%;
  padding: 1.8% 4%;
  border-top: 1px solid rgba(185, 154, 76, .55);
  border-bottom: 1px solid rgba(185, 154, 76, .55);
  font-size: clamp(7px, 2.25vw, 12px);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.see-you {
  margin-top: 3%;
  margin-bottom: 3.5%;
  color: #536049;
  font-family: "Allura", "Segoe Script", cursive;
  font-size: clamp(23px, 6.8vw, 38px);
  line-height: 1;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
  margin-top: auto;
}

.action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 7px;
  border: 1px solid rgba(78, 101, 77, .45);
  border-radius: 999px;
  color: #f9fbf6;
  background: rgba(79, 102, 80, .92);
  box-shadow: 0 6px 16px rgba(70, 84, 62, .15);
  font-size: clamp(8px, 2.45vw, 12px);
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  text-shadow: none;
  transition: transform .2s ease, background .2s ease;
}

.action--whatsapp { background: rgba(104, 127, 91, .94); }
.action:active { transform: scale(.96); }
.action svg { width: 15px; height: 15px; fill: currentColor; flex: 0 0 auto; }
.action .whatsapp-icon { width: 17px; height: 17px; }

.flip-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px;
  border: 0;
  color: rgba(68, 86, 65, .72);
  background: transparent;
  font: 500 clamp(10px, 3vw, 13px)/1.2 "Montserrat", sans-serif;
  letter-spacing: .03em;
  animation: settle 1s .4s ease both;
  transition: opacity .25s ease, visibility .25s ease;
}

.flip-hint.is-hidden { visibility: hidden; opacity: 0; }

.tap-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(96, 116, 89, .36);
  border-radius: 50%;
  font-size: 16px;
  animation: breathe 2.4s ease-in-out infinite;
}

.ambient-leaf {
  position: absolute;
  z-index: -1;
  width: 200px;
  height: 320px;
  opacity: .13;
  background: radial-gradient(ellipse at 50% 70%, #71836c 0 7%, transparent 8%) 0 0 / 42px 58px;
  transform: rotate(-24deg);
  filter: blur(.2px);
}

.ambient-leaf--one { top: -130px; right: -100px; }
.ambient-leaf--two { bottom: -170px; left: -100px; transform: rotate(150deg); }

@keyframes card-arrival {
  from { opacity: 0; transform: translateY(22px) scale(.975); }
  to { opacity: 1; transform: none; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (min-width: 700px) {
  .invitation-shell { padding-block: 22px; }
  .flip-card { width: min(430px, calc((100svh - 130px) * .709375)); }
  .action:hover { transform: translateY(-2px); background: #405740; }
}

@media (max-width: 699px) {
  .back-copy { transform: translateY(4px); }

  .see-you {
    position: relative;
    top: 25px;
    font-size: clamp(32px, 11vw, 45px);
  }
}

@media (max-height: 650px) {
  .eyebrow { display: none; }
  .invitation-shell { grid-template-rows: minmax(0, 1fr) auto; }
  .flip-card { width: min(100%, calc((100svh - 54px) * .709375)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
