.profile-page {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.is-skeleton-line,
.is-skeleton-avatar,
.is-skeleton-paragraph {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}

.is-skeleton-line::before,
.is-skeleton-avatar::before,
.is-skeleton-paragraph::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.14) 50%,
      rgba(255, 255, 255, 0.06) 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.35s linear infinite;
}

body[data-theme="light"] .is-skeleton-line::before,
body[data-theme="light"] .is-skeleton-avatar::before,
body[data-theme="light"] .is-skeleton-paragraph::before {
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.16) 50%,
      rgba(0, 0, 0, 0.08) 100%);
  background-size: 220% 100%;
}

.skeleton-line-short {
  width: min(180px, 42%);
  border-radius: 999px;
}

.skeleton-line-medium {
  width: min(280px, 58%);
  border-radius: 999px;
}

.skeleton-line-large {
  width: min(560px, 86%);
  border-radius: 18px;
}

.is-skeleton-paragraph {
  width: min(620px, 100%);
  min-height: 54px;
  border-radius: 18px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

[hidden] {
  display: none !important;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255, 223, 5, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.96), rgba(24, 24, 24, 0.92));
  box-shadow: var(--shadow);
}

body[data-theme="light"] .profile-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 223, 5, 0.18), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.96));
}

.profile-photo-frame {
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 223, 5, 0.92), rgba(255, 223, 5, 0.45));
}

.profile-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: #e5e5e5;
}

.profile-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile-kicker {
  color: var(--nav-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-name {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
  min-height: 1.1em;
}

.profile-role {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  min-height: 1.3em;
}

.profile-preferences-link {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 223, 5, 0.18);
  border-radius: 14px;
  background: rgba(255, 223, 5, 0.08);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.profile-preferences-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 223, 5, 0.34);
  background: rgba(255, 223, 5, 0.14);
}

.profile-preferences-link i {
  color: var(--nav-accent);
  font-size: 1.28rem;
}

.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-bio {
  margin: 2px 0 0;
  max-width: 62ch;
  color: var(--text);
  opacity: 0.86;
  line-height: 1.6;
  min-height: 54px;
}

.profile-badges-block {
  margin-top: 10px;
  display: grid;
  gap: 14px;
}

.profile-badges-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.profile-badges-title-row strong {
  font-size: 0.98rem;
}

.profile-badges-title-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

#profile-badges-summary,
.profile-badges-expanded {
  display: grid;
  gap: 12px;
}

#profile-badges-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.profile-badges-expanded {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.profile-badge-category {
  display: grid;
  gap: 10px;
}

#profile-badges-summary .profile-badge-category {
  display: flex;
  align-items: center;
  gap: 10px;
}

#profile-badges-summary .profile-badge-category + .profile-badge-category {
  margin-left: 12px;
  padding-left: 12px;
  padding-top: 0;
  border-top: 0;
  border-left: 1px solid var(--line);
}

.profile-badge-category-expanded {
  align-content: start;
}

.profile-badge-category-expanded + .profile-badge-category-expanded {
  padding-top: 0;
  padding-left: 16px;
  border-top: 0;
  border-left: 1px solid var(--line);
}

.profile-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.profile-badge-category-expanded .profile-badges-grid {
  flex-direction: column;
}

.profile-badges-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-badges-toggle {
  width: fit-content;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.profile-badges-toggle i {
  font-size: 1rem;
  transition: transform 0.18s ease;
}

.profile-badges-toggle.is-open i {
  transform: rotate(180deg);
}

body[data-theme="light"] .profile-badges-toggle {
  background: rgba(0, 0, 0, 0.03);
}

.profile-badge {
  margin: 0;
  width: 72px;
  display: grid;
  justify-items: center;
  padding: 6px;
  border-radius: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: default;
}

.profile-badge img {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.14));
}

.profile-badge-tier-1 img {
  width: 58px;
  height: 58px;
}

.profile-badge:hover {
  transform: translateY(-1px);
}

.profile-badge-expanded {
  width: 100%;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 12px;
  padding: 10px 12px;
}

.profile-badge-copy {
  display: grid;
  gap: 4px;
}

.profile-badge-copy strong,
.profile-badge-copy small {
  display: block;
}

.profile-badge-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.profile-badge-dev {
  position: relative;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="light"] .profile-badge-dev {
  background: transparent;
  border-color: transparent;
}

.profile-badge-dev-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(117, 176, 255, 0.4), transparent 55%),
    linear-gradient(160deg, rgba(46, 97, 219, 0.52), rgba(16, 48, 133, 0.78));
  border: 1px solid rgba(114, 169, 255, 0.52);
  box-shadow: 0 8px 18px rgba(16, 48, 133, 0.3);
}

.profile-badges-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.profile-badges-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.profile-badges-modal-dialog {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-badges-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-badge-dev-icon i {
  font-size: 1.7rem;
  color: #cfe5ff;
}

body[data-theme="light"] .profile-badge-dev-icon {
  background:
    radial-gradient(circle at 25% 20%, rgba(117, 176, 255, 0.42), transparent 55%),
    linear-gradient(160deg, rgba(46, 97, 219, 0.48), rgba(16, 48, 133, 0.72));
  border: 1px solid rgba(114, 169, 255, 0.5);
  box-shadow: 0 8px 18px rgba(16, 48, 133, 0.24);
}

body[data-theme="light"] .profile-badge-dev-icon i {
  color: #1a4ec0;
}

body[data-theme="light"] .profile-badge-tier-1,
body[data-theme="light"] .profile-badge-tier-2 {
  background: rgba(0, 0, 0, 0.02);
}

body[data-theme="light"] .profile-badge-tier-3,
body[data-theme="light"] .profile-badge-tier-4 {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
  border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .profile-badge-tier-5,
body[data-theme="light"] .profile-badge-tier-6 {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.03));
  border-color: rgba(0, 0, 0, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body[data-theme="light"] .profile-badge-tier-7,
body[data-theme="light"] .profile-badge-tier-8 {
  background:
    radial-gradient(circle at top center, rgba(0, 0, 0, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.03));
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .profile-badge-tier-9,
body[data-theme="light"] .profile-badge-tier-10 {
  background:
    radial-gradient(circle at top center, rgba(0, 0, 0, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.04));
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.10);
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-detail-card {
  display: grid;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.90), rgba(28, 28, 28, 0.86));
}

body[data-theme="light"] .profile-detail-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.9));
}

.detail-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-label i {
  color: var(--nav-accent);
  font-size: 1rem;
}

.detail-value {
  font-size: 1.04rem;
  line-height: 1.4;
  min-height: 1.4em;
}

@media (max-width: 1100px) {
  .profile-page {
    padding: 20px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-photo-frame {
    width: min(220px, 100%);
  }

  .profile-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .profile-page {
    padding: 16px;
  }

  .profile-hero {
    padding: 20px;
    gap: 18px;
    border-radius: 22px;
  }

  .profile-photo-frame {
    width: 140px;
    border-radius: 50%;
  }

  .profile-photo {
    border-radius: 50%;
  }

  .profile-badges-expanded {
    grid-template-columns: 1fr;
  }

  .profile-badge-category-expanded + .profile-badge-category-expanded {
    padding-left: 0;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .profile-badge {
    width: 78px;
  }

  .detail-value {
    font-size: 0.96rem;
  }
}
