/* =========================================================
   Juliana & José · 24.06.2027 · versão 3
   Design a partir das referências do casal (ver assets/):
   papel creme, aguarela verde salva, rosas brancas e eucalipto,
   caligrafia dourada.
   Mesmo conteúdo e mesmas funcionalidades da versão 2.
   ========================================================= */

:root {
  --paper: #FAF8F3;
  --cream: #FFFFFF;

  /* verde: o --sage-deep é o único que leva texto por cima,
     escolhido para passar o contraste AA com o creme */
  --sage-deep: #5F6E45;
  --sage: #8B9B6E;
  --sage-soft: #C9D5B8;
  --sage-wash: #E8EEDE;

  /* dourado: --gold para o que é grande e decorativo,
     --gold-ink para texto pequeno sobre fundo claro */
  --gold: #B18F52;
  --gold-ink: #8A6B2E;
  --gold-line: #D9C79C;
  --gold-light: #F5EBD8;

  --ink: #45483D;
  --light: #FBFAF5;

  --line: rgba(69, 72, 61, 0.14);
  --line-gold: rgba(177, 143, 82, 0.42);
  --line-light: rgba(251, 250, 245, 0.3);

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

  --shadow-card: 0 10px 30px rgba(95, 110, 69, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Qualquer regra nossa com `display` ganha ao `[hidden]` do browser, que tem
   especificidade mínima. Sem isto, um elemento escondido por JS continua à
   vista: era o que acontecia ao envelope, que tem `display: flex` e por isso
   ficava a tapar o site inteiro na segunda visita da sessão. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

/* ---------- blocos base ---------- */

.section {
  position: relative;
  padding: 6rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
@media (min-width: 768px) { .section { padding: 8.5rem 1.5rem; } }

/* textura de papel subtil + mancha de aguarela verde no topo de cada
   secção clara, o que dá o efeito de tinta a esbater-se da referência */
.section--paper,
.section--cream {
  background-image:
    radial-gradient(120% 46% at 50% -8%, rgba(139, 155, 110, 0.13) 0%, rgba(139, 155, 110, 0) 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}
.section--paper { background-color: var(--paper); }
.section--cream { background-color: var(--cream); }

.section--sage {
  background-color: var(--sage-deep);
  color: var(--light);
  background-image: radial-gradient(90% 60% at 50% 0%, rgba(251, 250, 245, 0.08) 0%, rgba(251, 250, 245, 0) 70%);
}
.section--sage h2,
.section--sage h3 { color: var(--light); }

/* divisória: o ramo de eucalipto em aguarela, ao centro do topo da secção.
   nas secções verdes o mesmo ramo vira silhueta creme, para continuar a ler-se */
.section::before {
  content: "";
  position: absolute;
  top: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 40px;
  background: url("../img/eucalipto.png") center / contain no-repeat;
  opacity: 0.92;
}
.section--sage::before {
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.wrap { max-width: 62rem; margin: 0 auto; position: relative; }
.wrap--narrow { max-width: 42rem; }

.eyebrow {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 1.4rem;
}
.eyebrow--light { color: var(--gold-light); }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 2.2rem;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.3;
}

.lead {
  max-width: 34rem;
  margin: 0 auto 2.4rem;
  color: rgba(69, 72, 61, 0.78);
}
.lead--light,
.section--sage .lead { color: rgba(251, 250, 245, 0.92); }

/* ---------- botões ---------- */

.btn {
  display: inline-block;
  background: var(--sage-deep);
  color: var(--light);
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.15rem 2.4rem;
  border-radius: 2px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: #4E5C38; transform: translateY(-1px); }
.btn--full { width: 100%; }

/* numa secção verde o botão verde desaparecia: passa a creme com texto verde */
.section--sage .btn {
  background: var(--gold-light);
  color: var(--sage-deep);
}
.section--sage .btn:hover { background: var(--light); }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line-gold);
  color: var(--gold-ink);
  padding: 0.95rem 1.8rem;
}
.btn--ghost:hover { background: transparent; border-color: var(--gold); color: var(--gold-ink); transform: none; }

/* botão circular do trajeto, como o "toque aqui" da referência */
.btn--circle {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  line-height: 2.1;
  box-shadow: 0 0 0 1px var(--sage-deep) inset, 0 0 0 5px var(--paper) inset, 0 0 0 6px rgba(251, 250, 245, 0.55) inset;
}
.btn--circle:hover { transform: translateY(-2px); }

/* ---------- hero: convite em papel ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem 2.2rem 6rem;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

/* manchas de aguarela verde, feitas em gradiente para não pesar */
.hero__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(58% 40% at 22% 18%, rgba(139, 155, 110, 0.20) 0%, rgba(139, 155, 110, 0) 68%),
    radial-gradient(52% 36% at 82% 62%, rgba(139, 155, 110, 0.17) 0%, rgba(139, 155, 110, 0) 70%),
    radial-gradient(70% 44% at 50% 100%, rgba(139, 155, 110, 0.13) 0%, rgba(139, 155, 110, 0) 72%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* moldura fina recuada, como a borda impressa do convite */
.hero::after {
  content: "";
  position: absolute;
  inset: 1.1rem;
  border: 1px solid var(--line-gold);
  pointer-events: none;
  z-index: 0;
}
@media (min-width: 768px) { .hero::after { inset: 1.8rem; } }

.hero__floral {
  position: absolute;
  width: clamp(150px, 44vw, 27rem);
  height: auto;
  pointer-events: none;
  z-index: 1;
}
.hero__floral--tl { top: -1.5%; left: -6%; }
.hero__floral--br { bottom: -1.5%; right: -6%; transform: rotate(180deg); }

.hero__frame { position: relative; z-index: 2; width: 100%; }

.hero__invite {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.78);
  max-width: 26rem;
  margin: 0 auto;
  line-height: 2.2;
}

.hero__names { width: min(84vw, 30rem); margin: 1.4rem auto 0; }

.names-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.names-svg text {
  font-family: var(--script);
  font-weight: 400;
  font-size: 200px;
  text-anchor: middle;
  color: var(--gold);
  fill: currentColor;
}

.names-svg .names-amp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 76px;
  color: var(--sage-deep);
}

/* --- nomes caligráficos: desenho do traço + preenchimento --- */
/* estados animados só com JS ativo; sem JS os nomes ficam visíveis normais */
/* o --len acompanha o perímetro do contorno de cada letra: as maiúsculas
   da Great Vibes têm laçadas muito maiores que as minúsculas */

html.js .names-svg tspan,
html.js .names-svg .names-amp {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-dasharray: var(--len, 900);
  stroke-dashoffset: var(--len, 900);
}

.names-line tspan:first-child,
.names-line--2 tspan:first-child { --len: 1500; }

/* os delays por letra vivem em custom properties (--dd desenho, --fd preenchimento)
   para a shorthand animation não os resetar */
html.js.fonts-ready .names-svg tspan,
html.js.fonts-ready .names-svg .names-amp {
  animation: name-draw 1.3s ease forwards, name-fill 0.9s ease forwards;
  animation-delay: var(--dd, 0s), var(--fd, 0s);
}

@keyframes name-draw { to { stroke-dashoffset: 0; } }
@keyframes name-fill { to { fill: currentColor; } }

.names-line tspan:nth-child(1) { --dd: 0.10s; --fd: 0.80s; }
.names-line tspan:nth-child(2) { --dd: 0.24s; --fd: 0.94s; }
.names-line tspan:nth-child(3) { --dd: 0.38s; --fd: 1.08s; }
.names-line tspan:nth-child(4) { --dd: 0.52s; --fd: 1.22s; }
.names-line tspan:nth-child(5) { --dd: 0.66s; --fd: 1.36s; }
.names-line tspan:nth-child(6) { --dd: 0.80s; --fd: 1.50s; }
.names-line tspan:nth-child(7) { --dd: 0.94s; --fd: 1.64s; }

.names-svg .names-amp { --dd: 1.16s; --fd: 1.86s; --len: 500; }

.names-line--2 tspan:nth-child(1) { --dd: 1.38s; --fd: 2.08s; }
.names-line--2 tspan:nth-child(2) { --dd: 1.52s; --fd: 2.22s; }
.names-line--2 tspan:nth-child(3) { --dd: 1.66s; --fd: 2.36s; }
.names-line--2 tspan:nth-child(4) { --dd: 1.80s; --fd: 2.50s; }

/* o convite entra antes dos nomes; a data e o local entram depois */
html.js:not(.static) .hero__invite,
html.js:not(.static) .hero__dateblock,
html.js:not(.static) .hero__where,
html.js:not(.static) .hero__scroll { opacity: 0; }

html.js.fonts-ready:not(.static) .hero__invite { animation: fade-up 0.9s ease 0.15s forwards; }
html.js.fonts-ready:not(.static) .hero__dateblock { animation: fade-up 0.9s ease 2.8s forwards; }
html.js.fonts-ready:not(.static) .hero__where { animation: fade-up 0.9s ease 3.1s forwards; }
html.js.fonts-ready:not(.static) .hero__scroll {
  animation: fade-in 0.9s ease 3.5s forwards, float 2.6s ease-in-out 4.4s infinite;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* estados sem animação: captura/testes e utilizadores com motion reduzido */
html.js.static .names-svg tspan,
html.js.static .names-svg .names-amp {
  animation: none;
  fill: currentColor;
  stroke-dashoffset: 0;
}
html.js.static .hero__invite,
html.js.static .hero__dateblock,
html.js.static .hero__where,
html.js.static .hero__scroll { opacity: 1; animation: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .names-svg tspan,
  html.js .names-svg .names-amp {
    animation: none;
    fill: currentColor;
    stroke-dashoffset: 0;
  }
  html.js .hero__invite,
  html.js .hero__dateblock,
  html.js .hero__where,
  html.js .hero__scroll { opacity: 1; animation: none; }
}

/* bloco de data com as regras horizontais, tal como o convite em papel */
.hero__dateblock { margin-top: 2.2rem; }

.hero__month {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(69, 72, 61, 0.85);
}

.hero__daterow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 3vw, 1.5rem);
  margin: 0.35rem auto 0.2rem;
  max-width: 28rem;
}

.hero__side {
  flex: 1;
  position: relative;
  font-size: clamp(0.56rem, 2.3vw, 0.68rem);
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.8);
  padding: 0.7rem 0;
  white-space: nowrap;
}
.hero__side::before,
.hero__side::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-gold);
}
.hero__side::before { top: 0; }
.hero__side::after { bottom: 0; }

