:root {
  --bg: #fdfcf7;
  --ink: #2c3e50;
  --ink-soft: #5a6b7c;
  --pink: #ffd6e0;
  --blue: #c5e3f6;
  --yellow: #fff3b0;
  --green: #c9ebc4;
  --paper-tape: rgba(255, 214, 224, 0.7);

  --font-hand: "Caveat", cursive;
  --font-body: "Patrick Hand", cursive;

  --max-content: 640px;
}

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

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  background-image: radial-gradient(
    rgba(44, 62, 80, 0.05) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
}

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

/* ============ Layout das seções ============ */

.section {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section > *:not(.hero__doodles):not(.hero__scroll) {
  width: 100%;
  max-width: var(--max-content);
}

.section__title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  text-align: center;
  margin-bottom: 8px;
}

.section__hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 28px;
}

/* ============ Reveal ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms ease-out,
    transform 700ms ease-out;
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ Containers com borda Rough.js ============ */

[data-rough] {
  position: relative;
  padding: 32px 24px;
  background: transparent;
}
.rough-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
[data-rough-fill="pink"] {
  background: var(--pink);
}
[data-rough-fill="yellow"] {
  background: var(--yellow);
}
[data-rough-fill="blue"] {
  background: var(--blue);
}
[data-rough-fill="green"] {
  background: var(--green);
}

/* ============ HERO ============ */

.hero {
  text-align: center;
}

.hero__title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(56px, 14vw, 96px);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 320px;
}

.hero__doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--ink);
}
.doodle {
  position: absolute;
  width: 36px;
  height: 36px;
  opacity: 0.5;
}
.doodle--heart {
  top: 12%;
  left: 14%;
  color: #d97a8c;
  transform: rotate(-12deg);
}
.doodle--star {
  top: 22%;
  right: 12%;
  color: #c8a23c;
  transform: rotate(8deg);
  width: 42px;
  height: 42px;
}
.doodle--spark {
  bottom: 22%;
  left: 18%;
  color: #6c8ebf;
}
.doodle--balloon {
  bottom: 14%;
  right: 16%;
  color: #a98ec1;
  width: 40px;
  height: 40px;
}

@keyframes bounce-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

.hero__scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink-soft);
  animation: bounce-soft 2s ease-in-out infinite;
}

/* ============ MENSAGEM ============ */

.message__box {
  margin: 0 auto;
}
.message__title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 36px;
  text-align: center;
  margin-bottom: 12px;
}
.message__text {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.message__signature {
  font-family: var(--font-hand);
  font-size: 26px;
  text-align: right;
}

/* ============ CONTADOR (nosso tempinho) ============ */

.contador__card {
  margin: 0 auto;
  text-align: center;
  padding: 40px 24px;
}
.contador__label {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.contador__number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 10px;
}
.contador__value {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(64px, 20vw, 112px);
  line-height: 1;
  color: var(--ink);
}
.contador__unit {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(28px, 8vw, 44px);
  color: var(--ink);
}
.contador__range {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-soft);
}

/* ============ POLAROID base ============ */

.polaroid {
  background: #ffffff;
  padding: 12px 12px 36px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  position: relative;
}
.polaroid--rot-l {
  transform: rotate(-2.5deg);
}
.polaroid--rot-r {
  transform: rotate(2deg);
}
.polaroid::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 60px;
  height: 18px;
  background: var(--paper-tape);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.polaroid__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #efeae1;
}
.polaroid__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.polaroid__caption {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink);
}

/* ============ CARROSSEL ============ */

.carousel {
  padding-left: 0;
  padding-right: 0;
}
.carousel > .section__title,
.carousel > .section__hint {
  padding-left: 24px;
  padding-right: 24px;
}

.carousel__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 24px;
  max-width: 100% !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar {
  display: none;
}
.carousel__track .polaroid {
  flex: 0 0 220px;
  scroll-snap-align: center;
}

@media (min-width: 768px) {
  .carousel__track .polaroid {
    flex-basis: 260px;
  }
}

/* ============ MÚSICA ============ */

.music__intro {
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-size: 17px;
}
.spotify-frame {
  position: relative;
  padding: 24px;
  margin: 0 auto;
  max-width: 480px;
}
.spotify-frame iframe {
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
  display: block;
}
.music__quote {
  font-family: var(--font-hand);
  font-size: 22px;
  text-align: center;
  margin-top: 20px;
  color: var(--ink-soft);
}

/* ============ FLIP CARDS ============ */

.flip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 20px;
  padding: 16px 0;
}
@media (min-width: 768px) {
  .flip-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 32px;
  }
}

