/* ===========================================================
   NOMNAM — link in bio
   =========================================================== */

:root {
  --bg:        #0c0a10;
  --card:      rgba(22, 19, 28, 0.72);
  --card-line: rgba(255, 255, 255, 0.08);
  --text:      #f3efe9;
  --muted:     #a59db2;
  --faint:     #6f677c;
  --accent:    #c9a24b;       /* soft gold, nod to the original */
  --yt:        #ff3d3d;
  --tt:        #25f4ee;
  --dc:        #5865f2;
  --dn:        #4d9fff;       /* EasyDonate azure */
  --radius:    22px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", "Noto Sans Thai", system-ui, sans-serif;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Ambient background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.bg-image {
  position: absolute;
  inset: -8%;
  background: url("assets/banner.gif") center/cover no-repeat;
  filter: blur(60px) saturate(1.25) brightness(0.55);
  transform: scale(1.15);
  animation: drift 26s var(--ease) infinite alternate;
}

.bg-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(201,162,75,0.18), transparent 55%),
    linear-gradient(180deg, rgba(12,10,16,0.55), rgba(12,10,16,0.92));
}

.bg-grain {
  position: absolute; inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: scale(1.15) translate(0, 0); }
  to   { transform: scale(1.22) translate(-2%, -2%); }
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  animation: rise 0.9s var(--ease) 0.05s forwards;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.banner-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.banner-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,19,28,0) 35%, var(--card) 100%);
}

.kanji {
  position: absolute;
  top: 10px; left: 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  writing-mode: vertical-rl;
}

.serial {
  position: absolute;
  top: 12px; right: 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* ---------- Avatar ---------- */
.avatar-wrap {
  position: relative;
  width: fit-content;
  margin: -54px auto 0;
}

.avatar-ring {
  width: 104px; height: 104px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(140deg, var(--accent), #f0d79a, var(--accent));
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7);
}

.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--card);
  background: var(--bg);
}

.status-dot {
  position: absolute;
  right: 6px; bottom: 8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #46d369;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(70, 211, 105, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(70, 211, 105, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(70, 211, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 211, 105, 0); }
}

/* ---------- Identity ---------- */
.identity {
  text-align: center;
  padding: 14px 26px 4px;
}

.name {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fff, #d8cfe0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.handle {
  margin-top: 2px;
  color: var(--accent);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}

.bio {
  margin-top: 12px;
  color: var(--muted);
  font-family: "Noto Sans Thai", "Outfit", sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 300;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 4px 11px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-family: "Noto Sans Thai", "Outfit", sans-serif;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 6px;
}

.link {
  --c: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-line);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  opacity: 0;
  transform: translateY(12px);
  animation: linkIn 0.7s var(--ease) forwards;
}

.link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: rgba(255, 255, 255, 0.06);
}

.link:hover::before { opacity: 1; }
.link:active { transform: translateY(0) scale(0.99); }

.link > * { position: relative; z-index: 1; }

.link:nth-child(1) { animation-delay: 0.35s; }
.link:nth-child(2) { animation-delay: 0.45s; }
.link:nth-child(3) { animation-delay: 0.55s; }
.link:nth-child(4) { animation-delay: 0.65s; }

@keyframes linkIn {
  to { opacity: 1; transform: none; }
}

.link-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  transition: transform 0.35s var(--ease);
}

.link:hover .link-icon { transform: scale(1.08) rotate(-3deg); }
.link-icon svg { width: 22px; height: 22px; }

/* ไอคอนที่เป็นรูปจริง (เช่นโลโก้ EasyDonate) ให้เต็มไทล์ */
.link-icon--img { background: transparent; overflow: hidden; }
.link-icon--img img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.link-text { display: flex; flex-direction: column; flex: 1 1 auto; }
.link-title { font-weight: 600; font-size: 1rem; letter-spacing: 0.02em; }
.link-sub {
  font-size: 0.78rem;
  color: var(--faint);
  font-family: "Noto Sans Thai", "Outfit", sans-serif;
  font-weight: 300;
}

.link-arrow {
  color: var(--faint);
  font-size: 1.1rem;
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}
.link:hover .link-arrow { color: var(--c); transform: translate(2px, -2px); }

.link-youtube  { --c: var(--yt); }
.link-tiktok   { --c: var(--tt); }
.link-discord  { --c: var(--dc); }
.link-donate   { --c: var(--dn); }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 26px 24px;
}

.foot-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-line), transparent);
}

.foot-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--faint);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 460px) {
  .name { font-size: 1.6rem; }
  .banner { height: 128px; }
  .avatar-ring { width: 94px; height: 94px; }
  .avatar-wrap { margin-top: -48px; }
}

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