.hero__day {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.hero__year {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(69, 72, 61, 0.8);
}

.hero__where {
  margin-top: 1.9rem;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.hero__scroll {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(69, 72, 61, 0.6);
  text-decoration: none;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  animation: float 2.6s ease-in-out infinite;
}
.hero__scroll::before {
  content: "";
  display: block;
  width: 1px;
  height: 2.2rem;
  margin: 0 auto 0.7rem;
  background: linear-gradient(180deg, rgba(177, 143, 82, 0) 0%, var(--gold-line) 100%);
}
.hero__scroll:hover { color: var(--ink); }

@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 7px); }
}

/* ---------- countdown ---------- */

.countdown {
  --cd-gap: 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--cd-gap);
  max-width: 34rem;
  margin: 0 auto;
}

.countdown__cell { position: relative; padding: 0.6rem 0.2rem; }

/* dois pontos dourados entre células, como na referência */
.countdown__cell + .countdown__cell::before {
  content: ":";
  position: absolute;
  left: calc(var(--cd-gap) / -2);
  top: 0.6rem;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  line-height: clamp(2.4rem, 9vw, 4.2rem);
  color: var(--gold);
}

.countdown__num {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  line-height: 1;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.6);
}

/* em ecrãs estreitos as labels espaçadas não podem ditar a largura da grelha */
@media (max-width: 480px) {
  .countdown { --cd-gap: 0.45rem; }
  .countdown__cell { min-width: 0; }
  .countdown__label { font-size: 0.52rem; letter-spacing: 0.16em; }
}

