:root {
  --ivory: #f7f3ec;
  --paper: #fffdf9;
  --sage: #8a9a7b;
  --sage-dark: #5f6f52;
  --gold: #b8975a;
  --ink: #3d3a35;
  --muted: #7a746a;
  --line: #e4dccd;

  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
  --sans: "Montserrat", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
}

h2 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  color: var(--sage-dark);
  margin-bottom: 1rem;
}

[hidden] {
  display: none !important;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 16px;
  background:
    radial-gradient(ellipse at top, rgba(138, 154, 123, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(184, 151, 90, 0.14), transparent 60%),
    var(--ivory);
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: 68rem;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 2.5rem;
}

.hero__photo {
  position: relative;
  margin: 0;
  width: min(62vw, 24rem);
}

/* Moldura em arco: uma linha dourada contornando a foto com um respiro. */
.hero__photo::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid var(--gold);
  border-radius: 999px 999px 0 0;
}

.hero__photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 24px 48px -24px rgba(61, 58, 53, 0.45);
}

@media (min-width: 860px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .hero__photo {
    order: 2;
  }
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.5rem, 15vw, 7.5rem);
  line-height: 1.05;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.3em;
}

.amp {
  color: var(--gold);
  font-size: 0.7em;
}

.date {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4.5vw, 1.75rem);
  letter-spacing: 0.25em;
  margin: 1.5rem 0 2.5rem;
  color: var(--sage-dark);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
}

.countdown div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4rem;
}

.countdown span {
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown small {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.4rem;
}

.countdown__done {
  font-family: var(--serif);
  font-size: 1.75rem;
  margin: 0;
}

.scroll-hint {
  display: inline-block;
  margin-top: 3rem;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.5rem;
  animation: float 2.4s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(6px);
  }
}

/* Sections */
.section {
  padding: clamp(4rem, 12vw, 7rem) 16px;
  text-align: center;
}

.section--narrow > * {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.section--tinted {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__lead {
  color: var(--muted);
  letter-spacing: 0.05em;
  margin: 0 0 2.5rem;
}

.ornament {
  color: var(--gold);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

/* Events */
.events {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
}

.event {
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: 2rem 1.5rem;
}

.event h3 {
  font-size: 1.75rem;
  color: var(--ink);
}

.event__time {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0.25rem 0 1rem;
}

.event__place {
  font-weight: 500;
  margin: 0;
}

.event__address {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.event .button {
  margin-top: 1.25rem;
}

/* Buttons */
.button {
  display: inline-block;
  font: 500 0.8rem/1 var(--sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--sage-dark);
  border: 1px solid var(--sage-dark);
  padding: 1rem 1.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button--ghost {
  color: var(--sage-dark);
  background: transparent;
}

.button--ghost:hover {
  color: #fff;
  background: var(--sage-dark);
  border-color: var(--sage-dark);
}

.button:focus-visible,
.chip:focus-visible,
.pix__custom input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* PIX */
.pix {
  margin-top: 2.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pix__amounts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.chip {
  font: 400 0.9rem/1 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--sage);
}

.chip[aria-pressed="true"] {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: #fff;
}

.pix__custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--sage);
  padding: 0.25rem 0.25rem;
}

.pix__custom span {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
}

.pix__custom input {
  font: 400 1.1rem var(--sans);
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 10rem;
  padding: 0.25rem;
}

.pix__custom input:focus {
  outline: none;
}

.pix__qr {
  width: min(15rem, 70vw);
  aspect-ratio: 1;
  background: #fff;
  padding: 0.5rem;
  border: 1px solid var(--line);
}

.pix__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pix__label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: -0.75rem;
}

.pix__code {
  width: 100%;
  max-width: 28rem;
  font: 400 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: 0.75rem;
  resize: none;
  word-break: break-all;
}

.pix__hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.pix__hint strong {
  font-weight: 500;
  color: var(--ink);
}

.card-gift {
  margin-top: 1.5rem;
}

.card-gift[hidden] {
  display: none;
}

.card-gift__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0;
}

a.chip {
  text-decoration: none;
}

.pix__missing {
  color: var(--muted);
  font-style: italic;
}

/* Galeria */
.gallery-section {
  padding-top: 0;
}

.gallery__title {
  font-family: var(--script);
  font-size: clamp(2.25rem, 8vw, 3rem);
  color: var(--gold);
  margin: 0 0 1.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
  align-items: start;
}

.gallery__item {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  box-shadow: 0 18px 36px -24px rgba(61, 58, 53, 0.5);
}

/* A foto do meio desce um pouco, para um ritmo mais editorial. */
.gallery__item:nth-child(2) {
  margin-top: 2.5rem;
}

.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery__item:hover img {
  transform: scale(1.04);
}

.gallery__item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* No celular, a galeria vira um carrossel de deslizar. */
@media (max-width: 700px) {
  .gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    margin: 0 -16px;
    padding: 0 16px 1.5rem;
    scrollbar-width: none;
  }

  .gallery::-webkit-scrollbar {
    display: none;
  }

  .gallery__item {
    flex: 0 0 72%;
    scroll-snap-align: center;
  }

  .gallery__item:nth-child(2) {
    margin-top: 0;
  }
}

