.profile-body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

.profile-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 30rem),
    radial-gradient(circle at 92% 22%, color-mix(in srgb, var(--success) 12%, transparent), transparent 26rem),
    linear-gradient(150deg, var(--bg), var(--surface-2));
}

.profile-page {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) 0;
}

.profile-loading {
  width: fit-content;
  margin: 25vh auto 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
}

.profile-access-actions {
  width: min(34rem, calc(100% - 2rem));
  margin: 1rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.profile-access-actions[hidden] {
  display: none;
}

.profile-shell {
  display: grid;
  gap: 24px;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.profile-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.profile-header p:not(.profile-eyebrow) {
  max-width: 58ch;
  margin: 14px 0 0;
  color: var(--muted);
}

.profile-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.profile-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-action {
  width: auto;
  min-width: 128px;
  text-decoration: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 20px;
}

.profile-card {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--text) 9%, transparent);
}

.profile-card--wide {
  grid-column: 1 / -1;
}

.profile-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.profile-card p {
  line-height: 1.65;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-avatar {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 18px;
  color: var(--on-accent);
  background: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.profile-form .field,
.profile-form input,
.profile-form button {
  min-width: 0;
  max-width: 100%;
}

.profile-form input[readonly] {
  cursor: default;
  color: var(--muted);
  background: var(--surface-2);
}

.profile-submit {
  width: fit-content;
  min-width: 170px;
}

.profile-help {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.profile-help--link {
  margin-top: 16px;
}

.profile-help a,
.profile-card--wide a {
  color: var(--link);
  font-weight: 700;
}

.profile-notice {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
  line-height: 1.5;
}

.profile-notice strong {
  color: var(--text);
}

.profile-message {
  min-height: 24px;
  margin: 0;
  padding: 0 4px;
  font-weight: 700;
}

.profile-message[data-kind="success"] { color: var(--success); }
.profile-message[data-kind="error"] { color: var(--danger); }

@media (max-width: 780px) {
  .profile-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-card--wide {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .profile-page {
    width: min(100% - 24px, 1120px);
    padding: 18px 0 28px;
  }

  .profile-header,
  .profile-card {
    padding: 18px;
    border-radius: 16px;
  }

  .profile-header__actions,
  .profile-action,
  .profile-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-body *,
  .profile-body *::before,
  .profile-body *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