.countdown__note {
  margin-top: 2rem;
  font-family: var(--script);
  font-size: 1.9rem;
  line-height: 1.3;
  color: var(--gold);
}

.cal-buttons {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.countdown__num.tick { animation: tick 0.4s ease; }

@keyframes tick {
  from { opacity: 0.45; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* ---------- citação ---------- */

.quote p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 4.2vw, 2.15rem);
  line-height: 1.5;
  max-width: 36rem;
  margin: 0 auto;
}

/* ---------- monograma ---------- */

.monogram {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 3rem;
}

.monogram__mark {
  position: relative;
  width: 7.4rem;
  height: 9.8rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monogram__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
}

.monogram__initials {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--script);
  font-size: 2.9rem;
  line-height: 0.95;
  color: var(--gold);
}
.monogram__initials i {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sage-deep);
  font-size: 0.4em;
  line-height: 1.6;
}

.monogram--light { margin-bottom: 1.6rem; }
.monogram--light .monogram__mark { border-color: var(--gold-light); }
.monogram--light .monogram__mark::after { border-color: var(--line-light); }
.monogram--light .monogram__initials { color: var(--gold-light); }
.monogram--light .monogram__initials i { color: rgba(251, 250, 245, 0.8); }

/* ---------- a cerimónia ---------- */