/* Lightbox */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(30, 28, 25, 0.92);
}

.lightbox img {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  display: block;
}

.lightbox__btn {
  position: absolute;
  font: 300 2.25rem/1 var(--serif);
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: 0;
  border-radius: 999px;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox__btn:hover {
  background: rgba(0, 0, 0, 0.55);
}

.lightbox:focus {
  outline: none;
}

.lightbox__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox__close {
  top: 16px;
  right: 16px;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev {
  left: 16px;
}

.lightbox__next {
  right: 16px;
}

/* RSVP */
.rsvp {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.rsvp__deadline {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold);
  margin-top: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.field > span,
.field legend {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
}

.field small {
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  font: 400 1rem var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
  width: 100%;
}

.field textarea {
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.field--choices {
  gap: 0.6rem;
}

.field--choices legend {
  margin-bottom: 0.4rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.choice:hover,
.choice:has(input:checked) {
  border-color: var(--sage);
}

.choice input {
  accent-color: var(--sage-dark);
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

.rsvp__hint {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.rsvp__companions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rsvp__companions:empty {
  display: none;
}

.rsvp__companion {
  display: flex;
  gap: 0.5rem;
}

.rsvp__remove,
.rsvp__add {
  font: 400 1rem var(--sans);
  color: var(--sage-dark);
  background: transparent;
  cursor: pointer;
}

.rsvp__remove {
  flex: none;
  width: 2.9rem;
  font-size: 1.4rem;
  line-height: 1;
  border: 1px solid var(--line);
}

.rsvp__remove:hover {
  border-color: var(--sage);
}

.rsvp__add {
  align-self: flex-start;
  border: 1px dashed var(--sage);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.rsvp__add:hover {
  background: var(--paper);
}

.rsvp__add[hidden] {
  display: none;
}

.rsvp__remove:focus-visible,
.rsvp__add:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.rsvp .button {
  align-self: center;
  margin-top: 0.5rem;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.rsvp__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rsvp__error {
  color: #a4453a;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

.rsvp__done {
  margin-top: 2.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2rem 1.5rem;
}

.rsvp__done p {
  margin: 0;
}

.rsvp__done-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--sage-dark);
  margin-bottom: 0.5rem !important;
}

.section--tinted .pix {
  background: var(--ivory);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 16px 4rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
}

.footer p {
  margin: 0;
}

.footer__names {
  font-family: var(--script);
  font-size: 2.5rem;
  letter-spacing: 0;
  color: var(--gold);
  margin-bottom: 0.25rem !important;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-hint {
    animation: none;
  }
  .gallery__item img {
    transition: none;
  }
}