.flip-card {
  perspective: 1200px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flip-card:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

.flip-card__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  transition: transform 700ms cubic-bezier(0.4, 0.1, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card__inner {
  transform: rotateY(180deg);
}
.flip-card__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}
.flip-card__face--back {
  transform: rotateY(180deg);
  background: var(--yellow);
  padding: 24px 18px;
  align-items: center;
  justify-content: center;
}
.flip-card__face--back::before {
  display: none;
}
.flip-card__message {
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
}
.flip-card__face .polaroid__photo {
  flex: 1;
}

/* ============ FECHAMENTO ============ */

.ending {
  padding-bottom: 120px;
}
.ending__content {
  text-align: center;
  margin: 0 auto;
  max-width: 420px;
}
.ending__text {
  font-family: var(--font-hand);
  font-size: 36px;
  margin-bottom: 12px;
}
.ending__sign {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--ink-soft);
}

/* ============ A GENTE (cards de data) ============ */

.agente-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
}

.agente-card {
  position: relative;
  padding: 20px 22px;
}
.agente-card[data-rough-fill="pink"] {
  background: var(--pink);
}
.agente-card[data-rough-fill="blue"] {
  background: var(--blue);
}
.agente-card[data-rough-fill="yellow"] {
  background: var(--yellow);
}
/* leve alternância de inclinação, no espírito feito à mão */
.agente-card:nth-child(odd) {
  transform: rotate(-0.6deg);
}
.agente-card:nth-child(even) {
  transform: rotate(0.6deg);
}

.agente-card__date {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 6px;
}
.agente-card__text {
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
}

/* reveal escalonado por card (sobrepõe o .reveal base quando visível) */
.agente-card {
  opacity: 0;
  transition:
    opacity 600ms ease-out,
    transform 600ms ease-out;
}
.agente.visible .agente-card {
  opacity: 1;
}
.agente.visible .agente-card:nth-child(1) {
  transition-delay: 100ms;
}
.agente.visible .agente-card:nth-child(2) {
  transition-delay: 240ms;
}
.agente.visible .agente-card:nth-child(3) {
  transition-delay: 380ms;
}
.agente.visible .agente-card:nth-child(4) {
  transition-delay: 520ms;
}
.agente.visible .agente-card:nth-child(5) {
  transition-delay: 660ms;
}

@media (prefers-reduced-motion: reduce) {
  .agente-card {
    opacity: 1;
    transition: none;
  }
}

/* ============ RASPADINHA ============ */

.raspadinha__card {
  position: relative;
  margin: 0 auto;
  max-width: 460px;
}
.raspadinha__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #fffdf5;
}
.raspadinha__secret {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink);
}
.raspadinha__foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none; /* não deixa o gesto de raspar rolar a página */
  transition: opacity 500ms ease-out;
}
.raspadinha__foil.cleared {
  opacity: 0;
  pointer-events: none;
}
.raspadinha__hint {
  margin-top: 16px;
}

/* ============ RAZÕES ============ */

