/* Frontier IA — waitlist. Paleta travada em sistema-visual.md. */
:root {
  --ivory: #ece8de;
  --pine: #0c1512;
  --farol: #e44036;
  --face-voz: "Fraunces", serif;
  --face-estrutura: "Archivo", sans-serif;
  --face-dado: "Space Mono", monospace;
  --margem: clamp(20px, 5vw, 56px);
  --calha: 24px;
  --reticula: var(--margem) repeat(12, minmax(0, 1fr)) var(--margem);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--pine);
  color: var(--ivory);
  font-family: var(--face-estrutura);
  overflow-x: hidden;
}

/* ---------- fundo: textura + vinheta ---------- */

.pagina {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--reticula);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  column-gap: var(--calha);
  isolation: isolate;
}

.fundo {
  position: absolute;
  inset: 0;
  z-index: 0;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  overflow: hidden;
}

.fundo__fumaca {
  /* A fumaça é a foto-base: movimento baixo, depois impresso pela retícula. */
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.6);
  opacity: 0.45;
}

.fundo__reticula {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: radial-gradient(circle at center, var(--pine) 34%, transparent 35%);
  background-size: 5px 5px;
  opacity: 0.42;
  filter: blur(8px);
  animation: reticula-foco 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reticula-foco {
  from {
    background-size: 26px 26px;
  }

  to {
    background-size: 5px 5px;
    filter: blur(0);
  }
}

@media (min-resolution: 2dppx) {
  .fundo__reticula {
    background-size: 4px 4px;
  }

  @keyframes reticula-foco {
    from {
      background-size: 22px 22px;
    }

    to {
      background-size: 4px 4px;
      filter: blur(0);
    }
  }
}

.pagina::after {
  /* vinheta radial: escurece a borda, deixa o centro respirar */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, var(--pine) 92%);
  z-index: 1;
}

#grao {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ---------- nav ---------- */

.nav {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: var(--reticula);
  column-gap: var(--calha);
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid rgba(236, 232, 222, 0.16);
  font-size: 13px;
  letter-spacing: 0;
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s forwards;
}

.nav__marca {
  grid-column: 2 / 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.nav__logo {
  display: block;
  border-radius: 0;
}

.nav__lote {
  grid-column: 13 / 14;
  justify-self: end;
  font-family: var(--face-dado);
  text-transform: uppercase;
  color: rgba(236, 232, 222, 0.7);
  white-space: nowrap;
}

/* ---------- conteúdo em grid ---------- */

.conteudo {
  position: relative;
  z-index: 3;
  grid-column: 3 / 9;
  grid-row: 2;
  align-self: center;
  display: grid;
  justify-items: start;
  row-gap: 16px;
  text-align: left;
  padding: 64px 0 48px;
}

.folio {
  margin: 0 0 8px;
  font-family: var(--face-dado);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--farol);
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.22s forwards;
}

.headline {
  margin: 0;
  max-width: 640px;
  font-family: var(--face-voz);
  font-weight: 600;
  font-size: clamp(30px, 5.4vw, 48px);
  line-height: 1.14;
  text-align: left;
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.32s forwards;
}

.sub {
  margin: 0;
  font-size: 16px;
  font-family: var(--face-estrutura);
  line-height: 1.5;
  text-align: left;
  color: rgba(236, 232, 222, 0.82);
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.42s forwards;
}

/* ---------- o cupom ---------- */

.cupom-wrap {
  position: relative;
  margin-top: 8px;
  width: min(480px, 100%);
}

.cupom {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  background: var(--pine);
  border: 1px dashed rgba(236, 232, 222, 0.55);
  padding: 6px;
  animation: subir 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.56s forwards;
}

.cupom__tesoura {
  position: absolute;
  top: -11px;
  left: -11px;
  width: 20px;
  height: 20px;
  background: var(--pine);
  color: rgba(236, 232, 222, 0.55);
}

.cupom__lamina {
  transform-box: fill-box;
  transition: transform 0.25s ease;
}

.cupom__lamina--sup {
  transform-origin: 0% 0%;
}

.cupom__lamina--inf {
  transform-origin: 0% 100%;
}

.cupom:hover .cupom__lamina--sup,
.cupom:focus-within .cupom__lamina--sup {
  transform: rotate(-10deg);
}

.cupom:hover .cupom__lamina--inf,
.cupom:focus-within .cupom__lamina--inf {
  transform: rotate(10deg);
}

@media (prefers-reduced-motion: reduce) {
  .cupom__lamina {
    transition: none;
  }
}

.cupom__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--ivory);
  font-family: var(--face-estrutura);
  font-size: 15px;
  padding: 14px 12px;
}

.cupom__input::placeholder {
  color: rgba(236, 232, 222, 0.45);
}

.cupom__input:focus {
  outline: 1px solid var(--farol);
  outline-offset: 2px;
}

