:root {
  color-scheme: light;
  --bg: #f6f8ff;
  --card: rgba(255, 255, 255, 0.78);
  --border: rgba(91, 206, 250, 0.28);
  --text: #182235;
  --muted: #5e6b84;
  --shadow: 0 12px 40px rgba(91, 169, 216, 0.15);
  --focus: #0e8fc4;
  --radius: 18px;
  --max: 520px;
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #110f1b;
  --card: rgba(20, 21, 34, 0.68);
  --border: rgba(245, 169, 184, 0.24);
  --text: #f8fbff;
  --muted: #bac3d8;
  --shadow: 0 14px 44px rgba(11, 12, 22, 0.5);
  --focus: #8ad8f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 8%, rgba(91, 206, 250, 0.22), transparent 43%),
    radial-gradient(circle at 88% 12%, rgba(245, 169, 184, 0.2), transparent 43%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.25), transparent 46%),
    var(--bg);
  color: var(--text);
  line-height: 1.4;
  overflow-x: hidden;
}

.bg-orb,
.bg-noise {
  pointer-events: none;
  position: fixed;
  inset: -20vmax;
  z-index: -1;
}

.bg-orb {
  filter: blur(70px);
  opacity: 0.24;
  transform-origin: center;
  animation: drift 18s ease-in-out infinite alternate;
}

.bg-orb-a {
  background: radial-gradient(circle, rgba(91, 206, 250, 0.64) 0%, rgba(91, 206, 250, 0.01) 65%);
}

.bg-orb-b {
  background: radial-gradient(circle, rgba(245, 169, 184, 0.62) 0%, rgba(245, 169, 184, 0.01) 62%);
  animation-delay: -6s;
}

.bg-noise {
  opacity: 0.04;
  background-image: radial-gradient(rgba(17, 24, 39, 0.45) 0.45px, transparent 0.45px);
  background-size: 3px 3px;
}

.page {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top) + 12px) 0 max(28px, env(safe-area-inset-bottom) + 16px);
}

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  isolation: isolate;
}

.profile {
  position: relative;
  padding: 1.05rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.identity h1 {
  margin: 0;
  font-size: clamp(1.38rem, 3.8vw, 1.65rem);
  letter-spacing: -0.02em;
}

.tagline,
.location {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background-color 220ms var(--ease);
}

.theme-toggle:hover {
  transform: translateY(-2px);
}

.theme-toggle:focus-visible,
.social-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.status {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.status.is-error {
  color: #dc2626;
}

.groups {
  margin-top: 1rem;
  display: grid;
  gap: 1.05rem;
}

.group {
  display: grid;
  gap: 0.62rem;
}

.group.is-pinned {
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, #5bcefa 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 88%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 12px 32px color-mix(in srgb, #f5a9b8 25%, transparent);
}

.group.is-pinned .group-title {
  color: color-mix(in srgb, var(--text) 74%, #5bcefa);
}

.group-title {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.card-list {
  display: grid;
  gap: 0.62rem;
}

.social-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.82rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent, #64748b) 24%, var(--border));
  background: color-mix(in srgb, var(--card) 80%, transparent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent, #64748b) 20%, transparent);
  transition: transform 230ms var(--ease), box-shadow 230ms var(--ease), border-color 230ms var(--ease), background-color 230ms var(--ease);
}

.social-card:hover,
.social-card:focus-visible {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--card) 94%, rgba(255, 255, 255, 0.4));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent, #64748b) 28%, transparent);
}

.social-card.is-static {
  cursor: default;
}

.social-card.is-static:hover {
  transform: none;
}

.icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent, #64748b);
  background: color-mix(in srgb, var(--accent, #64748b) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #64748b) 30%, transparent);
}

.icon-wrap svg {
  width: 22px;
  height: 22px;
  display: block;
}

.info {
  min-width: 0;
}

.service {
  margin: 0;
  font-weight: 600;
}

.username {
  margin: 0.05rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrow {
  color: var(--muted);
  font-size: 1.05rem;
  margin-left: 0.45rem;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: revealUp 550ms var(--ease) forwards;
  animation-delay: var(--delay, 0ms);
}

/* Prevent browser ghost-layer artifacts from animating blurred glass surfaces */
.profile.reveal,
.status.reveal {
  transform: none;
  animation-name: revealFade;
}

@media (max-width: 480px) {
  .page {
    width: calc(100% - 1.2rem);
    padding-top: max(12px, env(safe-area-inset-top));
  }

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

  .theme-toggle {
    grid-column: span 2;
    justify-self: end;
    margin-top: -0.3rem;
  }

  .status,
  .social-card {
    border-radius: 16px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .page {
    width: min(var(--max), calc(100% - 1.7rem));
  }
}

@media (min-width: 769px) {
  .page {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealFade {
  to {
    opacity: 1;
  }
}

@keyframes drift {
  from {
    transform: translate(-7%, -2%) scale(1);
  }

  to {
    transform: translate(8%, 4%) scale(1.08);
  }
}
