:root {
  --white: #ffffff;
  --paper: #fdfcf9;
  --ink: #3a3a3a;
  --ink-soft: #5b5b58;
  --gold: #a88b3d;
  --gold-2: #b8994a;
  --gold-light: #e6d7ac;
  --sage: #8fa382;
  --sage-dark: #6e8466;
  --sage-light: #e9eee4;
  --line: #e7e2d6;
  --shadow: 0 18px 50px -20px rgba(60, 55, 40, 0.28);
  --script: 'Pinyon Script', 'Great Vibes', cursive;
  --caps: 'Cinzel', 'Trajan Pro', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Folhagens */
.leaf {
  position: fixed;
  width: min(34vw, 400px);
  pointer-events: none;
  z-index: 6;
  opacity: 0.95;
}
.leaf-tl { top: -8px; left: -8px; }
.leaf-br { bottom: -8px; right: -8px; transform: rotate(180deg); }

/* Navegação */
.topnav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 40px);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(231, 226, 214, 0.7);
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.topnav a { text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.topnav a:hover { color: var(--gold); }

main { position: relative; z-index: 1; }
section { padding: 72px 16px; }

/* Cartão do convite */
.card {
  max-width: 1080px;
  margin: 48px auto 0;
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
  padding: clamp(40px, 7vw, 90px) clamp(18px, 6vw, 80px);
}
.verse, .caps, .parents, .place, .date, .caps-title {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.verse { font-size: clamp(12px, 1.6vw, 16px); margin: 0 0 36px; }
.verse span { font-size: 0.78em; white-space: nowrap; }
.caps { font-size: clamp(12px, 1.5vw, 15px); margin: 0 0 30px; }
.small { font-size: 12px; letter-spacing: 0.14em; }

.parents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  font-size: clamp(11px, 1.5vw, 15px);
  line-height: 1.5;
  margin-bottom: 18px;
}
.parents p { margin: 0; }

.names {
  font-family: var(--script);
  font-weight: 400;
  color: var(--gold);
  font-size: clamp(50px, 8.6vw, 116px);
  line-height: 1.15;
  margin: 18px 0 26px;
  letter-spacing: 0;
}
.names .amp { font-size: 0.8em; }

.date { display: inline-flex; flex-direction: column; align-items: center; margin: 10px 0 30px; }
.date-main {
  font-size: clamp(22px, 3.6vw, 36px);
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-top: 2px solid var(--ink);
}
.date-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: clamp(16px, 2.4vw, 24px);
}
.date-sub i { flex: 1; height: 2px; background: var(--ink); }

.place { font-size: clamp(13px, 1.6vw, 17px); line-height: 1.5; }
.place strong { display: block; font-weight: 600; }
.place a { text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.place a:hover { color: var(--gold); border-color: var(--gold-light); }

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 28px);
  margin-top: 44px;
}
.countdown div {
  min-width: 70px;
  padding: 10px 6px 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}
.countdown b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  color: var(--gold);
  line-height: 1.1;
}
.countdown span { font-family: var(--caps); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); }

/* Mensagem */
.message { max-width: 680px; margin: 0 auto; text-align: center; }
.script { font-family: var(--script); font-weight: 400; color: var(--gold); }
.message h2 { font-size: clamp(42px, 7vw, 64px); margin: 0 0 18px; line-height: 1.2; }
.message p { color: var(--ink-soft); margin: 0 0 16px; }
.signature { font-family: var(--caps); letter-spacing: 0.16em; font-size: 14px; color: var(--ink) !important; margin-top: 26px !important; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold-2); margin-top: 22px; }
.ornament span { width: 80px; height: 1px; background: var(--gold-light); }