.cupom__botao {
  flex-shrink: 0;
  background: var(--farol);
  color: var(--pine);
  border: none;
  border-radius: 0;
  font-family: var(--face-estrutura);
  font-weight: 500;
  font-size: 14px;
  padding: 14px 22px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.cupom__botao:hover {
  filter: brightness(1.1);
}

.cupom__botao:active {
  transform: translateY(1px);
  filter: brightness(0.85);
}

.cupom__botao:focus-visible {
  outline: 1px solid var(--ivory);
  outline-offset: 2px;
}

.cupom__botao:disabled {
  cursor: default;
}

/* rasgo do cupom: a borda pontilhada é picote de verdade. Quando o e-mail
   entra, o cupom rasga ao longo dela e cai fora do quadro, revelando a
   linha de sucesso que estava embaixo o tempo todo. */
.cupom--rasga {
  animation: rasgar 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes rasgar {
  0% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  35% {
    clip-path: polygon(
      0% 0%, 100% 0%, 100% 22%, 82% 30%, 68% 18%, 54% 34%, 40% 16%, 26% 32%, 12% 14%, 0% 26%
    );
    transform: translateY(-6px) rotate(-1deg);
    opacity: 1;
  }
  70% {
    clip-path: polygon(
      0% 0%, 100% 0%, 100% 62%, 82% 70%, 68% 58%, 54% 74%, 40% 56%, 26% 72%, 12% 54%, 0% 66%
    );
    transform: translateY(-22px) rotate(1.5deg);
    opacity: 0.6;
  }
  100% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    transform: translateY(-60px) rotate(4deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cupom--rasga {
    animation: none;
    opacity: 0;
  }
}

.sucesso {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 14px;
  text-align: left;
  font-family: var(--face-dado);
  font-size: 14px;
  color: var(--farol);
}

.sucesso[hidden] {
  display: none;
}

.mensagem {
  min-height: 1.2em;
  margin: 0;
  font-family: var(--face-estrutura);
  font-size: 14px;
  line-height: 1.4;
  color: rgba(236, 232, 222, 0.85);
}

.mensagem[data-tipo="erro"] {
  color: var(--farol);
}

.escassez {
  margin: 4px 0 0;
  max-width: 440px;
  font-family: var(--face-estrutura);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: rgba(236, 232, 222, 0.6);
}

.micro {
  margin: 0;
  font-family: var(--face-estrutura);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: rgba(236, 232, 222, 0.55);
}

/* ---------- legenda de foto ---------- */

.legenda-foto {
  position: relative;
  z-index: 3;
  grid-column: 3 / 6;
  grid-row: 3;
  align-self: end;
  margin: 0 0 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(236, 232, 222, 0.22);
  font-family: var(--face-dado);
  font-size: 11px;
  line-height: 1.45;
  color: rgba(236, 232, 222, 0.5);
}

.legenda-foto figcaption {
  display: grid;
  row-gap: 2px;
}

.legenda-foto span:last-child {
  text-transform: uppercase;
  color: rgba(236, 232, 222, 0.34);
}

/* ---------- wordmark de fundo, sangrando ---------- */

.wordmark {
  position: relative;
  z-index: 3;
  grid-column: 2 / 14;
  grid-row: 4;
  height: clamp(96px, 18vh, 208px);
  overflow: hidden;
}

.wordmark__chapa {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--face-estrutura);
  font-weight: 900;
  font-size: clamp(90px, 22vw, 340px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: left;
}

/* Registro offset: a chapa vermelha entra fora de registro e assenta. */
.wordmark__chapa--farol {
  z-index: 0;
  color: var(--farol);
  animation: registrar-farol 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wordmark__chapa--ivory {
  z-index: 1;
  color: var(--ivory);
  animation: assentar 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes assentar {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 0.12;
  }
}

@keyframes registrar-farol {
  from {
    transform: translate(4px, 4px);
    opacity: 0.12;
  }
  to {
    transform: translate(0, 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark__chapa--farol {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .wordmark__chapa--ivory {
    animation: none;
    transform: none;
    opacity: 0.12;
  }
}

/* ---------- animações ---------- */

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .folio,
  .headline,
  .sub,
  .cupom {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fundo__reticula {
    animation: none;
    background-size: 5px 5px;
    filter: blur(0);
  }
}

/* ---------- responsivo ---------- */

@media (max-width: 480px) {
  :root {
    --calha: 8px;
  }

  .nav {
    padding: 20px 0;
    font-size: 10px;
  }

  .nav__marca {
    grid-column: 2 / 7;
    gap: 8px;
  }

  .nav__logo {
    width: 22px;
    height: 22px;
  }

  .nav__lote {
    grid-column: 7 / 14;
  }

  .conteudo {
    grid-column: 2 / 14;
    padding: 48px 0 40px;
    row-gap: 16px;
  }

  .headline {
    font-size: clamp(30px, 10vw, 40px);
  }

  .cupom {
    flex-direction: column;
    padding: 4px;
  }

  .cupom__botao {
    width: 100%;
  }

  .legenda-foto {
    grid-column: 2 / 14;
    margin-bottom: 8px;
  }

  .wordmark {
    grid-column: 2 / 14;
    height: 104px;
  }

  .wordmark__chapa {
    font-size: 112px;
  }
}
