/* Um convite da casa: as fotos da mesa na frente, fundo claro e quente, a logo original.
   Cores, raios e fonte vêm do design system do Lá em Casa (fundo, painel, tinta, linha, marca-vermelho, marca-amarelo). */

@font-face {
  font-family: "Inter";
  src: url("/fontes/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fundo: #f4ede2;
  --painel: #fffcf7;
  --tinta: #2a1a12;
  --tinta-2: #5e4a3b;
  --tinta-3: #75604f;
  --linha: #e5d9c6;
  --linha-campo: #8f7965;
  --vermelho: #d40000;
  --vermelho-passa: #bc0000;
  --amarelo: #ffbc00;
  --selecao: #ffe7a8;
  --cafe-texto-2: #e9dccb; /* o texto de apoio sobre o café */
  --raio: 14px;
  --sai: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--tinta);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--selecao);
  color: var(--tinta);
}

:focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

.pagina {
  width: min(100% - 2.5rem, 66rem);
  margin-inline: auto;
}

/* ---------- A abertura: a foto da mesa e a folha do convite ---------- */

.capa {
  position: relative;
  height: 54svh;
  min-height: 19rem;
  max-height: 36rem;
  overflow: hidden;
  background: var(--tinta);
}

.capa > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--foco, 70%);
}

/* Um véu só no alto, para a logo e o nome lerem bem sobre a foto. */
.capa::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 42%;
  background: linear-gradient(rgba(42, 26, 18, 0.66), rgba(42, 26, 18, 0));
}

.marca {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  left: 1.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--painel);
  font-size: 0.9375rem;
  font-weight: 600;
}

.marca img,
.pe img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.55);
}

.folha {
  position: relative;
  z-index: 2;
  margin-top: -1.75rem;
  padding: 1.75rem 1.25rem 0;
  border-radius: 28px 28px 0 0;
  background: var(--fundo);
}