.ceremony-when {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.ceremony-address { margin-bottom: 0.4rem; }

/* só o bloco que tem mapa a seguir é que precisa de folga por baixo dos botões */
#cerimonia .cal-buttons:not(:last-child) { margin-bottom: 2.4rem; }

/* ---------- o lugar ---------- */

/* ---------- galeria da quinta ---------- */
/* As fotos entram todas em 4:3 (já vêm cortadas assim), para a grelha ficar
   alinhada sem depender do que cada foto trazia de origem. */

.galeria {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8rem 1.4rem;
  max-width: 58rem;
  margin: 0 auto 3.4rem;
}
@media (min-width: 620px) { .galeria { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .galeria { grid-template-columns: repeat(3, 1fr); } }

.galeria__foto { margin: 0; }

.galeria__foto img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.galeria__foto:hover img {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(95, 110, 69, 0.14);
}

.galeria__foto figcaption {
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--gold-ink);
}

/* ---------- retrato do casal ---------- */
/* O passe-partout creme é o que separa a foto do verde da secção. Sem ele a foto
   cola-se ao fundo e o medalhão deixa de se ler. */

.retrato {
  width: min(15rem, 52vw);
  margin: 0 auto 2.8rem;
}

.retrato img {
  width: 100%;
  /* sem o height:auto, o atributo height="1000" do HTML ganha ao aspect-ratio
     e o medalhão sai uma elipse esticada */
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(251, 250, 245, 0.92),
    0 0 0 7px var(--gold-line),
    0 18px 38px rgba(40, 45, 30, 0.3);
}

.galeria__credito {
  margin: -2.4rem auto 3rem;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.45);
}

/* cartão branco com laço, no espírito do cartão "Local" da referência */
.venue-card {
  position: relative;
  max-width: 26rem;
  margin: 0 auto 2.6rem;
  padding: 3.4rem 2rem 2.2rem;
  background: var(--cream);
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  box-shadow: var(--shadow-card);
}

.ribbon {
  position: absolute;
  top: -1.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5.4rem;
  color: var(--gold);
}

