:root {
  --black: #0b0b0b;
  --ink: #171717;
  --charcoal: #363636;
  --gray: #77746f;
  --line: rgba(11, 11, 11, .2);
  --paper: #f7f5f0;
  --paper-white: #fffefa;
  --butter: #e7dc8d;
  --serif: "Bodoni MT", Didot, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --script: "Segoe Script", "Snell Roundhand", "Brush Script MT", cursive;
  --shadow: 0 25px 70px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #dad8d3; }
body {
  margin: 0;
  color: var(--ink);
  background: #e8e6e1 url("assets/opening/paper-floral-clean.png") center top / 760px auto repeat-y;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; }
h2 { font-size: clamp(2.25rem, 8vw, 4.8rem); letter-spacing: -.04em; }
h3 { font-size: clamp(1.35rem, 4vw, 2rem); }
img { max-width: 100%; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 300; padding: .8rem 1rem; color: white; background: var(--black); }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Envelope de abertura */
.opening {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #e8e6e1;
  transition: opacity .8s ease, visibility .8s ease;
}
.opening.is-opened { opacity: 0; visibility: hidden; }
.opening-stage {
  position: relative;
  width: min(100vw, calc(100dvh * .566));
  height: 100dvh;
  display: block;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(0,0,0,.15);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
}
.opening-paper { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.opening-monogram {
  position: absolute;
  left: 50%;
  top: 53%;
  width: 31%;
  max-width: none;
  transform: translate(-50%, -50%);
}
.opening-prompt { position: absolute; left: 50%; bottom: max(2.2rem, calc(env(safe-area-inset-bottom) + 1.2rem)); width: 90%; display: block; color: #504f4b; font-size: .62rem; line-height: 1.45; letter-spacing: .1em; text-transform: uppercase; transform: translateX(-50%); }
.opening-prompt > span { display: inline-block; margin-right: .65rem; font-family: "Segoe UI Symbol", serif; font-size: 1.15rem; font-variant-emoji: text; vertical-align: middle; transform: rotate(-25deg); }
.opening-stage:hover .opening-monogram { transform: translate(-50%, -50%) scale(1.025); }

/* Estrutura de papel */
main { width: min(100%, 78rem); margin: 0 auto; padding: clamp(.75rem, 3vw, 2rem); }
.paper-panel, .paper-strip {
  position: relative;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,254,250,.18), rgba(255,254,250,.18)),
    url("assets/opening/paper-floral-clean.png") center / cover no-repeat,
    var(--paper);
  box-shadow: var(--shadow);
}
.paper-panel { margin: 0 0 clamp(1rem, 3vw, 2rem); padding: clamp(4.5rem, 10vw, 8rem) clamp(1.25rem, 6vw, 5rem); }
.paper-strip { margin: 0 0 clamp(1rem, 3vw, 2rem); padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 6vw, 5rem); }
.paper-border { position: absolute; inset: .8rem; border: 1px solid var(--line); pointer-events: none; }
.section-label, .blessing, .invitation-line {
  margin-bottom: 1rem;
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.section-heading { max-width: 47rem; margin: 0 auto 3rem; text-align: center; }
.section-heading p:last-child { color: var(--gray); }
.section-heading h2 { margin-bottom: 1rem; }

/* Capa editorial */
.hero { min-height: 100svh; text-align: center; }
.monogram-img { width: clamp(7.5rem, 18vw, 11rem); height: auto; display: block; margin: 0 auto 1rem; }
.blessing { margin-bottom: 1.35rem; text-transform: none; }
.hero h2.hero-name-art { width: min(100%, 58rem); margin: 0 auto 1.25rem; }
.hero-name-art img { display: block; width: 100%; height: auto; margin: 0 auto; }
.invitation-line { margin-bottom: 2rem; }
.hero-date { width: fit-content; margin: 0 auto 4rem; padding: 1rem 1.4rem; display: flex; align-items: center; gap: .7rem; border-block: 1px solid var(--ink); font: 400 clamp(.88rem, 3vw, 1.25rem)/1 var(--serif); letter-spacing: .16em; }
.hero-date i { font-style: normal; opacity: .35; }
.hero-date b { padding-left: .8rem; border-left: 1px solid var(--line); font: 600 .65rem/1 var(--sans); letter-spacing: .12em; }
.editorial-collage { position: relative; width: min(100%, 59rem); min-height: 38rem; margin: 0 auto; }
.torn-verse cite { font-size: .58rem; font-style: normal; letter-spacing: .22em; text-transform: uppercase; }
.polaroid { margin: 0; padding: .7rem .7rem 2.2rem; background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.16); }
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.polaroid--hero img { filter: grayscale(1) contrast(1.06); }
.polaroid figcaption { margin-top: .75rem; color: var(--gray); text-align: center; font: 400 .95rem/1 var(--script); }
.polaroid--hero { position: absolute; left: 5%; top: 4%; width: min(42%, 22rem); transform: rotate(-3deg); }
.circle-note { position: absolute; right: 5%; top: 18%; z-index: 3; width: 14rem; height: 14rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--ink); border-radius: 50%; background: rgba(247,245,240,.94); box-shadow: 0 8px 26px rgba(0,0,0,.08); transform: rotate(4deg); }
.circle-note::before { content: ""; position: absolute; inset: .45rem; border: 1px solid var(--line); border-radius: inherit; }
.circle-note span { font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; }
.circle-note strong { max-width: 8rem; margin-top: .35rem; font: 400 1.25rem/1.15 var(--serif); text-transform: uppercase; }
.circle-note a { position: relative; z-index: 2; margin-top: .7rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; color: white; border-radius: 50%; background: var(--black); text-decoration: none; }
.torn-verse { position: absolute; right: 8%; bottom: 2%; width: min(54%, 29rem); padding: 2rem 2.25rem; text-align: left; background: #e8e6e1; clip-path: polygon(0 5%, 5% 1%, 11% 4%, 18% 0, 27% 4%, 34% 1%, 43% 5%, 52% 0, 60% 4%, 69% 1%, 77% 5%, 87% 1%, 100% 4%, 98% 94%, 90% 98%, 81% 94%, 72% 100%, 63% 95%, 53% 99%, 43% 94%, 34% 99%, 24% 95%, 14% 100%, 4% 95%); transform: rotate(1.5deg); }
.torn-verse p { margin-bottom: .8rem; font: 400 clamp(1rem, 2.6vw, 1.35rem)/1.5 var(--serif); text-transform: uppercase; }

/* Introdução e localização */
.intro { text-align: center; color: white; background: var(--black); box-shadow: var(--shadow); }
.intro h2 { max-width: 45rem; margin: 0 auto 1.25rem; color: white; }
.intro > p:last-child { max-width: 40rem; margin: 0 auto; color: rgba(255,255,255,.72); }
.location-layout { width: min(100%, 64rem); margin: 0 auto 3rem; display: grid; grid-template-columns: 1.65fr .75fr; gap: 1.2rem; align-items: stretch; }
.venue-photo { position: relative; min-height: 29rem; margin: 0; overflow: hidden; background: #ddd; }
.venue-photo img { width: 100%; height: 100%; display: block; object-fit: cover; filter: grayscale(1) contrast(1.08); }
.venue-photo figcaption { position: absolute; left: 1rem; bottom: 1rem; padding: .65rem .85rem; color: white; background: rgba(0,0,0,.76); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }
.location-card { padding: clamp(1.5rem, 4vw, 2.8rem); display: flex; flex-direction: column; justify-content: center; color: white; text-align: center; background: var(--black); }
.location-card .date-small { margin: 0; font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; }
.location-card > strong { display: block; margin: .35rem 0 0; font: 400 clamp(5rem, 11vw, 7rem)/.9 var(--serif); }
.location-card > p { margin-bottom: 1.2rem; color: rgba(255,255,255,.7); }
.location-card b { color: white; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.location-card hr { width: 100%; margin: .8rem 0 1.4rem; border: 0; border-top: 1px solid rgba(255,255,255,.25); }
.venue-watercolor { width: min(100%, 65rem); margin: 1rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); text-align: center; }
.venue-watercolor img { width: 100%; display: block; mix-blend-mode: multiply; }
.venue-watercolor figcaption { margin-top: -.5rem; font: 400 clamp(1.7rem, 5vw, 2.8rem)/1 var(--script); }
.venue-watercolor--feature { min-height: 29rem; margin: 0; padding: 1.25rem 1rem 1.75rem; display: flex; flex-direction: column; justify-content: center; border: 0; overflow: hidden; background: #edeae3; }
.venue-watercolor--feature figcaption { margin-top: -1.25rem; }

/* Aviso de cores */
.color-note { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(1.2rem, 4vw, 3rem); align-items: center; }
.color-note-mark { width: 5rem; height: 5rem; display: grid; place-items: center; color: white; border-radius: 50%; background: var(--black); font: 400 2rem/1 var(--serif); }
.color-note h2 { margin-bottom: 1rem; font-size: clamp(2rem, 6vw, 3.75rem); }
.color-note p:last-child { margin-bottom: 0; color: var(--gray); }
.reserved-colors { display: flex; gap: 1rem; }
.reserved-colors > span { width: 7.2rem; text-align: center; }
.reserved-colors i { width: 4.8rem; height: 4.8rem; display: block; margin: 0 auto .65rem; border: 1px solid var(--ink); border-radius: 50%; }
.reserved-colors b, .reserved-colors small { display: block; }
.reserved-colors b { font: 400 1rem/1.2 var(--serif); }
.reserved-colors small { margin-top: .2rem; color: var(--gray); font-size: .57rem; letter-spacing: .1em; text-transform: uppercase; }
.butter-chip { background: var(--butter); }
.white-chip { background: white; }

/* Cronograma */
.schedule { color: white; background: var(--black); }
.schedule .section-heading h2, .schedule .section-heading p { color: white; }
.timeline { width: min(100%, 54rem); margin: 0 auto; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 7rem 1.2rem 1fr; gap: 1.4rem; align-items: start; padding: 1.6rem 0; border-top: 1px solid rgba(255,255,255,.18); }
.timeline li:last-child { border-bottom: 1px solid rgba(255,255,255,.18); }
.timeline time { padding-top: .2rem; font: 400 1rem/1.2 var(--serif); text-align: right; }
.timeline li > span { width: .75rem; height: .75rem; margin-top: .35rem; border: 1px solid white; border-radius: 50%; }
.timeline h3 { margin-bottom: .35rem; color: white; }
.timeline p { margin: 0; color: rgba(255,255,255,.62); }

/* Galeria */
.gallery-grid { width: min(100%, 68rem); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.gallery-grid .polaroid:nth-child(odd) { transform: rotate(-1.2deg); }
.gallery-grid .polaroid:nth-child(even) { transform: rotate(1.3deg) translateY(1.2rem); }

/* Presentes */
.gifts .section-heading { margin-bottom: 2rem; }
.gift-note { width: min(100%, 58rem); margin: 0 auto 2.5rem; padding: 1.8rem; display: flex; gap: 1rem; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--ink); }
.gift-note p { margin: 0; }
.gift-note strong { display: block; font: 400 clamp(1.55rem, 5vw, 2.65rem)/1.1 var(--serif); }
.gift-note small { display: block; max-width: 38rem; margin: .7rem auto 0; color: var(--gray); }
.gift-grid { width: min(100%, 64rem); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.gift-card { min-height: 8rem; padding: 1.3rem; display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 1rem; align-items: center; color: var(--ink); text-align: left; border: 1px solid var(--ink); background: transparent; cursor: pointer; transition: color .2s ease, background .2s ease, transform .2s ease; }
.gift-card:hover { color: white; background: var(--black); transform: translateY(-2px); }
.gift-card > span { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .6rem; }
.gift-card > strong { font: 400 1.15rem/1.25 var(--serif); }
.gift-card > small { white-space: nowrap; font-size: .7rem; font-weight: 600; }
.custom-gift { width: min(100%, 64rem); margin: 1rem auto 0; padding: clamp(1.5rem, 5vw, 3rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; color: white; background: var(--black); }
.custom-gift h3 { color: white; margin-bottom: .5rem; }
.custom-gift p { margin-bottom: 0; color: rgba(255,255,255,.65); }
.custom-gift form { display: grid; grid-template-columns: minmax(8rem, .8fr) 1.2fr; gap: .65rem; }
.custom-gift label { grid-column: 1 / -1; font-size: .62rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.money-input { min-height: 3.2rem; display: flex; align-items: center; border: 1px solid rgba(255,255,255,.35); }
.money-input span { padding-left: 1rem; color: rgba(255,255,255,.65); }
.money-input input { width: 100%; min-width: 0; padding: .8rem; border: 0; outline: 0; color: white; background: transparent; }
.money-input input::placeholder { color: rgba(255,255,255,.4); }

/* RSVP, botões e rodapé */
.rsvp { text-align: center; }
.rsvp-card { width: min(100%, 43rem); margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem); border: 1px solid var(--ink); }
.rsvp-card > p:not(.section-label) { color: var(--gray); }
.deadline { width: fit-content; margin: 1.8rem auto 2rem; display: flex; align-items: center; gap: 1rem; }
.deadline strong { font: 400 5rem/.85 var(--serif); }
.deadline span { padding-left: 1rem; border-left: 1px solid var(--ink); text-align: left; font-size: .67rem; font-weight: 700; letter-spacing: .14em; line-height: 1.55; text-transform: uppercase; }
.rsvp-card small { display: block; margin-top: 1rem; color: var(--gray); }
.individual-invite { margin: 1rem auto 1.25rem; color: var(--ink) !important; letter-spacing: .04em; }
.individual-notice { margin: 1rem 0 1.25rem; padding: .85rem 1rem; border: 1px solid var(--ink); text-align: center; font-size: .9rem; }
.button { min-height: 3.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .85rem 1.2rem; border: 1px solid var(--ink); text-decoration: none; font-size: .63rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: color .2s ease, background .2s ease; }
.button--dark { color: white; background: var(--black); }
.button--dark:hover { color: var(--black); background: white; }
.button--light { color: var(--black); border-color: white; background: white; }
.button--light:hover { color: white; background: transparent; }
.button--full { width: 100%; }
footer { padding: 5rem 1.25rem calc(5rem + env(safe-area-inset-bottom)); color: white; text-align: center; background: var(--black); }
.monogram-img--footer { width: 7rem; margin-bottom: .5rem; filter: invert(1); }
.footer-name-art { display: block; width: min(90%, 28rem); height: auto; margin: 0 auto .35rem; filter: invert(1); }
footer small { color: rgba(255,255,255,.55); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; }

/* Janelas */
.modal { width: min(calc(100% - 2rem), 32rem); max-height: calc(100svh - 2rem); padding: 0; overflow: auto; color: var(--ink); border: 1px solid var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .3s ease-out both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(1rem) scale(.98); } }
.modal-close { position: absolute; z-index: 2; right: .75rem; top: .75rem; width: 2.5rem; height: 2.5rem; border: 1px solid var(--ink); color: var(--ink); background: var(--paper); cursor: pointer; font-size: 1.6rem; line-height: 1; }
.modal-content { padding: clamp(2rem, 7vw, 3.5rem); text-align: center; }
.modal-content h2 { margin-bottom: 1rem; font-size: clamp(2rem, 8vw, 3rem); }
.selected-gift { min-height: 3rem; margin-bottom: 1.2rem; font-family: var(--serif); }
.selected-gift strong { display: block; font-size: 1.25rem; }
.pix-qr-wrap { width: min(100%, 18rem); margin: 0 auto 1rem; padding: .8rem; border: 1px solid var(--ink); background: white; }
.pix-qr-wrap img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.pix-name { margin-bottom: 1.25rem; color: var(--gray); font-size: .8rem; }
.pix-name strong { color: var(--ink); }
.modal details { margin-top: .75rem; text-align: left; border: 1px solid var(--ink); }
.modal summary { padding: .9rem 1rem; cursor: pointer; font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pix-code { margin: 0; padding: 0 1rem 1rem; overflow-wrap: anywhere; color: var(--gray); font: .68rem/1.5 monospace; }
.modal-help { margin: 1rem 0 0; color: var(--gray); font-size: .76rem; line-height: 1.6; }
.rsvp-form { margin-top: 1.6rem; display: grid; gap: .7rem; text-align: left; }
.rsvp-form label { margin-top: .35rem; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rsvp-form label span { color: var(--gray); font-weight: 400; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea { width: 100%; padding: .85rem .9rem; color: var(--ink); border: 1px solid var(--ink); border-radius: 0; outline: 0; background: white; }
.rsvp-form textarea { resize: vertical; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { box-shadow: 0 0 0 2px rgba(0,0,0,.12); }
.toast { position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 250; width: min(calc(100% - 2rem), 30rem); padding: 1rem 1.2rem; color: white; text-align: center; background: var(--black); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 1rem); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.65,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 800px) {
  main { padding: .55rem; }
  .paper-panel, .paper-strip { margin-bottom: .55rem; }
  .hero { min-height: auto; }
  .hero h2.hero-name-art { width: min(100%, 48rem); }
  .hero-date { margin-bottom: 2.5rem; padding-inline: .8rem; gap: .4rem; }
  .editorial-collage { min-height: 38rem; }
  .polaroid--hero { left: 0; top: 1rem; width: 52%; }
  .circle-note { right: 0; top: 9rem; width: 11rem; height: 11rem; }
  .circle-note strong { font-size: 1rem; }
  .torn-verse { right: 0; bottom: 0; width: 72%; padding: 1.6rem; }
  .location-layout { grid-template-columns: 1fr; }
  .venue-photo, .venue-watercolor--feature { min-height: 21rem; }
  .color-note { grid-template-columns: 1fr; text-align: center; }
  .color-note-mark { margin: 0 auto; }
  .reserved-colors { justify-content: center; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .gift-grid { grid-template-columns: 1fr; }
  .custom-gift { grid-template-columns: 1fr; }
  .custom-gift form { grid-template-columns: 1fr; }
  .custom-gift form > * { grid-column: 1; }
}

@media (max-width: 480px) {
  .hero h2.hero-name-art { width: 100%; }
  .hero-date { letter-spacing: .08em; }
  .paper-panel, .paper-strip { padding-inline: 1rem; }
  .editorial-collage { min-height: 34rem; }
  .polaroid--hero { top: 1rem; width: 54%; padding: .45rem .45rem 1.6rem; }
  .circle-note { top: 8rem; width: 9.5rem; height: 9.5rem; }
  .torn-verse { width: 78%; padding: 1.25rem; }
  .torn-verse p { font-size: .9rem; }
  .timeline li { grid-template-columns: 4.5rem .8rem 1fr; gap: .7rem; }
  .timeline time { font-size: .78rem; }
  .gallery-grid .polaroid { padding: .45rem .45rem 1.6rem; }
  .gift-card { grid-template-columns: 2.4rem 1fr auto; gap: .7rem; }
  .gift-card > strong { font-size: 1rem; }
  .reserved-colors > span { width: 6rem; }
  .reserved-colors i { width: 4rem; height: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
