/* ---- Reset ---- */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;

  /* Paper texture illusion */
  background:
    repeating-linear-gradient(
      135deg,
      rgba(214,180,90,0.06),
      rgba(214,180,90,0.06) 10px,
      rgba(255,255,255,0) 10px,
      rgba(255,255,255,0) 20px
    ),
    radial-gradient(circle at top, #f7e7b4, #e8c97a);

  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b2e0f;
}

/* ---- Card ---- */
.card {
  width: min(92%, 420px);
  background:
  /* edge wear */
  radial-gradient(
    ellipse at center,
    rgba(255,255,255,0.9) 55%,
    rgba(210,170,80,0.35) 100%
  ),

  /* blotchy aging */
  radial-gradient(
    circle at 20% 30%,
    rgba(255,255,255,0.12),
    transparent 60%
  ),
  radial-gradient(
    circle at 80% 70%,
    rgba(255,255,255,0.10),
    transparent 65%
  ),

  /* rough fibers (less regular) */
  repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.025),
    rgba(255,255,255,0.025) 2px,
    rgba(0,0,0,0.02) 5px
  ),

  /* base paper */
  linear-gradient(
    #f2dc9c,
    #e3c776
  );

  padding: 2.2rem 1.8rem 2.6rem;
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.25);
  text-align: center;
  transition: all 0.8s ease;
  overflow: hidden;
}

.card.open {
  width: min(96%, 520px);
  padding-bottom: 3.5rem;
}

/* ---- Typography ---- */
h1 {
  margin: 0;
  font-size: 2rem;
}

.subtitle {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 1.4rem;
}

.divider {
  width: 48px;
  height: 4px;
  background: #e0b75a;
  border-radius: 2px;
  margin: 0.8rem auto 1.6rem;
}

/* ---- Countdown ---- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.countdown div {
  border: 1px solid #e4c36f;
  border-radius: 10px;
  padding: 0.7rem 0.3rem;
  background: #fffdf7;
}

.countdown span {
  font-size: 1.3rem;
  font-weight: bold;
}

.countdown small {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.3rem;
}

/* ---- Date ---- */
.date {
  font-size: 0.85rem;
  margin-bottom: 1.6rem;
}

/* ---- Seal ---- */
#seal {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  background:
  radial-gradient(circle at 30% 30%, #c94a4a, #7d1515 70%),
  radial-gradient(circle at 70% 65%, rgba(255,255,255,0.12), transparent 60%);
  color: #f5d0d0;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow:
  inset 0 0 0 6px #8f1f1f,
  inset -6px -6px 12px rgba(0,0,0,0.25),
  0 8px 14px rgba(0,0,0,0.25);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

#seal {
  animation: wax-breathe 4s ease-in-out infinite;
}

@keyframes wax-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}


#seal.ready {
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

#seal.opened {
  transform: scale(0.6);
  opacity: 0;
}

/* ---- Letter ---- */
#letter {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease;
  margin-top: 1.5rem;
}

.card.open #letter {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.handwritten {
  font-family:
    "Bradley Hand",
    "Segoe Script",
    "Comic Sans MS",
    cursive;
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: left;
  margin-bottom: 1rem;
}

.signature {
  text-align: right;
  margin-top: 2rem;
}

/* ---- Card patterns ---- */
.card {
  position: relative;
}

/* Shared pattern base */
.card-pattern {
  position: absolute;
  pointer-events: none;
  color: #6b2e0f;
  opacity: 0.14;
  filter: grayscale(100%);
  font-size: 1.8rem;
  line-height: 1;
}

/* ---- Card ornaments (refined, non-cluttered) ---- */
.card {
  position: relative;
}

.card {
  margin: 0;
}

.card.open {
  margin: 4vh 0;
}


/* Shared ornament style */
.ornament {
  position: absolute;
  pointer-events: none;
  color: #6b2e0f;
  opacity: 0.5;
  filter: grayscale(10%);
}

/* 🐝 Primary bee */
.ornament.bee {
  top: 14px;
  left: 18px;
  font-size: 2.4rem;
  transform: rotate(-14deg);
}

/* 🐝 Secondary bee (echo) */
.ornament.bee.secondary {
  bottom: 22px;
  left: 26px;
  font-size: 1.6rem;
  opacity: 0.08;
  transform: rotate(8deg);
}

/* 💃 Dance as rhythm line */
.ornament.dance-line {
  right: 18px;
  top: 80px;
  width: 26px;
  height: 180px;
  border-right: 2px solid rgba(107, 46, 15, 0.15);
  border-radius: 40px;
  transform: rotate(3deg);
}

/* Soften ornaments after opening */
.card.open .ornament {
  opacity: 0.3;
}

.card.open::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(
      circle at 30% 40%,
      rgba(255,255,255,0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at 70% 65%,
      rgba(255,255,255,0.12),
      transparent 60%
    );

  animation: paper-alive 18s ease-in-out infinite;
}


@keyframes paper-alive {
  0% {
    background-position: 30% 40%, 70% 65%;
    opacity: 0.35;
  }
  50% {
    background-position: 36% 44%, 64% 60%;
    opacity: 0.55;
  }
  100% {
    background-position: 30% 40%, 70% 65%;
    opacity: 0.35;
  }
}