.venue-card__label {
  font-family: var(--script);
  font-size: 2rem;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.venue-address {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 2.2;
  color: rgba(69, 72, 61, 0.82);
}

.venue-map {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: 22rem;
  margin: 0 auto;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
}

/* setas desenhadas a apontar para o botão seguinte */
.arrow {
  width: 4.5rem;
  height: auto;
  margin: 1.2rem auto 0.2rem;
  color: var(--gold);
  opacity: 0.65;
  transform: translateX(-3.6rem);
}
.arrow--flip { transform: translateX(3.6rem) scaleX(-1); }
/* o dourado escuro não se lê sobre o verde: ali a seta vai a dourado claro */
.section--sage .arrow { color: var(--gold-light); opacity: 0.75; }

/* ---------- presentes ---------- */

.iban__hint {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.statement {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 500;
  line-height: 1.35;
  max-width: 30rem;
  margin: 0 auto 1.6rem;
}

/* a secção dos presentes passou a clara a 2026-08-14 (estava verde e encostava ao
   rodapé, que é do mesmo verde), por isso o cartão do IBAN é agora claro também */
.iban {
  background: var(--cream);
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  padding: 1.5rem 2.2rem;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.iban:hover { border-color: var(--gold); }

.iban__number {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  letter-spacing: 0.14em;
}
.iban__hint { color: var(--gold-ink); }

/* Campo-armadilha para robôs. Invisível para pessoas, mas NÃO com display:none nem
   type=hidden: muitos robôs saltam esses e a armadilha deixava de apanhar nada. */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-erro {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #A4443A;
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  background: var(--sage-deep);
  color: var(--light);
  text-align: center;
  padding: 5rem 1.5rem 4.5rem;
  overflow: hidden;
}

.footer__floral {
  position: absolute;
  width: clamp(165px, 42vw, 20rem);
  height: auto;
  opacity: 0.85;
  pointer-events: none;
}
/* o rodapé leva a mesma divisória de eucalipto das secções, para o verde final
   começar com a mesma marca com que começam todos os outros blocos */
.footer::before {
  content: "";
  position: absolute;
  top: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 40px;
  background: url("../img/eucalipto.png") center / contain no-repeat;
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.footer__floral--tl { top: -14%; left: -11%; }
.footer__floral--br { bottom: -14%; right: -11%; transform: rotate(180deg); }

.footer > *:not(.footer__floral) { position: relative; z-index: 1; }

.footer__names {
  font-family: var(--script);
  font-size: 2.6rem;
  line-height: 1.2;
  color: var(--gold-light);
}

.footer__closing {
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(251, 250, 245, 0.82);
}

.footer__line {
  margin-top: 2.6rem;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(251, 250, 245, 0.68);
}

/* ---------- dialogs ---------- */

.dialog {
  border: 1px solid var(--line-gold);
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
  width: min(92vw, 30rem);
  max-height: 88svh;
  padding: 0;
  margin: auto;
  box-shadow: 0 24px 60px rgba(95, 110, 69, 0.22);
}

.dialog::backdrop {
  background: rgba(95, 110, 69, 0.5);
  backdrop-filter: blur(3px);
}

.dialog__inner {
  position: relative;
  padding: 2.6rem 2rem 2.2rem;
  text-align: center;
}
@media (min-width: 480px) { .dialog__inner { padding: 3rem 2.6rem 2.6rem; } }

.dialog__close {
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(69, 72, 61, 0.5);
  padding: 0.3rem;
}
.dialog__close:hover { color: var(--ink); }

.dialog__title {
  font-family: var(--script);
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.1;
  color: var(--gold);
  /* no telemóvel o título parte-se em duas linhas: equilibra-as, senão sobra
     uma palavra sozinha na segunda */
  text-wrap: balance;
}

.dialog__sub {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(69, 72, 61, 0.65);
}

/* o afastamento até ao formulário vive aqui, e não na última linha do cabeçalho:
   assim não se desfaz quando se tira uma dessas linhas */
[data-cabecalho] { margin-bottom: 1.8rem; }

/* ---------- formulários ---------- */

.field { margin-bottom: 1.5rem; text-align: left; }

.field > label,
.field__label {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.65);
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  resize: none;
  transition: border-color 0.25s ease;
}
.field input:focus,
.field textarea:focus { border-color: var(--sage-deep); }

.field__help {
  margin: -0.1rem 0 1.1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  font-weight: 300;
  color: rgba(69, 72, 61, 0.7);
}

.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.pill input { position: absolute; opacity: 0; pointer-events: none; }

.pill span {
  display: block;
  text-align: center;
  padding: 0.85rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.pill input:checked + span {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--light);
}
.pill:hover span { border-color: var(--sage-deep); }

/* ---------- escalões de convidados, nome a nome ---------- */
/* Cada grupo (adultos, crianças dos 3 aos 8, crianças com menos de 3) é uma lista de
   linhas que o convidado acrescenta e tira. Os campos com name= são os hidden com a
   contagem e os nomes juntos; as caixas de texto não têm name= de propósito, senão
   linhas com o mesmo nome escreviam umas por cima das outras no envio. */

.grupo {
  padding: 1.05rem 0 1.1rem;
  border-top: 1px solid var(--line);
}
.grupo:last-of-type { border-bottom: 1px solid var(--line); }
/* num "não" só fica o grupo dos adultos, e é ele que passa a fechar o bloco */
.detalhes--nao .grupo:not([data-so-sim]) { border-bottom: 1px solid var(--line); }

.grupo__titulo {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.65);
}

.grupo__lista:not(:empty) { margin-top: 0.55rem; }

.convidado {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.field .convidado__nome {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}

.convidado__tirar {
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 1px solid var(--line-gold);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(69, 72, 61, 0.6);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.convidado__tirar:hover { border-color: var(--sage-deep); color: var(--ink); }
.convidado__tirar[hidden] { display: none; }

.grupo__add {
  margin-top: 0.7rem;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold-ink);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.grupo__add:hover { border-color: var(--sage-deep); background: rgba(139, 155, 110, 0.08); }
.grupo__add::before { content: "+"; margin-right: 0.45rem; }

.grupo__total {
  margin-top: 1rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--gold-ink);
}
.grupo__total:empty { display: none; }

.demo-note {
  margin-top: 1rem;
  font-size: 0.68rem;
  color: rgba(69, 72, 61, 0.5);
}

.form-success { padding: 2.4rem 0 1.6rem; }

.form-success__title {
  font-family: var(--script);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

/* ---------- animações de entrada ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* entradas em cascata dentro de cada secção */
.reveal :is(.countdown__cell) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--stagger, 0) * 95ms);
}
.reveal.visible :is(.countdown__cell) {
  opacity: 1;
  transform: none;
}

:is(.countdown__cell):nth-child(1) { --stagger: 0; }
:is(.countdown__cell):nth-child(2) { --stagger: 1; }
:is(.countdown__cell):nth-child(3) { --stagger: 2; }
:is(.countdown__cell):nth-child(4) { --stagger: 3; }
:is(.countdown__cell):nth-child(5) { --stagger: 4; }
:is(.countdown__cell):nth-child(6) { --stagger: 5; }

/* ---------- envelope de abertura ---------- */

.envelope {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(58% 40% at 20% 16%, rgba(139, 155, 110, 0.24) 0%, rgba(139, 155, 110, 0) 68%),
    radial-gradient(56% 38% at 82% 80%, rgba(139, 155, 110, 0.22) 0%, rgba(139, 155, 110, 0) 70%),
    var(--paper);
  transition: opacity 0.6s ease 0.45s;
}

.envelope__floral {
  position: absolute;
  width: clamp(140px, 42vw, 22rem);
  height: auto;
  pointer-events: none;
}
.envelope__floral--tl { top: -2%; left: -8%; }
.envelope__floral--br { bottom: -2%; right: -8%; transform: rotate(180deg); }

.envelope__scene {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  transition: transform 0.85s cubic-bezier(0.5, 0, 0.2, 1) 0.35s, opacity 0.6s ease 0.5s;
}

.envelope__greeting {
  font-family: var(--script);
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 1.15;
  color: var(--gold);
}

.envelope__sub {
  margin-top: 0.3rem;
  margin-bottom: 2.4rem;
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(69, 72, 61, 0.75);
  text-align: center;
  max-width: 18rem;
  line-height: 2;
}

/* envelope em CSS: corpo branco + aba triangular que roda ao abrir */
.envelope__card {
  position: relative;
  width: min(74vw, 21rem);
  aspect-ratio: 3 / 2;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  perspective: 900px;
  transition: transform 0.3s ease;
}
.envelope__card:hover { transform: translateY(-3px); }

.envelope__body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #FFFFFF 0%, #F4F1E8 100%);
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(95, 110, 69, 0.18);
}
/* as duas dobras inferiores do envelope, a traço muito leve */
.envelope__body::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - 0.5px), rgba(177, 143, 82, 0.28) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to top left, transparent calc(50% - 0.5px), rgba(177, 143, 82, 0.28) 50%, transparent calc(50% + 0.5px));
}

