/* ========== CONTAINER (CENTER ON MAIL) ========== */
.toTag{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%); /* slightly higher than exact center */
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 50;
}

/* ========== SEAL ========== */
.toTag__seal{
  position: absolute;
  width: 130px;
  left: -40px; /* overlap strip */
  top: -35px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.22));
  transform: translateX(-42px) scale(.98);
  opacity: 0;
  z-index: 10;
}

/* ========== STRIP (Your Name_tag.webp) ========== */
.toTag__strip{
  position: relative;
  width: 320px;
  transform-origin: left center;
  transform: scaleX(0.1);
  opacity: 0;
}

.toTag__strip::before{
  content: "";
  position: absolute;
  inset: 0;
  background: url("../IMG/Name_tag.webp") no-repeat center / contain;
}

/* ========== NAME TEXT ========== */
.title_head{
  font-family: "Khmer OS Moul","Khmer OS Muol Light","Times New Roman","Khmer OS Siemreap",cursive;
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  margin-top: 5px;
  margin-left: 10px;
  font-size: 18px;
  letter-spacing: .02em;
  color: rgba(0,0,0,.65);
  opacity: 0;
  transform: translateY(6px);
}

/* ========== ANIMATIONS ========== */
.toTag--play .toTag__seal{
  animation: sealIn 1.2s cubic-bezier(.22,1,.36,1) 0.6s forwards;
}

.toTag--play .toTag__strip{
  animation: stripReveal 2.2s cubic-bezier(.22,1,.36,1) 0.7s forwards;
}

.toTag--play .title_head{
  animation: nameIn 1.2s cubic-bezier(.22,1,.36,1) 0.7s forwards;
}

.toTag{
  position:absolute;
  left: 50%;      /* adjust */
  top: 80%;      /* adjust */
  height: 46px;
  display:flex;
  align-items:center;
  gap: 0;
  pointer-events:none;
}

/* Wax seal */
.toTag__seal{
  width: 130px;
  top: -78%;
  left: -18%;
  object-fit: contain;
  margin-right: -14px; /* overlap strip like your video */
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.22));
  transform: translateX(-42px) scale(.98);
  opacity: 0;
}

/* Paper strip */
.toTag__strip{
  height: 42px;
  width: 240px;                 /* final width */
  border-radius: 4px;
  position: relative;
  transform-origin: left center;
  transform: scaleX(0.18);
  opacity: 0;

  /* “paper” look */
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,242,235,.92));
  box-shadow:
    0 10px 18px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.55);
  overflow: hidden;
}

/* subtle paper texture */
.toTag__strip::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.18;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,.07) 0px,
      rgba(0,0,0,.07) 1px,
      rgba(255,255,255,0) 2px,
      rgba(255,255,255,0) 6px
    );
  mix-blend-mode: multiply;
  pointer-events:none;
}

.toTag__name{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 18px;
  letter-spacing:.02em;
  color: rgba(0,0,0,.58);

  opacity:0;
  transform: translateY(3px);
}

/* ===== PLAY ONCE (1.2s total feel) ===== */
.toTag--play .toTag__seal{
  animation: sealIn 1.8s cubic-bezier(.22,1,.36,1) 80ms forwards;
}

.toTag--play .toTag__strip{
  animation: stripReveal 2.2s cubic-bezier(.22,1,.36,1) 160ms forwards;
}

.toTag--play .toTag__name{
  animation: nameIn 2.3s cubic-bezier(.22,1,.36,1) 620ms forwards;
}

@keyframes sealIn{
  0%   { opacity:0; transform: translateX(-42px) scale(.98); filter: blur(1px) drop-shadow(0 10px 12px rgba(0,0,0,.22)); }
  70%  { opacity:1; transform: translateX(6px) scale(1.01); filter: blur(0px) drop-shadow(0 10px 12px rgba(0,0,0,.22)); }
  100% { opacity:1; transform: translateX(0px) scale(1); }
}

@keyframes stripReveal{
  0%   { opacity:0; transform: scaleX(0.18); }
  70%  { opacity:1; transform: scaleX(1.04); }
  100% { opacity:1; transform: scaleX(1); }
}

@keyframes nameIn{
  0%   { opacity:0; transform: translateY(3px); }
  100% { opacity:1; transform: translateY(0px); }
}

/* accessibility */
@media (prefers-reduced-motion: reduce){
  .toTag__seal, .toTag__strip, .toTag__name{ animation:none !important; opacity:1 !important; transform:none !important; }
}