.razoes__jar {
  margin: 0 auto;
  max-width: 460px;
  text-align: center;
}
.razoes__stage {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.razoes__stage:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
  border-radius: 6px;
}
.razoes__slip {
  position: relative;
  width: 230px;
  background: #fffdf5;
  padding: 22px 20px 30px;
  border-radius: 2px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.1);
}
.razoes__slip-text {
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 1.35;
  color: var(--ink);
}
.razoes__slip.enter {
  animation: slip-in 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes slip-in {
  from {
    opacity: 0;
    transform: translateY(22px) rotate(-4deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-1.5deg) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .razoes__slip.enter {
    animation: none;
  }
}

.btn-hand {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 14px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.btn-hand::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: var(--ink);
  opacity: 0.5;
  border-radius: 2px;
}
.btn-hand:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn-hand:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ============ FAZ UM PEDIDO (bolo + velas) ============ */

.pedido__scene {
  margin: 0 auto;
  max-width: 460px;
  text-align: center;
}
.cake {
  position: relative;
  width: 260px;
  max-width: 80%;
  margin: 8px auto 0;
  /* sobe de leve quando a vela é apagada */
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.pedido__scene.blown .cake {
  transform: translateY(-18px);
}
@media (prefers-reduced-motion: reduce) {
  .cake {
    transition: none;
  }
  .pedido__scene.blown .cake {
    transform: none;
  }
}

/* topo do bolo com a velinha no centro da cobertura */
.cake__topper {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  margin-bottom: -4px; /* a base da vela encosta na cobertura branca */
}

/* velinha listrada com a chama em cima (igual ao visual das 22 velas) */
.candle {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.candle:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
  border-radius: 8px;
}
.candle::after {
  /* corpo da vela */
  content: "";
  width: 10px;
  height: 34px;
  background: repeating-linear-gradient(45deg, #f6c1cf 0 5px, #fff 5px 10px);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

/* chama no topo, no fluxo (sempre centrada sobre a vela) */
.flame {
  width: 13px;
  height: 19px;
  margin-bottom: 2px; /* encosta no topo da vela */
  background: radial-gradient(
    circle at 50% 70%,
    #fff6c2 0%,
    #ffcf5c 45%,
    #ff9a3c 80%
  );
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 14px 3px rgba(255, 180, 80, 0.65);
  transform-origin: 50% 100%;
  animation: flame-flicker 1.1s ease-in-out infinite;
}
@keyframes flame-flicker {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.08, 0.92) rotate(2deg);
    opacity: 0.92;
  }
}
.candle.out .flame {
  display: none;
}

/* fumacinha ao apagar */
.smoke {
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(120, 120, 120, 0.45);
  transform: translateX(-50%);
  pointer-events: none;
  animation: smoke-up 900ms ease-out forwards;
}
@keyframes smoke-up {
  0% {
    opacity: 0.5;
    transform: translate(-50%, 0) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -26px) scale(1.6);
  }
}

.cake__body {
  position: relative;
  margin-top: 2px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}
.cake__frosting {
  /* cobertura branca com pingos */
  height: 30px;
  background: #ffffff;
  border-radius: 16px 16px 6px 6px / 22px 22px 6px 6px;
  position: relative;
  z-index: 2;
  border: 2px solid var(--ink);
  border-bottom: 0;
}
.cake__frosting::after {
  /* pingos de cobertura descendo na massa */
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -9px;
  height: 12px;
  background:
    radial-gradient(circle at 12% 0, #fff 0 7px, transparent 8px),
    radial-gradient(circle at 32% 0, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 52% 0, #fff 0 7px, transparent 8px),
    radial-gradient(circle at 72% 0, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 90% 0, #fff 0 7px, transparent 8px);
  z-index: 3;
}
.cake__tier {
  /* massa do bolo com o número */
  height: 80px;
  background: #f6d9a8;
  border-radius: 6px 6px 12px 12px;
  margin-top: -2px; /* encaixa logo abaixo da cobertura, sem vão */
  position: relative;
  z-index: 1;
  border: 2px solid var(--ink);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 26px,
    rgba(255, 255, 255, 0.4) 26px 28px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.cake__number {
  /* "22" escrito na massa */
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 50px;
  line-height: 1;
  color: #d97a8c;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
  padding-top: 6px; /* compensa a sobreposição dos pingos no topo */
}
.cake__plate {
  /* prato */
  height: 14px;
  width: 118%;
  margin: -3px -9% 0;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  position: relative;
  z-index: 0;
}

.pedido__wish {
  display: none;
  font-family: var(--font-hand);
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 26px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 700ms ease-out,
    transform 700ms ease-out;
}
.pedido__wish.show {
  opacity: 1;
  transform: translateY(0);

  display: block;
}

/* ============ O FUTURO (nossos planos) ============ */

.futuro__box {
  margin: 0 auto;
  text-align: center;
}
.futuro__intro {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.futuro__plans {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  max-width: 420px;
  margin: 0 auto 22px;
}
.futuro__plan {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  column-gap: 12px;
}
.futuro__icon {
  width: 30px;
  height: 30px;
  color: #6c8ebf;
}
.futuro__plan:nth-child(2n) .futuro__icon {
  color: #d97a8c;
}
.futuro__plan-text {
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  position: relative;
  padding-bottom: 6px;
}
.futuro__plan-text svg.underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 8px;
  width: 100%;
  overflow: visible;
  color: #c8a23c;
}
.futuro__stamp {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 27px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.futuro__stamp svg {
  width: 30px;
  height: 30px;
  color: #c8a23c;
  animation: stamp-in 700ms cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes stamp-in {
  from {
    transform: rotate(-40deg) scale(0.4);
    opacity: 0;
  }
  to {
    transform: rotate(-12deg) scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .futuro__stamp svg {
    animation: none;
    transform: rotate(-12deg);
  }
}

/* ============ O BRINDE (confete sobre o fechamento) ============ */

.ending {
  /* garante stacking pro confete */
  overflow: hidden;
}
.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ending__content,
.brinde__again {
  position: relative;
  z-index: 1;
}
.confetti {
  position: absolute;
  top: -24px;
  width: 16px;
  height: 16px;
  opacity: 0;
  will-change: transform, opacity;
}
.confetti svg {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(-10px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(var(--fall, 70vh)) rotate(var(--spin, 360deg));
  }
}
.brinde__again {
  margin-top: 20px;
  text-align: center;
}
