:root {
  --pink: #F2A8C0;
  --pink-soft: #fbe4ec;
  --pink-deep: #d9799c;
  --ink: #17171b;
  --ink-soft: #4a4a54;
  --paper: #ffffff;
  --mist: #eaeef6;
  --radius: 28px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  color: var(--ink);
  font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
  background:
    radial-gradient(700px 520px at 10% 4%, #ffe4ef 0%, transparent 60%),
    radial-gradient(680px 540px at 92% 10%, #f3e6ff 0%, transparent 62%),
    radial-gradient(900px 700px at 50% 108%, #e2ebff 0%, transparent 66%),
    repeating-linear-gradient(90deg, rgba(226, 214, 232, .30) 0 2px, transparent 2px 30px),
    linear-gradient(180deg, #fdfbfe 0%, #f0f2fa 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- hoa rơi ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.petal {
  position: absolute;
  top: -8vh;
  width: var(--s, 12px);
  height: var(--s, 12px);
  border-radius: 50% 0 50% 50%;
  background: linear-gradient(140deg, #ffe4ee, var(--pink));
  box-shadow: 0 0 8px rgba(242, 168, 192, .45);
  animation: fall var(--d, 18s) linear var(--delay, 0s) infinite;
}

@keyframes fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  50%  { transform: translate3d(var(--drift, 60px), 50vh, 0) rotate(calc(var(--rot, 240deg) / 2)); }
  100% { transform: translate3d(0, 110vh, 0) rotate(var(--rot, 240deg)); }
}

/* ---------- khung ---------- */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  place-items: center;
}

.card {
  position: relative;
  width: min(92vw, 420px);
  padding: 42px 34px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(242, 168, 192, .40);
  border-bottom: 0;
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  box-shadow:
    0 30px 70px -28px rgba(122, 62, 90, .40),
    0 0 0 1px rgba(255, 255, 255, .7) inset;
  animation: cardIn .9s cubic-bezier(.2, .8, .25, 1) both;
}

.card__inner {
  padding-bottom: 26px;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- scallop ---------- */
.card__scallop {
  height: 13px;
  background:
    radial-gradient(circle at 50% 100%, var(--pink) 12px, transparent 12.5px) 0 0 / 24px 13px repeat-x;
  filter: drop-shadow(0 5px 7px rgba(122, 62, 90, .22));
  pointer-events: none;
}

/* ---------- avatar ---------- */
.avatar {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 20px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.avatar__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--mist);
  border: 4px solid #fff;
  box-shadow:
    0 0 0 3px var(--pink),
    0 14px 30px -12px rgba(217, 121, 156, .85);
}

.avatar__ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(242, 168, 192, .55);
  animation: spin 26s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.avatar__flower {
  position: absolute;
  right: -2px;
  bottom: 4px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(160deg, #ffd3e2, var(--pink-deep));
  box-shadow: 0 8px 18px -8px rgba(217, 121, 156, .9);
}

/* ---------- animation name ---------- */
.name {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.3rem, 9vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: .01em;
  color: var(--pink);
  text-shadow: 0 0 26px rgba(242, 168, 192, .60);
  min-height: 1.2em;
}

.char {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(14px) rotateX(-55deg);
  transition:
    opacity .45s ease,
    filter .45s ease,
    transform .45s cubic-bezier(.2, .8, .25, 1);
}

.char.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.caret {
  display: inline-block;
  width: 2px;
  height: .92em;
  margin-left: 4px;
  vertical-align: -.08em;
  background: var(--pink);
  animation: blink .85s steps(1) infinite;
  transition: opacity .5s ease;
}

.caret.is-gone { opacity: 0; }

@keyframes blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ---------- animation intro ---------- */
.tagline, .intro, .handle, .divider, .discord, .note {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .25, 1);
}

.is-revealed .tagline   { opacity: 1; transform: none; transition-delay: .10s; }
.is-revealed .intro     { opacity: 1; transform: none; transition-delay: .20s; }
.is-revealed .handle    { opacity: 1; transform: none; transition-delay: .30s; }
.is-revealed .divider   { opacity: 1; transform: none; transition-delay: .38s; }
.is-revealed .discord   { opacity: 1; transform: none; transition-delay: .48s; }
.is-revealed .note      { opacity: 1; transform: none; transition-delay: .62s; }

.tagline {
  margin: 6px 0 0;
  font-family: 'Shippori Mincho', 'Cormorant Garamond', serif;
  font-size: 1.02rem;
  letter-spacing: .34em;
  color: rgba(23, 23, 27, .52);
  text-indent: .34em;
}

.intro {
  margin: 16px auto 0;
  max-width: 30ch;
  font-size: .92rem;
  line-height: 1.85;
  letter-spacing: .015em;
  color: rgba(23, 23, 27, .62);
}

.intro strong {
  font-weight: 500;
  color: var(--pink-deep);
}

.handle {
  margin: 14px 0 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-soft);
}

.handle:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 6px;
  border-radius: 6px;
}

.handle__text {
  font-family: 'Jost', monospace;
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--pink-deep);
  border-bottom: 1px dashed rgba(217, 121, 156, .55);
  transition: color .25s ease;
}

.handle:hover .handle__text { color: var(--pink); }

.handle__tip {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(23, 23, 27, .34);
  opacity: 0;
  transition: opacity .25s ease;
}

.handle:hover .handle__tip,
.handle.is-copied .handle__tip { opacity: 1; }

.handle.is-copied .handle__text { color: #4caf7d; border-bottom-color: #4caf7d; }

.divider {
  margin: 22px auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--pink);
  font-size: .9rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  width: min(90px, 22vw);
  background: linear-gradient(90deg, transparent, rgba(242, 168, 192, .75));
}

.divider::after { background: linear-gradient(90deg, rgba(242, 168, 192, .75), transparent); }

/* ---------- Discord ---------- */
.discord {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-size: .98rem;
  letter-spacing: .1em;
  background: linear-gradient(180deg, #24242b 0%, #0f0f12 100%);
  border: 1px solid rgba(242, 168, 192, .40);
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .70);
  transition:
    transform .28s cubic-bezier(.2, .8, .25, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background .28s ease;
}

.discord:hover,
.discord:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow:
    0 18px 34px -14px rgba(217, 121, 156, .85),
    0 0 0 4px rgba(242, 168, 192, .18);
  outline: none;
}

.discord:active { transform: translateY(-1px); }

.discord__icon { width: 22px; height: 22px; color: var(--pink); }

.discord__arrow {
  font-size: 1rem;
  color: var(--pink);
  transition: transform .28s ease;
}

.discord:hover .discord__arrow { transform: translateX(4px); }

.note {
  margin: 18px 0 0;
  font-size: .76rem;
  letter-spacing: .07em;
  color: rgba(23, 23, 27, .38);
}

/* ---------- responsive ---------- */
@media (max-width: 420px) {
  .card { padding: 34px 22px 0; }
  .avatar { width: 132px; height: 132px; }
}

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