h1 {
  font-size: clamp(2.125rem, 9.6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* O grifo amarelo da marca embaixo de "nossa mesa". */
h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--amarelo) 62%, var(--amarelo) 94%, transparent 94%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.sub {
  max-width: 30em;
  margin-top: 0.875rem;
  color: var(--tinta-2);
  text-wrap: pretty;
}

.fatos {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.fatos li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

svg {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fatos svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.08rem;
  color: var(--vermelho);
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--vermelho);
  color: var(--painel);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(42, 26, 18, 0.12), 0 10px 22px -10px rgba(42, 26, 18, 0.45);
  transition: background-color 180ms ease, transform 180ms var(--sai);
}

.botao:hover {
  background: var(--vermelho-passa);
}

.botao:active {
  transform: scale(0.98);
}

.botao[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.folha .botao {
  margin-top: 1.5rem;
}

/* ---------- A carta da casa e as fotos ---------- */

h2 {
  font-size: clamp(1.75rem, 7.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.carta {
  padding: clamp(3.5rem, 14vw, 7rem) 0 0;
}

.texto p {
  max-width: 32em;
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--tinta-2);
  text-wrap: pretty;
}

.texto .assina {
  margin-top: 1.5rem;
  font-size: 1rem;
}

.assina strong {
  display: block;
  color: var(--tinta);
  font-weight: 650;
}

.fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.fotos figure {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 20px;
  background: var(--linha);
}

/* A segunda foto desce um pouco: as duas leem como fotos soltas sobre a mesa, não como grade. */
.fotos figure:last-child {
  margin-top: 2rem;
  margin-bottom: -2rem;
}

.fotos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Como vai ser ---------- */

.dia {
  padding: clamp(5.5rem, 20vw, 9rem) 0 clamp(3.5rem, 14vw, 7rem);
}

/* O convite: a foto da chegada em cima, o dia em destaque, o resto em duas linhas. */
.convite {
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--linha);
  border-radius: 28px;
  background: var(--painel);
}

.convite > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.convite-corpo {
  padding: 1.5rem 1.375rem 0.375rem;
}

.quando {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quando .numero {
  font-size: 4.75rem;
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--vermelho);
}

.quando strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.022em;
}

.quando [data-semana] {
  display: block;
  margin-top: 0.25rem;
  color: var(--tinta-2);
}

.convite dl {
  margin: 1.5rem 0 0;
}

.convite dl div {
  padding: 1.125rem 0;
  border-top: 1px solid var(--linha);
}

.convite dt {
  font-size: 0.875rem;
  color: var(--tinta-3);
}

.convite dd {
  margin: 0.125rem 0 0;
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.convite dd small {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tinta-2);
}

.nota {
  padding: 1.125rem 1.375rem 1.25rem;
  background: var(--selecao);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* ---------- Confirmar ---------- */

.confirmar {
  padding: clamp(3rem, 12vw, 5.5rem) 0 calc(2rem + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--tinta);
  color: var(--painel);
  scroll-margin-top: -1px;
}

.chamada p {
  max-width: 28em;
  margin-top: 0.875rem;
  color: var(--cafe-texto-2);
}

.cartao {
  margin-top: 1.75rem;
  padding: 1.5rem 1.25rem;
  border-radius: 24px;
  background: var(--painel);
  color: var(--tinta);
}

form {
  display: grid;
  gap: 1.375rem;
}

.campo {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

label,
legend {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  height: 3.5rem;
  padding: 0 1rem;
  border: 1.5px solid var(--linha-campo);
  border-radius: var(--raio);
  background: #fff;
  color: var(--tinta);
  font: inherit;
  caret-color: var(--vermelho);
  transition: border-color 180ms ease;
}

input[type="text"]:focus-visible {
  border-color: var(--tinta);
  outline-offset: 2px;
}

input[aria-invalid="true"] {
  border-color: var(--vermelho-passa);
}

.dica,
.privado {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--tinta-3);
}

.erro {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--vermelho-passa);
}

.erro::before {
  content: "";
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.14rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 5h2.4v7h-2.4V7Zm1.2 11.2a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 5h2.4v7h-2.4V7Zm1.2 11.2a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Com o erro na tela, a dica sai: uma mensagem por campo. */
.campo:has(.erro:not([hidden])) .dica {
  display: none;
}

.erro.geral {
  margin-top: 0;
}

.isca {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.privado {
  margin-top: -0.625rem;
  text-align: center;
}

.feito {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.feito > svg {
  width: 3.5rem;
  height: 3.5rem;
  stroke: var(--tinta);
  stroke-width: 5;
}

.feito circle {
  fill: var(--amarelo);
  stroke: none;
}

.feito h3 {
  font-size: clamp(1.625rem, 7vw, 2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  outline: 0;
}

.feito p {
  color: var(--tinta-2);
}

.feito .fatos {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--linha);
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.retirar {
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid var(--linha);
}

.retirar > p:first-child {
  font-weight: 600;
  color: var(--tinta);
  outline: 0;
}

.aviso {
  padding: 0.875rem 1rem;
  border-radius: var(--raio);
  background: var(--selecao);
  font-size: 0.9375rem;
}

.quieto {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

.pe {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2.5rem;
  font-size: 0.9375rem;
  color: var(--cafe-texto-2);
}

.pe strong {
  display: block;
  color: var(--painel);
  font-weight: 600;
}

/* ---------- O atalho, sempre no polegar ---------- */

.atalho {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 5;
  width: max-content;
  min-height: 3.25rem;
  translate: -50% 0;
  box-shadow: 0 1px 2px rgba(42, 26, 18, 0.2), 0 12px 28px -8px rgba(42, 26, 18, 0.55);
  transition: background-color 180ms ease, transform 420ms var(--sai), opacity 240ms ease, visibility 0s;
}

.atalho.fora {
  transform: translateY(160%);
  opacity: 0;
  visibility: hidden;
  transition: background-color 180ms ease, transform 420ms var(--sai), opacity 240ms ease, visibility 0s 420ms;
}

/* ---------- Telas largas ---------- */

@media (min-width: 60rem) {
  .abre {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100svh;
  }

  .capa {
    height: 100svh;
    max-height: none;
  }

  .marca {
    left: 2rem;
    top: 1.75rem;
  }

  .folha {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 4rem clamp(2.5rem, 5vw, 5rem);
    border-radius: 0;
  }

  .folha .botao {
    max-width: 22rem;
  }

  .carta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
  }

  .fotos {
    margin-top: 0;
  }

  .dia,
  .confirmar .pagina {
    display: grid;
    grid-template-columns: 1fr minmax(0, 30rem);
    column-gap: 4rem;
    align-items: start;
  }

  .convite,
  .cartao {
    margin-top: 0;
  }

  .pe {
    grid-column: 1 / -1;
  }
}

/* ---------- Movimento: a foto chega perto, a folha sobe ---------- */

@media (prefers-reduced-motion: no-preference) {
  .capa > img {
    animation: chega 2.6s var(--sai) both;
  }

  .folha > * {
    animation: sobe 0.9s var(--sai) both;
  }

  .folha > :nth-child(1) {
    animation-delay: 0.15s;
  }

  .folha > :nth-child(2) {
    animation-delay: 0.25s;
  }

  .folha > :nth-child(3) {
    animation-delay: 0.35s;
  }

  .folha > :nth-child(4) {
    animation-delay: 0.45s;
  }

  .js .revela {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.97);
    transition: opacity 0.8s var(--sai), transform 1s var(--sai);
  }

  .js .revela:last-child {
    transition-delay: 0.12s;
  }

  .js .revela.visto {
    opacity: 1;
    transform: none;
  }
}

@keyframes chega {
  from {
    transform: scale(1.1);
  }
}

@keyframes sobe {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
