:root {
  --bg: #101217;
  --panel: rgba(18, 20, 27, .74);
  --panel-strong: rgba(22, 24, 31, .93);
  --line: rgba(255,255,255,.13);
  --text: #fffaf2;
  --muted: rgba(255,250,242,.62);
  --gold: #f2ad00;
  --gold-soft: #ffd66b;
  --orange: #f27732;
  --shadow: 0 28px 80px rgba(0,0,0,.48);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Noto Sans SC", sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }

.page-bg { position: fixed; inset: 0; overflow: hidden; z-index: -10; background: #0e1014; }
.bg-photo {
  position: absolute;
  inset: -8%;
  background-image: linear-gradient(rgba(8,9,12,.56), rgba(8,9,12,.82)), url("assets/heiji-card.png");
  background-size: cover;
  background-position: center 36%;
  filter: blur(22px) saturate(.9);
  transform: scale(1.12);
  animation: bgFloat 18s ease-in-out infinite alternate;
}
.bg-noise {
  position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.bg-grid {
  position: absolute; inset: 0; opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 75%, transparent 100%);
}
.bg-orb { position: absolute; border-radius: 999px; filter: blur(18px); opacity: .42; }
.orb-a { width: 42vw; height: 42vw; min-width: 330px; min-height: 330px; right: -15vw; top: -18vw; background: rgba(242,173,0,.55); animation: orbA 12s ease-in-out infinite alternate; }
.orb-b { width: 34vw; height: 34vw; min-width: 280px; min-height: 280px; left: -13vw; bottom: -14vw; background: rgba(242,94,50,.36); animation: orbB 15s ease-in-out infinite alternate; }

.shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 0;
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(330px, 1.18fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
}

.profile-panel { display: grid; gap: 26px; align-content: center; }
.profile-card-wrap {
  position: relative;
  width: min(390px, 100%);
  justify-self: center;
  border-radius: 26px;
  padding: 8px;
  transform-style: preserve-3d;
  will-change: transform;
  opacity: 0;
  transform: translateY(24px) scale(.97) rotateX(4deg);
  animation: cardEnter .9s cubic-bezier(.2,.8,.2,1) .08s forwards;
}
.profile-card {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow);
  user-select: none;
}
.card-glow {
  position: absolute;
  z-index: 0;
  inset: 8% 5% -5%;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(242,173,0,.9), rgba(242,94,50,.35));
  filter: blur(38px);
  opacity: .52;
  animation: breathe 4s ease-in-out infinite;
}
.shine {
  position: absolute;
  z-index: 3;
  inset: 8px;
  border-radius: 20px;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.22) 42%, transparent 58%);
  background-size: 240% 100%;
  background-position: 160% 0;
  mix-blend-mode: screen;
  opacity: .48;
  animation: cardShine 4.8s ease-in-out 1.2s infinite;
}

.identity { padding: 0 6px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(14,16,21,.48);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,.75);
  font-weight: 750;
  font-size: 11px;
  letter-spacing: .14em;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(242,173,0,.13), 0 0 20px rgba(242,173,0,.7); }
.identity h1 { margin: 15px 0 4px; font-size: clamp(36px, 5vw, 56px); line-height: .98; letter-spacing: -.04em; }
.identity h1 span { color: var(--gold-soft); }
.identity p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; font-size: 14px; }