/* o clip-path corta a border, por isso o contorno da aba vem do
   drop-shadow, que segue a forma recortada */
.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62%;
  background: linear-gradient(170deg, #FFFFFF 0%, #EFEBDD 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 3px rgba(122, 100, 52, 0.22));
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.75s cubic-bezier(0.6, 0, 0.3, 1);
  /* sem backface-visibility: hidden, senão a aba some a meio da rotação
     em vez de se ver a tombar para trás */
}

/* selo de cera dourado */
.envelope__seal {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 46% 54% 52% 48% / 50% 46% 54% 50%;
  background: radial-gradient(circle at 36% 30%, #E4C88C 0%, #C0A062 42%, #97783F 100%);
  box-shadow: 0 4px 12px rgba(122, 96, 46, 0.35), inset 0 -2px 5px rgba(120, 92, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.envelope__initials {
  font-family: var(--script);
  font-size: 1.5rem;
  line-height: 1;
  color: #FDF6E6;
  text-shadow: 0 1px 1px rgba(110, 84, 36, 0.5);
}
.envelope__initials i {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.6em;
  padding: 0 0.08em;
}

.envelope__hint {
  margin-top: 2.2rem;
  font-family: var(--sans);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

/* abertura: o selo desaparece, a aba levanta, o envelope sobe e tudo dissolve */
.envelope.open { opacity: 0; pointer-events: none; }
.envelope.open .envelope__seal { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
.envelope.open .envelope__flap { transform: rotateX(-158deg); }
.envelope.open .envelope__scene { transform: translateY(-14%) scale(0.96); opacity: 0; }

body.envelope-locked { overflow: hidden; }

/* ---------- modo ?static (capturas de ecrã e testes) ---------- */

html.static .reveal { transition: none; }
html.static .hero__scroll { animation: none; }
html.static { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html.static .envelope { display: none; }
html.static .reveal :is(.countdown__cell) {
  opacity: 1;
  transform: none;
  transition: none;
}
html.static .countdown__num { animation: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll { animation: none; }
  .envelope { display: none; }
  .reveal :is(.countdown__cell) {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .countdown__num.tick { animation: none; }
}
