* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: #050505;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: #7eeaff;
  color: #050505;
}

.scene {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: max(76px, calc(48px + env(safe-area-inset-top)))
    clamp(22px, 6vw, 90px) max(74px, calc(44px + env(safe-area-inset-bottom)));
  background:
    radial-gradient(
      circle 310px at 48% 46%,
      rgb(103 226 255 / 9%),
      transparent 72%
    ),
    #050505;
  color: #f6f6f3;
}

.grid {
  position: absolute;
  inset: 0;
  z-index: -5;
  opacity: 0.13;
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 70px 70px;
  -webkit-mask-image: radial-gradient(
    circle at 46% 48%,
    #000 5%,
    transparent 72%
  );
  mask-image: radial-gradient(circle at 46% 48%, #000 5%, transparent 72%);
}

.corner {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: clamp(330px, 42vw, 680px);
  height: clamp(270px, 47vw, 720px);
  overflow: hidden;
  background: #f6f6f3;
  color: #050505;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.corner-lines {
  position: absolute;
  right: -7%;
  bottom: -7%;
  width: 80%;
  height: 80%;
  opacity: 0.92;
  transform: rotate(-8deg);
  background: repeating-linear-gradient(
    135deg,
    transparent 0 19px,
    #050505 19px 26px,
    transparent 26px 43px
  );
  clip-path: polygon(29% 0, 100% 0, 100% 100%, 0 100%);
}

.card {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(100%, 900px);
  grid-template-columns: minmax(190px, 245px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(48px, 7vw, 92px);
  transform: none;
}

.avatar-block {
  display: grid;
  justify-items: center;
  gap: 25px;
}

.avatar-shell {
  position: relative;
  display: grid;
  width: clamp(196px, 20vw, 246px);
  aspect-ratio: 1;
  place-items: center;
}

.orbit {
  position: absolute;
  inset: -12px;
  border: 1px solid rgb(255 255 255 / 27%);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.orbit::before {
  inset: 7px;
  border: 1px dashed rgb(126 234 255 / 54%);
}

.orbit::after {
  inset: -7px;
  border: 2px solid transparent;
  border-top-color: #7eeaff;
  border-left-color: rgb(126 234 255 / 45%);
}

.avatar {
  width: 100%;
  height: 100%;
  border: 5px solid #151518;
  border-radius: 50%;
  object-fit: cover;
  user-select: none;
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 72%),
    0 28px 70px rgb(0 0 0 / 76%);
}

.orbit-dot {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7eeaff;
  box-shadow: 0 0 16px #7eeaff;
}

.dot-one {
  top: 11%;
  right: 2%;
}

.dot-two {
  bottom: 7%;
  left: 9%;
  width: 5px;
  height: 5px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a6a6aa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65ff9e;
  box-shadow: 0 0 14px rgb(101 255 158 / 78%);
}

.content {
  min-width: 0;
}

.greeting {
  margin: 0 0 8px;
  color: #a8a8ad;
  font-size: clamp(18px, 1.8vw, 23px);
  font-weight: 600;
}

.name {
  max-width: 660px;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #f5f5f5;
  text-transform: uppercase;
}

.name span {
  display: block;
  white-space: nowrap;
  word-spacing: -0.08em;
}

.name span:last-child {
  margin-top: 7px;
  color: #f5f5f5;

  /* Bỏ kiểu chữ viền rỗng */
  -webkit-text-stroke: 0;
}

.role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  color: #d7d7d8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-line span {
  color: #7eeaff;
}

.tagline {
  max-width: 600px;
  margin-top: 17px;
  color: #acacb1;
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 500;
  line-height: 1.68;
}

.detail {
  margin-top: 12px;
  color: rgb(126 234 255 / 78%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 29px;
}

.social-link {
  position: relative;
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #28282c;
  border-radius: 50%;
  background: #0d0d0f;
  color: #a7a7ac;
}

.social-link svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-link:focus-visible {
  outline: 2px solid #7eeaff;
  outline-offset: 3px;
}

.footer-note {
  position: absolute;
  right: clamp(22px, 5vw, 70px);
  bottom: max(24px, env(safe-area-inset-bottom));
  left: clamp(22px, 5vw, 70px);
  z-index: 3;
  display: flex;
  justify-content: space-between;
  color: #6d6d72;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

@media (max-width: 820px) {
  .scene {
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(82px, calc(56px + env(safe-area-inset-top))) 22px
      max(80px, calc(48px + env(safe-area-inset-bottom)));
  }

  .grid {
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(
      circle at 50% 42%,
      #000,
      transparent 75%
    );
    mask-image: radial-gradient(circle at 50% 42%, #000, transparent 75%);
  }

  .card {
    width: min(100%, 430px);
    grid-template-columns: 1fr;
    gap: clamp(27px, 4.6vh, 39px);
    text-align: center;
    transform: none;
  }

  .avatar-block {
    gap: 18px;
  }

  .avatar-shell {
    width: clamp(154px, 43vw, 182px);
  }

  .orbit {
    inset: -9px;
  }

  .greeting {
    margin-bottom: 8px;
    font-size: 15px;
  }

  .name {
    max-width: 380px;
    margin-inline: auto;
    font-size: clamp(35px, 9.2vw, 41px);
    letter-spacing: -0.048em;
  }

  .role-line {
    justify-content: center;
    gap: 7px;
    margin-top: 17px;
    font-size: 9px;
    letter-spacing: 0.07em;
  }

  .tagline {
    max-width: 330px;
    margin: 15px auto 0;
    font-size: 13.5px;
    line-height: 1.58;
  }

  .detail {
    margin-top: 9px;
    font-size: 8px;
  }

  .socials {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 22px;
  }

  .social-link {
    width: 42px;
    height: 42px;
  }

  .corner {
    right: -25px;
    width: 215px;
    height: 165px;
  }

  .corner-lines {
    right: -16%;
    bottom: -7%;
    width: 95%;
    height: 92%;
    opacity: 0.6;
    background: repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      #050505 14px 19px,
      transparent 19px 31px
    );
  }

  .footer-note {
    right: 20px;
    bottom: max(17px, env(safe-area-inset-bottom));
    left: 20px;
    font-size: 6px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 430px) {
  .scene {
    padding-right: 18px;
    padding-left: 18px;
  }

  .name {
    font-size: clamp(33px, 9.1vw, 38px);
  }

  .status {
    font-size: 8.5px;
  }
}

@media (max-width: 370px) {
  .avatar-shell {
    width: 145px;
  }

  .card {
    gap: 24px;
  }

  .name {
    font-size: 31px;
  }

  .tagline {
    font-size: 12.5px;
  }

  .social-link {
    width: 39px;
    height: 39px;
  }
}

@media (max-width: 820px) and (max-height: 740px) {
  .scene {
    min-height: 740px;
    padding-top: 68px;
    padding-bottom: 65px;
  }

  .card {
    gap: 21px;
  }

  .avatar-shell {
    width: 138px;
  }

  .status {
    display: none;
  }

  .name {
    font-size: 33px;
  }

  .role-line {
    margin-top: 13px;
  }

  .tagline {
    margin-top: 11px;
    font-size: 12.5px;
  }

  .socials {
    margin-top: 17px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .scene {
    min-height: 620px;
    padding: 78px 42px 70px;
  }

  .card {
    width: min(100%, 780px);
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 44px;
    text-align: left;
  }

  .avatar-shell {
    width: 155px;
  }

  .role-line,
  .socials {
    justify-content: flex-start;
  }

  .tagline {
    margin-left: 0;
  }
}
/* Giữ chiều cao để bố cục không bị nhảy khi đang chạy chữ */
.tagline {
  min-height: 3em;
}

/* Con trỏ máy đánh chữ */
.tagline.typing::after {
  content: "|";
  margin-left: 2px;
  color: #7eeaff;
  animation: blink 0.7s infinite;
}

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

  51%,
  100% {
    opacity: 0;
  }
}

/* Sọc chéo chạy liền từ góc trên phải xuống dưới */
.corner-lines {
  position: absolute;
  inset: 0;

  width: auto;
  height: auto;

  opacity: 0.92;
  transform: none;
  clip-path: none;

  background: repeating-linear-gradient(
    133deg,
    transparent 0 22px,
    #050505 22px 31px,
    transparent 29px 48px
  );
}

/* =========================
   MUSIC AVATAR
========================= */

.avatar-shell {
  isolation: isolate;
}

/* Nút phát nhạc */
.music-toggle {
  position: absolute;
  right: -4px;
  bottom: 8%;
  z-index: 10;

  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;

  padding: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;

  background: rgb(8 8 10 / 92%);
  color: #fff;

  font-size: 15px;
  cursor: pointer;

  opacity: 0;
  transform: scale(0.8);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Hiện nút khi rê chuột hoặc đang phát nhạc */
.avatar-shell:hover .music-toggle,
.avatar-shell.is-playing .music-toggle {
  opacity: 1;
  transform: scale(1);
}

.music-toggle:hover {
  border-color: #ad79ff;
  box-shadow:
    0 0 12px rgb(173 121 255 / 75%),
    0 0 28px rgb(123 65 255 / 45%);
}

/* Ánh sáng tím quanh ảnh khi phát nhạc */
.avatar-shell.is-playing .avatar {
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 75%),
    0 0 16px rgb(185 122 255 / 85%),
    0 0 38px rgb(126 55 255 / 65%),
    0 0 70px rgb(99 40 210 / 35%),
    0 28px 70px rgb(0 0 0 / 76%);
}

/* Đổi vòng ngoài sang tím khi phát */
.avatar-shell.is-playing .orbit {
  border-color: rgb(185 122 255 / 65%);
  box-shadow:
    0 0 12px rgb(185 122 255 / 60%),
    0 0 28px rgb(126 55 255 / 35%);
}

.avatar-shell.is-playing .orbit::before {
  border-color: rgb(196 151 255 / 70%);
}

.avatar-shell.is-playing .orbit::after {
  border-top-color: #c798ff;
  border-left-color: rgb(173 106 255 / 70%);
}

/* =========================
   SOCIAL ICON HOVER
========================= */

.social-link {
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.social-link:hover {
  transform: translateY(-3px) scale(1.08);
}

/* Facebook */
.social-link.facebook:hover {
  color: #1877f2;
  border-color: #1877f2;
  background: rgb(24 119 242 / 10%);
  box-shadow:
    0 0 10px rgb(24 119 242 / 65%),
    0 0 25px rgb(24 119 242 / 30%);
}

/* GitHub */
.social-link.github:hover {
  color: #ffffff;
  border-color: #ffffff;
  background: rgb(255 255 255 / 8%);
  box-shadow:
    0 0 10px rgb(255 255 255 / 50%),
    0 0 24px rgb(255 255 255 / 18%);
}

/* Telegram */
.social-link.telegram:hover {
  color: #2aabee;
  border-color: #2aabee;
  background: rgb(42 171 238 / 10%);
  box-shadow:
    0 0 10px rgb(42 171 238 / 65%),
    0 0 25px rgb(42 171 238 / 30%);
}

/* TikTok */
.social-link.tiktok:hover {
  color: #ffffff;
  border-color: #fe2c55;
  background: rgb(254 44 85 / 9%);
  box-shadow:
    -5px 0 15px rgb(37 244 238 / 35%),
    5px 0 15px rgb(254 44 85 / 45%);
}

/* Email */
.social-link.email:hover {
  color: #ff6666;
  border-color: #ff4d4d;
  background: rgb(255 77 77 / 10%);
  box-shadow:
    0 0 10px rgb(255 77 77 / 65%),
    0 0 25px rgb(255 77 77 / 30%);
}

/* Avatar nổi lên khi rê chuột */
.avatar-shell {
  cursor: pointer;
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

.avatar,
.orbit {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.avatar-shell:hover {
  z-index: 10;
  transform: translateY(-6px) rotate(2deg) scale(1.035);
}

.avatar-shell {
  cursor: pointer;
  transform-origin: center bottom;
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

/* Chỉ dùng ánh sáng xanh khi chưa phát nhạc */
.avatar-shell:not(.is-playing):hover .avatar {
  filter: brightness(1.06) contrast(1.03);

  box-shadow:
    0 0 0 2px rgb(255 255 255 / 80%),
    0 0 18px rgb(126 234 255 / 70%),
    0 0 42px rgb(126 234 255 / 35%),
    0 28px 70px rgb(0 0 0 / 76%);
}

.avatar-shell:not(.is-playing):hover .orbit {
  border-color: rgb(126 234 255 / 75%);

  box-shadow:
    0 0 14px rgb(126 234 255 / 55%),
    0 0 32px rgb(126 234 255 / 25%);
}
