/**
 * ProDigit Profile V2. Premium digital identity card.
 */
:root {
  --profile-bg: #050505;
  --profile-surface: rgba(18, 18, 20, 0.78);
  --profile-border: rgba(255, 255, 255, 0.06);
  --profile-border-hover: rgba(34, 211, 238, 0.35);
  --profile-text: #fafafa;
  --profile-muted: #a1a1aa;
  --profile-accent: #22d3ee;
  --profile-accent-dim: rgba(34, 211, 238, 0.08);
  --profile-accent-glow: rgba(34, 211, 238, 0.12);
  --reroute-accent: #b7e724;
  --reroute-glow: rgba(183, 231, 36, 0.16);
  --profile-radius: 12px;
  --profile-max: 26rem;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body.profile-v2 {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--profile-text);
  background-color: var(--profile-bg);
  background-image: linear-gradient(
    180deg,
    rgba(34, 211, 238, 0.11) 0%,
    rgba(34, 211, 238, 0.04) 14%,
    rgba(5, 5, 5, 0.92) 38%,
    #050505 72%,
    #050505 100%
  );
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Faint NFC frequency lines */
body.profile-v2::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 64px,
      rgba(255, 255, 255, 0.35) 64px,
      rgba(255, 255, 255, 0.35) 65px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 55%);
}

/* Faint NFC arc motif */
body.profile-v2::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none'%3E%3Cg transform='translate(200%2C 200)'%3E%3Cpath d='M 6 0 A 32 32 0 0 1 32 26' stroke='%2322d3ee' stroke-width='0.75'/%3E%3Cpath d='M 6 0 A 52 52 0 0 1 52 42' stroke='%23ffffff' stroke-width='0.5' opacity='0.6'/%3E%3Cpath d='M 6 0 A 72 72 0 0 1 72 58' stroke='%23a1a1aa' stroke-width='0.5' opacity='0.4'/%3E%3Cg transform='scale(-1%2C 1)'%3E%3Cpath d='M 6 0 A 32 32 0 0 1 32 26' stroke='%2322d3ee' stroke-width='0.75'/%3E%3Cpath d='M 6 0 A 52 52 0 0 1 52 42' stroke='%23ffffff' stroke-width='0.5' opacity='0.6'/%3E%3Cpath d='M 6 0 A 72 72 0 0 1 72 58' stroke='%23a1a1aa' stroke-width='0.5' opacity='0.4'/%3E%3C/g%3E%3C/g%3E%3Cpath d='M 0 140 Q 100 128%2C 200 140 T 400 140' stroke='%23ffffff' stroke-width='0.5' opacity='0.35'/%3E%3Cpath d='M 0 220 Q 120 208%2C 240 220 T 400 220' stroke='%23a1a1aa' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 22%;
  background-size: min(92vw, 380px);
}

@media (prefers-reduced-motion: reduce) {
  body.profile-v2::before,
  body.profile-v2::after {
    animation: none;
  }
}

.profile-shell {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
}

.profile {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--profile-max);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
}

.profile-header {
  text-align: center;
  margin-bottom: 0.35rem;
}

.profile-avatar {
  width: 6.5rem;
  height: 6.5rem;
  margin: 0 auto;
  padding: 2px;
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  background: #121214;
}

.profile-body {
  text-align: center;
  padding-top: 0.5rem;
}

.profile-name {
  margin: 0 0 0.2rem;
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile-title {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--profile-accent);
  letter-spacing: 0.04em;
}

.profile-title__sep {
  margin: 0 0.2em;
  color: rgba(255, 255, 255, 0.25);
}

.profile-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.profile-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  height: 2.625rem;
  color: var(--profile-text);
  text-decoration: none;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: 50%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.22s ease,
    color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.profile-icon-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.profile-icon-btn:hover,
.profile-icon-btn:focus-visible {
  border-color: var(--profile-border-hover);
  color: var(--profile-accent);
  background: var(--profile-accent-dim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 16px var(--profile-accent-glow);
  outline: none;
}

.profile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.profile-link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.625rem 0.8rem;
  text-decoration: none;
  text-align: left;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.profile-link-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 55%;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background 0.22s ease;
}

.profile-link-card:hover,
.profile-link-card:focus-visible {
  border-color: var(--profile-border-hover);
  background: rgba(34, 211, 238, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px var(--profile-accent-glow);
  outline: none;
}

.profile-link-card:hover::after,
.profile-link-card:focus-visible::after {
  background: var(--profile-accent);
}

.profile-link-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--profile-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 0.55rem;
}

.profile-link-card__icon svg {
  width: 1rem;
  height: 1rem;
}

.profile-link-card__icon--accent {
  color: var(--profile-accent);
  border-left-color: rgba(34, 211, 238, 0.35);
}

.profile-link-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.profile-link-card__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--profile-text);
  line-height: 1.3;
}

.profile-link-card__hint {
  font-size: 0.6875rem;
  color: var(--profile-muted);
  line-height: 1.2;
}

.profile-link-card--accent {
  border-color: rgba(34, 211, 238, 0.18);
}

.profile-link-card--accent .profile-link-card__label {
  color: var(--profile-accent);
}

.profile-link-card--accent:hover,
.profile-link-card--accent:focus-visible {
  border-color: rgba(34, 211, 238, 0.45);
}

.profile-link-card--reroute {
  border-color: rgba(183, 231, 36, 0.2);
  background: rgba(183, 231, 36, 0.03);
}

.profile-link-card--reroute .profile-link-card__label {
  color: var(--profile-text);
}

.profile-link-card--reroute .profile-link-card__hint {
  color: rgba(183, 231, 36, 0.6);
}

.profile-link-card--reroute:hover,
.profile-link-card--reroute:focus-visible,
.profile-link-card--reroute:active {
  border-color: rgba(183, 231, 36, 0.5);
  background: var(--reroute-glow);
  box-shadow: 0 0 18px var(--reroute-glow);
  transform: translateY(-1px);
  outline: none;
}

.profile-link-card--reroute:hover::after,
.profile-link-card--reroute:focus-visible::after,
.profile-link-card--reroute:active::after {
  background: var(--reroute-accent);
}

.profile-link-card--reroute:hover .profile-link-card__label,
.profile-link-card--reroute:focus-visible .profile-link-card__label,
.profile-link-card--reroute:active .profile-link-card__label {
  color: var(--reroute-accent);
}

.profile-link-card--reroute:hover .profile-link-card__icon--reroute,
.profile-link-card--reroute:focus-visible .profile-link-card__icon--reroute,
.profile-link-card--reroute:active .profile-link-card__icon--reroute {
  color: var(--reroute-accent);
  border-left-color: rgba(183, 231, 36, 0.5);
}

.profile-link-card__icon--reroute {
  border-left-color: rgba(183, 231, 36, 0.35);
}

.profile-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--profile-max);
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 16px max(1.25rem, env(safe-area-inset-bottom));
  text-align: center;
}

.profile-footer p {
  margin: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: rgba(161, 161, 170, 0.85);
}

@media (max-width: 390px) {
  .profile {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .profile-avatar {
    width: 6rem;
    height: 6rem;
  }

  .profile-name {
    font-size: 1.2rem;
  }

  .profile-links {
    gap: 0.3125rem;
  }

  .profile-link-card {
    padding: 0.5625rem 0.75rem;
  }
}