.links-panel {
  position: relative;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(20,22,29,.78), rgba(13,15,20,.74));
  box-shadow: 0 26px 90px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(24px) saturate(125%);
}
.links-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,214,107,.48), transparent 34%, transparent 70%, rgba(242,94,50,.27));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.social-card {
  --accent: #f2ad00;
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 36px;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  margin: 0 0 12px;
  padding: 11px 12px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.095);
  border-radius: 20px;
  background: linear-gradient(100deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, background .3s, box-shadow .3s;
  isolation: isolate;
}
.social-card::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(circle at 16% 50%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 44%);
  transition: opacity .35s ease;
}
.social-card::after {
  content: "";
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--accent);
  transform: scaleY(.25);
  opacity: .15;
  transition: transform .3s ease, opacity .3s ease;
}
.social-card:hover, .social-card:focus-visible {
  transform: translateY(-4px) translateX(3px);
  border-color: color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,.12));
  background: linear-gradient(100deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  box-shadow: 0 14px 38px rgba(0,0,0,.24);
  outline: none;
}
.social-card:hover::before, .social-card:focus-visible::before { opacity: 1; }
.social-card:hover::after, .social-card:focus-visible::after { transform: scaleY(1); opacity: .9; }
.social-card:hover .arrow, .social-card:focus-visible .arrow { transform: rotate(0deg) scale(1.08); color: #fff; }
.social-card:hover .social-icon, .social-card:focus-visible .social-icon { transform: scale(1.05) rotate(-3deg); }

.social-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--accent);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.social-icon svg { width: 27px; height: 27px; fill: currentColor; }
.social-icon-text { font-weight: 900; font-size: 24px; }
.qq-text { font-size: 16px; letter-spacing: -.05em; }
.social-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.social-copy strong { font-size: 17px; letter-spacing: -.015em; }
.social-copy small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow { font-size: 21px; color: rgba(255,255,255,.38); transform: rotate(-10deg); transition: transform .3s ease, color .3s ease; }

.bilibili { --accent: #fb7299; }
.facebook { --accent: #58a6ff; }
.x { --accent: #f1f1f1; }
.tiktok { --accent: #54f4f3; }
.qq { --accent: #ffc84b; }

.footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 0;
  color: rgba(255,255,255,.42);
  font-size: 11px;
  letter-spacing: .04em;
}
.footer-dot { color: var(--gold); }

.intro-item { opacity: 0; transform: translateY(18px); }
.intro-item.is-visible { animation: itemEnter .65s cubic-bezier(.2,.8,.2,1) forwards; }

.toast {
  position: fixed;
  left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 36px);
  padding: 11px 15px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(12,14,18,.88);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
  color: rgba(255,255,255,.84);
  font-size: 12px;
  transform: translate(-50%, 18px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: .26s ease;
}
.toast.show { transform: translate(-50%,0) scale(1); opacity: 1; }

@keyframes cardEnter { to { opacity: 1; transform: translateY(0) scale(1) rotateX(0); } }
@keyframes itemEnter { to { opacity: 1; transform: translateY(0); } }
@keyframes cardShine { 0%, 55% { background-position: 160% 0; } 85%, 100% { background-position: -80% 0; } }
@keyframes breathe { 0%,100% { opacity: .38; transform: scale(.96); } 50% { opacity: .62; transform: scale(1.03); } }
@keyframes bgFloat { from { transform: scale(1.12) translate3d(-1%, -1%, 0); } to { transform: scale(1.17) translate3d(2%, 1%, 0); } }
@keyframes orbA { to { transform: translate(-8vw, 7vw) scale(1.12); } }
@keyframes orbB { to { transform: translate(10vw, -6vw) scale(.9); } }

@media (max-width: 820px) {
  .shell {
    width: min(560px, calc(100% - 24px));
    grid-template-columns: 1fr;
    align-items: start;
    padding: 28px 0 42px;
    gap: 24px;
  }
  .profile-panel { gap: 20px; }
  .profile-card-wrap { width: min(325px, 82vw); }
  .identity { text-align: center; }
  .eyebrow { margin-inline: auto; }
  .identity h1 { font-size: clamp(38px, 12vw, 52px); }
  .links-panel { border-radius: 24px; padding: 15px; }
  .social-card { min-height: 72px; border-radius: 18px; grid-template-columns: 48px 1fr 30px; }
  .social-icon { width: 48px; height: 48px; border-radius: 14px; }
  .footer { flex-wrap: wrap; }
}

@media (max-width: 430px) {
  .shell { width: calc(100% - 18px); padding-top: 18px; }
  .profile-card-wrap { width: min(300px, 84vw); }
  .links-panel { padding: 10px; border-radius: 22px; }
  .social-card { margin-bottom: 9px; padding: 9px 10px; gap: 11px; }
  .social-copy strong { font-size: 16px; }
  .identity p { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
  .intro-item, .profile-card-wrap { opacity: 1; transform: none; }
}