/* Presentes */
.gifts { max-width: 1140px; margin: 0 auto; text-align: center; }
.caps-title { font-size: clamp(18px, 2.6vw, 26px); letter-spacing: 0.14em; font-weight: 400; margin: 0 0 10px; }
.lead { color: var(--ink-soft); margin: 0 0 40px; }
.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px;
  text-align: left;
}
.gift {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.gift:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gift-img {
  aspect-ratio: 4 / 3;
  background: var(--sage-light);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.gift-img img { width: 100%; height: 100%; object-fit: cover; }
.gift-img .ph { font-family: var(--script); font-size: 54px; color: var(--sage); }
.gift-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gift-name { font-family: var(--caps); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; line-height: 1.4; }
.gift-desc { font-size: 16px; color: var(--ink-soft); margin: 0; line-height: 1.45; }
.gift-price { font-size: 24px; color: var(--gold); font-weight: 500; margin: auto 0 8px; padding-top: 6px; }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,0.92);
  color: var(--sage-dark);
  font-family: var(--caps); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--sage);
}
.gift.is-gifted .gift-img img { filter: saturate(0.6); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-soft); font-style: italic; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--caps); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 13px 22px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--gold); transition: background .2s, color .2s, border-color .2s;
}
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #8f7432; border-color: #8f7432; }
.btn-outline { background: transparent; color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #fff; }
.btn:focus-visible, .topnav a:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; }

/* Presença */
.rsvp { text-align: center; max-width: 680px; margin: 0 auto; }
.rsvp p { color: var(--ink-soft); }
.rsvp .btn { margin-top: 10px; }

footer { position: relative; z-index: 1; text-align: center; padding: 40px 16px 70px; font-family: var(--caps); font-size: 12px; letter-spacing: 0.3em; color: var(--ink-soft); }
footer p { margin: 0; }
.small-script { font-size: 36px; letter-spacing: 0; text-transform: none; margin-bottom: 4px !important; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(40, 42, 36, 0.45); backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--white); box-shadow: var(--shadow); text-align: center;
  padding: 36px 26px 28px; animation: rise .25s ease;
  background-image: radial-gradient(circle at 0 0, var(--sage-light) 0, transparent 120px), radial-gradient(circle at 100% 100%, #f4eedd 0, transparent 120px);
}
.modal-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.modal-gift { font-family: var(--caps); font-weight: 500; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; margin: 4px 0 2px; }
.modal-price { font-size: 30px; color: var(--gold); margin: 0 0 12px; }
.qr { width: 200px; height: 200px; margin: 0 auto 10px; border: 1px solid var(--line); padding: 6px; background: #fff; }
.hint { font-size: 15px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.45; }
#pixCode {
  width: 100%; resize: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.4;
  padding: 10px; border: 1px dashed var(--gold-2); background: #fffdf6; color: var(--ink); margin-bottom: 12px; word-break: break-all;
}
.modal-card .btn { width: 100%; }
.thanks { margin-top: 18px; animation: rise .3s ease; }
.thanks .script { font-size: 40px; margin: 0; line-height: 1.2; }
.thanks p:last-child { font-size: 16px; color: var(--ink-soft); margin: 4px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: #fff; padding: 10px 18px; font-size: 15px; box-shadow: var(--shadow);
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Revelar ao rolar */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .leaf { width: 48vw; opacity: 0.7; z-index: 0; }
  .topnav { background: rgba(255,255,255,0.9); }
  .card { margin-top: 24px; box-shadow: none; background: transparent; }
  .parents { grid-template-columns: 1fr; gap: 12px; }
  .names .amp { display: block; line-height: 0.9; }
  .topnav { font-size: 10px; letter-spacing: 0.12em; gap: 14px; }
  section { padding: 56px 16px; }
  .countdown div { min-width: 0; flex: 1; max-width: 76px; }
  .countdown b { font-size: 24px; }
  .gift-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gift-body { padding: 12px; }
  .gift-name { font-size: 12px; }
  .gift-desc { display: none; }
  .gift-price { font-size: 19px; }
  .gift .btn { padding: 11px 8px; font-size: 10px; letter-spacing: 0.12em; }
}
@media (max-width: 360px) {
  .gift-grid { grid-template-columns: 1fr; }
}
